http://stackoverflow.com/comment/45386004
has text: @ Rikesh Logout functionality is added at specific time period and it should be performed anyhow at that particular time as per requirement and also you can't stop it comparing with onbeforeunload event as both are two separate activity where in logout is perfomed automtically from system within added time period and onbeforeunload is js event which will prompt on trying to leave the screen.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28535592

http://stackoverflow.com/comment/45226207
has text: seems to work fine http://jsfiddle.net/orveo3ao/
score: 0
comment on: http://stackoverflow.com/q/28448826
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45387659
comment on: http://stackoverflow.com/a/28536572
score: 0
type: Comment
has text: @Rakesh_Kumar var advs1=JSON.parse(response); gives JSON Parse error: Unexpected identifier "object"
type: AnswerComment

http://stackoverflow.com/comment/112493485
has text: Thank you @auser ,I wanted something like this for html, this pointed me in the right direction
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28570551
type: Comment

http://stackoverflow.com/q/28579401
has body: As mentioned in WA-ARIA 1.0 keyboard interaction, I need to implement the following behaviour: When a submenu is open and focus is on a menu item in that submenu: Escape or the Left Arrow key closes the submenu and returns focus to the parent menu item. To achieve this, I added the following rudimentary javascript code to my page: if (e.keyCode == 27) { element = document.getElementById("spanID"); menuElement = document.getElementById("bigMenu"); if (element.className == "glyphicon glyphicon-menu-down") { element.className = "glyphicon glyphicon-menu-right"; jQuery("#collapseMenu").hide(); menuElement.setAttribute('aria-expanded', false); sessionStorage.setItem("expand", false); } } That did not work, so it's not the correct way to go about things. Could someone point what is it that I am doing incorrectly.
has answer: http://stackoverflow.com/a/28579911
type: AnsweredQuestion
has title: Triggering jQuery("#collapseMenu").hide(); on pressing Esc key
accepted answer: http://stackoverflow.com/a/28579911
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28579736
tagged with: javascript
has comment: http://stackoverflow.com/comment/45467668
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28579736
score: 0

http://stackoverflow.com/q/28555326
tagged with: karma-jasmine
has answer: http://stackoverflow.com/a/28556587
tagged with: bdd
downvote count: 0
answer count: 1
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28556587
type: AnsweredQuestion
has body: I have implemented an angularjs directive that use mouse event; clicking on component and moving mouse up or down it can changes a value. So i need to know how do I trigger a mousemove event in a unit test (i use karma/jasmine); I'd like to have a suggestion to testing this component when mouse goes up or down in an unit test. Component template is something like that: &lt;div class="rotativeContent"&gt; &lt;p class="rotativeLabel"&gt;{{label}}&lt;/p&gt; &lt;pie class="zero"&gt;&lt;/pie&gt; &lt;p class="rotativeValue"&gt;{{ngModel}}&lt;/p&gt; &lt;input type="hidden" ng-model="ngModel"/&gt; &lt;/div&gt; and javascript code is: var Component = angular.module('Components', []); Components.directive('rotative', ['$document', function($document){ return { require : '?ngModel', restrict: 'E', replace: true, templateUrl: "templates/rotative.html", scope: {label: "@", ngModel: "="}, link: function(scope, element, attr, ngModel) { var value = 0; function bindElementMove() { element.bind('mousedown', function (event) { $document.bind('mousemove', mousemove); $document.bind('mouseup', mouseup); }); } bindElementMove(); function mousemove(event) { // code on mouse move // to track vertical mouse position var prevY = element.attr('data-prevY'); if (event.pageY &lt; prevY) { // do something if mouse goes down // ... value++; } else { // do something if mouse goes up // ... value--; } element.attr('data-prevY', event.pageY); ngModel.$setViewValue(value); } function mouseup() { $document.off('mousemove', mousemove); $document.off('mouseup', mouseup); } } }; // ... Also i need to simulate an variation of event.pageY. How can i do this?
upvote count: 3
has title: How do I trigger a mousemove event in an angularjs unit test
tagged with: unit-testing
type: Question
score: 3
tagged with: javascript

http://stackoverflow.com/comment/45246908
has text: Your missing `"` after stuff and blah. It's just typos [working version](http://jsfiddle.net/x04dp435/1/). Make sure you check you console for errors
score: 1
comment on: http://stackoverflow.com/q/28460373
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45444137
type: QuestionComment
score: 0
has text: Wow - is there really a close vote too? It makes me wonder what I actually should write to be considered asking a proper question... Thanks @davidkonrad for your support. ThankS to people like you I actually improve my learning curve which should be the intention with SO.
comment on: http://stackoverflow.com/q/28556325
type: Comment

javascript
tags question: http://stackoverflow.com/q/28473095
tags question: http://stackoverflow.com/q/28511927
tags question: http://stackoverflow.com/q/28453959
tags question: http://stackoverflow.com/q/28528422
tags question: http://stackoverflow.com/q/28455539
tags question: http://stackoverflow.com/q/28524822
tags question: http://stackoverflow.com/q/28570834
tags question: http://stackoverflow.com/q/28500737
tags question: http://stackoverflow.com/q/28526582
tags question: http://stackoverflow.com/q/28548260
tags question: http://stackoverflow.com/q/28538503
tags question: http://stackoverflow.com/q/28527304
tags question: http://stackoverflow.com/q/28581780
tags question: http://stackoverflow.com/q/28583178
tags question: http://stackoverflow.com/q/28582724
tags question: http://stackoverflow.com/q/28460411
tags question: http://stackoverflow.com/q/28487466
tags question: http://stackoverflow.com/q/28584758
tags question: http://stackoverflow.com/q/28554027
tags question: http://stackoverflow.com/q/28588623
tags question: http://stackoverflow.com/q/28498014
tags question: http://stackoverflow.com/q/28566814
tags question: http://stackoverflow.com/q/28517869
tags question: http://stackoverflow.com/q/28458622
tags question: http://stackoverflow.com/q/28449146
tags question: http://stackoverflow.com/q/28474174
tags question: http://stackoverflow.com/q/28459008
tags question: http://stackoverflow.com/q/28568480
tags question: http://stackoverflow.com/q/28472946
tags question: http://stackoverflow.com/q/28479171
tags question: http://stackoverflow.com/q/28492347
tags question: http://stackoverflow.com/q/28460437
tags question: http://stackoverflow.com/q/28484685
tags question: http://stackoverflow.com/q/28570354
tags question: http://stackoverflow.com/q/28447944
tags question: http://stackoverflow.com/q/28539105
tags question: http://stackoverflow.com/q/28478597
tags question: http://stackoverflow.com/q/28526584
tags question: http://stackoverflow.com/q/28554357
tags question: http://stackoverflow.com/q/28464243
tags question: http://stackoverflow.com/q/28510994
tags question: http://stackoverflow.com/q/28583253
tags question: http://stackoverflow.com/q/28514318
tags question: http://stackoverflow.com/q/28580904
tags question: http://stackoverflow.com/q/28509885
tags question: http://stackoverflow.com/q/28507895
tags question: http://stackoverflow.com/q/28590132
tags question: http://stackoverflow.com/q/28491260
tags question: http://stackoverflow.com/q/28573480
tags question: http://stackoverflow.com/q/28490321
tags question: http://stackoverflow.com/q/28514123
tags question: http://stackoverflow.com/q/28513331
tags question: http://stackoverflow.com/q/28487031
tags question: http://stackoverflow.com/q/28503730
tags question: http://stackoverflow.com/q/28557718
tags question: http://stackoverflow.com/q/28473977
tags question: http://stackoverflow.com/q/28517886
tags question: http://stackoverflow.com/q/28521229
tags question: http://stackoverflow.com/q/28590988
tags question: http://stackoverflow.com/q/28526506
tags question: http://stackoverflow.com/q/28512232
tags question: http://stackoverflow.com/q/28545727
tags question: http://stackoverflow.com/q/28473944
tags question: http://stackoverflow.com/q/28462543
tags question: http://stackoverflow.com/q/28461696
tags question: http://stackoverflow.com/q/28565777
tags question: http://stackoverflow.com/q/28461914
tags question: http://stackoverflow.com/q/28588989
tags question: http://stackoverflow.com/q/28473978
tags question: http://stackoverflow.com/q/28523696
tags question: http://stackoverflow.com/q/28574809
tags question: http://stackoverflow.com/q/28461602
tags question: http://stackoverflow.com/q/28546458
tags question: http://stackoverflow.com/q/28516658
tags question: http://stackoverflow.com/q/28588141
tags question: http://stackoverflow.com/q/28461700
tags question: http://stackoverflow.com/q/28539904
tags question: http://stackoverflow.com/q/28575595
tags question: http://stackoverflow.com/q/28575039
tags question: http://stackoverflow.com/q/28483893

http://stackoverflow.com/comment/45444906
type: QuestionComment
comment on: http://stackoverflow.com/q/28567300
score: 0
type: Comment
has text: And... that's not what you want?

http://stackoverflow.com/q/28542203
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45399097
score: -3
upvote count: 1
has title: How to implement background image transition or smooth slider for navigation
type: Question
downvote count: 4
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45580298
has answer: http://stackoverflow.com/a/28640620
has body: Can anyone suggest how to implement a navigation similar to this theme? http://themes.goodlayers.com/?theme=kingpower When you hover on any menu item, the background image moves very smoothly left or right to the item on which we currently hover. Please help if there are any plugins available to implement this or what is an alternative solution.
answer count: 1
tagged with: css

http://stackoverflow.com/q/28491490
type: UnansweredQuestion
has body: "Error: Services Directory has been disabled." (Error: 403) Hi, I'm a first-time user of ESRI/ArcGIS API's. I've set up an account...etc... and have a Node server which gets an ESRI token and makes a request to an ESRI/ArcGIS services endpoint -- the VRP (Vehicle Routing Problem) service. I simply want to 'Enable' the "Services Directory" ... or whatever the language is in this case. I'm not trying to do anything advanced, just touch the service to get acquainted with the input & output -- very simple straight-forward basic stuff. However, when I attempt this request, the response body is an HTML string (200/ok): Error: Services Directory has been disabled. I've searched (a lot) for a resolution, including from the following page: http://resources.arcgis.com/en/help/rest/apiref/admin.html Ironically enough (or maybe too much), I don't find anything on ESRI/ArcGIS -- OR -- even Stackoverflow about this matter -- even though it seems to be the first barrier to entry in using these services. Take a look at the link above, if you will, and hopefully you can enlighten me on what its explaining -- namely, the http://<host>:<port>/<instance>/admin URI schema. It seems that I may need to host/install an Admin/Management server somewhere (?). I'm using my localhost (signed up for Free / Developer Package) right now -- do I need to deploy before I can install/config something? Is there a "Enable Service 'X'" in the ESRI Online portal / myesri?
tagged with: arcgis-server
has answer: http://stackoverflow.com/a/28494489
has title: ESRI/ArcGIS: "Error: Services Directory has been disabled."
type: Question
score: 5
tagged with: javascript
tagged with: esri
answer count: 3
tagged with: geospatial
has answer: http://stackoverflow.com/a/30487303
favorite count: 0
tagged with: arcgis
has answer: http://stackoverflow.com/a/67086098
upvote count: 5
downvote count: 0

http://stackoverflow.com/q/28502661
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/45324595
has comment: http://stackoverflow.com/comment/45324565
has comment: http://stackoverflow.com/comment/45324692
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45324608
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I am working on JavaScript accordion and somehow i struck on targeting accordion ID instead of its Basically, I want below to generate two accordion if there are two markups like this {tag_name_nolink} {tag_Partners Module tag} If there are two ....... then it should display two working accordions but it is making two working accordions when there are two in the div. Here is the JS and Fiddles WORKING | NOT WORKING (function( window, $, undefined ) { var $event = $.event, resizeTimeout; $event.special.smartresize = { setup: function() { $(this).bind( "resize", $event.special.smartresize.handler ); }, teardown: function() { $(this).unbind( "resize", $event.special.smartresize.handler ); }, handler: function( event, execAsap ) { // Save the context var context = this, args = arguments; // set correct event type event.type = "smartresize"; if ( resizeTimeout ) { clearTimeout( resizeTimeout ); } resizeTimeout = setTimeout(function() { jQuery.event.handle.apply( context, args ); }, execAsap === "execAsap"? 0 : 100 ); } }; $.fn.smartresize = function( fn ) { return fn ? this.bind( "smartresize", fn ) : this.trigger( "smartresize", ["execAsap"] ); }; $.Accordion = function( options, element ) { this.$el = $( element ); // list items this.$items = this.$el.children('ul').children('li'); // total number of items this.itemsCount = this.$items.length; // initialize accordion this._init( options ); }; $.Accordion.defaults = { // index of opened item. -1 means all are closed by default. open : -1, // if set to true, only one item can be opened. Once one item is opened, any other that is opened will be closed first oneOpenedItem : false, // speed of the open / close item animation speed : 600, // easing of the open / close item animation easing : 'easeInOutExpo', // speed of the scroll to action animation scrollSpeed : 900, // easing of the scroll to action animation scrollEasing : 'easeInOutExpo' }; $.Accordion.prototype = { _init : function( options ) { this.options = $.extend(…
has title: Target ID instead of
upvote count: 0
type: Question
tagged with: jquery-ui
has answer: http://stackoverflow.com/a/28502736

http://stackoverflow.com/comment/45385650
type: AnswerComment
comment on: http://stackoverflow.com/a/28500290
has text: WelCome.I have update my answer and tried also it is working ,value also getting in the html page.
type: Comment
score: 0

http://stackoverflow.com/q/28467347
has comment: http://stackoverflow.com/comment/45260231
answer count: 1
has title: jQuery and Wordpress changing css depending on the page selected
tagged with: css
has body: I have a menu and depending on which page the user is currently on, I would like a border to show up under that menu item. For example if the user is on the home page, there would be a blue border underneath the home text on the navigation bar. I am having trouble figuring out what page the user is on using jQuery. Normally I would use CSS and on each page manually change the class in the html but since I'm dealing with Wordpress I can't change the ids unless I work with a walker but I figured I would give it a try with jQuery. I tried setting each page as a variable such as: var homeUrl = 'http://example.com/'; if (document.URL.is(homeUrl)) { $('#link-one').css('border-bottom', '1px solid #000'); };
type: UnansweredQuestion
tagged with: wordpress
type: Question
has comment: http://stackoverflow.com/comment/45260292
has comment: http://stackoverflow.com/comment/45260272
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28467731
score: 0

http://stackoverflow.com/comment/45266328
has text: I did misunderstand what you are doing but the file still has to come from somewhere, even if you aren't uploading to the server. Think about what a `src` attribute it is. It stands for `source` meaning an absolute or relative `path` on the server from which the browser will render content. In this case you will need to load it from a temp file location
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28470554

http://stackoverflow.com/comment/45371205
has text: What are you trying to achieve?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28527723

http://stackoverflow.com/q/28522762
upvote count: 2
has answer: http://stackoverflow.com/a/28522796
tagged with: local-storage
has body: I am trying to use themes for one of my websites wherein the user can select the theme color dynamically. Once the theme color is stored, it has to retain the color value and has to get updated in other pages too. But, the color does not get updated in my other pages Theme red green blue next page AND MY JQUERY CODE IS: $(document).ready(function(){ $(document).on('click', '.dropdown-menu li a', function () { var color=($(this).text()); if(color == "red"){ $('body').css("background-color","red"); } else if(color == "green"){ $('body').css("background-color","green"); } else if(color == "blue"){ $('body').css("background-color","blue"); } localStorage.setItem("value", color); }); var name = localStorage.getItem("value"); $('body').css("background-color","name"); });
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28522782
type: Question
has title: Local Storage is not working as expected
answer count: 2
downvote count: 0
accepted answer: http://stackoverflow.com/a/28522782
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: themes
tagged with: http://stackoverflow.com/tag/html
score: 2
possible better answer: http://stackoverflow.com/a/28522796

http://stackoverflow.com/q/28480956
tagged with: javascript
tagged with: jquery
tagged with: asp.net
favorite count: 0
linked to: http://stackoverflow.com/q/699677
has comment: http://stackoverflow.com/comment/45284165
type: AnsweredQuestion
upvote count: 0
accepted answer: http://stackoverflow.com/a/28589525
has title: Jquery onchange event not triggered
has comment: http://stackoverflow.com/comment/45284531
type: Question
has comment: http://stackoverflow.com/comment/45284467
has answer: http://stackoverflow.com/a/28589525
has comment: http://stackoverflow.com/comment/45285003
score: -1
has body: I have a drop down list inside a data grid in main page and upon changing values it should display popup and popup values are posted back to the main page. I have to trigger onchange event which is not working. Below is the code I am using. Server side: ddlID.Attributes.Add("OnChange", "return Show("txtFName.text,txtLstName.text"); Client side: $('#ddlID').val(6).trigger("change"); //should hit function Show() which is not triggered.
answer count: 1
downvote count: 1

http://stackoverflow.com/comment/45238390
type: QuestionComment
has text: @JayBlanchard can you elaborate on how the variables can be set through AJAX?
type: Comment
comment on: http://stackoverflow.com/q/28455590
score: 0

http://stackoverflow.com/a/28494426
answers question: http://stackoverflow.com/q/28488545
type: Answer
score: 0
has body: The reason may be that the variables inside a function're visible only for function itself. Try this way: $name = $_POST['name']; function showUser($name) { global $con; $sql = "SELECT * FROM users WHERE first_name=$name"; $result = mysqli_query($con, $sql); $array = mysqli_fetch_row($result); mysqli_close($con); echo json_encode($array); } Note: If you'll use 'mysql_escape_string' to prevent sql injections, don't forget to connect to db first, otherwise 'mysql_escape_string' will return empty string.

http://stackoverflow.com/q/28529717
tagged with: http://stackoverflow.com/tag/json
type: Question
answer count: 3
tagged with: javascript
favorite count: 0
score: 0
tagged with: multidimensional-array
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/28529884
tagged with: php
downvote count: 1
has answer: http://stackoverflow.com/a/28529829
has title: Passing Multidimensional PHP Array to Javascript
has answer: http://stackoverflow.com/a/28529826
has body: I'm currently transferring a PHP array that is the result of an SQL query into a javascript function but it is not performing properly. When i attempt to print to error check the json array I have passed it just gives the output of [object Object],[object Object],[object Object],[object Object], which is obviously not ideal. &lt;?php include_once('connect.php'); $result = mysqli_query($conn, "SELECT ip, longitude, latitude FROM IPDB;"); while($row = mysqli_fetch_array($result)) { $iplonglat[] = array('ip'=&gt;$row['ip'], 'longitude'=&gt;$row['longitude'], 'latitude'=&gt;$row['latitude']); } $jsoniplonglat = json_encode($iplonglat); ?&gt; &lt;script type="text/javascript"&gt; var obj = &lt;?php echo $jsoniplonglat; ?&gt;; document.write(obj); &lt;/script&gt;
has comment: http://stackoverflow.com/comment/45374637

http://stackoverflow.com/comment/45496131
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28589756
type: Comment
has text: Looks like it's not an easy task as I tought... I'm using PHP and Zend Framework 2, how can I check if the URL exists from there?

http://stackoverflow.com/q/28522907
has comment: http://stackoverflow.com/comment/45362952
has comment: http://stackoverflow.com/comment/45362616
tagged with: javascript
has comment: http://stackoverflow.com/comment/45362928
score: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45365482
has comment: http://stackoverflow.com/comment/45364126
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45364098
type: Question
has title: cannot use angular js ng-app directive
has body: I'm going through the angular tutorial and it asked me to do the following: &lt;html lang="en" class="no-js" ng-app="appname"&gt; And then in my app.js: app = angular.module('appname',[]); I'm loading all of the angular files, including the angular-route.min.js. Can someone please explain what I am doing incorrectly? The error I am receiving and cannot find a solution to is: Uncaught Error: [$injector:modulerr] UPDATE: Here is my app.js var spinner,app; $(document).ready(function(){ spinner = new Spinner(); bindSearch(); $(".phonenumber").mask("(999) 999-9999? x99999",{placeholder:" "}); $(".zipcode").mask("99999?-9999",{placeholder:" "}); if(useDataTable){ $("#loadingdiv").after(spinner.spin().el); reloadSearchItems(); } app = angular.module('appname',[]); }); Here is my html: &lt;html lang="en" class="no-js" ng-app="appname" ng-strict-di&gt;

http://stackoverflow.com/comment/45297401
type: Comment
comment on: http://stackoverflow.com/a/28487478
has text: So the stack that is cleaned is the one I define before catch method? cause my guess is that if I call cancel() all stack defined before cancel should be cleaned, not just the stack defined before catch.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28458933
favorite count: 0
has title: jQuery geocomplete street_address not working
has body: I have been knocking my head to the walls today trying to get the field result from jQuery Geocomplete to display street_address but it looks the plugin is not rendering it as a data-geo="" onto my form field or anything else!. Bellow on my HTML i have the fields to pick up the street name and another for number i need the result from both to go to #BillingAddress. I believe some JavaScript may do the work but I am not an expert on it. So far I have tried using some jquery to trnasfer the fields values to the #BillingAddress input but it only copies if the other inputs are keyed or pressed, clicked, but I want them to keep hidden to improve visibility and make the form less complex for some people, so when the Geo results is chosen they populate into this field together. $('#houseNo').on('propertychange change click keyup input paste',function(){ $('#BillingAddress').val(this.value+' '+$('#street').val()); }); $('#street').on('propertychange change click keyup input paste', function(){ $('#BillingAddress').val($('#houseNo').val()+' '+this.value); }); Much appreciated the help and i think this is also a good query for some others out there. HERE IS THE FIDDLE
has answer: http://stackoverflow.com/a/31800570
tagged with: geolocation
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29378956
accepted answer: http://stackoverflow.com/a/29378956
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: geocomplete
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/31800570

http://stackoverflow.com/comment/45311627
score: 0
type: Comment
type: QuestionComment
has text: Try using `ng-keyup=""` for a start, can we see your function `fname`. Also, you need to bind the input to a `$scope` property (`ng-model` attribute).
comment on: http://stackoverflow.com/q/28495947

http://stackoverflow.com/q/28495418
tagged with: javascript
score: 0
has body: The widget I'm making uses Open Graph tags and I'm running into a complication when it comes to the "og:image" meta tag. I stripped out the rest of the irrelevant code, but this is what is causing the problem: &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;HTMLWidget&gt; &lt;parameters&gt; &lt;file name="ogImage" label="Image"/&gt; &lt;!-- This enables the user to upload an image--&gt; &lt;/parameters&gt; &lt;headHTML&gt; &lt;meta property="og:image" content="{param_ogImage}" /&gt; &lt;/headHTML&gt; &lt;/HTMLWidget&gt; The code that this will output is: &lt;meta property="og:image" content="/assets/example-image.png"/&gt; Facebook debugger will then say: Object at URL 'http://www.example.com/' of type 'website' is invalid because the given value '/assets/image.png' for property 'og:image:url' could not be parsed as type 'url'. So, my question is, is there a way to automatically grab and place the domain name in front of the {param_ogImage} content? Is it possible to use something like this to accomplish this task? &lt;script&gt; function myFunction() { var x = document.domain; document.getElementById("demo").innerHTML = x; } &lt;/script&gt;
answer count: 1
has title: I'm making a widget for adobe muse, and I need to know how to place a domain name in front of the content of a meta property tag
accepted answer: http://stackoverflow.com/a/31668615
tagged with: facebook
tagged with: http://stackoverflow.com/tag/xml
tagged with: widget
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/31668615

http://stackoverflow.com/a/28480061
has body: Unless "external API" provides means of signalling that it has completed DOM modifications, you will have to resort to using setInterval/clearInterval or chained setTimeouts. function changeStructure() { if ($('.build-div').length &gt; 0) { ... your code $('.build-div').appendTo('.another'); } else setTimeout(changeStructure, 100); };
downvote count: 0
score: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28479564
answers question: http://stackoverflow.com/q/28479564
upvote count: 1
type: Answer

http://stackoverflow.com/a/28444675
has comment: http://stackoverflow.com/comment/45294605
has comment: http://stackoverflow.com/comment/45246805
type: Answer
has comment: http://stackoverflow.com/comment/45295072
upvote count: 0
downvote count: 2
score: -2
answers question: http://stackoverflow.com/q/28444452
has comment: http://stackoverflow.com/comment/45246754
has body: You need to use the this keyword. function guess(){ /* do stuff here for guess() */ this.correct = function(){ /* Do stuff for correct */ } this.wrong = function(){ /* Do stuff for wrong */ } return this; } Because you returned this you can now access the correct() and wrong() functions using: guess().correct(); // AND guess().wrong(); Note that whatever code you write inside guess() and outside the two nested functions will also be called every time you call guess().correct() or guess().wrong() If you do not want any particular code to execute every time they "guess" regardless of right or wrong then I would suggest just storing the correct() and wrong() functions in an object literal. var guess = { correct: function(){ // Code for "correct" here }, wrong: function(){ // Code for "wrong" here } } And then you can access them using guess.correct(); // AND guess.wrong();

http://stackoverflow.com/a/28512630
type: Answer
has comment: http://stackoverflow.com/comment/45355990
accepted answer of: http://stackoverflow.com/q/28512508
has body: Assuming that you have access to the array in the post route: var express = require("express"), request = require("request"), app = express(); var start = new Date(); app.use(express.static('public')); app.use(bodyParser.urlencoded({extended: false})); function siteToPrime(req, res, urls) { urls.forEach(function(url)) { request(url, function(error, res, body) { if (!error &amp;&amp; res.statusCode == 200) { console.log(url +' : ' + body); console.log('Request took: ', new Date() - start, 'ms'); } }); } res.redirect('/'); }; app.post('/', function(req, res){ var urls = req.body.urls // Array os urls. siteToPrime(req, res, urls); }); app.listen(3000, function(){ console.log("Server listening on port 3000..."); });
answers question: http://stackoverflow.com/q/28512508
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45356062

http://stackoverflow.com/q/28554445
has comment: http://stackoverflow.com/comment/45426507
has title: Calling a controller function using javascript onchange event in zend
tagged with: javascript
has comment: http://stackoverflow.com/comment/45433751
type: Question
score: 0
has body: I have an select dropdown list on my view <?php $level = $this->escapeHtml($user->level); ?> <?php if ($level == 1): ?> Administrator Manager HR Staff <?php elseif ($level == 2): ?> Administrator Manager HR Staff <?php elseif ($level == 3): ?> Administrator Manager HR Staff <?php endif; ?> and it has an onchange event that calls this javascript function and on my controller i have this function public function editLevel() { > updating level code here. } What i want is every onchange in my view, i will call my editLevel function in my controller. how can i call a controller function using a javascript onchange? thanks in advance!
tagged with: onchange
tagged with: zend-framework
has comment: http://stackoverflow.com/comment/45436562
tagged with: php
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45442453
has comment: http://stackoverflow.com/comment/45427565

http://stackoverflow.com/a/28458752
type: Answer
answers question: http://stackoverflow.com/q/28458215
has body: You need to use concat instead of push. The push() method adds new elements to the end of an array: var a = [1, 2]; a.push([3, 4]); // a is [1, 2, [3, 4]] The concat() creates a new array by concatenating arrays: var a = [1, 2]; var b = a.concat([3, 4]); // b is [1, 2, 3, 4] Demo
score: 0

http://stackoverflow.com/comment/45208027
type: Comment
type: QuestionComment
has text: I suppose you could draw an ellipse with the same rx and ry so its a circle and then decrease the ry till it looks like a line.
comment on: http://stackoverflow.com/q/28438622
score: 0

http://stackoverflow.com/a/28478412
answers question: http://stackoverflow.com/q/28477810
has body: You could read the loaded css rules using document.styleSheets. Then, find the rules that are setting the specific property, in your case style.color == "blue". Then, get the selectorText from the rule, it will give you the selectors. It will be easy then to select the elements using document.querySelector() passing the obtained selectors as the parameter. var classes = document.styleSheets[0].rules || document.styleSheets[0].cssRules; for (var x = 0; x &lt; classes.length; x++) { var cls = classes[x]; if(cls.style.color == "blue") { alert(cls.selectorText); //Gets a node list of the elements matching the selector var elements = document.querySelectorAll(cls.selectorText); } } html { color: blue; } div.x { color: blue; }
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28477810
upvote count: 2

http://stackoverflow.com/q/28512368
score: 2
has answer: http://stackoverflow.com/a/28822316
upvote count: 2
type: UnansweredQuestion
has title: Jquery .closest() on Bootstrap Datepicker returning undefined
type: Question
has comment: http://stackoverflow.com/comment/45343412
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: bootstrap-datepicker
has body: I'm working with the Bootstrap Datepicker and I'm trying to close the popup I have when there's a click outside of the modal. The problem I'm having is that clicks on the table &lt;td&gt; elements don't return the parent div its in when I use $(e.target).closest('.datepicker'). If I click the blue box around it (also a child element) it returns the parent div but not for clicks in the table. http://jsfiddle.net/tuG6C/662/ JS $('body').click(function(e){ console.log($(e.target).closest('.datepicker')[0]); }); $(document).ready(function() { $('.datepicker').datepicker({ startDate: new Date() }); }); HTML &lt;div class="datepicker"&gt;&lt;/div&gt; CSS .datepicker { padding: 20px; background: aliceblue !important; display: inline-block; } table { background: #fff; } Screencast of the problem. I'm trying to avoid the undefined output.
has comment: http://stackoverflow.com/comment/45343338
favorite count: 0
has comment: http://stackoverflow.com/comment/45343903

http://stackoverflow.com/q/28456448
has body: These are the values I get when array has 3 elements and 1 element respectively: $.extend.apply(this,[{a:"b"},{a:"c"},{a:"d"}]) Object {a: "d"} $.extend.apply(this,[{a:"b"}]) Window {top: Window, window: Window, location: Location, external: Object, chrome: Object…} The first is as expected, but for second I was expecting Object {a: "b"} Why is this happening? Thanks in advance.
downvote count: 1
has comment: http://stackoverflow.com/comment/45239682
type: Question
has comment: http://stackoverflow.com/comment/45239459
accepted answer: http://stackoverflow.com/a/28456663
tagged with: javascript
tagged with: jquery
score: -1
has answer: http://stackoverflow.com/a/28456663
upvote count: 0
answer count: 1
favorite count: 0
has title: Why is javascript "apply" on $.extend and array of one element returns the element combined with Window object?
has comment: http://stackoverflow.com/comment/45239698
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45239733

http://stackoverflow.com/q/28456509
has title: Angular JS - Ng-Repeat issue
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/28456546
tagged with: javascript
score: 0
answer count: 2
tagged with: angularjs-ng-repeat
has answer: http://stackoverflow.com/a/28456550
tagged with: angularjs
has answer: http://stackoverflow.com/a/28456546
has body: I am defining my array as shown: $scope.tt= [ { "name" : "1", "sel" : false }, { "name" : "2", "sel" : false }, { "name" : "3", "sel" : false } ]; And showing in my view as so: {{mod.name}} Ok Cancel It works and shows all three of my items name and the related image but then errors: GET http://localhost:63342/tt/images/tt/%7B%7Bmod.name%7D%7D.png 404 (Not Found) As if there is 4 items rather than 3? What could cause this?
possible better answer: http://stackoverflow.com/a/28456550

http://stackoverflow.com/a/28439596
downvote count: 0
score: 3
answers question: http://stackoverflow.com/q/28438578
upvote count: 3
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28438578
type: Answer
has body: I have updated your fiddle. You need position: absolute not fixed since fixed position is anchored to the viewport, not the containing positioned element.

http://stackoverflow.com/a/28461803
answers question: http://stackoverflow.com/q/28461736
has comment: http://stackoverflow.com/comment/45249675
has comment: http://stackoverflow.com/comment/45249798
has body: You can't just do $scope.test = fileLoader.loadFile(); loadFile is an async call, and you can't return from that! You can use .then to continue the promise pattern. Your factory would change to: loadFile : function(fileLoc){ return $http.get('data/sideEffects.json').then(function(result) { // you can do some processing here return result.data; }); } And your controller: fileLoader.loadFile().then(function(data) { $scope.test = data; });
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45249726
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/45249876
accepted answer of: http://stackoverflow.com/q/28461736
has comment: http://stackoverflow.com/comment/45249622
score: 2

jquery
tags question: http://stackoverflow.com/q/28476197
tags question: http://stackoverflow.com/q/28553543
tags question: http://stackoverflow.com/q/28493770
tags question: http://stackoverflow.com/q/28559831
tags question: http://stackoverflow.com/q/28499967
tags question: http://stackoverflow.com/q/28486082
tags question: http://stackoverflow.com/q/28454262
tags question: http://stackoverflow.com/q/28458418
tags question: http://stackoverflow.com/q/28508223
tags question: http://stackoverflow.com/q/28464626
tags question: http://stackoverflow.com/q/28561545
tags question: http://stackoverflow.com/q/28499538
tags question: http://stackoverflow.com/q/28530623
tags question: http://stackoverflow.com/q/28559648
tags question: http://stackoverflow.com/q/28464874
tags question: http://stackoverflow.com/q/28443754
tags question: http://stackoverflow.com/q/28583747
tags question: http://stackoverflow.com/q/28467680
tags question: http://stackoverflow.com/q/28482040
tags question: http://stackoverflow.com/q/28476389
tags question: http://stackoverflow.com/q/28585731
tags question: http://stackoverflow.com/q/28519754
tags question: http://stackoverflow.com/q/28528322
tags question: http://stackoverflow.com/q/28452192
tags question: http://stackoverflow.com/q/28548654
tags question: http://stackoverflow.com/q/28561004
tags question: http://stackoverflow.com/q/28550966
tags question: http://stackoverflow.com/q/28469374
tags question: http://stackoverflow.com/q/28580354
tags question: http://stackoverflow.com/q/28551023
tags question: http://stackoverflow.com/q/28473133
tags question: http://stackoverflow.com/q/28546516
tags question: http://stackoverflow.com/q/28584915
tags question: http://stackoverflow.com/q/28576564
tags question: http://stackoverflow.com/q/28549622
tags question: http://stackoverflow.com/q/28520772
tags question: http://stackoverflow.com/q/28531491
tags question: http://stackoverflow.com/q/28470908
tags question: http://stackoverflow.com/q/28505148
tags question: http://stackoverflow.com/q/28559912
tags question: http://stackoverflow.com/q/28577678
tags question: http://stackoverflow.com/q/28463983
tags question: http://stackoverflow.com/q/28537450
tags question: http://stackoverflow.com/q/28585175
tags question: http://stackoverflow.com/q/28450096
tags question: http://stackoverflow.com/q/28528814
tags question: http://stackoverflow.com/q/28510620
tags question: http://stackoverflow.com/q/28534304
tags question: http://stackoverflow.com/q/28543527
tags question: http://stackoverflow.com/q/28489140
tags question: http://stackoverflow.com/q/28567160
tags question: http://stackoverflow.com/q/28478425
tags question: http://stackoverflow.com/q/28463357
tags question: http://stackoverflow.com/q/28439237
tags question: http://stackoverflow.com/q/28507445
tags question: http://stackoverflow.com/q/28488162
tags question: http://stackoverflow.com/q/28483618
tags question: http://stackoverflow.com/q/28530204
tags question: http://stackoverflow.com/q/28558201
tags question: http://stackoverflow.com/q/28504583
tags question: http://stackoverflow.com/q/28539907
tags question: http://stackoverflow.com/q/28590803
tags question: http://stackoverflow.com/q/28465218
tags question: http://stackoverflow.com/q/28466120
tags question: http://stackoverflow.com/q/28480410
tags question: http://stackoverflow.com/q/28527237
tags question: http://stackoverflow.com/q/28482798
tags question: http://stackoverflow.com/q/28479771
tags question: http://stackoverflow.com/q/28470646
tags question: http://stackoverflow.com/q/28540415
tags question: http://stackoverflow.com/q/28591472
tags question: http://stackoverflow.com/q/28463839
tags question: http://stackoverflow.com/q/28583630
tags question: http://stackoverflow.com/q/28536984
tags question: http://stackoverflow.com/q/28530239
tags question: http://stackoverflow.com/q/28523735
tags question: http://stackoverflow.com/q/28469551
tags question: http://stackoverflow.com/q/28566196
tags question: http://stackoverflow.com/q/28541998
tags question: http://stackoverflow.com/q/28451738

http://stackoverflow.com/a/28526553
answers question: http://stackoverflow.com/q/28467006
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: I used position:absolute on my header to begin with, because that also takes it out of the flow, so I could take that into account from the start and keep the following content at bay via a margin.
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28467006

http://stackoverflow.com/a/61176279
downvote count: 0
has comment: http://stackoverflow.com/comment/137525571
has body: LINQ users call first and firstOrDefault a lot with no predicate, which is not possible with find. So, first() { var firstOrDefault = this.firstOrDefault(); if(firstOrDefault !== undefined) return firstOrDefault; else throw new Error('No element satisfies the condition in predicate.'); } firstOrDefault() { return this.find(o =&gt; true); }
type: Answer
answers question: http://stackoverflow.com/q/28476629
upvote count: 7
has comment: http://stackoverflow.com/comment/117461976
score: 7

http://stackoverflow.com/q/28456560
has title: Check if object inside an object is empty with javascript
possible better answer: http://stackoverflow.com/a/28456625
upvote count: 6
has answer: http://stackoverflow.com/a/28456625
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28456607
type: Question
answer count: 2
has body: Hello I have an object: var equippedItems = { weapon: {}, armor: {}, accessory: {} }; I need a way to check if equippedItems.weapon equals to '' at some point I am doing something like equippedItems.weapon = ''; I dont know if it's exactly the same as above object. I already tried using object.hasOwnProperty but it seems I cannot use equippedItems.weapon in this case, maybe I am doing something wrong? Also note I did read how to check if object is empty already, but it didn't work for my object inside an object. @Edit: Like I said, I already read those and they did not give me a straight answer for my question, they did answer how to check if object is empty, but the object was like object = {}; while mine is like object = { object:{}, object2:{}, object3:{}}; Thats why it confuses me.
downvote count: 0
tagged with: javascript
score: 6
linked to: http://stackoverflow.com/q/679915
accepted answer: http://stackoverflow.com/a/28456607
has comment: http://stackoverflow.com/comment/45239829
duplicate of: http://stackoverflow.com/q/679915
favorite count: 0

http://stackoverflow.com/comment/45288816
comment on: http://stackoverflow.com/q/28483222
has text: put code you have attempted in the question itself. Hint: iterate over each row, then check cells within that row
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/28681359
has comment: http://stackoverflow.com/comment/45655580
downvote count: 0
has comment: http://stackoverflow.com/comment/45656038
has comment: http://stackoverflow.com/comment/45655862
has body: The code posted that extends the Object prototype will work, if corrected. However, it makes an incorrect assumption about what this is inside the invoked method. With the posted code the following output is correct and to be expected (barring a few old implementation bugs); "5".isString() //returns false This is because JavaScript will "wrap" or "promote" the primitive value to the corresponding object type before it invokes the method - this is really a String object, not a string value. (JavaScript effectively fakes calling methods upon primitive values.) Replace the function with: Object.prototype.isString = function() { return this instanceof String; } Then: "5".isString() // =&gt; true (a string was "promoted" to a String) (5).isString() // =&gt; false (`this` is a Number) Another solution to this is also to use polymorphism; with the same "pitfalls"1 of modifying standard prototypes. Object.prototype.isString = function () { return false; } String.prototype.isString = function () { return true; } 1The concern of adding a new enumerable property to the global protoypes can be mitigated with using defineProperty which creates a "not enumerable" property by default. Simply change x.prototype.y = .. to Object.defineProperty(x.prototype, 'y', { value: .. }) (I am not defending the use of modifying the prototype; just explaining the original problematic output and pointing out a way to prevent the enumeration behavior.)
score: 5
has comment: http://stackoverflow.com/comment/45655734
has comment: http://stackoverflow.com/comment/49806297
answers question: http://stackoverflow.com/q/28574376
upvote count: 5
type: Answer

http://stackoverflow.com/q/28459108
tagged with: crossfilter
upvote count: 1
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28460842
accepted answer: http://stackoverflow.com/a/28460842
has title: How to round the brush selection to 10 or 10k in DC.js
type: AnsweredQuestion
score: 1
type: Question
has body: Using D3, crossfilter and DC, I would like to draw a barchart with a selection brush. The dimension of this chart is rounded to the 10k. votesDim = ndx.dimension(function(d) { return Math.round(d.votes / 10000)*10000; }) But the brush on the chart is not. All I managed to do is round it to nearest integer with .round(Math.round) OR .round(dc.round.round) I'm looking to round the brush to the 10k too. Does someone knows which function I have to use in .round()? Thanks in advance !
tagged with: javascript
tagged with: dc.js

http://stackoverflow.com/comment/45436545
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28561991
has text: You seem to have made a lot of assumptions there. As it happens, if it's a lastUpdated time, then it *is* going to be server-generated - but that's still an assumption. Imagine a calendar application: the producer of a time is usually a person, and there can be multiple consumers in multiple different time zones. If you try to look at *every* date/time problem in the way you've dealt with this question, you'll run into problems.
score: 0

http://stackoverflow.com/q/28532328
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28538704
tagged with: intellij-idea
tagged with: javascript
has body: I have a custom Javascript API implemented in C++ that I want to make work like any other API that IntelliJ can parse, i.e. I want keyword suggestions and highlighting. Being implemented in C++, the javascript API is made up of glue code that generates the API in runtime. So there is no Javascript code for IntelliJ to parse like for a normal API. Does anyone know if its possible to manually define the keyword suggestion and relations between classes and methods in IntelliJ ? I cant find anything in the doc, maybe I've missed something in the plugin documentation...
downvote count: 0
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28538704
has title: Custom keyword suggestion in IntelliJ
tagged with: c++

http://stackoverflow.com/comment/45258929
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28445999
has text: @DavidS. Source:

pyqt
type: Tag
tags question: http://stackoverflow.com/q/28519677
tag name: pyqt

http://stackoverflow.com/comment/45352436
has text: Just by giving it the string passed into the controller it doesn't escape it properly. E.g. &lt; is left untouched
comment on: http://stackoverflow.com/a/28516993
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45233957
comment on: http://stackoverflow.com/a/28453381
has text: That's great, thanks! And thanks for the link to the style guide too!
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28567253
has body: I've found 5 different ways to change current location on a webpage. Which one's better and way are they all needed? This is basically what I found: window.location.assign("www.example.com") does the same as window.replace("www.example.com") the difference is that replace() removes the URL of the current document from the document history, meaning that it is not possible to use the "back" button to navigate back to the original document. But what's the difference between these two and changing the location by window.location = "www.example.com" ? What about &lt;a href&gt; ? And history.pushState? EDIT Some of you marked this as duplicated because of Javascript: Setting location.href versus location and What&#39;s the difference between window.location= and window.location.replace()? but it is not. My question's far wider than this. It's everywhere "how to change location" but I didn't find a full comparison between these methods.
type: Question
linked to: http://stackoverflow.com/q/2383401
answer count: 1
tagged with: url
has answer: http://stackoverflow.com/a/28567358
tagged with: javascript
tagged with: jquery
favorite count: 0
duplicate of: http://stackoverflow.com/q/2383401
score: 0
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/1865837
has title: Best way change url location
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/1865837
accepted answer: http://stackoverflow.com/a/28567358
upvote count: 1
downvote count: 1

http://stackoverflow.com/q/28574594
answer count: 1
has comment: http://stackoverflow.com/comment/45458722
tagged with: css
score: 10
has body: I've been trying to make Dropzone.js look like the theme on the site (dropzonejs.com) using a short piece of example code and dropzone.css. Here's my code: &lt;html&gt; &lt;head&gt; &lt;script src="dropzone.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" type="text/css" href="dropzone.css"&gt; &lt;link rel="stylesheet" type="text/css" href="basic.css"&gt; &lt;/head&gt; &lt;form action="/upload-target" class="dropzone"&gt;&lt;/form&gt; &lt;/html&gt; I checked the file paths, and those are all good. The end result looks like http://www.dropzonejs.com/examples/simple.html but my intended result is like the example on the main page "Try It!" section. Let me know if you can help.
has answer: http://stackoverflow.com/a/28574743
has comment: http://stackoverflow.com/comment/45458786
accepted answer: http://stackoverflow.com/a/28574743
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45458818
upvote count: 10
type: Question
has title: How to make Dropzone.js appear like the theme on the site?
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: dropzone.js

http://stackoverflow.com/comment/45444865
type: QuestionComment
comment on: http://stackoverflow.com/q/28567300
score: 0
has text: The response is `{"success":true,"uploaded":true,"url":"C:\\wamp\\tmp\\php7A29.tmp"}`
type: Comment

http://stackoverflow.com/comment/45358046
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28520539
type: Comment
has text: It should be `.otherwise({redirectTo: '/'})`

http://stackoverflow.com/a/28473341
type: Answer
has body: I think is because the name of the popped window is the same: the parent.opener of the popup is the first tab... so it will always refer to it. All I can think of is to have a different popup-name for each tab the site is opened. This way you will have 2(or more) popups and each will refer to his own parent.oopener. try this : var myTime=new Date().getTime(); var popupName="mypopup_"+myTime; var myPopup=null; function popMypopup(URL){ myPopup=window.open(URL,popupName,"height=50,width=50"); myPopup.focus(); } to pop the window use popMypopup('your/url/here.html')
score: 0
has comment: http://stackoverflow.com/comment/45332339
answers question: http://stackoverflow.com/q/28452623

http://stackoverflow.com/q/28468583
answer count: 1
has comment: http://stackoverflow.com/comment/45294468
tagged with: indexeddb
tagged with: javascript
type: UnansweredQuestion
tagged with: arrays
has title: Storing a huge array of strings into IndexedDB
has answer: http://stackoverflow.com/a/28483074
type: Question
has comment: http://stackoverflow.com/comment/45267670
has body: I have a huge array called newCombs when I call store.put(game) the tab turns white and is gone in chrome task manager. Basically the process just stops and it fails to store the array var trans = this.db.transaction('Games', 'readwrite'); var store = trans.objectStore('Games'); store.get(new Date().toLocaleDateString() + ' ' + prize.value).onsuccess = function() { var game = this.result; game.combs = game.combs.concat(newCombs); //I'm appending to the game.combs array which is empty when I first run it (when it also crashes) store.put(game); } trans.oncomplete = function(evt) { arrLength = 0; newCombs = []; } This is what game is equal to: game = { name: new Date().toLocaleDateString() + ' ' + prize.value, date: new Date().toLocaleDateString(), prize: prize.value, playerData: [...], points: {...} } The above part is a method of an object so this is not the window object everything works fine until the code hits the line with: store.put(game); the page just crashes.
score: 0

http://stackoverflow.com/a/28592970
has body: Ok, I figured out the problem and the solution is as simple as it is embarrassing :) Here goes..... don't call your own collections 'Accounts'. Yup, the reason that Accounts._storedLoginToken() was erroring is that it was calling the method on my collection - not the one declared in the, um, accounts package. I'll leave this answer here in the unlikely event that someone repeats my mistake (and because I deserve it :)
accepted answer of: http://stackoverflow.com/q/28582528
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28582528
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/a/28574492
downvote count: 0
has body: If you rotate the lines, instead of skewing them, and set the appropriate transform-origin, your code will work fine as it is. The origin's y shoud be the same as the top of the content div. Just add this to your css: .right.lean-forward { -webkit-transform: rotate(15deg); -webkit-transform-origin: 0 361px; } .slide-content.one.lean-forward { -webkit-transform-origin: 0 0; } Demo jsfiddle. Note: The rotated line is not covering the full image height, so you may want to add a scaleY transform after the rotate to make it longer. Edit: You can set the transform-origin like this (new fiddle): $('.lines .right').css('transform-origin', '0 ' + bottomLinePos + 'px');
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45495890
accepted answer of: http://stackoverflow.com/q/28552382
score: 1
answers question: http://stackoverflow.com/q/28552382
type: AcceptedAnswer

http://stackoverflow.com/q/28479584
has comment: http://stackoverflow.com/comment/45281575
tagged with: javascript
has title: Javascript Regex: null is lower case letter?
has answer: http://stackoverflow.com/a/28479652
answer count: 3
downvote count: 0
has body: Can anyone explain why /[a-z]/.test(null) returns true while /[A-Z]/.test(null) returns false? Is null (or undefined or false) considered a lower case letter in Javascript? Thanks. Tested on Chrome and Firefox.
linked to: http://stackoverflow.com/q/1085189
favorite count: 0
has answer: http://stackoverflow.com/a/28479716
duplicate of: http://stackoverflow.com/q/1085189
has answer: http://stackoverflow.com/a/28479768
tagged with: regex
accepted answer: http://stackoverflow.com/a/28479652
upvote count: 11
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28479768
score: 11
type: Question

http://stackoverflow.com/q/28503653
type: AnsweredQuestion
downvote count: 0
linked to: http://stackoverflow.com/q/4639372
has answer: http://stackoverflow.com/a/28504617
accepted answer: http://stackoverflow.com/a/28504617
type: Question
tagged with: jquery-ui
has comment: http://stackoverflow.com/comment/45327192
tagged with: javascript
has comment: http://stackoverflow.com/comment/45326836
has title: jquery export sortable list (user sorted) to csv?
upvote count: 2
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/45327347
favorite count: 0
tagged with: http://stackoverflow.com/tag/csv
has comment: http://stackoverflow.com/comment/45326783
has body: So I have two sortable lists that a user can drag items out of and into a third list where they can hopefully export that list to a downloadable csv file. I have the multiple selectable and sortable part working fine at this jsfiddle, but now need to include the export to csv funtionality. Can anyone help? Here is a screenshot of what I am attempting to achieve from the jsfiddle: Here is my code so far: jQuery UI Sortable with Selectable $(function() { // $('body').selectable({ filter: 'li' //filter: '#album2 > li' }); $('.connectedSortable').sortable({ connectWith: ".connectedSortable", delay: 100, start: function(e, ui) { var topleft = 0; // if the current sorting LI is not selected, select $(ui.item).addClass('ui-selected'); $('.ui-selected div').each(function() { // save reference to original parent var originalParent = $(this).parent()[0]; $(this).data('origin', originalParent); // position each DIV in cascade $(this).css('position', 'absolute'); $(this).css('top', topleft); $(this).css('left', topleft); topleft += 20; }).appendTo(ui.item); // glue them all inside current sorting LI }, stop: function(e, ui) { $(ui.item).children().each(function() { // restore all the DIVs in the sorting LI to their original parents var originalParent = $(this).data('origin'); $(this).appendTo(originalParent); // remove the cascade positioning $(this).css('position', ''); $(this).css('top', ''); $(this).css('left', ''); }); // put the selected LIs after the just-dropped sorting LI $('#album .ui-selected').insertAfter(ui.item); // put the selected LIs after the just-dropped sorting LI $('#album2 .ui-selected').insertAfter(ui.item); } }); // }); 1- First 2- Second 3- Third 4- Fourth 5- Fifth 6- Sixth 7- Seventh 8- Eighth 1- 1 2- 2 3- 3 4- 4 5- 5 6- 6 7- 7 8- 8 This is a list of what to export to csv
score: 2

http://stackoverflow.com/comment/45257799
has text: Something seems to be calling your handler before the change actually takes effect. I can't think of what would be doing that. Try putting a breakpoint in the handler, then look at the call stack to see where it's being called from.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28465387
type: Comment

http://stackoverflow.com/comment/45394638
score: 0
has text: @Grundy new implicitly returns the function , which means it points to the function ?
comment on: http://stackoverflow.com/q/28540388
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28546181
type: Question
tagged with: object
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/45405941
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28554917
has title: converting html markup to object
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28546350
has body: I have the below code Hello! This is a headline! I want to make this code look in the below format { "html" : [ { "head" : [{ "title" : "hello" }] }, { "body" : [ { "div1" : [ { "h1" : "This is a headline!" }, { "br" : "" }, { "img" : "header-image.png" } ]}, { "div2" : [{ "a" : "http://www.google.com" }] }, {"div3" : [] } ] } ] } I tried converting the whole markup into a string and converting the result into an array. http://plnkr.co/edit/SslHEaU8bQMvyWJj04iM?p=preview I am stuck in between. Can some one help me on this? Thanks in advance.
score: 0

http://stackoverflow.com/comment/45781207
score: 0
has text: can you provide me the example about that? links are okay with me
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28557221

http://stackoverflow.com/q/28511927
score: 1
type: Question
has answer: http://stackoverflow.com/a/28511968
answer count: 1
accepted answer: http://stackoverflow.com/a/28511968
tagged with: javascript
tagged with: jquery
has title: Using $(this) with css class selectors in Jquery
upvote count: 1
downvote count: 0
favorite count: 0
type: AnsweredQuestion
has body: I have below HTML to display and download tracks . What i need is to hide Play button , Download button and the share button when user clicks share button(what i really need is to show social media buttons after hiding the default buttons) . Track Name :- Get Low By :- DJ perera Play Your browser does not support HTML5 audio. Download MP3 Share Track Name :- Eclips - Hardwell By :- DJ perera Play Your browser does not support HTML5 audio. Download MP3 Share i already have above js code to hide play , download and share buttons when a user clicks share button . The Problem is since im using css class selectors , when user press Share button it hide all the play buttons , download buttons and share buttons from the webpage . what i need to achieve is that when a user click share button i need to hide only buttons that belong into that form only . i have already tried doing this . but it won't work and and this Kindly point out what went wrong since im new to javascript . Thanks

http://stackoverflow.com/a/28532526
answers question: http://stackoverflow.com/q/28532142
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/45380105
score: 3
has body: To form an if clause in your ng-class simply use ng-class="main.success?'success':'error'" Here is your plunker modified, so that it works. Unfortunately I had to add a template file to make the quotations easier readable. Additionally I removed your vm.error and toggle vm.success between true and false.
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28532142
type: AcceptedAnswer

http://stackoverflow.com/q/28452504
has comment: http://stackoverflow.com/comment/45232225
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/45235299
tagged with: asp.net-mvc-helpers
tagged with: javascript
has comment: http://stackoverflow.com/comment/45236706
score: 0
has comment: http://stackoverflow.com/comment/45236629
has title: using html helper for dropdownlist in javascript not working
has comment: http://stackoverflow.com/comment/45236573
has comment: http://stackoverflow.com/comment/45232317
has body: I am using html helper for dropdownlist in javascript function but it's not working. I have tried using various syntax with or without encoder etc but it is rendering as string not as a html control. Actually I have to create dynamic dropdownlist each time my Add new row button is clicked. Placing the code for dropdownlist in view is working fine but in javascript file it is rendering as simple text. addServer.js-Way1 function addServerRow() { var html = ' ' + ' ' + ' @Ajax.JavaScriptStringEncode(Html.DropDownListFor(m => m.ServerPrivateNetworks, ViewData["PrivateNetwork"] as List<SelectListItem>, "Select",new { Class = "form-control", data_required = "true"}).ToHtmlString()) ' + ' ' $(html).appendTo($("#tblServerPrivateNw")) }; $("#btnAddPrivateServerNetwork").click(function (e) { e.preventDefault(); _totalRows += 1; addServerRow(); }); I have tried the other way also to create dropdownlist it works fine but when I select item from the dynamically created dropdownlists I get null value in my controller on form submission. Below is the code used addServer.js-Way2 function addServerRow() { var html = ' ' + ' ' + ' ' + ' ' + ' ' $(html).appendTo($("#tblServerPrivateNw")) var drplist = document.getElementById('drpPrivateNetwork' + _totalRows); for (i = 0; i < allPrivateNetworks.length; i++) { var option = document.createElement('option'); option.text = allPrivateNetworks[i].Name; option.value = allPrivateNetworks.Id; drplist.add(option, 0); } }; $("#btnAddPrivateServerNetwork").click(function (e) { e.preventDefault(); _totalRows += 1; addServerRow(); }); My model for this dropdownlist is ServerAllNetworks and dropdownlist is used to get PrivateNetworkId public class ServerAllNetworks { public ServerDetails server { get; set; } public List<ServerPrivateNetworkDetails> ServerPrivateNetworks { get; set; } } public class ServerPrivateNetworkDetails : ServerPrivateNetwork { public string ServerName { get; set; } public string PrivateNetworkName { get; set; } } public partia…
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45236185
has comment: http://stackoverflow.com/comment/45236022
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/45236170

http://stackoverflow.com/a/69383228
has body: // format from M/D/YYYY to YYYYMMDD function formatDate(userDate) { var dateObj = new Date(userDate); let year = dateObj.getFullYear(); let date = ('0' + (dateObj.getDate())).slice(-2); let month = ("0" + (dateObj.getMonth() + 1)).slice(-2); return '' + year + month + date; } console.log("The converted date is : " , formatDate("12/31/2014"));
answers question: http://stackoverflow.com/q/28477304
type: Answer
upvote count: 2
score: 2
downvote count: 0

http://stackoverflow.com/comment/53616885
score: 0
comment on: http://stackoverflow.com/a/28572926
type: Comment
type: AnswerComment
has text: This fix helped me when I was executing global packages but wanted to run local packages with a new node version. Just has to switch versions when I ran global commands.

http://stackoverflow.com/comment/45715892
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28579200
has text: I still don't get how it is gonna be dispayed on your page, what kind of UI control
score: 0

http://stackoverflow.com/a/28480314
type: Answer
has body: You don't need to do a $watch (although you could) but instead compare to another changed value. You can use ng-blur to trigger the change check. $scope.old = $scope.cron_format = ""; $scope.saveCron(user_id, script_id, cron_format) { if ($scope.old == $scope.cron_format) { return; //value was unchanged } $scope.old = $scope.cron_format; $http.post(); });
answers question: http://stackoverflow.com/q/28480192
score: 0

internet-explorer-9
tag name: internet-explorer-9
tags question: http://stackoverflow.com/q/28544908
tags question: http://stackoverflow.com/q/28458288
tags question: http://stackoverflow.com/q/28563315
tags question: http://stackoverflow.com/q/28465387
tags question: http://stackoverflow.com/q/28479107
type: Tag

http://stackoverflow.com/q/28453081
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28453461
possible better answer: http://stackoverflow.com/a/28453302
has answer: http://stackoverflow.com/a/28453332
has answer: http://stackoverflow.com/a/28453302
has comment: http://stackoverflow.com/comment/45233380
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
has title: text sits lower in one div compared to the other
has answer: http://stackoverflow.com/a/28453203
accepted answer: http://stackoverflow.com/a/28453203
has body: I have this JAVA script at the moment. /* ******************************************************************** */ /* Generated by: http://csscreator.com */ /* ******************************************************************** */ html, body { margin: 0; padding: 0; text-align: center; BACKGROUND: #fff; font-family: Verdana, Geneva, 'DejaVu Sans', sans-serif; } a { color: #fff; text-decoration: none; white-spaces: nobreak } li { color: #fff; } body { color: #BAC6DE } #pagewidth { width: 1395px; text-align: left; margin: 0px auto; } #header { position: relative; height: 100px; width: 1395px; display: block; overflow: none; padding: 0px 0px 0px 0px; } #header h2 { color: #fff; padding: 0px 0px 0px 60px; } #header p { color: #fff; padding: 10px 0px 0px 60px; } #maincol { background-color: #BAC6DE; position: relative; width: 1395px; height: 800px; padding: 0px 0px 0px 0px; Margin: 0px 0px 0px 0px; } #widgetcontainer { background-color: #00386B; position: relative; width: 1175px; height: 100%; Margin: 0px 0px 0px 0px; Padding: 0px 0px 0px 10px; Overflow: auto; } .widget { background-color: #BAC6DE; float: left; width: 200px; height: 100%; margin: 0px 0px 0px 0px; padding: 0px 0px 0px 10px; } #result p { color: #000; } #footer h2 { color: fff; padding: 0px 0px 0px 0px; } #footer p { color: fff; padding: 0px 50px 0px 60px; font-family: 'Monotype Corsiva', 'Apple Chancery', 'ITC Zapf Chancery', 'URW Chancery L', cursive; font-size: 120%; margin-right: 2px; margin-top: 8px; } /* ******************************************************************** */ /* Clearfix: http://csscreator.com/attributes/containedfloat.php */ /* ******************************************************************** */ .clearfix:after { content: "."; display: block; height: 0; clear: both; visibility; hidden; } .clearfix { display: inline-block; } /* Hides from IE-mac \*/ * html .clearfix { height: 1%; } .clearfix { display: block; } /* End hide from IE-mac */ /* *****************************************…
type: Question

http://stackoverflow.com/comment/74967381
type: QuestionComment
comment on: http://stackoverflow.com/q/28582516
has text: For Windows Microsoft gave us JScript https://msdn.microsoft.com/en-us/library/ms692435(v=vs.85).aspx
score: 0
type: Comment

http://stackoverflow.com/q/28511321
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28511360
has title: Modifying css with javascript quickly flashes on screen then returns to original (help)
type: Question
has comment: http://stackoverflow.com/comment/45341467
tagged with: javascript
has body: A little hard to explain but here it is, I changed some css with javascript and when i run it in my web browser it appears and then quickly disappears back to the original css. In other words my changed css value from javascript doesn't stay! CSS: #login_temp{ width: 350px; height:150px; background: rgba(255, 255, 255, 0.1); position: absolute; top: 50%; left: 50%; margin-left: -175px; margin-top: -150px; border-radius: 2px; box-shadow: 0px 30px 40px -25px rgba(0, 0, 0, 1); } HTML: &lt;input type="submit" name="submit" id="submit" onclick = dog(); value="Login" /&gt; JAVASCRIPT: function dog(){ document.getElementById("login_temp").style.background = "black"; }
has answer: http://stackoverflow.com/a/28511378
score: 0
answer count: 3
tagged with: css
has answer: http://stackoverflow.com/a/28511367

http://stackoverflow.com/q/28578866
has answer: http://stackoverflow.com/a/28579053
tagged with: angularjs
has title: how does angular implement bind-once directives?
type: AnsweredQuestion
has body: I've looked through source code but haven't found relative piece of code. I'm particularly interested in bind-once watchers and the way to attach them. At the moment I've done the following: var removeNodeTypeWatcher = scope.$watch(function () { return paneController.getNodeType(); }, function (value) { if (value) { scope.nodeType = value; // as soon as the value is defined we no longer need watcher removeNodeTypeWatcher(); } });
score: 0
accepted answer: http://stackoverflow.com/a/28579053
has comment: http://stackoverflow.com/comment/45466389
type: Question
has comment: http://stackoverflow.com/comment/45466881
tagged with: javascript
has comment: http://stackoverflow.com/comment/45466283
answer count: 1

http://stackoverflow.com/comment/45360344
score: 1
has text: Stop using `cfform` and `cfinput` and use `form` and `input` respectively. The ColdFusion UI functionality is poorly implemented, and will give you headaches down the road.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28519711

http://stackoverflow.com/a/28445659
has comment: http://stackoverflow.com/comment/45220929
has body: var myData = [ {"text" : "item 1", "id":11111, "active" : 0 }, {"text" : "item 2", "id":22222, "active" : 1 }, {"text" : "item 3", "id":33333, "active" : 1 }, {"text" : "item 4", "id":44444, "active" : 0 } ]; console.log(myData[0].text); //returns item 1 var active = myData.filter(function(data){ return data.active; }); var inactive = myData.filter(function(data){ return !data.active; }); Or perhaps make it a function function getData(type){ return myData.filter(function(data){ return (type == 'active') ? data.active : !data.active; }); } and if you're already using ES6 arrow functions you can shorten them to: var active = myData.filter(data =&gt; data.active); var inactive = myData.filter(data =&gt; !data.active); function getData(type){ return myData.filter(data =&gt; (type == 'active') ? data.active : !data.active); }
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/28445401
answers question: http://stackoverflow.com/q/28445401
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/a/28581766
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/45472575
answers question: http://stackoverflow.com/q/28581179
has body: If you have all your models under the same object, you can perform a deep watch on that object and build an history. &lt;input type="text" ng-model="user.name" /&gt; &lt;input type="text" ng-model="user.email" /&gt; &lt;input type="text" ng-model="user.details.phone" /&gt; And a controller function Controller($scope) { $scope.user = { details: {} }; var lastValue; // Deep watch ('true' as last argument) $scope.$watch('user', function (newVal, oldVal) { // Add to history (create a copy) lastValue = angular.copy(oldVal); }, true); } If you are using Angular 1.3+ You can look at ngModelOptions https://docs.angularjs.org/api/ng/directive/ngModelOptions if you want better control over when a model is updated. Additionally you can look at $rollbackViewValue() on the FormController and ngModelController: https://docs.angularjs.org/api/ng/type/form.FormController#$rollbackViewValue, https://docs.angularjs.org/api/ng/type/ngModel.NgModelController#$rollbackViewValue
has comment: http://stackoverflow.com/comment/45472222
downvote count: 0

http://stackoverflow.com/q/28534473
has comment: http://stackoverflow.com/comment/45530228
has comment: http://stackoverflow.com/comment/45383616
has comment: http://stackoverflow.com/comment/45383723
answer count: 1
has comment: http://stackoverflow.com/comment/45533947
favorite count: 0
has answer: http://stackoverflow.com/a/28596416
has body: In JavaScript, I am attempting to take a given user input and guess the 3 most likely words that might complete the user's currently (incomplete) typed word. The guess is based on the user's past inputs. I'm working on this here, in this JSFiddle. The structure I build to record the user's past inputs is a modified Radix Tree (AKA Patricia Trie): Input: "hey" { "h": { "value": "h", "count": 1, "followables": { "e": { "value": "e", "count": 1, "followables": { "y": { "value": "y", "count": 1, "followables": {} } } } } } } This data structure is built perfectly, and I think it's the best structure to achieve the goal described. My problem is the function for reading the Radix Tree data to define the 3 most likely words for a given input. In the above data for example, if the user inputs "h", the guessing function should return an object like this: guess : { 1 : "hey", 2 : "", 3 : "" } So here's my code/progress: Learn - take completed input string and organize the combination into the Radix Tree (brain): function learn(message, brain) { if (message.length == 0) return {}; // or do something else var ch = message[0]; // get the first character if (!brain[ch]) { // create new node when not exists brain[ch] = { value: ch, count: 1, followables: {} }; } else { // increment count when exist brain[ch].count += 1; } var substr = message.substring(1); // remove first character if (substr) { // do it for the remaining substring brain[ch].followables = learn(substr, brain[ch].followables); } else { renderData(); } return brain; } That's all done right. Unfortunately, the next code, meant to read the data and guess the word that the user is typing, is not good. I'm having trouble with what's to me a very complex function. I've divided it into small functions, as I've learned is the best practice, but I'm afraid I've made a mess that could probably be much simpler: Guess - take the "learned" string data and make 3 guesses at which word the user might be typing: function guess(pro…
has comment: http://stackoverflow.com/comment/45504466
has title: How can I read this Radix Tree structure to determine next-string probability?
has comment: http://stackoverflow.com/comment/45499549
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45534105
tagged with: patricia-trie
accepted answer: http://stackoverflow.com/a/28596416
type: Question
upvote count: 4
linked to: http://stackoverflow.com/q/2901831
has comment: http://stackoverflow.com/comment/45511268
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45383860
score: 4
has comment: http://stackoverflow.com/comment/45520252
has comment: http://stackoverflow.com/comment/45520361

http://stackoverflow.com/a/28579694
upvote count: 2
answers question: http://stackoverflow.com/q/28579646
has body: In PHP you have to set header. Check Manual header("Location:http://example.com");
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/comment/45264632
comment on: http://stackoverflow.com/q/28469583
type: Comment
type: QuestionComment
has text: Yes it can be and its actually a security issue called session hijacking.
score: 0

http://stackoverflow.com/a/28489109
has body: You can see my answer to Activate the tab of the location hash for more info. If you want to navigate to the selected URL when the page loads, you'll need to add javascript on page load to gather the necessary information from the URL and then use that to open the appropriate panel. Here's an example using the hash value of the tab: $(function() { // jump to tab if it exists if (location.hash) { $('a[href="' + location.hash + '"]').tab('show'); } // add tab hash to url to persist state $(document.body).on("shown.bs.tab", function(e){ location.hash = e.target.hash; }); }); If the tab had an ID of tab-two, you could open it with the url http://example.com/#tab-two Here's a demo in Plunker Open the window or run it directly here
type: Answer
answers question: http://stackoverflow.com/q/28488767
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/45300248
upvote count: 3
has comment: http://stackoverflow.com/comment/45300190
has comment: http://stackoverflow.com/comment/45300137

http://stackoverflow.com/q/28552545
type: AnsweredQuestion
tagged with: jquery
has body: I have two number pickers which one of them is under the other one but i need to make them side by side but i couldnt succeed. Also the number pickers are somehow connected. when i press up both of them moves up. Its probably because of calling the class spinner on click function, but i have no clue how can i do them separated without writing function for each one. $(' ').appendTo(tabPage); $(' ').appendTo(tabPage); var tableSpinnerRow = $(' ').appendTo(tabPage); var spinnerContainer = $(' ').appendTo(tableSpinnerRow); var spinner1 = $(' ').appendTo(spinnerContainer); var input1 = $(' ').appendTo(spinner1); var input_Group1 = $(' ').appendTo(spinner1); var buttonPlus1 = $(' ').appendTo(input_Group1); var buttonMinus1 = $(' ').appendTo(input_Group1); $(' ').appendTo(tabPage); var spinnerContainer2 = $(' ').appendTo(tableSpinnerRow); var spinner2 = $(' ').appendTo(spinnerContainer2); var input2 = $(' ').appendTo(spinner2); var input_Group2 = $(' ').appendTo(spinner2); var buttonPlus2 = $(' ').appendTo(input_Group2); var buttonMinus2 = $(' ').appendTo(input_Group2); (function ($) { $('.spinner .btn:first-of-type').on('click', function() { $('.spinner input').val( parseInt($('.spinner input').val(), 10) + 1); }); $('.spinner .btn:last-of-type').on('click', function() { $('.spinner input').val( parseInt($('.spinner input').val(), 10) - 1); }); })(jQuery);
type: Question
has answer: http://stackoverflow.com/a/28553317
score: 0
answer count: 1
has title: number picker in javascript
accepted answer: http://stackoverflow.com/a/28553317
tagged with: javascript

http://stackoverflow.com/q/28463789
favorite count: 0
has answer: http://stackoverflow.com/a/28464122
type: UnansweredQuestion
has title: Update JSON Data in JavaScript
score: 1
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I have been working on creating dynamic accordion by getting json data. I have implemented it and it works as expected, the code is as follows: fiddle: jsfiddle.net/xg7cr0g4/68/ However, at this stage, I would like to edit accordion header (formationName) and once I click on the refresh button, it should update the json string. I couldn't figure out how to approach the problem. $("#refresh").click(function(){ $( '.formationName' ).on( 'change', function(){ var text=myData.offsetFormations[0].val(); myData.offsetFormations[0]["formationName"]=text; json = JSON.stringify(jsonString); alert( jsonString ); }); }); By the way, I recently started on web development.
answer count: 1

http://stackoverflow.com/comment/45478758
comment on: http://stackoverflow.com/q/28585542
has text: Hi , thank you for respond, i could rtl the content but not the plus sign and label
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45341413
score: 0
type: Comment
type: QuestionComment
has text: Tamper Data unfortunately does not have automation or other such features. You would have to manually modify it for every request. You could make your own add-on that does though.
comment on: http://stackoverflow.com/q/28511248

http://stackoverflow.com/a/28810136
accepted answer of: http://stackoverflow.com/q/28438309
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28438309
has body: // i used that code For Next and Previous Functionality And it works fine // function uiWebview_HighlightAllOccurencesOfNextStringForElement(element,keyword) { if (element) { if (element.nodeType == 3) { // Text node while (true) { //if (counter &lt; 1) { var value = element.nodeValue; // Search for keyword in text node var idx = value.toLowerCase().indexOf(keyword); if (idx &lt; 0) break; // not found, abort var span = document.createElement("span"); var text = document.createTextNode(value.substr(idx,keyword.length)); span.appendChild(text); span.setAttribute("class","MyAppHighlight"); text = document.createTextNode(value.substr(idx+keyword.length)); element.deleteData(idx,value.length-idx); var next = element.nextSibling; element.parentNode.insertBefore(span,next); element.parentNode.insertBefore(text,next); element = text; span.scrollIntoView(); span.style.backgroundColor = "yellow"; span.style.color = "black"; a.push(span); uiWebview_SearchResultCount++; } } else if (element.nodeType == 1) { // Element node if (element.style.display != "none" &amp;&amp; element.nodeName.toLowerCase() != 'select') { for (var i=element.childNodes.length-1; i&gt;=0; i--) { uiWebview_HighlightAllOccurencesOfNextStringForElement(element.childNodes[i],keyword); } } } } } // the main entry point to start the search function uiWebview_HighlightAllOccurencesOfNextString(keyword) `enter code here`{ uiWebview_RemoveAllHighlights(); uiWebview_HighlightAllOccurencesOfNextStringForElement(document.body, keyword.toLowerCase()); } //And than In Your ViewContrlller Called this function on Next And Previous button method - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar { [self highlightAllOccurencesOfNextString:searchbar.text]; } - (NSInteger)highlightAllOccurencesOfNextString:(NSString*)str { NSString *filePath = [[NSBundle mainBundle]pathForResource:@"UIWebViewSearch" ofType:@"js"]; NSData *fileData = [NSData dataWithContentsOfFile:filePath]; NSString *jsString = [[NSMutableString…

http://stackoverflow.com/q/28571280
has comment: http://stackoverflow.com/comment/45484444
type: Question
tagged with: highcharts
has body: I have several charts utilizing the highcharts plugin and directive, and tables using ng-grid through my app. When viewing a page with a chart or table directly after viewing the homepage, the charts and tables don't respect their frame widths, and expand to a width of 1900px (see image: https://i.sstatic.net/1NKhG.png). After refreshing the page once, the charts and grids fit within their frames as they should. What could be causing this issue? Code below, let me know if any other code would be helpful. Thanks. HTML for one of the offending pages: Top 8 Drugs by 2013 Revenue 0"> RxScore Safety Indicator Low High Highcharts config: exports.getOverviewChart = function (RevenueSlices) { var companyName; var Series = [ {name: 'Revenue ($MM USD)', data: [], type: 'column'} ]; var cCategories = []; var colors = ['green', 'yellow', '#CD7D0F', 'red']; var thresholds = [47.17, 55.81, 61.83, 82.83]; var cleanSlices = _.reject(RevenueSlices, function (sl) { return sl.BrandName === "Unknown"; }); cleanSlices = _.filter(cleanSlices, function (cs) { return Math.abs(cs.evaluate_productRevenue2013) > 0; }); angular.forEach(cleanSlices, function (o) { var s = Math.abs(o.metric_rxscore); var color; if (s >= thresholds[2]) { color = colors[3]; } else if (s >= thresholds[1]) { color = colors[2]; } else if (s >= thresholds[0]) { color = colors[1]; } else if (s >= 1) { color = colors[0]; } else { color = 'lightgrey'; } companyName = o.parent; cCategories.push(o.BrandName); Series[0].data.push({name: o.BrandName, color: color, y: Math.abs(o.evaluate_productRevenue2013)}); }); var overviewChart = { options: { chart: { type: 'StockChart' }, legend: { enabled: false }, exporting: { enabled: false }, plotOptions: { series: { stacking: '' } } }, size: { // width: 573, height: 380 }, xAxis: { title: { text: 'Drug' }, categories: cCategories }, yAxis: { title: { text: '2013 Revenue' }, labels: { format: '{value} $MM USD' } }, credits: { enabled: false }, series: Series, title: { style: { 'displ…
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28611767
tagged with: ng-grid
score: 0
answer count: 1
tagged with: css
tagged with: angularjs
has title: Angular highchart and ng-grid headers not respecting frame widths
has comment: http://stackoverflow.com/comment/45481894
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28611767

http://stackoverflow.com/comment/45293091
type: Comment
type: QuestionComment
has text: i understand that you created these methods to get some reference to some element or to get the value of that element but why not just use the way Wolff already pointed ? any specific reason ?
score: 0
comment on: http://stackoverflow.com/q/28485207

http://stackoverflow.com/q/28532449
tagged with: protractor
tagged with: javascript
has comment: http://stackoverflow.com/comment/45379786
has comment: http://stackoverflow.com/comment/45379911
score: 0
has answer: http://stackoverflow.com/a/28532515
answer count: 1
has comment: http://stackoverflow.com/comment/45448723
accepted answer: http://stackoverflow.com/a/28532515
tagged with: angularjs
linked to: http://stackoverflow.com/q/23667086
has title: JavaScript, variables scope, order of variable evaluation
linked to: http://stackoverflow.com/q/27910331
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/23667086
has body: I'm testing some angularjs app using protractor and have encountered such a problem: var counter = 0; redButton.click(); allImages.each(function(element) { element.isDisplayed().then(function(isDispl){ if(isDispl === true){ expect(element.getInnerHtml()).toContain('red'); counter++; console.log("I'm here!") } }); }); console.log(counter); The output is: 0 I'm here! I'm here! while I expected output: I'm here! I'm here! 2 Why so? Why variable counter does not equal 2 -- the number of times the condition isDispl === true is fullfiled?
type: Question

http://stackoverflow.com/comment/45379983
comment on: http://stackoverflow.com/q/28532284
has text: if you log a student instance in chrome Dev tools it'll say its a Person when you don't repair the constructor property
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45280124
comment on: http://stackoverflow.com/a/28478665
type: AnswerComment
score: 0
type: Comment
has text: I have edited question. Any help would be appreciated.

http://stackoverflow.com/comment/45208276
has text: Ok, any suggestions for a solution to my problem? That is, a good way to achive the result i want? :)
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28439151

http://stackoverflow.com/a/28482902
type: Answer
answers question: http://stackoverflow.com/q/28482754
has comment: http://stackoverflow.com/comment/45288244
has comment: http://stackoverflow.com/comment/45288662
has body: Keep in mind that in JS an undefined (not initialized) variable evaluates to false. Try the following: var a; if (a) console.log('True'); else console.log('False'); Evaluates to false. The same is true for any logic operation performed on undefined values. var a; var b = 5; if (a &gt; b) console.log('greater'); else console.log('lower or equal'); Evaluates to false.
score: 0

http://stackoverflow.com/comment/45481403
comment on: http://stackoverflow.com/a/28585601
type: Comment
type: AnswerComment
has text: OP's problem was (apparently) caused by a typo, this answer doesn't (and indeed can't) address that at all. Also, there's a typo here as well which would result in a syntax error
score: 0

http://stackoverflow.com/comment/45488015
type: QuestionComment
has text: Mope, the page doesn't throw any js errors, however the javascript is right at the end of the form when I check the source
comment on: http://stackoverflow.com/q/28589969
score: 0
type: Comment

http://stackoverflow.com/comment/45304776
score: 0
type: Comment
type: AnswerComment
has text: This simple change will cause the AM/PM to appear before the ":" in the output....
comment on: http://stackoverflow.com/a/28491952

http://stackoverflow.com/comment/45306797
type: AnswerComment
comment on: http://stackoverflow.com/a/28463580
type: Comment
has text: Thats Awesome Guilherme, Thanks a lot... :)
score: 0

express
tags question: http://stackoverflow.com/q/28574244
tags question: http://stackoverflow.com/q/28524862
tags question: http://stackoverflow.com/q/28533927
tags question: http://stackoverflow.com/q/28526187
tags question: http://stackoverflow.com/q/28486852
tags question: http://stackoverflow.com/q/28512508
tags question: http://stackoverflow.com/q/28558459
tags question: http://stackoverflow.com/q/28581861
tags question: http://stackoverflow.com/q/28569686
tags question: http://stackoverflow.com/q/28440369
tags question: http://stackoverflow.com/q/28447944
tags question: http://stackoverflow.com/q/28491640
tags question: http://stackoverflow.com/q/28567889
tags question: http://stackoverflow.com/q/28479952
tags question: http://stackoverflow.com/q/28526980
tags question: http://stackoverflow.com/q/28569421
tags question: http://stackoverflow.com/q/28481405
tags question: http://stackoverflow.com/q/28517050
tags question: http://stackoverflow.com/q/28484014
tags question: http://stackoverflow.com/q/28452548
tags question: http://stackoverflow.com/q/28570122
tags question: http://stackoverflow.com/q/28516308
tags question: http://stackoverflow.com/q/28509855
tags question: http://stackoverflow.com/q/28520433
tags question: http://stackoverflow.com/q/28588658
tags question: http://stackoverflow.com/q/28553823
tags question: http://stackoverflow.com/q/28459699
tags question: http://stackoverflow.com/q/28465067
tags question: http://stackoverflow.com/q/28539165
tag name: express
tags question: http://stackoverflow.com/q/28565525
tags question: http://stackoverflow.com/q/28572141
tags question: http://stackoverflow.com/q/28439706
tags question: http://stackoverflow.com/q/28470814
type: Tag
tags question: http://stackoverflow.com/q/28552883
tags question: http://stackoverflow.com/q/28590276
tags question: http://stackoverflow.com/q/28516330
tags question: http://stackoverflow.com/q/28469685
tags question: http://stackoverflow.com/q/28567568
tags question: http://stackoverflow.com/q/28503947
tags question: http://stackoverflow.com/q/28587442
tags question: http://stackoverflow.com/q/28577930
tags question: http://stackoverflow.com/q/28482340
tags question: http://stackoverflow.com/q/28532702
tags question: http://stackoverflow.com/q/28464101
tags question: http://stackoverflow.com/q/28488189
tags question: http://stackoverflow.com/q/28445392
tags question: http://stackoverflow.com/q/28463592

http://stackoverflow.com/comment/45486126
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28587866
has text: Ah, I see now, it's creating a promise for the promises of the pairs… which didn't found very useful as the arrays contain primitives. And then it uses Bluebirds `.map()` method which does the implicit all… instead of `compose(all, R.map)`

http://stackoverflow.com/q/28559337
favorite count: 0
type: UnansweredQuestion
has title: Dynamic Logo Re-sizing using HTML or CSS
tagged with: css
has body: Hi trying to figure out how to dynamically resize a logo, when i use percentages it uses a percentage of the whole page not the div that contains it. &lt;img src="Images/logo.png" name="logo" id="logo"&gt; &lt;div id="top_border"&gt;&lt;/div&gt; &lt;img id="background" src="Images/BG_1.jpg"&gt; Any help will be greatly appreciated. thank you.
downvote count: 0
tagged with: dynamic
score: 1
type: Question
has answer: http://stackoverflow.com/a/28559438
tagged with: javascript
tagged with: jquery
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/45430287

http://stackoverflow.com/q/28521531
linked to: http://stackoverflow.com/q/14220321
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45359819
has comment: http://stackoverflow.com/comment/45360521
has title: javascript function return value from mongoDB
tagged with: http://stackoverflow.com/tag/json
has body: Im quite new to Javascript. i have a problem and i cant figure out what is wrong with my code. i have a function that should return a value from a mongoDB database. but it seems to return as empty every time. the function sites inside a JSON object like so: getRecord: function (criteria) { var record = {}; cats.findOne(criteria, function (err, results) { if (err) console.log(err); record = JSON.parse(JSON.stringify(results)); }); return record; }, i have tried console.log inside the findOne function and it is logging what i expect to be returned, but the value seems to get destroyed outside the function. im using "record = JSON.parse(JSON.stringify(results));" to try and create a brand new object (because i expect that the returned results from the DB would be deleting objects after the function has run).
type: Question
tagged with: mongodb
has comment: http://stackoverflow.com/comment/45366785
tagged with: javascript
duplicate of: http://stackoverflow.com/q/23667086
score: 0
linked to: http://stackoverflow.com/q/23667086
tagged with: node.js

http://stackoverflow.com/q/28443667
tagged with: protractor
answer count: 1
tagged with: javascript
tagged with: end-to-end
has title: protractor Page Object - method is not being called
score: 0
tagged with: angularjs
has body: I am in the process of learning protractor using paject object. Here is my Page object file and my test spec. files: Page Object (file name PO_Login.js) var ptor; var LoginPage = function () { ptor = protractor.getInstance(); this.login = function() { console.log("here"); var user=ptor.findElement(protractor.By.id("username")); user.sendKeys('admin'); var pwd=ptor.findElement(protractor.By.id('password')); pwd.sendKeys('admin'); } } module.exports = new LoginPage(); My Test spec file: var ptor; describe( 'homepage', function() { var LoginPage = require('./LoginPO.js'); beforeEach( function() { ptor = protractor.getInstance(); var driver=ptor.driver; ptor.driver.get('http://localhost/xxxxxxxxxx/login'); ptor.waitForAngular(); } ); it( 'xxxx', function() { ptor = protractor.getInstance(); ptor.driver.findElement(protractor.By.tagName('html')) .getAttribute('ng-app').then(function(text) { expect(text).toBe('xxxxxxx.sso') } ); ptor.driver.findElement( protractor.By.tagName('body')).getAttribute('id') .then(function(text) { expect(text).toBe('cas') } ); }, 10000 ); it( 'login', function() { console.log("here..."); LoginPage.login; // var ctrlpoints_url=ptor.getCurrentUrl(); // expect(ctrlpoints_url).toContain('http://localhost/xxxxxxxxxxxxxxx/#/dashboard/points'); // expect(loginPage.header.getText()).toEqual('xxxxxx'); } ); } ); I am not sure what is wrong - the login method defined in Page object is not getting called. I used console.log() to debugg the script.
has answer: http://stackoverflow.com/a/28443803
type: UnansweredQuestion
type: Question
tagged with: testing

http://stackoverflow.com/q/28470474
tagged with: mysql
type: Question
tagged with: validation
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Validations on dynamic php grid with check boxes and text fields
type: UnansweredQuestion
has body: I have following data to show from data base, it is no ok. S.N PO REFERENCE ITEM NAME UNIT QUANTITY IN STOCK FROM THIS THIS QUANTITY <?php $i=1; while($rs_rows=mysql_fetch_array($result_of_SQL_GET_POREF_FOR_ITEM)) { ?> <tr <?=$bg?>> <?=$i?> <?=$rs_rows['po_reference_name'];?> <?=$rs_rows['item_name'];?> <?=$rs_rows['unit_name'];?> <?=$rs_rows['Total_Quantity'];?> <input type="checkbox" name="check_list[]" value="<?=$rs_rows['po_refrence_id'];?>"> <input type="text" name="txt[<?=$rs_rows['po_refrence_id'];?>]"> <?php $i++; } ?> <input type="hidden" name="req" value="<?=$req?>"> <?php if(isset($_GET[msg])) echo "".$_GET[msg].""; // if(isset($messsag)) echo $messsag; ?> this is the form where users issue the quantity to users, let suppose the requested quantity is 10, then it is upto admin to issue this 10 items from one po reference, or some quantity from po-laptop-hp-1 and some from po-dell-hp-1. I want to validate that before submitting it should be validate that quantity entered by user in text field for each row is less then the quantity in stock. the sum of all text field quantity is not more than requested quantity. and else.... i have write this code, but not working as i expected, if(isset($_POST['save'])) { if ($_GET[add]==0) { if($_GET['req']=="") $abc= $_POST['req']; if($_POST['req']=="") $abc= $_GET['req']; echo $abc; $quantity_issued = $qty; foreach($_POST['check_list'] as $selected){ foreach ( $_POST['txt'] as $key => $value ) { echo 'Textbox #'.htmlentities($key).' has this value: '; echo htmlentities($value); } $SQL_Query_Get_Item_Quantity = mysql_query("SELECT * FROM stock WHERE po_refrence_id = '".$selected."'"); if($SQL_Query_Get_Item_Quantity === FALSE){ die(mysql_error()); } else{ $result_SQL_Query_Get_Item_Quantity = mysql_fetch_assoc($SQL_Query_Get_Item_Quantity); if($quantity_issued > $result_SQL_Query_Get_Item_Quantity['quantity'] && $result_SQL_Query_Get_Item_Quantity['quantity'] != 0){ echo 'quantiy you want to issued is more than the quanti…
upvote count: 1
tagged with: php
has answer: http://stackoverflow.com/a/28586078
score: 1

http://stackoverflow.com/comment/134593681
type: AnswerComment
score: 0
type: Comment
has text: Thank you - I had to use case-2 from this answer. Case-1 seems to possibly break in older verison sof agnular
comment on: http://stackoverflow.com/a/28497862

http://stackoverflow.com/comment/45253393
type: Comment
type: QuestionComment
has text: angular is not loaded.
comment on: http://stackoverflow.com/q/28463753
score: 0

http://stackoverflow.com/q/28455969
type: Question
tagged with: file-get-contents
tagged with: javascript
has comment: http://stackoverflow.com/comment/45238512
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/28456103
answer count: 1
has comment: http://stackoverflow.com/comment/45240934
has comment: http://stackoverflow.com/comment/45238603
type: UnansweredQuestion
has title: Echo strings when page is still downloading
tagged with: php
has comment: http://stackoverflow.com/comment/45239160
has body: Im trying to make a PHP downloader. echo ' Downloading New Update '; $newUpdate = file_get_contents('http://your-server.com/update.zip'); echo 'Done downloading'; When I run the script (saying the zip takes long to download), the page loads until its fully downloaded and then shows the Downloading New Update and Done downloading at the same time. What I want is to show the Downloading New Update before its finished downloading. When it is, Done downloading has to appear. How can I combine this script with Ajax, Jquery, Javascript, in order to create a more dynamic downloader?

http://stackoverflow.com/a/28548667
answers question: http://stackoverflow.com/q/28547205
has comment: http://stackoverflow.com/comment/45410316
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45411191
accepted answer of: http://stackoverflow.com/q/28547205
type: Answer
has comment: http://stackoverflow.com/comment/45410467
has body: Aha got it. If unescape is allowed, not encoded for clarity: []['constructor']['constructor']['call']('','return unescape' + '("%68%71%77%7' + 'a' +'")')() This gives us hqwx, and can of course give us anything else. the only bit that cannot be reached is '("%68%71%77%7&lt;a goes here&gt;")', but that satisfies the symbols and numbers rule. The a can be constructed otherwise. If we want to avoid unescape, we can use (828035)['toString'](36) -- The "magic" number 828035 was generated by using parseInt('hqwz',36). And encoded -- with large parts broken out for readability: // From your post str_constructor = ($=[]+{}+'')[5]+$[1]+(([]+[])[1]+'')[1]+ ((!1)+'')[3]+($=!0+'')[0]+$[1]+$[2]+($=[]+{}+'')[5]+ $[6]+$[1]+((!0)+'')[1]; // call str_call = ([]+{}+'')[5]+($=!1+'')[1]+$[2]+$[2]; // return unescape ( bonus, not using a literal space character ) ret_unescape = ($=!0+'')[1]+$[3]+$[0]+$[2]+$[1]+($=''[1]+'')[1]+ ([]+{}+'')[7]+$[0]+$[1]+$[3]+($=!1+'')[3]+([]+{}+'')[5]+$[1]+ ((/./)[str_constructor]+'')[14]+(!0+'')[3]; // finally [][str_constructor][str_constructor][str_call]('',ret_unescape + '("%68%71%77%7' + (!1+'')[1] +'")')() // "hqwz" // or -- toString str_toString = (!0+'')[0]+([]+{}+'')[1]+($=(('')[str_constructor]+''))[9]+$[10]+$[11]+$[12]+$[13]+$[14] (828035)[str_toString](36) // hqwz Bonus-bonus: We can even ditch numbers if we are sneaky. true: !![] false: ![] 0: ![]+![] 1: !![]+![] 2: !![]+!![] 10: (!![]+![]+'')+(![]+![]) My big nasty magic constant could therefore be: ((!![]+!![])*(!![]+!![])*(!![]+!![])+'')+((!![]+!![])+'')+ ((!![]+!![])*(!![]+!![])*(!![]+!![])+'')+ (![]+![]+'')+(!![]+!![]+!![]+'')+((!![]+!![])*(!![]+!![])+!![])-![]
has comment: http://stackoverflow.com/comment/45411328
has comment: http://stackoverflow.com/comment/45410883
upvote count: 1
has comment: http://stackoverflow.com/comment/45411189
score: 1
has comment: http://stackoverflow.com/comment/45410366

http://stackoverflow.com/q/28564175
answer count: 1
tagged with: qunit
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28565753
accepted answer: http://stackoverflow.com/a/28565753
type: Question
tagged with: javascript
tagged with: jquery
has title: Qunit trigger function does not work on JQuery DatePicker
score: 0
has body: I try to trigger the onSelect function of a JQuery Datepicker with QUnit, but the event is never entered. Here is my sample code: QUnit.test("Datepicker Test", function(assert) { var datepicker = $("#datepicker"); var event = $.Event("onSelect"); datepicker.on("onSelect"), function() { alert("Test"); }; // Trigger the key event datepicker.trigger(event); } What is wrong with my code?
tagged with: datepicker

http://stackoverflow.com/q/28524862
tagged with: javascript
has answer: http://stackoverflow.com/a/28534739
tagged with: express
favorite count: 0
accepted answer: http://stackoverflow.com/a/28559930
type: Question
has body: So I have a simple node.js server which serves only dynamic content: // app.js var app = require('express')(); app.get('/message/:poster', function(request, response) { response.writeHeader(200, {'content-type': 'text/html'}); // some database queries response.end(""+ " "+ " "+ " "+ " messages of "+request.params.poster+" "+ " "+ " "+ " "+ " "+ "" // and so on ); }) app.listen(2345); Now, suppose I want to update my HTML. And suppose further that I don't want to restart the server. Is there a way of achieving this? I tried exporting the part to send to an external file like: // lib.js module.exports.message = function(request, response) { response.writeHeader(200, {'content-type': 'text/html'}) //some database queries response.end(""+ " "+ " "+ " "+ " messages of "+request.params.poster+" "+ " "+ " "+ " "+ " "+ "" //and so on ); } and // app.js var app = require('express')(); app.get('/message/:poster', require('./lib.js').message) app.listen(2345); And it works but if I update lib.js it doesn't update. It seems to be making a copy of that function. Then I tried // app.js var app = require('express')(); app.get('/message/:poster', function(request, response) { require('./lib.js').message(request, response); }) app.listen(2345); But this doesn't update either. Seems like the function gets cached and reused all the time(once I start the server). I dare say that there must be a way to set it so that it either revalidates the function each time(checking if the file containing it changed) and if so updates its cache, or we can set it to update the function each n amount of time, or even better, since we're in node, having an event listener for changes to the files containing the function and as the function changes, event fires and the function in cache gets updated. So how do we get one of the above behaviors? Or something else? I know to restart a server may take only 100ms but restarting it would interrupt all the currently active websockets, which is not an option. N…
possible better answer: http://stackoverflow.com/a/28530008
score: 5
has answer: http://stackoverflow.com/a/28530008
tagged with: node.js
has answer: http://stackoverflow.com/a/28559930
has answer: http://stackoverflow.com/a/28563533
upvote count: 5
has comment: http://stackoverflow.com/comment/45632100
answer count: 4
type: AnsweredQuestion
downvote count: 0
has title: How to update server's content without restarting it? (node.js)

http://stackoverflow.com/comment/45346890
comment on: http://stackoverflow.com/a/28514563
has text: @Joenesy it is a closure
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45513474
has text: @J-Dizzle hi, I don´t consider my self well versed on directives yet lol. I started learning from here: https://egghead.io/ (check the older videos first) and then took some courses on http://pluralsight.com (there is a free trial). Also a lot of googling :)
comment on: http://stackoverflow.com/a/28591575
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28453521
has comment: http://stackoverflow.com/comment/45234239
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45234065
has title: how to make a modal div appear and disappear via javascript
type: Question
has comment: http://stackoverflow.com/comment/45234952
has comment: http://stackoverflow.com/comment/45234397
tagged with: modal-dialog
tagged with: javascript
has comment: http://stackoverflow.com/comment/45234161
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: this is the js code that is supposed to make the modal div appear and disappear, the modal div (pr_ball0) is hidden by default via css using the aforementioned id function setStile(){ document.getElementById('pr_ball0').style.visibility="visible"; } function hide(){ document.getElementById("myHide1").style.visibility="hidden"; } this is the css code which make the balls work /* [Object] Modal * =============================== */ @import url(http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); .ball { opacity: 0; visibility: hidden; position: fixed; top: 0; right: 0; bottom: 0; left: 0; text-align: center; background: rgba(0,0,0, .9); transition: opacity .25s ease; padding: 40px; } .ball_bg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; cursor: pointer; } .ball-state { display: none; } .ball-state:checked + .ball { opacity: 1; visibility: visible; } .modal-state:checked + .ball .pr_inner { top: 0; } .pr_ball { transition: top .25s ease; position: absolute; width: 50%; height: 50%; top: -2%; right: 0; bottom: 0; left: 0; padding: 10%; border-radius: 100%; } #pr_ball0 { margin: auto; overflow: auto; box-shadow: #cccccc 10px 10px 10px; background-image: radial-gradient(ellipse farthest-corner at center, #F2E357 0%, #F2EB1B 100%); visibility: hidden; } #pr_ball1 { margin: auto; overflow: auto; box-shadow: #cccccc 10px 10px 10px; background-image: radial-gradient(circle farthest-corner at center, #D6D696 0%, #EFEFB1 100%); } #pr_ball2 { margin: auto; overflow: auto; box-shadow: #cccccc 10px 10px 10px; background-image: radial-gradient(circle farthest-corner at center, #D6D262 0%, #8CCF59 100%); } #pr_ball3 { margin: auto; overflow: auto; box-shadow: #cccccc 10px 10px 10px; background-image: radial-gradient(circle farthest-corner at center, #B3F2AE 0%, #DBF2C2 100%); } #pr_ball4 { margin: auto; overflow: auto; box-shadow: #cccccc 10px 10px 10px; background-image: radial-gradient(ellipse farthest-corner at center, #D69C15 0%, #F7E334 100%); } #pr_ball5 { …
tagged with: css
answer count: 0

http://stackoverflow.com/q/28439274
has body: I need to determine if the user is logged into Yammer. We're trying to just use Yammer's embed feed. All this is is a script... &lt;script type="text/javascript" src="https://c64.assets-yammer.com/assets/platform_embed.js"&gt;&lt;/script&gt; ... and a call to create the feed: &lt;script&gt; yam.connect.embedFeed({ container: '#container_id', network: 'networkname', config: { header: false } }); &lt;/script&gt; If the user is not logged in, I want to display the feed in a short container (to house just the login button). Once they log in, I want to expand the height of the container to better fit the feed. So I would need to know: Whether or not the user was logged in when they load the page. If they're not initially logged in, trigger an event when the user does log in. Is this possible with just the embed script/functionality, or would we need to use the JavaScript SDK as well?
tagged with: yammer
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/31874971
type: Question
answer count: 2
tagged with: javascript
has title: Can you determine if the user is logged onto Yammer with the embed script?
score: 0
has answer: http://stackoverflow.com/a/28621635

http://stackoverflow.com/q/28580396
favorite count: 0
tagged with: minify
tagged with: node.js
has comment: http://stackoverflow.com/comment/45469401
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45469898
has comment: http://stackoverflow.com/comment/45469346
upvote count: 3
has body: All my scripts are compressed and minified used uglifyJS: The size of this file "app.min.js" is 982.1KB however when I tried to run the node server and open the app in the browser It's stopped in 502kB and after some while I don't know what happened there, Is there any limitation on Javascript file '502kB' ? what I miss
type: Question
has title: Failed to load large JavaScript file ExpressJS after uglifying
tagged with: uglifyjs
has comment: http://stackoverflow.com/comment/45469642
has comment: http://stackoverflow.com/comment/45469444
has answer: http://stackoverflow.com/a/28584415
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28584415
score: 3
has comment: http://stackoverflow.com/comment/45469765
downvote count: 0
answer count: 1

http://stackoverflow.com/comment/45305677
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28491840
type: Comment
has text: In this case, you should be using "display:none:" instead of "visibility:hidden;".... visibility will not hide the element.. So if google release an update, in this case i think they are forcing to make map elements visible.

http://stackoverflow.com/q/28520121
accepted answer: http://stackoverflow.com/a/28520302
has title: How do I get a popup open with PhantomJS only knowing the popup id?
tagged with: phantomjs
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/15739263
tagged with: onclick
type: Question
has answer: http://stackoverflow.com/a/28520302
has body: I am trying to use PhantomJS to open a popup that is normally called via a link and dump a picture of that popup. I have only found ways using id's but all of the links have the same id, same href value, and same title. The only difference between all of the links is a 3 letter code in the showpopup function that corresponds to the 3 letter link text. How can this be done? Can I just fire the ShowPopup('XXX') function or will I need to figure out a way to actually click the link? XXX This link will then open up the popup: ...code... Which I assume I think I can just have phantomjs screen dump that div correct?
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/q/28575838
has body: I'm kind of pulling my hair out on this one. I am trying to build an array of JSON objects via a foreach loop. It works great - except for one property. The property that I am having difficulty with - is an array that is updated during each loop. During the first loop, the array would be empty. At the end of the first loop, I add a value to prepare it for the next loop. During the next loop - create a new JSON object to add to the array. When I add the array property, it also updates the previous key. Kinda of strange. The end result, is for each array key (JSON Object), the 'excludedUsers' array is the same. ( function () { // Pre-populate User Permissions var userPermissions = $('.js-user-permissions').val(); var numberOfSelects = 1; var count = 1; var arraySize; var viewHtml = ''; var userSelects = []; var excludedUsers = []; if(userPermissions) { userPermissions = jQuery.parseJSON(userPermissions); // An array of JSON like: // [{ usersId=57, type="user"}, { usersId=58, type="user"}] arraySize = userPermissions.length; for(var idx = 0; idx &lt; userPermissions.length; idx++) { userSelects[idx] = {}; console.log("Loop #" + idx); // Set default value of select element userSelects[idx].usersId = userPermissions[idx].usersId; userSelects[idx].type = userPermissions[idx].type; userSelects[idx].disabled = arraySize == count ? null : 'disabled'; userSelects[idx].excludedUsers = excludedUsers; userSelects[idx].count = numberOfSelects; userSelects[idx].name = "user" + numberOfSelects; numberOfSelects++; console.log("Before Array Push: " + JSON.stringify(userSelects)); excludedUsers[idx] = userPermissions[idx].usersId; console.log("After Array Push: " + JSON.stringify(userSelects)); count++; } } })(); If you ran - this, I am finding the following output to the console. (NOTE: Watch the property 'excludedUsers')....... Loop #0 Before Array Push: [{"usersId":57,"type":"user","disabled":"disabled","excludedUsers":[],"count":1,"name":"user1"}] After Array Push: [{"usersId":57,…
tagged with: arrays
tagged with: javascript
has title: Array property in JSON object updated via foreach - updates all keys
score: 0
has answer: http://stackoverflow.com/a/28575916
answer count: 1
tagged with: foreach
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28575916
tagged with: http://stackoverflow.com/tag/json
type: Question

http://stackoverflow.com/q/28528711
answer count: 2
upvote count: 0
has body: When I click a button, I'm trying to get the name of the button to display on the next page. So far, I've managed to display the button name in an alert box but not sure how to get it to appear on another page. &lt;script&gt; $(document).ready(function(){ $("#test").click(function(){ alert("Text: " + $("#test").text()); }); }); &lt;/script&gt; The code below gets modules that the logged in user is registered to and displays two buttons. I'm trying to display the button label(subject names) on another page rather than in the alert box. So when I click on a button, the label name appears on the next page. $sql = DB::getInstance()-&gt;get('modules', array('username','=' ,$user-&gt;data()-&gt;username)); if(!$sql-&gt;count()){ echo 'No data'; }else { foreach ($sql-&gt;results() as $sql){ ?&gt; &lt;p&gt;&lt;a href="try.php" class=" btn btn-danger btn-lg btn-block" id="test"&gt; &lt;?php echo $sql-&gt;name; ?&gt;&lt;/a&gt;&lt;/p&gt;
has comment: http://stackoverflow.com/comment/45372847
possible better answer: http://stackoverflow.com/a/28528770
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28528855
linked to: http://stackoverflow.com/q/28526417
has comment: http://stackoverflow.com/comment/45372687
tagged with: http://stackoverflow.com/tag/html
has title: How to load information to another page when button is clicked
tagged with: php
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28528770
tagged with: mysql
has comment: http://stackoverflow.com/comment/45372906
downvote count: 1
type: Question
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45372768
accepted answer: http://stackoverflow.com/a/28528855
has comment: http://stackoverflow.com/comment/45372696

http://stackoverflow.com/a/28588758
accepted answer of: http://stackoverflow.com/q/28588470
upvote count: 1
has comment: http://stackoverflow.com/comment/45510166
has body: From what I have understood as your question,when you select a option in a select tags it disables all the other select tags: JS: function onOptionChange(elem){ var selects=document.getElementsByClassName("form-control column_type"); for(var i=0;i<n;i++) if(selects[i]!=elem) selects[i].options[elem.selectedIndex].disabled=true; } HTML: Ne pas Importer Mobile Email Nom If that's not what you want, I'll edit the answer
type: AcceptedAnswer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28588470
type: Answer

http://stackoverflow.com/comment/45272516
score: 0
type: Comment
type: QuestionComment
has text: Yes check both console
comment on: http://stackoverflow.com/q/28474309

http://stackoverflow.com/comment/45478441
comment on: http://stackoverflow.com/a/28584469
has text: just to clarify what I meant above: `collection.find().fetch()` is not reactive whereas `collection.find()` is a reactive cursor
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/q/28481446
has body: I am using PrestaShop 1.5.6.1 and I am using blockcategories module (with dynamic property set on), to display my categories. The problem is that, if I expand few categories while I am on main page and then I go to another page, for example cart, all categories in blockcategories collapses. What I want to do: I have categories, lets say: cat1, cat2, cat3 and cat4. On main page I collapse cat2, cat3 and expand cat1, cat4 When I go to Cart page, cat2 and cat3 should be collapsed and cat1, cat4 should be expanded. Now when i go to cart (or any other page), all categories are collapsed and I have to expand them again, if I want to see subcategories. It's really irritating. Sorry for my bad english, I hope I explained everything comprehensibly. Thanks in advance!
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45285998
has comment: http://stackoverflow.com/comment/45286058
tagged with: prestashop
type: Question
tagged with: javascript
tagged with: jquery
has title: Prestashop blockcategories: save expanded and collapsed while browsing
score: 0
has comment: http://stackoverflow.com/comment/45286474
has comment: http://stackoverflow.com/comment/45287616
has comment: http://stackoverflow.com/comment/45286437
has comment: http://stackoverflow.com/comment/45285709
answer count: 0

http://stackoverflow.com/a/28497457
upvote count: 1
answers question: http://stackoverflow.com/q/28497157
has body: To do this you would add a click event listener to all the links on the page. Then in the click handler you check if the client is offline. If that's the case the event is canceled and we show an alert message to the user. An implementation of this will look something like: var links = document.querySelectorAll('a') for (var i = 0; i &lt; links.length; i++) links[i].addEventListener("click", handle, false); function handle(e) { if(!navigator.onLine) { e.preventDefault(); alert('You are offline!'); } }
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/comment/45388524
score: 0
type: AnswerComment
has text: Neither here toggles it the class
type: Comment
comment on: http://stackoverflow.com/a/28537182

http://stackoverflow.com/a/28474658
score: 1
accepted answer of: http://stackoverflow.com/q/28471675
type: AcceptedAnswer
upvote count: 1
type: Answer
downvote count: 0
has body: If you want to add color to the vertex you have to set the vertexColors array in the face. In the example code you pasted it is also done like that but you miss this piece of code inside your own example. So you should add: var numberOfSides, j, vertexIndex; for ( var i = 0; i &lt; sphereGeom.faces.length; i++ ) { face = sphereGeom.faces[ i ]; face.color= baseColor; numberOfSides = ( face instanceof THREE.Face3 ) ? 3 : 4; for( j = 0; j &lt; numberOfSides; j++ ) { vertexIndex = face[ faceIndices[ j ] ]; face.vertexColors[ j ] = sphereGeom.colors[ vertexIndex ]; } }
has comment: http://stackoverflow.com/comment/45285453
has comment: http://stackoverflow.com/comment/45285296
answers question: http://stackoverflow.com/q/28471675

http://stackoverflow.com/comment/45276625
score: 3
comment on: http://stackoverflow.com/q/28476791
type: Comment
type: QuestionComment
has text: Upload the relevant source code and we have something to debug. Without the source code we have nothing to debug meaning we have no answers for you.

http://stackoverflow.com/q/28485547
has comment: http://stackoverflow.com/comment/45293301
score: 0
has answer: http://stackoverflow.com/a/28486497
answer count: 1
has title: HTML form with checkboxes processing
tagged with: jquery
has body: So I have this simplified table from which I'd to choose rows to process. The whole table is wrapped in a form, the submit action is controlled via javascript. I already found out, that when the form-row contains only the checkbox as in form "simple", only the checked items will be passed in the POST action. With additional input fields added to the row as in form "multiple", all rows including the non-checked will be passed. From some days ago I think I remember that by that time I had multiple fields per row and only the checked ones were passed, but I cannot reproduce that any more. What would be the best way to process only the checked rows? Have a JQuery capturing the $(":checkbox").change event and have that add or remove an JSON object which will get passed by the POST action? Or try to reproduce my previous code with which I think it worked? Or forget the whole idea and have the PHP page processing the POST data loop over the form data and skipping the non-checked? But in large forms with only a few rows checked, that feels like a waste of resources. a description a ... b description b ... ... a description a ... b description b ... ...
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: checkbox
type: Question
tagged with: javascript
tagged with: forms

http://stackoverflow.com/a/28539337
answers question: http://stackoverflow.com/q/28539059
has comment: http://stackoverflow.com/comment/45392974
score: 0
type: Answer
has body: There is a way, although its not 100% predictable / controllable how fast the animation rusn. You can just animate the max-height, that enables you to still use height: auto. div { max-height:1.2em; -moz-transition: 1s; -ms-transition: 1s; -o-transition: 1s; -webkit-transition: 1s; transition: 1s; } like this

http://stackoverflow.com/a/61709750
has body: You can simply convert the given number using Number primitive type in JavaScript as shown below. var c = Number(first) + Number(second);
score: -1
upvote count: 0
answers question: http://stackoverflow.com/q/28520173
type: Answer
downvote count: 1

http://stackoverflow.com/a/28550757
score: 4
type: Answer
has body: You are not targeting the img, you are targeting the &lt;div&gt;, which is why the innerHTML property holds the &lt;img&gt; inside. (Images don't have innerHTML). Select the &lt;img&gt; instead. I've used .querySelectorAll(): var picture = document.querySelectorAll(".image_div_name img"); var src = picture[0]; var src = picture[0].src;
answers question: http://stackoverflow.com/q/28550718
upvote count: 4
downvote count: 0

http://stackoverflow.com/q/28580173
answer count: 4
has body: Here is the sample of URLs. 1) domain.com/our-work/insights/tips-and-advice/2008/02/04/the-path-to-good-design-is-proper-analytics 2) subdomain.domain.com 3) im.domain.com/About.htm 4) domain.uk/help.htm Get the Result like this domain.com domain.uk
has answer: http://stackoverflow.com/a/28580204
type: Question
duplicate of: http://stackoverflow.com/q/6941533
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28580467
accepted answer: http://stackoverflow.com/a/28580332
possible better answer: http://stackoverflow.com/a/28580204
has comment: http://stackoverflow.com/comment/45468579
tagged with: url
has answer: http://stackoverflow.com/a/28580419
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/6941533
has title: how to Extract hostname from url using jquery
score: 0
has answer: http://stackoverflow.com/a/28580332
tagged with: regex

http://stackoverflow.com/comment/45419073
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28551574
has text: Try change return to `return ServerService.getRoomName(uuid).$promise;` (`.$promise` added to end)
score: 0

http://stackoverflow.com/a/28592975
type: Answer
accepted answer of: http://stackoverflow.com/q/28592668
has body: You missed couple of thing Pass addon object from ng-repeat ng-click function like ng-click="sectionClass(addOn)" Don't return a string from method instead set one scope variable like customClass & use it in ng-class directive HTML {{addOn.name}} Controller var myApp = angular.module('myApp', []); myApp.controller('MyCtrl', function ($scope) { $scope.addOns = [ { name: "Cover options" }, { name: "Stamping" }]; $scope.sectionClass = function (addOn) { if (addOn.name == "Cover options") $scope.customClass="covers" else if (addOn.name == "Stamping") $scope.customClass="stamping" } }); Working Fiddle Hope this could help you. Thanks.
type: AcceptedAnswer
score: 0
answers question: http://stackoverflow.com/q/28592668

http://stackoverflow.com/q/28564518
has answer: http://stackoverflow.com/a/28565240
upvote count: 1
accepted answer: http://stackoverflow.com/a/28564989
type: Question
tagged with: javascript
tagged with: mocha.js
has title: mocha with expect is not working for testing errors
has answer: http://stackoverflow.com/a/28564989
answer count: 2
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/28565240
duplicate of: http://stackoverflow.com/q/21587122
tagged with: node.js
type: AnsweredQuestion
has body: In the following script only one test is passing. Testing error (throw Error()) is failing with message 1) a test should throw error: var expect = require('chai').expect; describe("a test", function() { var fn; before(function() { fn = function(arg){ if(arg == 'error'){ throw new Error(); }else{ return 'hi'; } } }); it("should throw error", function() { expect(fn('error')).to.throw(Error); }); it("should return hi", function() { expect(fn('hi')).to.equal('hi'); }); }); How to alter expect to test errors?
linked to: http://stackoverflow.com/q/21587122
tagged with: chai
score: 1

http://stackoverflow.com/a/28537312
has body: $new() is mainly used when creating a new scope out of an existing scope. Your code is already injecting rootScope in the service so it would not hold any difference. $new() can be used when you want to get some attributes from the parent scope with/without isolation. It takes two params isolate and parent. Isolate (boolean) need to be used if isolation from parent scope is required. Parent (object) Explicitly defining the parent scope. Do note that a new scope created manually needs to be destroyed manually as well. More on it over here
score: 6
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28536866
type: Answer
upvote count: 6
accepted answer of: http://stackoverflow.com/q/28536866

http://stackoverflow.com/a/28530573
has comment: http://stackoverflow.com/comment/45380117
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28530405
has body: var jsonSource = [{"COLUMNS":["NUM","USERID","NAME","YEARCREATED","LASTCONTACTED","RELATIONSHIP"],"DATA":333,"Joe Smith",2015,"January, 19 2015 00:00:00","30 Days"}] $.each(jsonSource, function( i, item ) { console.log( i.COLUMNS ); console.log( i.DATA ); });

http://stackoverflow.com/q/28454417
favorite count: 0
has body: In chrome function in brakets like below one throws error. Anybody can explain that behavior? (function x () {return 4;}) x(); throws Uncaught ReferenceError: x is not defined In firefox and IE it works properly. I mean x is defined
duplicate of: http://stackoverflow.com/q/9667148
answer count: 0
type: UnansweredQuestion
tagged with: google-chrome
type: Question
has title: scope of JS code in chroome
linked to: http://stackoverflow.com/q/9667148
score: 1
tagged with: google-chrome-devtools
has comment: http://stackoverflow.com/comment/45235766
has comment: http://stackoverflow.com/comment/45235825
has comment: http://stackoverflow.com/comment/45235879
upvote count: 1
has comment: http://stackoverflow.com/comment/45235907
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/45446270
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28567467
type: Comment
has text: It is failing to load your local copy of gridster.js. Why not use a cdn and save the bandwidth? Try ` `

http://stackoverflow.com/a/28476723
has body: Had this same problem, solved it like this (example with jquery datepicker) $('#myDateInput').datepicker({ dateFormat: 'yy-mm-dd', onSelect: function (dateText) { updateDate(dateText); }, onClose: function (dateText) { updateDate(dateText); } }); function updateDate(dateText) { var date = angular.element('#myDateInput').val(); angular.element('#myDateInput').val(date); if (dateText) { $scope.object.date = dateText; } $scope.object.dateReadable = date; $scope.safeApply(function (childScope) { }); } // safely apply changes to the $scope $scope.safeApply = function (fn) { var phase = this.$root.$$phase; if (phase == '$apply' || phase == '$digest') { if (fn && (typeof (fn) === 'function')) { fn(); } } else { this.$apply(fn); } }; Set date on page load $("#myDateInput").datepicker("setDate", $scope.dateReadable); HTML Date: The important thing here is that I use SafeApply to apply the changes to the $scope. Hope the example helps even tough it's a working sample for me. Why do I have to do this? Well angular isn't aware of what happens outside its $scope, in this case jQUery. So we will have to tell it manually. EDIT: It might be a bit confusing with date and dateReadable but ignore the details and look at the safeApply that binds the changes to the $scope.
has comment: http://stackoverflow.com/comment/45287990
has comment: http://stackoverflow.com/comment/45277209
answers question: http://stackoverflow.com/q/28476195
has comment: http://stackoverflow.com/comment/45277488
downvote count: 0
has comment: http://stackoverflow.com/comment/45276590
has comment: http://stackoverflow.com/comment/45276745
has comment: http://stackoverflow.com/comment/45277561
type: Answer
has comment: http://stackoverflow.com/comment/45278128
has comment: http://stackoverflow.com/comment/45277807
score: 2
has comment: http://stackoverflow.com/comment/45277069
upvote count: 2

http://stackoverflow.com/q/28467573
answer count: 1
has answer: http://stackoverflow.com/a/28470211
accepted answer: http://stackoverflow.com/a/28470211
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45261264
type: AnsweredQuestion
has title: Is it possible to manipulate components based on the actual laid out html in Reactjs?
has comment: http://stackoverflow.com/comment/45261148
has comment: http://stackoverflow.com/comment/45261757
type: Question
has body: So I have a feeling React is just going to be the wrong tool for this job (since React is very much about one direction flow), but I figured I would ask. Say I have the following HTML: First Row Second Row Third Row Now say that container class divs have a max height that only allows it to display the first and second row, causing the third flow to overflow. When this occurs, I want to move the overflowed rows into a new container, so I have the following output: First Row Second Row Third Row Without React, I plan to do this by passing my data structure into a render() call, creating the html in the first code example, then iterating through each module (then row), find out if the bottom pixel value is greater than the container's max height, and if so re-render it split. I would like to do this in Reactjs, by making each row a component that is inside a module component, but I am unsure if it's possible to accomplish this efficiently in React.
tagged with: reactjs

http://stackoverflow.com/a/28438471
answers question: http://stackoverflow.com/q/28437901
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: You may try this: http://jsfiddle.net/apq59j9u/ Date.prototype.currentTime = function(){ return ((this.getHours()&gt;12)?(this.getHours()-12):this.getHours()) +":"+ this.getMinutes()+((this.getHours()&gt;12)?('PM'):'AM'); }; var d1= new Date(); var d2 = new Date(); d1.setHours(7); d1.setMinutes(10); d2.setHours(19); d2.setMinutes(10); alert(d1.currentTime()); alert(d2.currentTime());

http://stackoverflow.com/comment/45322707
has text: Nope. I like what his code does in this answer as demonstrated. I just want it to work that way in my case. Instead of getting back 7 flat arrays, when I run his code on my my JS console I get one array of the seven [child]. I run: for (var prop in p){ p[prop] = _.flatten(p[prop]) } console.log(p[prop]);
comment on: http://stackoverflow.com/a/28501296
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28467266
linked to: http://stackoverflow.com/q/4775722
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45260509
has title: Can I use `obj.constructor === Array` to test if object is Array?
has answer: http://stackoverflow.com/a/28467392
has comment: http://stackoverflow.com/comment/46975743
accepted answer: http://stackoverflow.com/a/28467392
upvote count: 7
type: AnsweredQuestion
score: 7
tagged with: prototype
type: Question
has body: Is it correct to use obj.constructor === Array to test if an object is an array as suggested here? Does it always returns correct answer compatible with Array.isArray?
has comment: http://stackoverflow.com/comment/46975549
tagged with: types
answer count: 1
tagged with: arrays
downvote count: 0

http://stackoverflow.com/q/28593146
tagged with: php
tagged with: mysql
type: Question
score: -2
tagged with: javascript
has body: I'm making a website which will when opened on the phone have two functions. To be used as regular website or as a remote for the same website opened on the PC. Let me try to explain a bit better: For example YouTube TV does exactly what i want to do. I want to be able to pair my Website and Phone(Website opened on the phone) so i can use my phone to control the website functions. For example executing JavaScript command with parameters sent from the Phone (Playing a video on PC that i selected on Phone) I've been looking into this and so far using my limited skills of PHP/JS/MySQL i ended up making ajax that checks if theres queued command in DB to be executed ever so often (interval of 2 sec). But i dont really think thats the best option to go with even if ... It'll work somehow. So please if you could give me some example where this is done right, some tutorials links or tools i can use it would be great. Thank You
downvote count: 3
upvote count: 1
has title: Controlling a website with phone/tablet
answer count: 1
has answer: http://stackoverflow.com/a/28594662
favorite count: 0
tagged with: backbone.js
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/comment/45454987
has text: "Note: I have limited control over the actual page embedding the iframe, that's why it would be nice if this could be done by the page being shown by the iframe."
type: AnswerComment
comment on: http://stackoverflow.com/a/28572647
score: 0
type: Comment

http://stackoverflow.com/q/28506764
tagged with: google-sheets
tagged with: javascript
has answer: http://stackoverflow.com/a/28506856
tagged with: google-apps-script
answer count: 2
downvote count: 0
possible better answer: http://stackoverflow.com/a/28506856
favorite count: 0
has answer: http://stackoverflow.com/a/28506835
has title: Google Scripts If filename contains x string log "x was found" missing bracket?
score: 2
type: AnsweredQuestion
upvote count: 2
has body: I'm attempting to search through all of my files and see if any of the files have a specified string inside of their filename. The script will then return that X file was found. Later on, I hope to use indexOf to return "x file was found at position y in array" function myFunction() { var response = "Current" var files = DriveApp.getFiles(); while (files.hasNext()) { var file = files.next(); Logger.log(file.getName()); if(file.toString().indexOf(response)){ Logger.log("the file" + file + "has been found at" response)}; } When I run the program I receive the error message that I'm missing a ')' at the end of the last line. Am I missing something here?
accepted answer: http://stackoverflow.com/a/28506835
type: Question
tagged with: google-apps

http://stackoverflow.com/q/28490321
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28490385
tagged with: jquery
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28490385
has body: I am currently using a bit of javascript to move the user down to the location of the information they click on in a side navigation menu. However the problem being if they click on one item and then another item when they go to scroll away the animation is still trying to complete. Is there a way to prevent the js from running if already at the top of the scroll top destination. I have a .stop() in already to stop the original animation on click. Or possibly cancel animation on scroll away? $('#zoomTo li a').on('click', function(e) { $('html, body').stop().animate({ scrollTop : $('#scrollDest').offset().top - 20 }, 1000); e.preventDefault(); });
has title: Stop animation if page is already at destination
has comment: http://stackoverflow.com/comment/45301908
type: AnsweredQuestion

http://stackoverflow.com/q/28502028
tagged with: javascript
answer count: 1
downvote count: 0
tagged with: web-audio-api
has answer: http://stackoverflow.com/a/28507804
accepted answer: http://stackoverflow.com/a/28507804
favorite count: 0
tagged with: html5-audio
has title: Web Audio API 24db Filter
tagged with: audio
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: signal-processing
type: Question
has body: The web audio biquad filter is 12db. Is it possible to create a 24db filter by connecting 2 of these together? I have tried connecting 2 together and it certainly creates a much more extreme effect with the resonance being particularly harsh. I divided the resonance value by 2 to compensate for this. Is what I have created here a 24db filter?

http://stackoverflow.com/comment/45421503
comment on: http://stackoverflow.com/a/28553850
has text: Thanks so much, this is what i needed. Used "window.onload = function(){}" to do away with the button so that it becomes a link once the page loads, thanks!
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28522207
downvote count: 0
has body: I've implemented a JavaScript console into Sublime Text 3 using node.js. Build code (saved as Node.sublime-build): { "cmd": ["node /Program Files/nodejs", "$file"], "selector": "source.js" } It originally gave WinError 2 which meant it couldn't find node.js. I fixed that by adding the file location. Now, it gives [WinError 5] Access is denied. Doing some research, I discovered the solution of "Run as Administrator". Unfortunately, that didn't work. My JavaScript is perfectly valid and node.js has been installed. What is the problem? Do I have to reinstall node.js with the permission to connect to my PATH? (I deselected that during installation)
type: Question
has comment: http://stackoverflow.com/comment/45361651
has comment: http://stackoverflow.com/comment/45361728
tagged with: javascript
upvote count: 3
answer count: 1
tagged with: sublimetext3
favorite count: 0
has answer: http://stackoverflow.com/a/28969467
accepted answer: http://stackoverflow.com/a/28969467
has title: WinError 5 when attempting to run JS from Sublime Text
tagged with: node.js
type: AnsweredQuestion
score: 3

http://stackoverflow.com/comment/45487630
has text: Thanks a lot, dude. Thanks for your help. :) I can't vote up, but thanks.
comment on: http://stackoverflow.com/a/28589304
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45457175
type: Comment
type: QuestionComment
has text: Ok, http://crapaudhall.com/admin/ this may help, I am working under the news button
score: 0
comment on: http://stackoverflow.com/q/28573319

http://stackoverflow.com/q/28587018
favorite count: 0
upvote count: 25
has answer: http://stackoverflow.com/a/45989102
has title: check format of date with moment.js
score: 25
type: AnsweredQuestion
has body: I am taking input from calendar in my screen which is of this type DD-MMM-YYYY HH:mm a but user can provide date from keyboard. Now I have to check whether user has provided the date in correct format or not. I am heavily using moment.js in my application and validating it like this if(angular.equals(moment(scope.modelValue).format('DD-MMM-YYYY HH:mm a'), 'Invalid date')) { alert('date is not correct'); } else { alert('date is correct'); } It is working fine but the problem is if I provide input like '18-Feb-2015 2' then it is converted to '18-Feb-2015 00:00 am'. so now how to check that format is exactly what I want ? please help ..
has answer: http://stackoverflow.com/a/35123965
tagged with: date
type: Question
accepted answer: http://stackoverflow.com/a/35123965
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/44007054
answer count: 3
has answer: http://stackoverflow.com/a/44007054
tagged with: date-format
tagged with: momentjs

http://stackoverflow.com/a/28453399
has comment: http://stackoverflow.com/comment/45234445
score: 2
has comment: http://stackoverflow.com/comment/45234093
has comment: http://stackoverflow.com/comment/45235181
has comment: http://stackoverflow.com/comment/45234422
has body: Try to use stop() and no need to use loop to bind hover event, $( ".views-field-wrapper" ).hover(function() { // no need to use each loop $( "#front_panel",this ).stop(true).fadeOut(400); $( "#back_panel",this ).delay(500).fadeIn(1000); }, function(){ $( "#back_panel",this ).stop(true).fadeOut(400); $( "#front_panel",this ).delay(500).fadeIn(1000); }); Try it without using using delay() like, $(".views-field-wrapper").hover(function () { // no need to use each loop $("#front_panel", this).stop(true).fadeOut(400); $("#back_panel", this).fadeIn(1000); }, function () { $("#back_panel", this).stop(true).fadeOut(400); $("#front_panel", this).fadeIn(1000); }); $(".views-field-wrapper").hover(function () { // no need to use each loop $("#front_panel", this).stop(true).fadeOut(400); $("#back_panel", this).fadeIn(1000); }, function () { $("#back_panel", this).stop(true).fadeOut(400); $("#front_panel", this).fadeIn(1000); }); title teaser
has comment: http://stackoverflow.com/comment/45239161
has comment: http://stackoverflow.com/comment/45234377
answers question: http://stackoverflow.com/q/28453320
has comment: http://stackoverflow.com/comment/45235397
has comment: http://stackoverflow.com/comment/45234839
has comment: http://stackoverflow.com/comment/45235398
has comment: http://stackoverflow.com/comment/45234409
type: AcceptedAnswer
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/45234898
accepted answer of: http://stackoverflow.com/q/28453320
type: Answer

http://stackoverflow.com/q/28470171
has comment: http://stackoverflow.com/comment/45268455
type: Question
has comment: http://stackoverflow.com/comment/45267907
tagged with: javascript
has comment: http://stackoverflow.com/comment/45265447
score: 0
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
has title: Not triggering event inside init()
has comment: http://stackoverflow.com/comment/45274715
has comment: http://stackoverflow.com/comment/45265073
has comment: http://stackoverflow.com/comment/45266443
has body: I want to trigger a event in order to display a success message on the screen. Notification event is properly working everywhere but when I try to trigger it inside init() function for the app, its not getting executed although the rest code inside that block is executed. $scope.init = function() { if (appUtils.groupCreated === true) { console.log("inside"); //getting printed $rootScope.$broadcast("notifyEvent", { type: "alert-success", message: "Server group is successfully created." }); appUtils.groupCreated = false; } }; //HTML code &lt;div class="container" ng-controller="ServerController" ng-init="init()"&gt; &lt;notification position="top" timeout="5000" class="myClass"&gt;&lt;/notification&gt; &lt;/div&gt; Notification Directive .directive("notification", function($interval) { return { restrict: "E", scope: { timeout: "@", position: "@" }, replace: true, template: '&lt;div&gt;&lt;div ng-repeat="notification in notifications" ng-show="displayNotification" class="alert alert-dismissible {{notification.type}} {{notificationPosition}}" role="alert"&gt;&lt;button type="button" class="close" data-dismiss="alert" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;{{notification.message}}&lt;/div&gt;&lt;/div&gt;', controller: function($scope) { $scope.$on("notifyEvent", function(e, notifyObject) { $scope.displayNotification = true; console.log("notification"); // if there are multiple messages if (notifyObject.messages &amp;&amp; notifyObject.messages.length &gt; 0) { $scope.notifications = notifyObject.messages; } else { $scope.notifications = [{ message: notifyObject.message, type: notifyObject.type }]; } if ($scope.position) { $scope.notificationPosition = "notify" + $scope.position; } if ($scope.timeout) { $interval(function() { $scope.displayNotification = false; }, $scope.timeout); } }); }, link: function(scope, element, attributes, controller) { scope.timeout = attributes.timeout; scope.position = attributes.position; }…

http://stackoverflow.com/comment/45275114
type: QuestionComment
has text: Sadly, that does not seem to work. Could it possibly be related to the 'onended' listener?
type: Comment
comment on: http://stackoverflow.com/q/28475430
score: 0

http://stackoverflow.com/a/28504423
downvote count: 0
type: Answer
upvote count: 3
score: 3
has body: You have a lot of patterns new promise users have in your code: You're using a deferred when you don't need to. You're not using promise aggregation methods You're not waiting for things in appropriate places but nesting instead. Promises represent a value over time. You can use promises and access their result via then at a later point and not just right away - Sequelize's promises are based on bluebird and offer a rich API that does aggregation for you. Here is an annotated version of cleaned up code - note it is not nesting: toexport.getlasttransactions = function(lower,upper){ // no need for callback var lowerbound = (lower || moment.utc().subtract(10, 'minutes')).format(); var upperbound = (upper || moment.utc()).format(); // use `map` over a `each` with a push. var failedIds = FailedSync.find({ limit: 100 }).map(function(value){ return value.transaction_id; }); // build condition. var queryCondition = { where: { updated_at: { between: [lowerbound,upperbound] } }, limit: 3 }; var query = failedIds.then(function(ids){ // use promise as proxy if(ids.length === 0) return queryCondition; return { // You can return a value or a promise from `then` where: Sequelize.and({ updated_at: { between: [lowerbound,upperbound] } }, Sequelize.or({ id: ids}); }; }); var pheonixTransactions = query.then(function(condition){ return PhoenixTransaction.findAll(queryCondition); // filter based on result }); return pheonixTransactions.map(function(value){ // again, map over each return Transaction.findOne({ where: { id: value.id }}); // get the relevant one }).filter(function(result){ // filter over if chain and push return (!result || result.length === 0) || ((result &amp;&amp; result.length === 1) &amp;&amp; result.hash != value.hash); }); };
answers question: http://stackoverflow.com/q/28503617

http://stackoverflow.com/a/28454778
upvote count: 1
has body: You should handle it by selecting image by their Id ,you should do it by replacing this line var $this = this.ui.holder; by this one : $('#original') and get the height and width for the image , this will solve your issue.
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28450321
answers question: http://stackoverflow.com/q/28450321
type: Answer

http://stackoverflow.com/q/28478339
has title: Error: Argument 'ContactController' is not a function, got undefined
has body: I'm trying to create a little controller in my simple web app using angularjs but i get this error: Error: Argument 'ContactController' is not a function, got undefined This is what i've done so far: angular (ContactsController.js): var mainApp = angular.module('mainApp', []); mainApp.ContactController = ("ContactController", ["$scope", function($scope) { $scope.contatti = {}; $scope.contatti.contacts = ["test.one@gmail.com", "test.two@gmail.com"]; $scope.contatti.addContacts = function () { $scope.contatti.contacts.push($scope.newcontact); $scope.contatti.newcontact = ""; }; }]); html: Email: Add Contacts {{ contact }}
downvote count: 0
score: 1
favorite count: 0
tagged with: controller
tagged with: angularjs
type: Question
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/31429867
has answer: http://stackoverflow.com/a/28478403
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/a/28624998
has body: I solved this thusly using moment timezone: dateTime = date.concat(" ").time dateTimeAdjusted = moment.tz(dateTime, timezone).format() (where timezone was a variable that I had access to that contained the timezone of the given date and time.)
answers question: http://stackoverflow.com/q/28498214
score: 0
type: Answer

http://stackoverflow.com/q/28546885
upvote count: 4
accepted answer: http://stackoverflow.com/a/28547084
answer count: 1
downvote count: 0
tagged with: javascript
score: 4
favorite count: 0
tagged with: sequelize.js
has title: Does sequelize have any change tracking built-in mechanism?
tagged with: node.js
type: AnsweredQuestion
has body: I was wondering whether sequelize implements (or plans to implement) any change tracking mechanism, which goal would be to avoid running unnecessary queries. For example: var user = sequelize.User.find { where: { name: 'bob' } }; user.name = 'john'; user.save(); The sequelize will of course update the username. Now, imagine that the assignment is missing. var user = sequelize.User.find { where: { name: 'bob' } }; user.save(); Is sequelize smart enough to figure it out that no database update is needed (and won't do one)? Is there any flag exposed by the sequelize object to see whether any changes were done to the model? Or should I simply test by hand each property against the original model? I have noticed an user._previousDataValues and user.options.isDirty properties on the sequelize model, but I am not sure what is their purpose and whether I should rely my code on those in any way.
has answer: http://stackoverflow.com/a/28547084
type: Question

http://stackoverflow.com/comment/45440652
comment on: http://stackoverflow.com/a/28565008
type: AnswerComment
has text: Ah okay. I'll test this real quick, and if it works, I'll 1up + accept as answer!
score: 0
type: Comment

http://stackoverflow.com/comment/67405728
score: 0
type: Comment
has text: This is late coming to this question, but then how do we deal with data processing beore it gets passed on? For example If i wanted to intercept an error in the request and return a default value instead
type: AnswerComment
comment on: http://stackoverflow.com/a/30597022

http://stackoverflow.com/comment/45433277
has text: Support for objects in the class attribute were introduced in `1.8`. Update your Jade version.
comment on: http://stackoverflow.com/q/28558476
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/45403190
type: Comment
comment on: http://stackoverflow.com/q/28521295
has text: You have to think about what value `current` has. The first `thenOpen` will be executed after the `while` loop finished every iteration. So the `current` in the `then` function of `thenOpen` points to `current` from the last iteration.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45242431
score: 0
comment on: http://stackoverflow.com/q/28457966
type: Comment
type: QuestionComment
has text: Works fine on my Chrome. Do you have any errors in the console?

http://stackoverflow.com/a/29346877
score: 0
has body: This would mean that it has not been through the digest loop. A common problem with mixing jQuery and AngularJs. Add a watcher.
type: Answer
answers question: http://stackoverflow.com/q/28492355
has comment: http://stackoverflow.com/comment/46880265

http://stackoverflow.com/q/28505471
tagged with: jquery
has body: var firstDate = new Date(); firstDate .setMonth(firstDate.getMonth() - 3); How can i get above date like below in Javascript or Jquery 13.02.2015 It must be dynamic date (according to today) i want to get date and 3 months ago like day.month.year. Thanks
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28505509
accepted answer: http://stackoverflow.com/a/28505509
has title: Javascript getdate and edit
type: AnsweredQuestion
type: Question
tagged with: javascript

asp.net-mvc
tags question: http://stackoverflow.com/q/28589969
tags question: http://stackoverflow.com/q/28465248
tags question: http://stackoverflow.com/q/28470898
tags question: http://stackoverflow.com/q/28536472
tags question: http://stackoverflow.com/q/28546724
tags question: http://stackoverflow.com/q/28455040
tags question: http://stackoverflow.com/q/28494683
tags question: http://stackoverflow.com/q/28501562
tags question: http://stackoverflow.com/q/28446536
tags question: http://stackoverflow.com/q/28516895
tags question: http://stackoverflow.com/q/28458619
tags question: http://stackoverflow.com/q/28482201
tags question: http://stackoverflow.com/q/28580466
tags question: http://stackoverflow.com/q/28564567
tags question: http://stackoverflow.com/q/28497800
tags question: http://stackoverflow.com/q/28461079
tags question: http://stackoverflow.com/q/28509647
tags question: http://stackoverflow.com/q/28474701
tags question: http://stackoverflow.com/q/28590809
tags question: http://stackoverflow.com/q/28485642
tags question: http://stackoverflow.com/q/28499324
tags question: http://stackoverflow.com/q/28453022
tags question: http://stackoverflow.com/q/28536609
tags question: http://stackoverflow.com/q/28538135
tags question: http://stackoverflow.com/q/28585541
tags question: http://stackoverflow.com/q/28564561
tag name: asp.net-mvc
tags question: http://stackoverflow.com/q/28589267
tags question: http://stackoverflow.com/q/28559744
tags question: http://stackoverflow.com/q/28438624
tags question: http://stackoverflow.com/q/28482373
tags question: http://stackoverflow.com/q/28545871
tags question: http://stackoverflow.com/q/28468208
tags question: http://stackoverflow.com/q/28551717
tags question: http://stackoverflow.com/q/28589938
tags question: http://stackoverflow.com/q/28452504
tags question: http://stackoverflow.com/q/28489140
tags question: http://stackoverflow.com/q/28450330
tags question: http://stackoverflow.com/q/28446398
type: Tag
tags question: http://stackoverflow.com/q/28551299
tags question: http://stackoverflow.com/q/28554110
tags question: http://stackoverflow.com/q/28548025
tags question: http://stackoverflow.com/q/28572482
tags question: http://stackoverflow.com/q/28566296
tags question: http://stackoverflow.com/q/28582863
tags question: http://stackoverflow.com/q/28467725
tags question: http://stackoverflow.com/q/28474739

http://stackoverflow.com/comment/45395335
type: AnswerComment
comment on: http://stackoverflow.com/a/28540635
type: Comment
score: 0
has text: Anyways, if you want to avoid using eval for various reasons (Maybe you have to get input from a user?) then you should take a look at PEG.js and write a parser for math expressions

http://stackoverflow.com/comment/45271412
has text: @Hudixt did't mean it is not possible, by a mistake i had write how it is possible, that's why i had edit the comment and remove the unwanted statement.
comment on: http://stackoverflow.com/q/28473373
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45449139
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28568459
has text: Haha yeah, it might be sexy, but it won't work either, because `.forEach` is used on arrays. `document.getElementsByTagName('a')` is not really an array, it's an object with properties. [**Try it**](http://jsfiddle.net/gj2e0ts5/)

http://stackoverflow.com/a/28492218
type: AcceptedAnswer
score: 0
has body: I don't suggest saving the complete children hierarchy, but if you want - why not use .html() var data = []; $(".layer").each(function(){ var html = $(this).html(); data.push(html); }); OR Just save what is required to re-render them at the correct position - left, top etc. for(var i=0 ; i&lt;length; i++){ var layerTemplate = "...div template html goes here"; var $layerTemplate = $(layerTemplate); $layerTemplate.css({top : data[i].top , left : data[i].left}); $("#maincontainer1").append($layerTemplate); } Some time back I wrote a script for saving &amp; re-rendering jsPlumb - https://github.com/nitinsurana/jsPlumb-Persistence
type: Answer
answers question: http://stackoverflow.com/q/28476824
accepted answer of: http://stackoverflow.com/q/28476824

http://stackoverflow.com/q/28497592
tagged with: javascript
tagged with: sorting
score: 0
tagged with: filter
answer count: 2
tagged with: angularjs-filter
has body: I am trying to sort my comments. I want the last comment to be the first one, and the remaining should be ordered by the id. The below is sorting them by the id, but I need to put the last comment on top. &lt;div ng-repeat="comment in comments | orderBy:'-id'"&gt;&lt;/div&gt; If we have the numbers 1, 2, 3, 4 the output should be 4, 1, 2, 3. note that this is not in chronological order. How can I achieve this?
has comment: http://stackoverflow.com/comment/45314849
tagged with: angularjs
type: UnansweredQuestion
has title: orderBy, first one should be the oldest, the remaining newest
has comment: http://stackoverflow.com/comment/45315081
has answer: http://stackoverflow.com/a/28497809
has answer: http://stackoverflow.com/a/28497998
type: Question

http://stackoverflow.com/comment/45352513
score: 1
comment on: http://stackoverflow.com/q/28517597
type: Comment
type: QuestionComment
has text: The last }); in test2.js , why ?

http://stackoverflow.com/a/28557418
score: 4
accepted answer of: http://stackoverflow.com/q/28557402
has body: you need to use event delegation for attaching event to dynamically added dom. Event delegation allows us to attach a single event listener, to a parent element, that will fire for all descendants matching a selector, whether those descendants exist now or are added in the future. $("ol").on('click','.remove',function(){ $(this).parents('li').remove(); }); Working Demo
answers question: http://stackoverflow.com/q/28557402
upvote count: 4
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/45477673
has text: Let me clarify a little bit, I send a number to this server and it must return me (myNumber*2), it works on SoapUI 5.0.0 and I want to do it on my html app. I just want to receive the number not the raw XML.
comment on: http://stackoverflow.com/a/28584977
type: AnswerComment
type: Comment
score: 1

meteor
tags question: http://stackoverflow.com/q/28487819
tags question: http://stackoverflow.com/q/28590025
tags question: http://stackoverflow.com/q/28531904
tags question: http://stackoverflow.com/q/28494826
tags question: http://stackoverflow.com/q/28527304
tags question: http://stackoverflow.com/q/28583942
tags question: http://stackoverflow.com/q/28455320
tags question: http://stackoverflow.com/q/28445695
tags question: http://stackoverflow.com/q/28569860
tags question: http://stackoverflow.com/q/28547632
tags question: http://stackoverflow.com/q/28525354
tags question: http://stackoverflow.com/q/28513392
tags question: http://stackoverflow.com/q/28454166
tags question: http://stackoverflow.com/q/28471201
tags question: http://stackoverflow.com/q/28506866
tags question: http://stackoverflow.com/q/28509177
tags question: http://stackoverflow.com/q/28562815
tags question: http://stackoverflow.com/q/28572659
tags question: http://stackoverflow.com/q/28450293
tags question: http://stackoverflow.com/q/28507546
tags question: http://stackoverflow.com/q/28519651
tags question: http://stackoverflow.com/q/28446242
tags question: http://stackoverflow.com/q/28569913
tags question: http://stackoverflow.com/q/28575882
tags question: http://stackoverflow.com/q/28513108
tags question: http://stackoverflow.com/q/28500785
tags question: http://stackoverflow.com/q/28442884
tags question: http://stackoverflow.com/q/28532716
tags question: http://stackoverflow.com/q/28574114
tags question: http://stackoverflow.com/q/28530516
tags question: http://stackoverflow.com/q/28568356
tags question: http://stackoverflow.com/q/28489798
tags question: http://stackoverflow.com/q/28534818
tags question: http://stackoverflow.com/q/28581994
tags question: http://stackoverflow.com/q/28569009
tags question: http://stackoverflow.com/q/28509695
tags question: http://stackoverflow.com/q/28553481
tags question: http://stackoverflow.com/q/28498807
type: Tag
tags question: http://stackoverflow.com/q/28569233
tags question: http://stackoverflow.com/q/28515619
tags question: http://stackoverflow.com/q/28515403
tags question: http://stackoverflow.com/q/28459382
tags question: http://stackoverflow.com/q/28542691
tags question: http://stackoverflow.com/q/28508296
tags question: http://stackoverflow.com/q/28550462
tags question: http://stackoverflow.com/q/28526338
tags question: http://stackoverflow.com/q/28591126
tags question: http://stackoverflow.com/q/28575288
tags question: http://stackoverflow.com/q/28554221
tags question: http://stackoverflow.com/q/28582528
tags question: http://stackoverflow.com/q/28509915
tags question: http://stackoverflow.com/q/28445385
tags question: http://stackoverflow.com/q/28535863
tags question: http://stackoverflow.com/q/28503179
tags question: http://stackoverflow.com/q/28573129
tags question: http://stackoverflow.com/q/28545229
tags question: http://stackoverflow.com/q/28587604
tags question: http://stackoverflow.com/q/28471393
tags question: http://stackoverflow.com/q/28550176
tags question: http://stackoverflow.com/q/28491233
tags question: http://stackoverflow.com/q/28443621
tags question: http://stackoverflow.com/q/28455407
tags question: http://stackoverflow.com/q/28593343
tag name: meteor
tags question: http://stackoverflow.com/q/28532572
tags question: http://stackoverflow.com/q/28573609
tags question: http://stackoverflow.com/q/28472347
tags question: http://stackoverflow.com/q/28549053
tags question: http://stackoverflow.com/q/28571434
tags question: http://stackoverflow.com/q/28467523
tags question: http://stackoverflow.com/q/28470752
tags question: http://stackoverflow.com/q/28484079
tags question: http://stackoverflow.com/q/28480596
tags question: http://stackoverflow.com/q/28501446
tags question: http://stackoverflow.com/q/28522037
tags question: http://stackoverflow.com/q/28584085

http://stackoverflow.com/comment/45330741
type: AnswerComment
score: 0
type: Comment
has text: Might not be understanding your solution fully but I don't want to stop the current animation. I Need it to animate the full length before the next animation runs. Then when the current animation is done, move to the next animation.
comment on: http://stackoverflow.com/a/28505717

http://stackoverflow.com/comment/45209304
has text: yes correct. equal spacing both left and right. It's probably more simple than I thought. I could be overthinking it. (I usually do)
comment on: http://stackoverflow.com/q/28439561
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/tag/json
tags question: http://stackoverflow.com/q/28529717
tags question: http://stackoverflow.com/q/28473055
tags question: http://stackoverflow.com/q/28449723
tags question: http://stackoverflow.com/q/28438193
tags question: http://stackoverflow.com/q/28462847
tags question: http://stackoverflow.com/q/28564065
tags question: http://stackoverflow.com/q/28439479
tags question: http://stackoverflow.com/q/28449603
tags question: http://stackoverflow.com/q/28564473
tags question: http://stackoverflow.com/q/28441287
tags question: http://stackoverflow.com/q/28481254
tags question: http://stackoverflow.com/q/28518587
tags question: http://stackoverflow.com/q/28494109
tags question: http://stackoverflow.com/q/28536871
tags question: http://stackoverflow.com/q/28472456
tags question: http://stackoverflow.com/q/28557294
tags question: http://stackoverflow.com/q/28533927
tags question: http://stackoverflow.com/q/28471661
tags question: http://stackoverflow.com/q/28588118
tags question: http://stackoverflow.com/q/28451065
tags question: http://stackoverflow.com/q/28492328
tags question: http://stackoverflow.com/q/28541866
tags question: http://stackoverflow.com/q/28529162
tags question: http://stackoverflow.com/q/28486498
tags question: http://stackoverflow.com/q/28462451
tags question: http://stackoverflow.com/q/28546724
tags question: http://stackoverflow.com/q/28469990
tags question: http://stackoverflow.com/q/28584948
tags question: http://stackoverflow.com/q/28477070
tags question: http://stackoverflow.com/q/28475532
tags question: http://stackoverflow.com/q/28488524
tags question: http://stackoverflow.com/q/28474754
tags question: http://stackoverflow.com/q/28493536
tags question: http://stackoverflow.com/q/28506225
tags question: http://stackoverflow.com/q/28554275
tags question: http://stackoverflow.com/q/28485516
tags question: http://stackoverflow.com/q/28472054
tags question: http://stackoverflow.com/q/28552353
tags question: http://stackoverflow.com/q/28488545
tags question: http://stackoverflow.com/q/28520612
tags question: http://stackoverflow.com/q/28447688
tags question: http://stackoverflow.com/q/28512760
tags question: http://stackoverflow.com/q/28438747
tags question: http://stackoverflow.com/q/28554303
tags question: http://stackoverflow.com/q/28444958
tags question: http://stackoverflow.com/q/28575896
tags question: http://stackoverflow.com/q/28445991
tags question: http://stackoverflow.com/q/28485468
tags question: http://stackoverflow.com/q/28548882
tags question: http://stackoverflow.com/q/28481799
tags question: http://stackoverflow.com/q/28482840
tags question: http://stackoverflow.com/q/28547734
tags question: http://stackoverflow.com/q/28446583
tags question: http://stackoverflow.com/q/28578869
tags question: http://stackoverflow.com/q/28560542
tags question: http://stackoverflow.com/q/28536375
tags question: http://stackoverflow.com/q/28557676
tags question: http://stackoverflow.com/q/28466510
tags question: http://stackoverflow.com/q/28573335
tags question: http://stackoverflow.com/q/28564567
tags question: http://stackoverflow.com/q/28565910
tags question: http://stackoverflow.com/q/28555275
tags question: http://stackoverflow.com/q/28564915
tags question: http://stackoverflow.com/q/28581046
tags question: http://stackoverflow.com/q/28450438
tags question: http://stackoverflow.com/q/28579491
tags question: http://stackoverflow.com/q/28446992
tags question: http://stackoverflow.com/q/28490023
tags question: http://stackoverflow.com/q/28476824
tags question: http://stackoverflow.com/q/28527976
tags question: http://stackoverflow.com/q/28469279
type: Tag
tags question: http://stackoverflow.com/q/28537505
tags question: http://stackoverflow.com/q/28585823
tags question: http://stackoverflow.com/q/28500851
tags question: http://stackoverflow.com/q/28461184
tags question: http://stackoverflow.com/q/28524292
tags question: http://stackoverflow.com/q/28516361
tags question: http://stackoverflow.com/q/28479180
tags question: http://stackoverflow.com/q/28515512

http://stackoverflow.com/comment/45457366
type: Comment
comment on: http://stackoverflow.com/a/28573940
score: 0
type: AnswerComment
has text: Thanks for your answer. but nope. thats not an option. I can run multiple times the foo for example in the same page.

http://stackoverflow.com/comment/45219156
comment on: http://stackoverflow.com/a/28444788
score: 0
type: AnswerComment
has text: and what about the / ?
type: Comment

http://stackoverflow.com/a/28503082
accepted answer of: http://stackoverflow.com/q/28502797
has body: Have you tried to put the value in console.log()? There is an encoded array of objects in the JSON string. You should get item first. // Moved from comments below: var list_json = localStorage.getItem('items'); var list = JSON.parse(list_json) || []; var index, item; for (index in list) { item = list[index]; alert(item.ID); }
has comment: http://stackoverflow.com/comment/45325477
has comment: http://stackoverflow.com/comment/45325521
score: 1
has comment: http://stackoverflow.com/comment/45326178
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45325784
type: Answer
has comment: http://stackoverflow.com/comment/45325978
downvote count: 0
answers question: http://stackoverflow.com/q/28502797
has comment: http://stackoverflow.com/comment/45325727
has comment: http://stackoverflow.com/comment/45325929

http://stackoverflow.com/q/28581454
tagged with: node.js
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28594616
accepted answer: http://stackoverflow.com/a/28594616
upvote count: 1
type: Question
has body: Sorry if this is a repetitive one, I really couldn't solve it with any of the information provided here. Basically I have this in my User.js mongoDB schema: notifications: [{ type: String, story: String, seen: Boolean, createdTime: Date, from: { name: String, username: String, id: mongoose.Schema.ObjectId } }] After I query the user, this is what I do to push this object: var notifObj = { type: notification.type, story: notification.story || ' ', seen: false, createdTime: new Date(), from: { name: notification.from.firstName + " " + notification.from.lastName, username: notification.from.username, id: notification.from._id } }; into the mongoDB database: user.notifications.push(notifObj); User.update({ _id: notification.to }, user, function(err, data) { if (err) { deferred.reject({ err: err }); } //Tell sender everything went alrgiht deferred.resolve(data); }); P.S.: I have deferred.resolve instead of res.end(), because I push notifications on some of the requests in a different controller, I don't have a separate route only for notifications. (e.g.: User has a new message, I send the message and push a notification too)
tagged with: object
tagged with: mongodb
has comment: http://stackoverflow.com/comment/45495854
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
has title: Pushing object into mongoDB, ["object Object"] is saved
has comment: http://stackoverflow.com/comment/45495687

http://stackoverflow.com/comment/45281782
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28478720
has text: I don't have direct access to it but they use an Apache Server and the Headers are currently set via .htaccess
type: Comment

http://stackoverflow.com/q/28451459
tagged with: cxf
upvote count: 3
has comment: http://stackoverflow.com/comment/47029567
has body: What I want to do: Call a cross-domain SOAP-Service from JavaScript using jQuery with the jQuery Soap plugin (by Remy Blom). (that is, I call $.soap(); in JavaScript) What I did: CORS Setting on the server side (CXF) are working (using the org.eclipse.jetty.servlets.CrossOriginFilter), so the following is present in the answer: Access-Control-Allow-Head... X-Requested-With,Content-Type,Accept,Origin Access-Control-Allow-Meth... GET,POST,OPTIONS,HEAD Access-Control-Allow-Orig... http://localhost:8082 Content-Type application/soap+xml;charset=UTF-8 What is missing: Firefox and Chrome send preflight OPTIONS requests prior to the POST request for the SOAP call. Obviously SOAP does not allow the OPTIONS verb. It does not work with SoapUI (5.0) as well as CXF (2.7.7). It is even stated in a comment in org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor line 130ff: /* * Reject OPTIONS, and any other noise that is not allowed in SOAP. */ So, my question is: How can I modify my SOAP servcie implementation (using CXF), such that the OPTIONS request returns successfully?
accepted answer: http://stackoverflow.com/a/33913451
type: Question
has comment: http://stackoverflow.com/comment/45462047
tagged with: javascript
has title: Preflight OPTIONS request to SOAP service does not work
tagged with: jquery
tagged with: cors
downvote count: 0
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/33913451
tagged with: soap
type: AnsweredQuestion
score: 3

http://stackoverflow.com/comment/45479425
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28585731
type: QuestionComment
has text: Not a very clear question

http://stackoverflow.com/comment/79103374
type: Comment
has text: even with Object.assign you have same issues, every method that exists right now in Javascript works ok with primitives, if you have your object with keys that have as value another object, references will be kept
comment on: http://stackoverflow.com/a/45838155
score: 1
type: AnswerComment

http://stackoverflow.com/comment/45487434
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28589523
has text: Interestingly, if I remove //= require okzoom, I no longer get the error. Javascript still doesn't fire though so I'm not sure what the problem is now.

http://stackoverflow.com/q/28437635
has title: $rootScope.$apply() not working
type: AnsweredQuestion
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/45205479
has body: I am doing an api call using angular service "AzureMobileClient " inside angular run method as follow: myModule.run(function ($rootScope, $localStorage, AzureMobileClient, Data) { //Return user json object; store it in Data.customerUserJsonObject AzureMobileClient.getCustomerUser(function (item) { $rootScope.$apply(function () { Data.customerServerRowObject = item; console.log("rootScope applied"); }); console.log("myModule.run: item &gt;"); console.log(item);}, $localStorage.phonenumber); }); Notice that I have a data sharing service "Data" passed to the run method to store the retrieved item from the api callback. The object "Data.customerServerRowObject" get set by the api call correctly. Also see the $rootScope.$apply() being called inside the callback to sync the object cross the angular application. Now, whenever I try to retrieve the object "Data.customerServerRowObject" in my controller I get "undefined" value: controllers.OrderVarification = function ($scope, Data) { // ng-model="customerPhonenumber" in the view $scope.customerPhonenumber = Data.customerServerRowObject.phonenumber; } This is because the code inside the controller get executed while the api callback is still not done. I am also doing $rootSope.$apply() which has no effect in my run function
type: Question
tagged with: javascript
upvote count: 3
has answer: http://stackoverflow.com/a/28437924
accepted answer: http://stackoverflow.com/a/28437924
answer count: 1
has comment: http://stackoverflow.com/comment/45205564
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/q/28464207
tagged with: javascript
has comment: http://stackoverflow.com/comment/45255362
tagged with: jquery
tagged with: ajax
score: 3
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has title: jQuery AJAX call sending as OPTIONS and missing Authorization header
has comment: http://stackoverflow.com/comment/45254246
answer count: 0
has comment: http://stackoverflow.com/comment/45255736
has comment: http://stackoverflow.com/comment/45255353
upvote count: 3
has body: I'm starting to get stumped on this. I'm developing a C#.NET Web API service and frontend application to use it. I've been having a lot of difficulty using a token to authenticate my requests and jQuery seems to be having trouble. I can get a token just fine, but jQuery won't add it to an Authorization header in further requests. My setup is an index.html page with several jQuery Mobile pages inside it. It starts on a '#login' page, which sends a request to my /Token URI with a username, password, and grant type. This is successful and the return is the token. The page changes to '#home' and a test ajax call is sent to /api/values to grab value. The problem is that instead of adding a header called 'Authorization', jQuery adds an 'Access-Control-Request-Headers' with the value 'accept, authorization' instead. At first I thought it was a CORS issue, but the request works fine when I use Advanced Rest Client in Chrome to send the request. AJAX Call from '#Home' $.ajax({ url: 'http://slalomtest2.azurewebsites.net/api/values/', type: 'GET', async: true, dataType:"json", beforeSend: function(request){ request.withCredentials = true; request.setRequestHeader("Authorization", "Basic " + Token); }, success: function(result){ console.log(result); }, error: function(request, error){ $.mobile.changePage("#login"); } }); The bad request the AJAX sends This is what it looks like from Advanced Rest Client in the same browser Thanks in advance for the help, I've been banging my head against the wall all day.
has comment: http://stackoverflow.com/comment/45254460
tagged with: http
type: Question
has comment: http://stackoverflow.com/comment/45254881
tagged with: c#

http://stackoverflow.com/a/28515701
has body: jQuery('.school_id').click(function (event){ var theTd = jQuery(this).parent(); var theId = theTd.attr('id'); }); Something like this?
type: Answer
answers question: http://stackoverflow.com/q/28515492
score: 0

http://stackoverflow.com/q/28536987
tagged with: coordinates
type: Question
has body: I am creating an interface that enables user to hightlight custom area in map with overlay canvas polygons. as in figure. then, I want to get all filled pixels from canvas with specified color so that I can transform that pixel values into geo LAT-LONG values. I want to create custom database that hold LAT-LONG values ranges with tagged custom known names. It's ok to create overlay canvas polygons by mouse-dragging. But I have a problem in retrieving filled area from canvas as pixel array. I found that var imageData = ctx.getImageData(0,0,canvas.width,canvas.height); var data=image.data; But,it's impossible to iterate all value and cast related R,G,B values and validate with specified color for entire image data. Instead, is there any way to get image data as pixels only for filled area of polygon and let me know other solutions for this purpose if any? ![enter image description here][1] Please help me.
has comment: http://stackoverflow.com/comment/45388373
tagged with: javascript
has comment: http://stackoverflow.com/comment/45388529
tagged with: canvas
tagged with: google-maps
accepted answer: http://stackoverflow.com/a/28538996
answer count: 1
downvote count: 0
favorite count: 0
has title: How to get pixel coordinates from canvas polygon (filled area)
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45388792
type: AnsweredQuestion
score: 2
upvote count: 2
has answer: http://stackoverflow.com/a/28538996

http://stackoverflow.com/comment/45231151
score: 0
type: AnswerComment
has text: @Phil, that's not how I read it. Questioner says *I need to get the position of each [element]*, but that position does not only depend on inline styles. Granted, the premise of the question may be flawed in the first place.
type: Comment
comment on: http://stackoverflow.com/a/28451798

http://stackoverflow.com/q/28463471
tagged with: javascript
has comment: http://stackoverflow.com/comment/45252998
type: UnansweredQuestion
has body: I'm trying to scroll between divs vertically with the mousewheel event in Chrome and the DOMMouseScroll event in firefox. It's working fine in firefox, but in chrome it gets stuck after the first scroll step. Here's my code for scroll down same thing I'm using to scroll up with inverted marks. $(window).bind('mousewheel DOMMouseScroll', function(event){ if (event.originalEvent.wheelDelta &lt; 0 || event.originalEvent.detail &gt; 0 &amp;&amp; $('body,html').scrollTop() == $('#ctverec1').offsetTop ) { $('body,html').animate({scrollTop: $('#ctverec2').offsetTop},400 ); } else if (event.originalEvent.wheelDelta &lt; 0 || event.originalEvent.detail &gt; 0 &amp;&amp; $('body,html').scrollTop() == $('#ctverec2').offsetTop) { $('body,html').animate({scrollTop: $('#ctverec3').offsetTop},400 ); } return false; });
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/45252942
has comment: http://stackoverflow.com/comment/45253043
tagged with: scroll
type: Question
tagged with: mousewheel
has title: Scroll to specific element using mousewheel and DOMMouseScroll

http://stackoverflow.com/q/28493464
has comment: http://stackoverflow.com/comment/45307287
accepted answer: http://stackoverflow.com/a/28493556
tagged with: javascript
has comment: http://stackoverflow.com/comment/45307203
upvote count: 7
has answer: http://stackoverflow.com/a/28493556
has comment: http://stackoverflow.com/comment/45307408
has comment: http://stackoverflow.com/comment/45307357
favorite count: 0
has body: Why does this JavaScript statement: console.log(1 + + "2"); print 3 as the output? I am not sure why it's printing this - I expected "12".
downvote count: 5
linked to: http://stackoverflow.com/q/9081880
has answer: http://stackoverflow.com/a/28493520
has comment: http://stackoverflow.com/comment/45307247
has answer: http://stackoverflow.com/a/76735086
answer count: 4
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/28493532
has title: what it will print console.log(1+ + "2")
possible better answer: http://stackoverflow.com/a/28493520
has comment: http://stackoverflow.com/comment/45307284
has comment: http://stackoverflow.com/comment/45307259
type: Question
has comment: http://stackoverflow.com/comment/45307405

http://stackoverflow.com/comment/45443864
comment on: http://stackoverflow.com/q/28563997
has text: you could delete the files by adding the following lines at the end of the `build.sh` script. `find . -name \*.uncompressed.js -type f -delete` and `find . -name \*.js.map -type f -delete`. The above command is for Linux systems only.
score: 1
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45404993
score: 1
comment on: http://stackoverflow.com/q/28545879
has text: Need more information. A Synchronous HTTP Call? Or another type of synchronous call?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28441766
has title: JavaScript Code works in jsfiddle but not in .hta file: getElementById returns undefined
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45213159
has answer: http://stackoverflow.com/a/28441808
favorite count: 0
score: -3
linked to: http://stackoverflow.com/q/9899372
has comment: http://stackoverflow.com/comment/45213179
possible better answer: http://stackoverflow.com/a/28441818
type: AnsweredQuestion
upvote count: 0
has body: I'm currently writing a little (html&javascript-)application in a .hta file, but somehow document.getElementById seems to return nothing (undefined) while executed in the .hta application, but when pasted in jsfiddle, the code works fine. <category id="cat0" name="My Category 1" topCat="none" /> Date Source Description 28/01/2015 src Lorem Ipsum dolores est I omitted the useless part of the code. All variables used ARE properly defined, the only problem lies in the document.getElementById, createElement, etc methods. Does anyone know what the problem could be?
downvote count: 3
type: Question
tagged with: jsfiddle
tagged with: hta
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28441808
has answer: http://stackoverflow.com/a/28441818
answer count: 2

http://stackoverflow.com/comment/45521400
type: AnswerComment
has text: You didn't miss anything. Thanks.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28592412

http://stackoverflow.com/comment/45273733
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28470659
has text: `hasSubAllocations:hidden:` - what's the trailing comma there?

http://stackoverflow.com/comment/45377748
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28531087
has text: I can always add a to the widget and i can set the innerhtml of the someid to what i want. I know this will work but can this be acheiveed by just the script tags alone???
type: AnswerComment

http://stackoverflow.com/q/28586611
has answer: http://stackoverflow.com/a/28603660
type: AnsweredQuestion
has body: I have an ng-grid with data and each row has a button for edit and cancel. When edit button is clicked the row data can be edited. So here if I dont want to save the editted data I click cancel.When edit is clicked I copy the original value of the row with angular.copy(row.entity,$scope.data) ; So now after editting few values I want to cancel the edit and i click cancel button. when cancel button is clicked I want the grid to show the original value before edit.How can I change. Please help
accepted answer: http://stackoverflow.com/a/28603660
upvote count: 1
has comment: http://stackoverflow.com/comment/45482395
has title: Angular JS ng-grid: How to cancel Editted Row to show back the original values in ng-grid
type: Question
tagged with: javascript
tagged with: ng-grid
answer count: 1
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45482705
tagged with: angularjs

http://stackoverflow.com/q/28464914
has comment: http://stackoverflow.com/comment/45255561
downvote count: 0
has answer: http://stackoverflow.com/a/28465001
tagged with: javascript
tagged with: jquery
tagged with: datatables
favorite count: 0
has body: So, I have a dataTable that gets its data from ajax. I want two of the columns to have text inputs so that the user may edit and update the information by clicking a button in the same row. This works fine like this: { "render": function ( data, type, row ) { return ' '; }, "targets": 0 }, { "render": function ( data, type, row ) { return ' '; }, "targets": 1 }, { "targets": 2, "data": null, "defaultContent": " Update " }, The data is loaded into the editable text input. However, I can't find a way to extract the value from the input after this. The closest I've come is var data = table.row( $(this).parents('tr') ).data(); which give successfully gives me the data from that row. However, the text input value never changes. If the user edits the text, data.name gives me the old data that was originally loaded into the table. Is there an efficient way to pull this data out of the text input?
upvote count: 2
type: UnansweredQuestion
has title: Getting value from a dynamically-generated DataTable input
score: 2
type: Question
has answer: http://stackoverflow.com/a/28559268
answer count: 2

http://stackoverflow.com/comment/45316552
comment on: http://stackoverflow.com/q/28498450
has text: Put your external Js file on root level.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28468504
has comment: http://stackoverflow.com/comment/45262550
has title: How to change CSS attribute at all div inside td with class
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/13743671
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45262485
type: Question
linked to: http://stackoverflow.com/q/3706819
answer count: 1
downvote count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28468697
accepted answer: http://stackoverflow.com/a/28468697
tagged with: http://stackoverflow.com/tag/html
tagged with: telerik
tagged with: css
has body: I use Telerik.. with SkinID I am not sure, which wrong with my code.. At the aspx page the code just like this: &lt;tr&gt; &lt;td colspan="2" align="center" class="to_center"&gt; &lt;telerik:RadButton ID="btnCLSave" runat="server" ValidationGroup="AddCL" OnClick="btnCLSave_Click" Skin="" SkinID="RadButtonAdd" /&gt; &lt;telerik:RadButton ID="btnCLCancel" runat="server" CausesValidation="False" OnClick="btnCLCancel_Click" Skin="" UseSubmitBehavior="False" SkinID="RadButtonReset" /&gt; &lt;/td&gt; &lt;/tr&gt; But after I run it, my page appears like this: I do not know which wrong.. But after I look at the source, some divs appears at the page. I try to add some style, like this: .to_center div { display: inline; } still not working. I want that buttons to center. How to change CSS attribute display:none to display: inline to all divs inside that TD with class to_center using jquery? Thank you
upvote count: 0

http://stackoverflow.com/q/28478954
has comment: http://stackoverflow.com/comment/45281192
has body: I have a simple code that Logs into to Google to use the Google Calendar API and creates and event for the user. The code works fine but every so often I get a 401 - Login Required error from Google. If I open the developer console in the browser and try again it works... which is very odd var scopes = 'https://www.googleapis.com/auth/calendar'; var clientId = 'CLIENT_ID'; var apiKey = 'API_KEY'; function handleClientLoad() { gapi.client.setApiKey(apiKey); window.setTimeout(checkAuth,1); } function checkAuth() { gapi.auth.authorize({client_id: clientId, scope: scopes, immediate: true}, handleAuthResult); } function handleAuthResult(authResult) { var authorizeButton = $('#calendarAuth'); var calendarFrame = $('#calendarFrame'); if (authResult &amp;&amp; !authResult.error) { authorizeButton.remove(); calendarFrame.show(); calendarFrame.attr('src', calendarFrame.attr('src')); //Hack to reload the iframe } else { authorizeButton.show(); calendarFrame.hide(); } } function Authorize() { gapi.auth.authorize({client_id: clientId, scope: scopes, immediate: false}, handleAuthResult); return false; } function GoogleScheduleFollowup(followup) { gapi.client.load('calendar', 'v3', function () { var request = gapi.client.calendar.events.insert({ "calendarId": "primary", resource: { "summary": followup.title, "start": { "dateTime": window.GetFullDateString(followup.date, followup.time) }, "end": { "dateTime": window.GetFullDateString(followup.date, followup.time) } } }); request.execute(function (resp) { console.log(resp); }); } Everything seems to be well configured in the API Console, and I'm sure we haven't reached the quota (either total or requests per second). As an example today I have made 133 requests of which 36 failed with this error. I have tried to call gapi.auth.authorize every 10 minutes to see if the problem was a session timeout, and as I read in another question I tried removing this line gapi.client.setApiKey(apiKey);, both without success
type: Question
tagged with: javascript
has title: Google Calendar Api Intermittent 401
score: 0
has comment: http://stackoverflow.com/comment/45281109
tagged with: google-calendar-api
answer count: 0
tagged with: google-api
type: UnansweredQuestion

http://stackoverflow.com/comment/45268673
type: Comment
score: 0
type: AnswerComment
has text: It worked, really thanks for helping me. Will accept this answer as correct in just 10 minutes
comment on: http://stackoverflow.com/a/28472301

http://stackoverflow.com/a/28556876
has body: Since When you substitute Array or Object in Javascript, Javascript makes Referencing to the Array/Object instead of Copying. So when you do player1.action.action1 = "aaa"; or player2.action.action1 = "bbb";, You are changing the Value of Player's value. Since player1 or player2 are just pointing to Player Object. The Object.create() method creates a new object with the specified prototype object and properties. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create which means you are creating a new object which has same reference to the Array/Object. Because even Player does not have Array as its property but a reference to the memory address of the Array/Object.So the new Object created by Object.create() also have just references. If you check What the Player object has as well, You'd notice that its values had also changed. console.log(Player) action: action1: "bbb" action2: "bbb" action3: "bbb" To avoid this. You need to deep copy the object when you use it as prototype. //Method 1 var Player = { name: "", id: "", action: { action1: "", action2: "", action3: "" } } objectCreate = function(obj){ return jQuery.extend(true, {},obj) }; var player1 = objectCreate(Player); player1.name = " hack"; player1.id = 1; player1.action.action1 = "aaa"; player1.action.action2 = "aaa"; player1.action.action3 = "aaa"; console.log(JSON.stringify(player1.action)); var player2 = objectCreate(Player); player2.name = " Jason"; player2.id = 2; player2.action.action1 = "bbb"; player2.action.action2 = "bbb"; player2.action.action3 = "bbb"; console.log(JSON.stringify(player2)); console.log(JSON.stringify(player1)); console.log(Player) You need jQuery though objectCreate = function(obj){ return jQuery.extend(true, {},obj) }; this gives you perfect deep copied Object. and the code above works as you expected. see the jQuery.extend details here http://api.jquery.com/jquery.extend/
answers question: http://stackoverflow.com/q/28556589
score: 0
type: Answer

http://stackoverflow.com/q/28548058
has comment: http://stackoverflow.com/comment/45409827
favorite count: 0
type: UnansweredQuestion
has body: I have this field as part of a web response: datetime_local: "2015-02-16T19:00:00" Can I extract the date and time? For instance I would like to display February 16th at 7pm Is this possible?
score: 2
upvote count: 3
has answer: http://stackoverflow.com/a/28548182
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45409403
tagged with: javascript
tagged with: date
has title: JavaScript get date and time from timestamp
answer count: 2
has answer: http://stackoverflow.com/a/28548262

http://stackoverflow.com/q/28508725
tagged with: parse-platform
type: UnansweredQuestion
tagged with: cookies
type: Question
has body: I'm logging into my Parse app through the JavaScript SDK, it appears to be storing cookies however once it progresses to the next page it always displays the current user as being null despite having logged in successfully. I've cleared the cookies and it appears to be storing the cookies after login fine. This is the code I'm using however no matter what I seem to do it just won't collect the current user. Does anyone know if there's an issue with this or if there's something extra I have to do for it to be able to recall the cookie? If it's relevant the two site are on subdomains, could this be the problem? Parse.initialize(JSDK, API); var currentUser = Parse.User.current(); var currentUsername = currentUser.get('username'); alert(currentUsername);
has answer: http://stackoverflow.com/a/28528138
answer count: 1
tagged with: javascript
score: 0
tagged with: web
has title: Unable to retrieve current Parse user

http://stackoverflow.com/q/28513171
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/28513228
tagged with: php
has title: Set color to tr dynamically
type: AnsweredQuestion
has body: I am working on a php project where I have a calender and some dates coming from database. when I select date from calender then data which is coming from database gets highlighted. But this does not work for all dates. Through javascript I am able to add background color but its not display. I am doing this from javascript. here is my code for javaScript &lt;script type="text/javascript"&gt; var cal_1 = new Calendar({ element: 'calendar_1', inline: true, months: 3, dateFormat: 'm/d/Y', onSelect: function (element, selectedDate, date, cell) { debugger; var sd =selectedDate.split("/"); var newdate = sd[2]+"-"+sd[1]+"-"+sd[0]; var startDate = "startDate"; var count = document.getElementById('countResult').value; for(var i=1; i&lt;= count;i++) { var start_date = document.getElementById(startDate+i).value; var month = sd[0]-1; var selectedDate = new Date(ss[2],month,ss[1]); var splittedDate = start_date.split("-"); var startDateInTextBox = new Date(splittedDate[0],splittedDate[1]-1,splittedDate[2]); if(selectedDate.valueOf() === startDateInTextBox.valueOf()) { document.getElementById("tr_id"+i).style.backgroundColor = "lightGreen"; } else { document.getElementById("tr_id"+i).style.backgroundColor = "#FFFFFF"; } } document.getElementById('date_1').value = newdate; } }); &lt;/script&gt; But when I check my html I can see That background color has been added to tr but it not display the color. Can someone help me out. Thanks in advance.
type: Question
has answer: http://stackoverflow.com/a/28513228
tagged with: javascript

http://stackoverflow.com/q/28445928
type: UnansweredQuestion
has body: I must be missing something really basic here but I am not seeing the values of variables inside or outside of functions using node-inspector. UPDATE: I am on node --version -> v0.10.35 Also I think maybe someone else has similar problem without an answer yet : node-inspector shows 'No Properties' for objects I am seeing the same as this error: Runtime.getProperties failed. ReferenceError: includeSource is not defined #461 https://github.com/node-inspector/node-inspector/issues/461 Is this still an issue? I just 'npm installed node-inspector' 0.8.3 and downloaded chrome Version 39.0.2171.65 (64-bit), but I cannot see the values of variables. I have a simple javascript program called test.js var test1 = 'test'; debugger; console.log(test1); Then I run: node --debug-brk test.js Followed by: node-inspector Node Inspector v0.8.3 Visit http://127.0.0.1:8080/debug?port=5858 to start debugging. breaking on line 1,2 or 3 and I always see this error. No values shown for the variables variables. I also found this to be the case inside functions.
tagged with: node-inspector
score: 1
has answer: http://stackoverflow.com/a/29199557
type: Question
upvote count: 1
answer count: 1
tagged with: javascript
has title: Node-Inspector debugger Runtime.getProperties failed. Can't see values of variables
favorite count: 0
linked to: http://stackoverflow.com/q/27830963
tagged with: node.js
has comment: http://stackoverflow.com/comment/45254391
downvote count: 0

http://stackoverflow.com/comment/45474427
has text: @Sandeeproop i tried copying ur code. it doenst work
comment on: http://stackoverflow.com/a/28582321
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28488556
type: Question
has answer: http://stackoverflow.com/a/28488695
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28488654
has title: Using one onchange javascript function for all div
answer count: 3
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion
has body: I have multiple , sometime they are blank and sometime they are filled with text. I want to insert a simple text code such as "<check>" which will automatically change to a check (\u2713). Presently, my code is like this: <check> //an input written by a user <check> //an input written by a user <check> //an input written by a user (This block of gets repeated, but of course, with different name in each one.) The output will then replace <check> into actual check symbol (\u2713) The challenge is, I don't want to have to add ID to every and then write a script for each one. So is there a way for me to use this one script to apply to all ??? Many thanks in advance!
has answer: http://stackoverflow.com/a/28488700
downvote count: 0
score: 1

http://stackoverflow.com/comment/45333613
type: Comment
has text: well you are answering other question I want to see it in php not in html I already know it how in the html but not in $_POST I don't care if it is not the same page I just want to see it in $_POST just tell me how
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28506966

http://stackoverflow.com/q/28462776
accepted answer: http://stackoverflow.com/a/28462798
favorite count: 0
has body: I have made a keyup event listener on classes called userInput, but after appending multiple input boxes with the same class, this event listener will not fire from the new input boxes. HTML Add Javascript $(document).ready(function(){ $(".userInput").on("keyup", function(){ alert("Key has been released"); }); var target = $("#wrapper"), innerHTML = " "; $("#add_input").on("click", function(){ target.append(innerHTML); }); }); The event listener fires for the original input box, but doesn't for any of the new appended input boxes which have the same class.
duplicate of: http://stackoverflow.com/q/203198
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45251429
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/28462798
type: Question
linked to: http://stackoverflow.com/q/203198
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Event listener on appended input boxes
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/a/28529936
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28529891
has comment: http://stackoverflow.com/comment/45375154
score: 4
upvote count: 4
has body: Pass parameters to a function in your JS file not as a query string to the file itself. Declare a function like function doSomething(place, list) { //do something with place //do something with list } Use it in other JS as doSomething('us',10); Any other attempt to do what you've set out to do is a hacked attempt. While you may achieve it, it's not intended design. See related posts - Get the query string on the called javascript file Passing Querystring style parameters into Javascript file The general consensus is no, it can't or shouldn't be done. -- EDIT Some months later I learned about cache busting. This is one exceptional use case for query parameters on script files. Consider the case where a cache is set for one-year expiration. To break this time problem, changing the query parameter in the HTML href doesn't necessarily mean you have changed the content of the script but it does have the added side effect of breaking though the one-year cache expiry.

recursion
type: Tag
tags question: http://stackoverflow.com/q/28460391
tag name: recursion
tags question: http://stackoverflow.com/q/28442601
tags question: http://stackoverflow.com/q/28559587
tags question: http://stackoverflow.com/q/28556904
tags question: http://stackoverflow.com/q/28450438
tags question: http://stackoverflow.com/q/28553107
tags question: http://stackoverflow.com/q/28535341
tags question: http://stackoverflow.com/q/28547752
tags question: http://stackoverflow.com/q/28534399
tags question: http://stackoverflow.com/q/28505083
tags question: http://stackoverflow.com/q/28442009
tags question: http://stackoverflow.com/q/28478833
tags question: http://stackoverflow.com/q/28492422
tags question: http://stackoverflow.com/q/28509695
tags question: http://stackoverflow.com/q/28507074

http://stackoverflow.com/q/28525622
has answer: http://stackoverflow.com/a/28526418
accepted answer: http://stackoverflow.com/a/28526418
has comment: http://stackoverflow.com/comment/45368029
tagged with: javascript
score: -1
has body: See my codes below regarding a quiz question. I want to have a function when I missed a radio button (s), an alert box should popped displaying the number of questions I missed when I clicked the "Grade Me" button. &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script src = "quiz.js"&gt; &lt;/script&gt; &lt;link rel = "stylesheet" href = "quiz_style.css"&gt; &lt;/head&gt; &lt;body&gt; &lt;center&gt;&lt;h1&gt; &amp;copy; JavaScript Quiz by Hamsheed ! :) &lt;/h1&gt;&lt;/center&gt; &lt;div id = "wrapper"&gt; &lt;form id = "quiz"&gt; &lt;fieldset&gt; &lt;legend&gt; Question 1 &lt;/legend&gt; He _____ it. &lt;br&gt; &lt;label&gt;&lt;input type = "radio" value = "wrong" name = "q1" id = "q"&gt; don't like &lt;br&gt;&lt;/label&gt; &lt;label&gt;&lt;input type = "radio" value = "right" name = "q1" id = "q"&gt; doesn't like &lt;br&gt;&lt;/label&gt; &lt;label&gt;&lt;input type = "radio" value = "wrong" name = "q1" id = "q"&gt; don't likes &lt;br&gt;&lt;/label&gt; &lt;/fieldset&gt; &lt;br&gt; &lt;fieldset&gt; &lt;legend&gt; Question 2 &lt;/legend&gt; They _____ here very often. &lt;br&gt; &lt;label&gt;&lt;input type = "radio" value = "right" name = "q2" id = "q"&gt; don't come &lt;br&gt;&lt;/label&gt; &lt;label&gt;&lt;input type = "radio" value = "wrong" name = "q2" id = "q"&gt; doesn't comes &lt;br&gt;&lt;/label&gt; &lt;label&gt;&lt;input type = "radio" value = "wrong" name = "q2" id = "q"&gt; doesn't coming &lt;br&gt;&lt;/label&gt; &lt;/fieldset&gt; &lt;br&gt; &lt;fieldset&gt; &lt;legend&gt; Question 3 &lt;/legend&gt; John and Mary _____ twice last week. &lt;br&gt; &lt;label&gt;&lt;input type = "radio" value = "wrong" name = "q3"&gt; comes &lt;br&gt;&lt;/label&gt; &lt;label&gt;&lt;input type = "radio" value = "right" name = "q3"&gt; came &lt;br&gt;&lt;/label&gt; &lt;label&gt;&lt;input type = "radio" value = "wrong" name = "q3"&gt; coming &lt;br&gt;&lt;/label&gt; &lt;/fieldset&gt; &lt;br&gt; var score = 0; function validate(){ var rad = document.getElementById("quiz").get…
has answer: http://stackoverflow.com/a/28526232
answer count: 2
downvote count: 1
has comment: http://stackoverflow.com/comment/45367187
possible better answer: http://stackoverflow.com/a/28526232
favorite count: 0
type: AnsweredQuestion
upvote count: 0
has title: JavaScript Validation when a button is clicked
has comment: http://stackoverflow.com/comment/45367474
type: Question

http://stackoverflow.com/comment/45406701
type: Comment
type: QuestionComment
has text: You may want to look, for example, here: http://stackoverflow.com/questions/12545286/select-word-under-mouse-pointer-in-qt After all, QTextDocument, QTextCursor, QSyntaxHighlighter are your friends.
comment on: http://stackoverflow.com/q/28540319
score: 0

http://stackoverflow.com/comment/45232866
type: AnswerComment
has text: thank you, chartDataArray is an array so the first one is working for me.
comment on: http://stackoverflow.com/a/28452811
type: Comment
score: 0

http://stackoverflow.com/comment/45324123
score: 0
type: QuestionComment
type: Comment
has text: beacuse it's js file! php does not intepret it, its a browser job to do this, you can write php inside js, you can generate js using php. You have to read more and understand. For now you just say to browser: "Hey i'v got some js under this source 'yourPathToJsFile', do what is inside", and browser looks on this script and see php markup and browser says, "Sorry i dont understant"
comment on: http://stackoverflow.com/q/28500390

http://stackoverflow.com/comment/45274635
type: Comment
comment on: http://stackoverflow.com/q/28475541
has text: `Fields ` is not an array but rather an object. so you better use `for in` loop
score: 0
type: QuestionComment

http://stackoverflow.com/q/28482373
accepted answer: http://stackoverflow.com/a/28486164
has comment: http://stackoverflow.com/comment/45287688
type: AnsweredQuestion
has title: JSON doesn't post array with 1 item in MVC 4
score: 1
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
has comment: http://stackoverflow.com/comment/45288968
type: Question
has body: I have my MVC 4 project. I have 2 select with multiple options. Administration Adminstrative Resource Center Balance Sheet Atlanta Baltimore Betheseda Camden Submit I need to collect all selected values from 2 select lists and post it in my Action Here's my JavaScript Code: $('#btnSubmit').click(function () { var result = []; // Go through Details List $('select#ReportDetailsSelectList option:selected').each(function () { // Collect Name and Value var item = {}; item.Key = $(this).val(); item.Value = $(this).text(); result.push(item); }); var result2 = []; // Go through Details List $('select#ReportDetailsSelectList2 option:selected').each(function () { // Collect Name and Value var item = {}; item.Key = $(this).val(); item.Value = $(this).text(); result2.push(item); }); CollectPostData(result, result2); }); function CollectPostData(result, result2) { // Post collected data to the action $.ajax({ url: "/Home/GenerateReport", type: "POST", data: JSON.stringify({ 'detailList': result, 'detailList2': result2 }), dataType: "json", traditional: true, contentType: "application/json; charset=utf-8", success: function (data) { if (data.status == "Success") { alert(data.message); } else { alert("Error occurs on the Database level!"); } }, error: function () { alert("An error has occurred!!!"); } }); } I have a simple class to store my objects: public class DetailList { public string Key { get; set; } public string Value { get; set; } } And here's my Controller ActionResult: [HttpPost] public ActionResult GenerateReport(DetailList[] detailList, DetailList[] detailList2) { return Json(new { status = "Success", message = "Success" }, JsonRequestBehavior.AllowGet); } And here's start my problem... A few scenarios: 1) I have multiple option selected in both lists - data posted correctly: 2) Multiple options in 1st list, 1 option in 2nd list - data posted correctly 3) 1 option in 1st list, 1 option in 2nd list - First array is null, but the second array posted correctly: I have no…
tagged with: asp.net-mvc
tagged with: arrays
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28486164
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45293153
tagged with: ajax
linked to: http://stackoverflow.com/q/6627300

http://stackoverflow.com/a/28578463
answers question: http://stackoverflow.com/q/28578244
score: 0
type: Answer
has body: if your output variable returns 1 (true) then you can try this. if($output) { echo "&lt;script&gt;"; echo "alert(""\Successfull!\");"; echo "&lt;/script&gt;"; }

http://stackoverflow.com/q/28588653
tagged with: unit-testing
type: Question
has body: I'm trying unit test a promise ["q": "^1.1.2"]; the following code works when the error is not being thrown. I need to validate the expected behaviour that the error is handled correctly. Code: Service.prototype.getItem = function (itemId) { var deferred = Promise.defer(); // Ensure if (typeof itemId !== 'string' || itemId === '') { return deferred.reject(new Error('itemId is a required field')); } .... // do some logic at return item return deferred.resolve(item); .... return deferred.promise; Since the method hasnt returned the promise, I cant test it for error handling! Is there a better way for the service to handle the promise but to return an error if one of the params are wrong. Unit Test: it('Call Service - should throw an error', function (done) { Service.getItem('') .then(function (item) {}) .catch(function (err) { expect(err).not.to.be.empty(); done() }).done(); });
has comment: http://stackoverflow.com/comment/45484533
tagged with: javascript
has comment: http://stackoverflow.com/comment/45484767
upvote count: 1
answer count: 1
favorite count: 0
has title: Unit testing a promise where the input params are invalid
has answer: http://stackoverflow.com/a/28590579
tagged with: promise
has comment: http://stackoverflow.com/comment/45484744
accepted answer: http://stackoverflow.com/a/28590579
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/45484552
score: 1

http://stackoverflow.com/a/28590848
type: Answer
accepted answer of: http://stackoverflow.com/q/28590467
answers question: http://stackoverflow.com/q/28590467
score: 0
type: AcceptedAnswer
has body: Ok, the first problem I see here is that you need to replace the div with span tags for semantic HTML. Next your transitions should be set on the element without the hover selector, so that when you hover in and out, the transition still applies. Check out this FIDDLE I created to help you understand it. HTML: Lorem ipsum dolodfsd fs fdsd sd fsd fsdf sdf sdf sd fsdf r sit amet Click Here CSS: a{ text-decoration:none; color: #000000; position: relative; width: 200px; display:block; } a>span{ -webkit-transition: all .5s ease-in-out; -moz-transition: all .5s ease-in-out; -o-transition: all .5s ease-in-out; transition: all .5s ease-in-out; } a:hover .mainSpan{ opacity: .3; } .hoverSpan{ opacity:0; font-weight:bold; padding:20px; text-align: center; position: absolute; left: 0; right: 0; top:0; bottom:0; } a:hover .hoverSpan{ opacity: 1; }

http://stackoverflow.com/a/28503450
has comment: http://stackoverflow.com/comment/45327814
has comment: http://stackoverflow.com/comment/45329523
has comment: http://stackoverflow.com/comment/45327449
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45328019
accepted answer of: http://stackoverflow.com/q/28502341
has comment: http://stackoverflow.com/comment/45328997
answers question: http://stackoverflow.com/q/28502341
has comment: http://stackoverflow.com/comment/45327198
downvote count: 0
has comment: http://stackoverflow.com/comment/45328676
has comment: http://stackoverflow.com/comment/45329727
has comment: http://stackoverflow.com/comment/45328741
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45326065
has comment: http://stackoverflow.com/comment/45327103
has comment: http://stackoverflow.com/comment/45327183
has comment: http://stackoverflow.com/comment/45326956
has body: Updated: One select to enable/disable others. The values of the first select options must match the ID of the select you want to keep enabled. For Example: Drop List One Will Keep this this enabled Drop List 1 2 Full Source Code: function DropEvents(){ var Lists=document.getElementById('Category'); Lists.addEventListener('change', DisableMenu ,false); } function DisableMenu(){ var Lists=document.getElementsByClassName('Drops'); for(var i=0; i<Lists.length; i++){ if(Lists[i].id!==event.target.value){ Lists[i].disabled=true; }else{ Lists[i].disabled=false; } } } window.onload=DropEvents; Drop List One Drop List Two Drop List Three Drop List Four Drop List Five Drop List 1 2 Drop List 2 2 Drop List 3 2 Drop List 4 2 Drop List 5 2 I hope this helps. Happy coding!
type: Answer
has comment: http://stackoverflow.com/comment/45327081
has comment: http://stackoverflow.com/comment/45329595
has comment: http://stackoverflow.com/comment/45327004
has comment: http://stackoverflow.com/comment/45326194
has comment: http://stackoverflow.com/comment/45329141

http://stackoverflow.com/q/28533409
tagged with: cookies
tagged with: session
has title: Check if user has alread visited site in browser session
accepted answer: http://stackoverflow.com/a/28533616
has body: So I have this splash screen animation that plays when you visit my website. However, I only want the animation to play the first time you visit it (in the session of course). I tried to make an if else where I check for a cookie called "Session", and if it exists, delete the div containing the animation. If there is no such cookie, create it. Code: function session() { if (document.cookie.indexOf("visited") &gt;= 0) { $('.splash').remove(this); } else { document.cookie = "visited"; } } I have never used cookies before so I think I might have made some errors
answer count: 3
possible better answer: http://stackoverflow.com/a/28533769
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28533769
favorite count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28533616
upvote count: 3
type: Question
score: 3
has answer: http://stackoverflow.com/a/71879292

http://stackoverflow.com/q/28477967
upvote count: 2
accepted answer: http://stackoverflow.com/a/28484492
possible better answer: http://stackoverflow.com/a/28482011
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28482011
linked to: http://stackoverflow.com/q/22528967
has title: How should I keep a reference to 'options object' in a ES6 instance?
type: Question
tagged with: ecmascript-6
answer count: 2
has body: Given an ES6 class as follows, what is the best way to keep a reference to the data passed into the constructor so it is available from instance methods? The best I've found so far is to manually add a reference to each one to some instance property within the constructor. Is there a cleaner/easier way? class Test { constructor( { option1 = 1, option2 = 2 } = {} ) { // What's the best way to keep a reference to // the options on the instance? this.options = { option1, option2 }; } addOptions() { return this.options.option1 + this.options.option2; } } let t = new Test({ option1: 5 }); console.log(t.addOptions()); // 7 Here's a link to the above code running via 6to5.
tagged with: javascript
has answer: http://stackoverflow.com/a/28484492
downvote count: 0
favorite count: 0

http://stackoverflow.com/a/28489271
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28489222
score: 1
answers question: http://stackoverflow.com/q/28489222
upvote count: 1
has body: confirm returns a boolean - true if the user clicked "Ok", false if they clicked "Cancel", so simply return the result of the confirm call: if (validEmail(frm.Email.value) == true) { return confirm('Are you sure you want to unsubscribe?'); }

http://stackoverflow.com/q/28550804
accepted answer: http://stackoverflow.com/a/28550871
tagged with: polyfills
has body: Why does the MDN polyfill for Object.create have the following line: Temp.prototype = null; Is it so that we avoid maintaining a reference to the prototype argument enabling faster garbage collection? The polyfill: if (typeof Object.create != 'function') { Object.create = (function() { var Temp = function() {}; return function (prototype) { if (arguments.length &gt; 1) { throw Error('Second argument not supported'); } if (typeof prototype != 'object') { throw TypeError('Argument must be an object'); } Temp.prototype = prototype; var result = new Temp(); Temp.prototype = null; return result; }; })(); }
has answer: http://stackoverflow.com/a/39255015
upvote count: 2
possible better answer: http://stackoverflow.com/a/39255015
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28550871
answer count: 2
has title: Why is the Temp.prototype on the MDN Object.create polyfill set to null?
score: 2
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/28576253
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28576277
tagged with: jquery
favorite count: 0
type: AnsweredQuestion
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28576277
has answer: http://stackoverflow.com/a/28577056
tagged with: http://stackoverflow.com/tag/json
has body: I am designing an simple application, which plays with words. every time a user types a word, i need to validate the word that it is proper English word or not. my requirement is simple like if i pass a word to a method, it just have to return me true(Valid) or false (invalid) Can i find any J Query API or even if i get a list of English words as a JS-file. I can use it in my application.
has comment: http://stackoverflow.com/comment/45461863
possible better answer: http://stackoverflow.com/a/28577056
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45461865
has title: Jquery/Javascript check my word is valid or not.

http://stackoverflow.com/a/28560050
answers question: http://stackoverflow.com/q/28558374
type: Answer
has body: It matters less if you use PHP (or any other server side programming language) or jQuery or a JSON document to feed markers to your markers array Try this snippet (I've tested it): &lt;script src="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;signed_in=true&amp;"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var mapObj; function initialize() { var myOptions = { zoom: 6, mapTypeId: google.maps.MapTypeId.ROADMAP }; var mapObj = new google.maps.Map(document.getElementById("map_canvas"), myOptions); var bounds = new google.maps.LatLngBounds(); // Try HTML5 geolocation if(navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { var pos = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); var infowindow = new google.maps.InfoWindow({ map: mapObj, position: pos, content: 'Deine Position' }); mapObj.setCenter(pos); }, function() { var options = { map: mapObj, position: new google.maps.LatLng(60, 105), content: content }; var infowindow = new google.maps.InfoWindow(options); mapObj.setCenter(options.position); }); } else { // Browser doesn't support Geolocation } var infowindow = new google.maps.InfoWindow(); var markers = []; //array to hold markers // Multiple Markers markers.push(['London Eye, London', 51.503454, -0.119562]); markers.push(['Palace of Westminster, London', 51.499633, -0.124755]); // Loop through your array of markers and add them to mapObj for (i = 0; i &lt; markers.length; i++) { //create a latitude / longitude object first: var pointLatLng = new google.maps.LatLng(markers[i][1],markers[i][2]); //extend map to include new marker bounds.extend(pointLatLng); //create the marker object: markerObj = new google.maps.Marker({ position: pointLatLng, map: mapObj, title: markers[i][0] }); google.maps.event.addListener(markerObj, 'click', (function(markerObj, i) { return function() { infowindow.setContent("info window: "+ markers[i][0]); infowindow.open(mapObj, markerObj); } })(markerObj, i));…
has comment: http://stackoverflow.com/comment/45437291
score: 0
has comment: http://stackoverflow.com/comment/45432374
has comment: http://stackoverflow.com/comment/45435221
has comment: http://stackoverflow.com/comment/45945502
has comment: http://stackoverflow.com/comment/45435589

http://stackoverflow.com/comment/45470412
type: QuestionComment
has text: @MokshShah you mean this? http://oi57.tinypic.com/o9mna9.jpg
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28580466

http://stackoverflow.com/q/28520453
has body: When bind to attributes(one-way) there are a couple of options you can either bind with attr-name.bind="variable" (also tried one-way and one-time) or using interpolation attr-name="${variable}", either way though if you try to bind to a namespaced element such as xlink:href you currently get: Uncaught NamespaceError: Failed to execute 'setAttributeNS' on 'Element': '' is an invalid namespace for attributes. For have the following in a controller page.js: export class page { constructor(){ this.icon = 'blah'; } } and the following in page.html: &lt;template&gt; &lt;svg class="icon ${icon}"&gt; &lt;use xlink:href="${icon}"&gt;&lt;/use&gt; &lt;/svg&gt; &lt;/template&gt; As I said either of the bind's above is throwing the given error. Any thoughts on how to bind to this namespaced attribute? Instrumented the bootstrap handleApp function to print the full stack trace: Error: Failed to execute 'setAttributeNS' on 'Element': '' is an invalid namespace for attributes. at Error (native) at OoPropertyObserver.setValue (http://localhost:9000/jspm_packages/github/aurelia/binding@0.3.3/system/property-observation.js:200:26) at InterpolationBinding.setValue (http://localhost:9000/jspm_packages/github/aurelia/templating-binding@0.8.4/system/binding-language.js:214:35) at InterpolationBinding.bind (http://localhost:9000/jspm_packages/github/aurelia/templating-binding@0.8.4/system/binding-language.js:202:22) at View.bind (http://localhost:9000/jspm_packages/github/aurelia/templating@0.8.9/system/view.js:65:29) at ViewFactory.create (http://localhost:9000/jspm_packages/github/aurelia/templating@0.8.9/system/view-factory.js:173:22) at BoundViewFactory.create (http://localhost:9000/jspm_packages/github/aurelia/templating@0.8.9/system/view-factory.js:128:39) at Repeat.processItems (http://localhost:9000/jspm_packages/github/aurelia/templating-resources@0.8.6/system/repeat.js:105:36) at Repeat.bind (http://localhost:9000/jspm_packages/github/aurelia/templating-resources@0.8.6/system/re…
type: Question
tagged with: aurelia
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/28861825
upvote count: 4
downvote count: 0
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28861825
type: AnsweredQuestion
has title: Binding to a Namespaced Attribute in Aurelia

http://stackoverflow.com/comment/45220568
comment on: http://stackoverflow.com/q/28445530
type: Comment
type: QuestionComment
score: 2
has text: Search and replace is not enough. Change the SQL statements to [parameterized queries](https://www.owasp.org/index.php/Query_Parameterization_Cheat_Sheet) and read OWASP's [SQL Injection Prevention Cheat Sheet](https://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet).

http://stackoverflow.com/a/28451924
score: 2
upvote count: 2
has body: Anoter solution is to use jquery map and get the value of all like: var pos = $(".container > .class").map(function() { return { left: $(this).css("left"), top: $(this).css("top"), right: $(this).css("top"), bottom: $(this).css("bottom"), } }).get(); console.log(pos);
answers question: http://stackoverflow.com/q/28451750
downvote count: 0
type: Answer

http://stackoverflow.com/a/28462616
has body: If all the pages are local, you could use JavaScript to set a cookie or use the HTML5 local storage to save and retrieve the referrer. One example using the localStorage object. Add this code to all your pages: // get the referrer if it's set var referrer = ""; if (localStorage.getItem("referrer")) { referrer = localStorage.getItem("referrer"); } // set the new referrer localStorage.setItem("referrer", window.location.href); // show the previous page url (just for testing) console.log(referrer);
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28461778
has comment: http://stackoverflow.com/comment/45252521
accepted answer of: http://stackoverflow.com/q/28461778
downvote count: 0
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/a/45989102
downvote count: 1
score: 5
has body: If you don't have a particular date format then you can also use Array of formats, moment(checked_date, [DATE_FORMAT1, DATE_FORMAT2]).format(DATE_FORMAT) === checked_date
answers question: http://stackoverflow.com/q/28587018
type: Answer
upvote count: 6

http://stackoverflow.com/q/28442531
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/28444165
tagged with: bdd
tagged with: javascript
tagged with: mocha.js
score: 0
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has title: Mocha Loading Blank in Browser
has body: Context I've used Mocha before many times, both in the browser and just using the command line. I tend to use Chai's expect module for bdd. I have five test files that have been working with command line npm test. I just want to run the tests in the browser for better debugging. Problem The setup is just boggling my mind. I either get a blank Mocha page without tests or I see the first test flash on screen, then it redirects. Current specRunner.html <!DOCTYPE HTML Mocha Tests Previous Attempts I've tried moving script tags around, thinking that dependencies are being unmet at load time. I've tried relative vs. absolute paths. Console says all the tags are loading correctly. I've tried modifying the run script tag. When it is as the example above, it turns out a blank page and says "Cannot read property 'appendChild' of null", pointing back to Mocha: When the run script tag looks like this: $(function() { window.mochaPhantomJS ? mochaPhantomJS.run() : mocha.run(); }); It redirects from /specRunner.html to /2,1 and the console error repeats about every 30 seconds.
favorite count: 0
possible better answer: http://stackoverflow.com/a/28443485
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28443485
tagged with: chai
accepted answer: http://stackoverflow.com/a/28444165
type: Question

angularjs
tags question: http://stackoverflow.com/q/28581937
tags question: http://stackoverflow.com/q/28575259
tags question: http://stackoverflow.com/q/28591314
tags question: http://stackoverflow.com/q/28438009
tags question: http://stackoverflow.com/q/28492340
tags question: http://stackoverflow.com/q/28492309
tags question: http://stackoverflow.com/q/28506345
tags question: http://stackoverflow.com/q/28454865
tags question: http://stackoverflow.com/q/28562861
tags question: http://stackoverflow.com/q/28543994
tags question: http://stackoverflow.com/q/28568024
tags question: http://stackoverflow.com/q/28464751
tags question: http://stackoverflow.com/q/28517750
tags question: http://stackoverflow.com/q/28460542
tags question: http://stackoverflow.com/q/28470344
tags question: http://stackoverflow.com/q/28590623
tags question: http://stackoverflow.com/q/28484203
tags question: http://stackoverflow.com/q/28465442
tags question: http://stackoverflow.com/q/28510806
tags question: http://stackoverflow.com/q/28575847
tags question: http://stackoverflow.com/q/28552421
tags question: http://stackoverflow.com/q/28437953
tags question: http://stackoverflow.com/q/28497592
tags question: http://stackoverflow.com/q/28473889
tags question: http://stackoverflow.com/q/28588698
tags question: http://stackoverflow.com/q/28482456
tags question: http://stackoverflow.com/q/28557591
tags question: http://stackoverflow.com/q/28573169
tags question: http://stackoverflow.com/q/28491401
tags question: http://stackoverflow.com/q/28494845
tags question: http://stackoverflow.com/q/28535791
tags question: http://stackoverflow.com/q/28583662
tags question: http://stackoverflow.com/q/28577005
tags question: http://stackoverflow.com/q/28470171
tags question: http://stackoverflow.com/q/28477376
tags question: http://stackoverflow.com/q/28523432
tags question: http://stackoverflow.com/q/28484979
tags question: http://stackoverflow.com/q/28537352
tags question: http://stackoverflow.com/q/28588898
tags question: http://stackoverflow.com/q/28542912
tags question: http://stackoverflow.com/q/28565399
tags question: http://stackoverflow.com/q/28457647
tags question: http://stackoverflow.com/q/28464292
tags question: http://stackoverflow.com/q/28461736
tags question: http://stackoverflow.com/q/28473282
tags question: http://stackoverflow.com/q/28574066
tags question: http://stackoverflow.com/q/28514241
tags question: http://stackoverflow.com/q/28553749
tags question: http://stackoverflow.com/q/28507256
tags question: http://stackoverflow.com/q/28525169
tags question: http://stackoverflow.com/q/28500013
tags question: http://stackoverflow.com/q/28490555
tags question: http://stackoverflow.com/q/28571864
tags question: http://stackoverflow.com/q/28505381
tags question: http://stackoverflow.com/q/28592232
tags question: http://stackoverflow.com/q/28482679
tags question: http://stackoverflow.com/q/28530151
tags question: http://stackoverflow.com/q/28466241
tags question: http://stackoverflow.com/q/28443667
tags question: http://stackoverflow.com/q/28472959
tags question: http://stackoverflow.com/q/28565334
tags question: http://stackoverflow.com/q/28566719
tags question: http://stackoverflow.com/q/28519980
tags question: http://stackoverflow.com/q/28490399
tags question: http://stackoverflow.com/q/28526316
tags question: http://stackoverflow.com/q/28491329
tags question: http://stackoverflow.com/q/28564313
tags question: http://stackoverflow.com/q/28449622
tags question: http://stackoverflow.com/q/28554652
tags question: http://stackoverflow.com/q/28533075
tags question: http://stackoverflow.com/q/28447621
tags question: http://stackoverflow.com/q/28485774
tags question: http://stackoverflow.com/q/28439333
tags question: http://stackoverflow.com/q/28579265
tags question: http://stackoverflow.com/q/28566680
tags question: http://stackoverflow.com/q/28583630
tags question: http://stackoverflow.com/q/28583479
tags question: http://stackoverflow.com/q/28478120
tags question: http://stackoverflow.com/q/28527863
tags question: http://stackoverflow.com/q/28592578

http://stackoverflow.com/q/28583223
has title: on submit not running validation script
score: 1
tagged with: forms
has comment: http://stackoverflow.com/comment/45474092
type: Question
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28583354
has answer: http://stackoverflow.com/a/28583313
answer count: 2
tagged with: validation
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45474238
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has body: If this question has been answered elsewhere I do apologize (I did check before hand, however couldn't find an answer). The problem seems to be that the validation script is not running when I click submit. Here is the code: window.onload = function() { document.forms[0].onsubmit = validForm; } function validForm() { var allGood = true; var allTags = document.forms[0].getElementsByTagName("*"); for (var i=0; i&lt;allTags.length; i++) { if(!validTag(allTags[i])) { allGood = false; } } return allGood; function validTag(thisTag) { var outClass = ""; var allClasses = thisTag.className.split(" "); for (var j=0; j&lt;allClasses.length; j++) { outClass += validBasedOnClass(allClasses[j]) + " "; } thisTag.className = outClass; if (outClass.indexOf("invalid") &gt; -1) { thisTag.focus(); if (thisTag.nodeName == "INPUT") { thisTag.select(); } return false; } return true; function validBasedOnClass(thisClass) { var classBack = ""; switch(thisClass) { case "": case "invalid": break; case "reqd": if(allGood &amp;&amp; thisTag.value == "") { classBack = "invalid"; } classBack += thisClass; break; default: classBack += thisClass; } return classBack; } } } input.invalid { background-color: yellow; border: 1px solid red!important; } &lt;form action="#" id=quote-generator&gt; &lt;input type=number step=1 placeholder=Distance id=distance class=reqd autofocus&gt; &lt;input type=text value="Running Cost" id=fuelPrice onFocus="this.blur()" readonly&gt;&lt;span id=aside title="This value is calculated by the AA &amp; is updated every 3 months"&gt;*&lt;/span&gt; &lt;/form&gt; &lt;input type=submit value="Submit" form=quote-generator onclick="formQuote()"&gt; Here is a fiddle.

http://stackoverflow.com/q/28536332
accepted answer: http://stackoverflow.com/a/28536684
has comment: http://stackoverflow.com/comment/45386823
possible better answer: http://stackoverflow.com/a/28536428
type: AnsweredQuestion
tagged with: loops
downvote count: 1
has title: Why is my loop function to create 4 divs wrong?
has comment: http://stackoverflow.com/comment/45386926
type: Question
score: -1
has answer: http://stackoverflow.com/a/28536428
has body: Im practicing using loops and what I did was: var writing = function() { for (var i = 0, n = 4; i &lt; n; i++) { document.createElement("div") += 1; } }; writing(); It didnt work, why is that? It should create 4 divs.
answer count: 2
tagged with: for-loop
has comment: http://stackoverflow.com/comment/45386936
upvote count: 0
has comment: http://stackoverflow.com/comment/45386881
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45387011
has answer: http://stackoverflow.com/a/28536684

http://stackoverflow.com/a/28549558
has comment: http://stackoverflow.com/comment/45413583
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28549475
answers question: http://stackoverflow.com/q/28549475
has body: You're exiting PhantomJS after the first test, so the second test fails. You need to run ph.exit(); only once after all the tests. I suspect that this can be done with: describe('document', function() { before(...); after(function(done) { ph.exit(); done(); }); it(...); it(...); }); You can probably go so far as to createPage during before and use the page instance in the tests. Each test case should still open a new URL so that a fresh DOM is presented. This will probably be faster and more resilient against memory leaks. By the way, PhantomJS' localStorage is never cleared (because it is stored on disk), so you have to clear it yourself after each test case or at the end of the execution. PhantomJS also has only one CookieJar per process (which is only in memory), so you would have to remove the cookies if you test login or something like that.
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45413683
has comment: http://stackoverflow.com/comment/45413800

http://stackoverflow.com/q/28546516
score: 0
has answer: http://stackoverflow.com/a/28547004
tagged with: http://stackoverflow.com/tag/html
tagged with: http://stackoverflow.com/tag/xml
accepted answer: http://stackoverflow.com/a/28547004
type: AnsweredQuestion
type: Question
has title: Render the Xml file having controls layout into HTML5 page
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I have the following xml file with the controls information to render into HTML page. The contents are like: <control type="panel"> TEST HELLO <control> This has to rendered on the fly into a div with a panel containing one button and one textbox.The contents of xml are known only at runtime.It can be anything like only a button or a dropdown list information.How would one go about approaching this problem.A generic algorithm(probably using jquery) would be really helpful.

http://stackoverflow.com/a/28450033
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28449953
has body: $http.get is asynchronous function, that returns HttpPromise. There are couple ways how you can get data 1.Pass callback, like this diary.factory('notesService', function($http) { return { getText: function (callback) { $http.get('www/getNotes.php') .then( function(payload) { callback(payload.data); }); } } }); notesService.getText(function (notes) { console.log(notes); }); 2.return promise diary.factory('notesService', function($http) { return { getText: function () { return $http.get('www/getNotes.php'); } } }); notesService.getText().then( function(payload) { callback(payload.data); });
answers question: http://stackoverflow.com/q/28449953

http://stackoverflow.com/q/28524231
has body: So I'm trying to convert a Laravel array into json so I can then manipulate it through javascript. Im not sure how this is achieved correctly. Here is the code, so far @foreach ($posts as $post) postName }}}">#{{String::title($posts->postName) }} @endforeach
answer count: 5
tagged with: php
has answer: http://stackoverflow.com/a/28524412
tagged with: laravel
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28524241
type: Question
has answer: http://stackoverflow.com/a/57821382
accepted answer: http://stackoverflow.com/a/28524412
possible better answer: http://stackoverflow.com/a/38318803
downvote count: 0
tagged with: javascript
has title: Laravel array to json format
has answer: http://stackoverflow.com/a/38318803
upvote count: 8
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28524453
favorite count: 0
score: 8

http://stackoverflow.com/comment/45306313
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28492443
score: 0
has text: Ok I've made 2x screenshots on photoshop trying to demonstrate floating layer, I hope you can access it: https://onedrive.live.com/redir?resid=DD86D796C03ED2B0!607&authkey=!AI56DLbQ6Kpjjyo&ithint=album%2c

http://stackoverflow.com/comment/45429326
type: QuestionComment
has text: how would i test if the lexicon is still there? thats one thing I cannot find out how. and if both objects are wiped I would have no logical accesspoint to `$newvalue`
comment on: http://stackoverflow.com/q/28558186
score: 0
type: Comment

http://stackoverflow.com/comment/45350683
has text: ^ You also have an eclectic mix of Mootools and jQuery on your site. You might want to pick one or the other to avoid issues.
comment on: http://stackoverflow.com/q/28516693
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45400623
score: 0
comment on: http://stackoverflow.com/a/28543092
type: AnswerComment
type: Comment
has text: And yes, @uʍopǝpısdn you do deserve a cookie! Thanks bro! What does the :before selector do? I haven't really been around .CSS that much to know what it does.

http://stackoverflow.com/q/28481701
has answer: http://stackoverflow.com/a/28492034
tagged with: javascript
has comment: http://stackoverflow.com/comment/45285957
type: AnsweredQuestion
tagged with: elasticsearch
downvote count: 0
accepted answer: http://stackoverflow.com/a/28492034
score: 1
has body: I am working on a User Interface (HTML + JavaScript) which queries ElasticSearch 1.4 Right now the search is spanned over multiple indexes using the following URL: http://localhost:9200/_all/_search But in order to query all the fields I have to send the following JSON in the POST request: Formatted JSON Data { "query":{ "multi_match":{ "query":"monitor", "type":"most_fields", "fields":[ "First Name", "Last Name", "ProductName", "Organization", "Description" ] } }, "highlight":{ "fields":{ "*":{ } } } } The problem arise because I don't want to specify the search fields. I want to ask to ElasticSearch to search on all the available fields of all documents. Is this possible?
favorite count: 0
has comment: http://stackoverflow.com/comment/45286297
type: Question
upvote count: 1
answer count: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45286854
has title: ElasticSearch span search over multiple Index over all fields

http://stackoverflow.com/q/28565333
has comment: http://stackoverflow.com/comment/45441027
upvote count: 1
has body: I wonder why the length property of a textbox never return 0 when I am getting it with JQuery. Even when the textbox is empty, $(element).length never return 0. Lets say we have this code : &lt;input id="Text1" type="text" /&gt; $(function () { alert($('#Text1').length); var textBox1 = document.getElementById("Text1"); alert(textBox1.value.length); $('#Text1').on('input', function() { alert($('#Text1').length); var textBox1 = document.getElementById("Text1"); alert(textBox1.value.length); }); }); JS Fiddle here Has you can see, the $('#Text1').length never return 0. With pure javascript, it return 0 when the textbox is empty. Why ?
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28565351
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/28565351
score: 1
type: Question
tagged with: javascript
tagged with: jquery
has title: Textbox's length property never return 0 with JQuery

http://stackoverflow.com/a/28488882
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/45346434
has body: I solved the problem by checking if description is empty, and if it is, rerun the function. function test() { if (Xrm.Page.getAttribute("description").getValue() == "") { console.log("Description empty, rerunning in 1 second"); setTimeout(function() { test(); }, 1000); } else { console.log(Xrm.Page.getAttribute("description").getValue()); } }
answers question: http://stackoverflow.com/q/28440363
downvote count: 0
has comment: http://stackoverflow.com/comment/45329920
type: Answer

http://stackoverflow.com/q/28579480
has comment: http://stackoverflow.com/comment/45467550
type: Question
has comment: http://stackoverflow.com/comment/45467508
tagged with: prototype
has comment: http://stackoverflow.com/comment/45467273
has comment: http://stackoverflow.com/comment/45467460
has title: JavaScript updating last index class data
has comment: http://stackoverflow.com/comment/45467666
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28579672
tagged with: inheritance
score: 0
has comment: http://stackoverflow.com/comment/45467551
has comment: http://stackoverflow.com/comment/45467433
has comment: http://stackoverflow.com/comment/45467641
has comment: http://stackoverflow.com/comment/45467368
has body: I have following issue. I have array of objects, and when I want to get one of the items and update data, it updates last data. for example: var arr = []; for (var i = 0; i &lt; 8; i++){ var c = new MyClass1(i); arr.push (c) } and the MyClass1 (function () { var score = 0; function MyClass1(id){ this.id = id; this.x = 100; //some code. not important } var p = MyClass1.prototype; p.updateScore = function (s){ score = s; } window.MyClass1 = MyClass1; }()); and function which returns one of these classes var getMyClassesById = function(/* int */ id){ var size = arr.length; for (var i = 0; i&lt;size; i++){ if (id == arr[i].id){ return arr [i]; } } } Finally I'm calling function and want to update Score getMyClassesById(1).updateScore (122); it's updates last index item Score, and calls last item "updateScore" function... why? but when i'm changing some other property its changes correctly for example "x". I can't understand is here something not right with prototypes?
type: UnansweredQuestion

http://stackoverflow.com/q/28544908
has comment: http://stackoverflow.com/comment/45404416
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45404320
has comment: http://stackoverflow.com/comment/45403546
score: 1
upvote count: 3
has answer: http://stackoverflow.com/a/28544995
downvote count: 2
type: Question
has title: Associative Array Internet Explorer 8/9
has comment: http://stackoverflow.com/comment/45409760
tagged with: internet-explorer-8
tagged with: internet-explorer-9
tagged with: arrays
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28544995
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45403082
has body: I've an javascript Array: obj[name][uid] = 10 obj[name][blub] = 12 When I am checking in modern browsers for if(obj[name] == undefined){ ...do stuff } else ... it works great. But in IE 8 and 9 it doesnt work. How can I check in IE 8/9 if this array has been created? Thanks, Falk

http://stackoverflow.com/q/28474760
has comment: http://stackoverflow.com/comment/45273020
type: Question
has comment: http://stackoverflow.com/comment/45273136
has comment: http://stackoverflow.com/comment/45273167
has title: A good and fast way to check if a JSON object contains certain values
score: 0
tagged with: http://stackoverflow.com/tag/json
answer count: 1
has answer: http://stackoverflow.com/a/28474876
has body: I am looking for direct way of checking if the JSON I recieve from my backend holds the value i need without throwing an exception or making a for loop of if-statements. I would like it to look something like this: success = function(requestBody, xhr, options){ jsonObj = JSON.parse(requestBody); if (!json.path.to.item.is.very.deep[0].really[3]){ responseErrorHandler(requestBody, xhr, options) } // More Code here } This code obviously does not work because if I.E. the json object does not have the item object and error is throw and the code stops. I can make a for-loop and parse the json but i like to see a shortcut.
has comment: http://stackoverflow.com/comment/45273165
has comment: http://stackoverflow.com/comment/45273200
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45273208
has comment: http://stackoverflow.com/comment/45273062

http://stackoverflow.com/comment/45410102
has text: Thanks for all the great feedback! I decided to go with the mini form setup and works like a charm :)
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28545597

http://stackoverflow.com/a/28497293
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45329992
has comment: http://stackoverflow.com/comment/45330439
answers question: http://stackoverflow.com/q/28496373
has body: An update every 10 milliseconds is extremely frequent. If everything keeps up, this would be 100 updates a second: around 4 times the frame rate of a lot of video formats. A very simple way of speeding things up is to reduce this considerably. One way I can think of doing this that would probably fit in with most architectures is to use a throttle function, such as `_.throttle' from lodash: var throttledApply = _.throttle($scope.apply, 500); And then when you receive a message, you would have something like: worker.onmessage = function(e) { // ... Other processing code ... throttledApply(); }; If you're using the Bootstrap progress bar, it should still give a smooth transition between displayed values, even if the differences between them are large.

http://stackoverflow.com/a/28520582
score: 0
answers question: http://stackoverflow.com/q/28520231
type: Answer
has body: It is much better to use css class for formating element: .shopping_cart { z-index: 189; visibility: hidden; opacity: 0; } .shopping_cart_active{ z-index: 300; visibility:visible; } So you add class shopping_cart_active on hover: $('#shopping_button, .shopping_cart').on('hover',function(){ $(this).addClass('shopping_cart_active'); }); And when you want outside of it you can use this: $(html).on('click', function(){ $('.shopping_cart.).removeClass('shopping_cart_active'); })

http://stackoverflow.com/a/28590876
answers question: http://stackoverflow.com/q/28468089
downvote count: 0
has body: It sounds like it might be easier to split the list, sort the parts and put it back together, i.e.: _(data) //begin chain .filter("name") //the entries with names .sortBy("name") //sorted by name .concat(_.sortBy(_.reject(data, "name"), "number")) //followed by the entries without name, sorted by number .value(); //end chain
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/q/28537743
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45389447
has comment: http://stackoverflow.com/comment/45389485
has body: When I am calling the java script from my VB code as oCell.InnerHtml += "&lt;input type='submit' id='btnOK' value='" &amp; Phrasebook.Text("Button_OK") &amp; "' onclick='helpCommit();' onkeyup='disableEnterKey(event);'/&gt;" its not working. My Javascript function is function disableEnterKey(event) { var key= window.event.keyCode; if(key == 13) { e.preventDefault(); return false; } }
type: UnansweredQuestion
tagged with: vb.net
has title: My java script function to disable the enter key is not working
type: Question
has answer: http://stackoverflow.com/a/28538018
tagged with: javascript

http://stackoverflow.com/a/28535276
upvote count: 4
has body: The rect() command will add to the path and accumulate, so each time you call fill() all the previous rect's are filled as well. Solve in one of two ways: function paintBackground() { ctx.beginPath(); // RESET path here ctx.rect(0, 0, canvas.width, canvas.height); ctx.fillStyle = "black"; ctx.fill(); } or fill directly without using the path: function paintBackground() { ctx.fillStyle = "black"; ctx.fillRect(0, 0, canvas.width, canvas.height); } Also use requestAnimationFrame for better animations. Modified fiddle Ps: don't forget the semi-columns.
downvote count: 0
answers question: http://stackoverflow.com/q/28534715
score: 4
type: Answer

http://stackoverflow.com/comment/76502484
comment on: http://stackoverflow.com/q/28588707
has text: See: https://stackoverflow.com/a/44760825/2138743
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/33030381
type: Answer
has body: What were your arguments? Whose test didn’t pass? The latter depends, but regarding arguments, the function actually works with strings, yet a type check might be in order: if(typeof test != 'string' || typeof orig != 'string') return false; // “return false otherwise”
score: 0
answers question: http://stackoverflow.com/q/28448096

http://stackoverflow.com/q/28486065
possible better answer: http://stackoverflow.com/a/28486434
tagged with: css
type: AnsweredQuestion
downvote count: 0
score: 1
has body: that's basically what I want, I need to make that button appears once the user focus on that input with the ng-model=query, so I know that there is an ng-focus directive, how can I use it ? &lt;input type="search" ng-model="query"&gt; &lt;!--this is the button I need to show once the user focus the input--&gt; &lt;div ng-show="query.length" ng-click="query = ''"&gt; Cancel &lt;/div&gt; there is the button that I to display once user focus on the input. So, instead of ng-show, what can I use ?
type: Question
linked to: http://stackoverflow.com/q/16535383
has answer: http://stackoverflow.com/a/28486602
has title: How to appear a button when focus ? Angular
accepted answer: http://stackoverflow.com/a/28486613
tagged with: javascript
has answer: http://stackoverflow.com/a/28486434
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/28486613
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/q/28552447
has comment: http://stackoverflow.com/comment/45441363
type: Question
has comment: http://stackoverflow.com/comment/45527726
has comment: http://stackoverflow.com/comment/45459660
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45455512
tagged with: coldfusion-8
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45504579
tagged with: processing.js
has body: I am trying to use Processing.js on our ColdFusion server and having no luck. If I take a regular html program, that runs fine locally, and save it to our server, the canvas will not show in IE 11. However, it displays fine with Chrome. Unfortunately, the app I am trying to fold this into was not written to be cross browser and needs IE. Has anyone gotten processing to work on a ColdFusion server using IE as the browser?
has title: Processing.js and ColdFusion Server with IE
tagged with: internet-explorer-11

http://stackoverflow.com/comment/45391641
type: Comment
comment on: http://stackoverflow.com/a/28538277
has text: Submitting the form on select change requires javascript.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/109139575
comment on: http://stackoverflow.com/a/42259885
has text: You are talking about the ternary example? If you need else if, I suggest you use a full if/elseif/else block. Ternary operator is usually just syntactic sugar. However, if you need to you can 'nest' ternary operators ( example, in react you *could* do this, but don't!): `condition1 ? "This is the IF" : condition2 ? "This is the ELSE IF" : "This is the ELSE"`
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/a/28569422
upvote count: 1
has comment: http://stackoverflow.com/comment/45479881
score: 1
has comment: http://stackoverflow.com/comment/45587620
has body: Try changing this line $('.displayCheck').html(result.join(' ')); to $('.displayCheck').html(result.sort().join(' ')); Fiddle EDIT: for the question about sorting based on the number following the word. change $('.displayCheck').html(result.sort().join(' ')); to $('.displayCheck').html(result.sort(function (a, b) { return +a.split(' ')[1] - +b.split(' ')[1]; }).join(' ')); Fiddle and the followup example you could change: $('.displayCheck').html(result.sort(function (a, b) { return +a.split(' ')[1] - +b.split(' ')[1]; }).join(' ')); to $('.displayCheck').html(result.sort(function (a, b) { return +a.split(' ')[a.split(' ').length-1] - +b.split(' ')[b.split(' ').length-1] ; }).join(' ')); Fiddle I would consider changing how you are storing the result array. var result = []; Might change it to an array of objects with text, value like: var results = [ { "text": theTextOfTheOption, "value": theValueOfTheOption }, { ... } ]; Then you could sort based on the value rather than doing the splits on the strings in your results array.
downvote count: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28568338
has comment: http://stackoverflow.com/comment/45509887
type: Answer
answers question: http://stackoverflow.com/q/28568338

http://stackoverflow.com/a/28458817
answers question: http://stackoverflow.com/q/28458491
score: 0
type: Answer
has body: To accomplish this, I use a div within the main page. This is the HTML placed just before the body close tag &lt;div id="popup"&gt; &lt;div id="popupcontent"&gt; &lt;/div&gt; &lt;/div&gt; This is the css #popup { display:none; position: fixed; width:auto; height:auto; top:13%; left:40%; background-color:#FFF; border:#0073EA solid 4px; border-radius:10px; overflow:auto; padding:20px; } When populating and displaying a div like this from a jquery event handler, your code will look something like this: $('#mybutton').click(function(e) { var popupdata = "Some latin stuff used as a placeholder"; $('#popupcontent').html(popupdata); $('#popup').show(); }); Hopefully this helps.

http://stackoverflow.com/q/28562587
has body: My app is like this: angular.module('app', [ // other includes 'ui.bootstrap' ]) in my directive I'm working on : angular.module('app').directive('DateFields','DatepickerController', ['$timeout', 'DatepickerController', function ($timeout, DatepickerControlle) { return { restrict: 'A', replace: true, templateUrl: 'path to calendar.html', scope: { element: "=", flowParameterMap: "=?" }, controller: ['$scope', '$element', '$timeout', function (scope, element, $timeout) { if (!scope.element) return; scope.overlayClick = function (e) { scope.isOpen = true; var input = $(e.currentTarget).next(); $timeout(function () { $(input).focus(); $DatepickerController.isOpen = true; }); } }] }; }]); As you can see I'm trying from code change value of datepickers isOpen variable to show datepicker binded to the other dom object. But all my tries end in "is undefined" error.
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28562663
score: 0
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
has title: How to call method from other module in directive

http://stackoverflow.com/a/28517913
has comment: http://stackoverflow.com/comment/45353800
upvote count: 7
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28517886
type: Answer
accepted answer of: http://stackoverflow.com/q/28517886
downvote count: 0
score: 7
has comment: http://stackoverflow.com/comment/45354454
has body: The in operator tells you if an index has been actually assigned to: a = [] a[5] = window.foo document.write(a[4] + "&lt;br&gt;") document.write(a[5] + "&lt;br&gt;") document.write((4 in a) + "&lt;br&gt;") document.write((5 in a) + "&lt;br&gt;") Javascript arrays are actually objects with a special length property, and array indexes are just property names (in fact, they are even strings, not numbers, internally). So the above definition is equivalent to: a = { 5: window.foo, length: 6 } Therefore, all object functionality related to keys (like in, hasOwnProperty, Object.keys) work for array indexes as well. forEach and other iteration methods work by iterating from 0 to length-1 and checking if n-th index is actually present in the argument, they don't "know" if the argument is actually an array or just a generic object: a = {1:'one', 5:'five', length:100}; [].forEach.call(a, function(x) { document.write(x) });

http://stackoverflow.com/q/28540372
tagged with: history
tagged with: javascript
has body: I'm currently messing with the browser history with javascript, and I almost have what I want. But I encounter one huge error, let me explain the situation: I have a menu, and when pressing on a menu item, the following code is executed: $("#content").load("http://example.com/menuitem"); window.history.pushState({ page:"http://example.com/menuitem" },"", "http://example.com/menuitem"); document.title = 'Menu item'; I also have an empty onbeforeunload function, so the browser's back, forward and history options work as expected. And I have an onpopstate function, but I don't see him doing anything, so don't know if I actually need him. window.onbeforeunload = function(){ }; window.onpopstate = function(e){ console.log('onpopstate was called'); if(e.state){ window.location.href = e.state.page; } }; Now, my huge error: I am testing as follows: Type 'stackoverflow.com' in the addressbar Type 'example.com' in the addressbar Click on a menuitem Type 'google.com' in the addressbar Go back by the browser back-button, until you reach stackoverflow.com When I go back, the first time I got on example.com/menuitem as expected, but when going back the second time, I once more got on the exact same page, instead of getting on example.com, which is what I want. From this moment, when I look in the history, my 'example.com/menuitem' page seems to be duplicated for some reason. What goes wrong here and how can I fix my error?
has answer: http://stackoverflow.com/a/28602465
downvote count: 0
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28602465
has comment: http://stackoverflow.com/comment/45398356
has title: Javascript history error: Going back seems broken
type: AnsweredQuestion
tagged with: back
score: 1
has comment: http://stackoverflow.com/comment/45397667
upvote count: 1
type: Question

http://stackoverflow.com/comment/75357464
type: AnswerComment
has text: Glad for you (Y) :D
comment on: http://stackoverflow.com/a/41283828
type: Comment
score: 0

http://stackoverflow.com/comment/45466206
comment on: http://stackoverflow.com/a/28564408
type: AnswerComment
score: 0
type: Comment
has text: yeah, I understand I'll have to write the comparison by hand, but how do I plug it into my/angularjs ng-options code?

http://stackoverflow.com/comment/45502271
score: 0
type: AnswerComment
has text: In that case I'm way too slow.
type: Comment
comment on: http://stackoverflow.com/a/28532337

http://stackoverflow.com/comment/45476167
has text: Your servlet method should return a string and your ajax script should pop up the alert with `msg` set
type: Comment
comment on: http://stackoverflow.com/a/28584112
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45492804
score: 0
type: AnswerComment
type: Comment
has text: thats a specific corner case for user authrization in which the devs decied to use jsp for this parctiular use case and app... as a general rule, get rid of them
comment on: http://stackoverflow.com/a/28589501

http://stackoverflow.com/q/28539458
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28539598
type: AnsweredQuestion
score: 1
has body: I want to do a custom modal asking if user wants to save changes before leaving a page, using ui.bootstrap. I'm not using angular route configuration (so i guess i can't use '$locationChangeStart'or '$routeChangeStart'). I can't use window.onbeforeunload as you can't custom the popup window ( apart maybe from the messages displayed ). Any idea ? Thank you,
upvote count: 1
type: Question
has title: AngularJS custom window while changing page
tagged with: javascript
has answer: http://stackoverflow.com/a/28539598
downvote count: 0
answer count: 1
tagged with: onbeforeunload
favorite count: 0

http://stackoverflow.com/comment/45395000
has text: @Suomi Oh, that's a little odd. I looked through your other question, are you sure you want to be calling masonry on `#pins` and not `#masonry-container`? If you are dealing with images you might need to look into imagesLoaded http://masonry.desandro.com/appendix.html I remember them breaking my masonry layout
type: Comment
comment on: http://stackoverflow.com/a/28540546
score: 0
type: AnswerComment

graphics
tag name: graphics
tags question: http://stackoverflow.com/q/28515726
tags question: http://stackoverflow.com/q/28505750
type: Tag
tags question: http://stackoverflow.com/q/28437451

http://stackoverflow.com/comment/45393322
type: AnswerComment
comment on: http://stackoverflow.com/a/28536689
has text: Ya thnx. it works my expectations are like this https://jsfiddle.net/RaghuM/1dt6oyr1/ I've used validateForm function onblur of each field.
type: Comment
score: 0

http://stackoverflow.com/a/28553750
score: 1
answers question: http://stackoverflow.com/q/28529858
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
has body: SOLVED (with my blacked eyes!). So as @JFK said, onclick='post_value(n)' is passing form index not the form's name. So i try it out with adding several char in the form's name like this : &lt;form name="form&lt;?php echo $no ?&gt;" method='post' action=""&gt; Then in the button is like this one : onclick='post_value("form&lt;?php echo $no ?&gt;")' And on the JavaScript : function post_value(NamaForm){ parent.setSelectedUser(document.forms[NamaForm]["NO_INDUK"].value); parent.$.fancybox.close(); } That is. Sorry for Indonesian language may confuse you. :)
accepted answer of: http://stackoverflow.com/q/28529858

http://stackoverflow.com/q/28453925
has title: Convert Excel array formula into PHP or Javascript
tagged with: php
tagged with: excel
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45235251
has body: I want to convert {=(PRODUCT(1 + A2:A85) )} into PHP or JavaScript. I've searched google for "array excel formulas", but I could not find right result. How do I convert {=(PRODUCT(1 + A2:A85) )}? I have array for the A2:A85 range. My array is like this: var abc_array={2,3,4,5,67,7,8.........}.
type: Question
has answer: http://stackoverflow.com/a/28454181
accepted answer: http://stackoverflow.com/a/28454181
tagged with: arrays
has comment: http://stackoverflow.com/comment/45235093
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/q/28534715
tagged with: performance
has title: Why does filling in a rectangle on a canvas degrade performance slowly?
tagged with: javascript
tagged with: canvas
has body: I'm currently working on a HTML5 game that utilizes a &lt;canvas&gt; element. I'm mysteriously suffering performance degradation in the program as time passes, and was hoping you could perhaps explain the behavior. I have traced the problem to a function that paints the background of each frame. In gist it appears as: function paintBackground() { ctx.rect(0, 0, canvas.width, canvas.height) ctx.fillStyle = "black" ctx.fill() } I've also setup a JSFiddle representing this scenario. The interesting thing about this piece of code is that when measured, it slowly becomes less efficient by order of a few magnitudes. Using the JSFiddle as an example, it begins with the function taking less than a millisecond to complete. About 2-3 seconds later, it is reporting it to now take about 1 millisecond. About 10 seconds in, it's now averaging between 2-3 milliseconds. Within a minute it averages about 6-7 milliseconds, and when I let it run for about 5 minutes, it got as high as 13-14 milliseconds. This is hundreds of percent slower than when it started, with nothing changing! I have tested identical pieces of code in IE 11 and Firefox 35.0.1. Both show the same degradation, but it seems to go downhill slightly faster in Firefox. Now, I'm not someone who fusses over microoptimisations, but my goal is to hit a solid 60FPS, which means I only have ~16.67ms for rendering and updates, and I'm basically gradually losing half of that alone just by rendering the background! I'm also worried that this might be a runaway train, and who knows how bad performance might get; potentially rendering my game unplayable. As far as I can tell, this is the only factor contributing to the performance degradation for two reasons: 1) The rest of the game code is running smoothly, including rendering all of the tiles (375+ tiles per frame) that make up a level, and 2) I experience this behavior even in the JSFiddle provided which includes nothing but that rectangle fill. Any explanations or suggestions…
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28535276
has comment: http://stackoverflow.com/comment/45384117
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
upvote count: 3
type: Question
score: 3

http://stackoverflow.com/q/28437070
upvote count: 0
answer count: 1
has body: I'm trying to make a chatbox using PHP, AJAX and JS. There is no syntax error here, but the browser is not showing desired output. In "message loading please wait," no replacement is happening. chat box Enter your chat name: Your Message: send Loading chatlog please wait... Insert .php code is <?php $uname = $_REQUEST['uname']; $msg = $_REQUEST['msg']; $con = mysql_connect('localhost','root',''); mysql_select_db('chatbox',$con); mysql_query("INSERT INTO msg ('usernmae',msg') Values ('$uname','$msg')"); $result1=mysql_query("SELECT * FROM msg ORDER by id desc"); while($extract= mysql_fetch_array($result1)){ echo $extract['username'].":".$extract['msg']." "; } ?>
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/45204125
tagged with: php
has title: XML code is not working
type: UnansweredQuestion
downvote count: 1
has answer: http://stackoverflow.com/a/28437472
tagged with: javascript
score: -1
type: Question
tagged with: chat

http://stackoverflow.com/q/28508378
has comment: http://stackoverflow.com/comment/45335965
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28509267
has title: Adjusting a div based on the size of the container
has answer: http://stackoverflow.com/a/28508940
type: Question
has comment: http://stackoverflow.com/comment/45336607
has comment: http://stackoverflow.com/comment/45336431
has answer: http://stackoverflow.com/a/28508773
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45336680
has body: I have an HTML video player with Javascript generated controls(with background images of SVG graphics). I'm having an issue using the css calc() function, and need to resize the div's based on the video controls bar. So when the window is expanded/contracted, the controls need to adjust accordingly. The controls div: //Controls Wrapper videoObj.controlsWrapper = document.createElement("div"); videoObj.controlsWrapper.className = "video-controls"; The controls are generated dynamically, so for instance, the play button is generated by this: videoObj.playBtn = document.createElement("button"); videoObj.playBtn.className = "play btn"; So the question is how to adjust the size of the play button(which is a background of an SVG graphic), to a percentage(about 25%) of the height of the controls wrapper div. jsfiddle
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/45336211
tagged with: http://stackoverflow.com/tag/svg

http://stackoverflow.com/comment/121789272
comment on: http://stackoverflow.com/a/28565147
type: AnswerComment
has text: `approval_prompt: "force"` [no longer works](https://github.com/googleapis/oauth2client/issues/453). Instead, use `prompt: "consent"`.
type: Comment
score: 3

http://stackoverflow.com/q/28448826
has answer: http://stackoverflow.com/a/64009030
upvote count: 1
has comment: http://stackoverflow.com/comment/45226207
score: 1
has title: Dropdown does not bind properly on ng-click in AngularJS
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28448857
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45226288
favorite count: 0
has comment: http://stackoverflow.com/comment/45226546
has body: In angularjs, Instead of binding data to dropdown at initially(for eg.: Assigning values through controller $scope.items), I need to bind dropdown at dropdown click event. I tired with ng-click event but it doesn't work properly, consider the code My Problem: when i execute my code Step-1 : First time click the dropdown it does not show the data list. Step-2 : Second time click the dropdown now it shows the data list. am new to angularJS, i don't know how to resolve this simple issue. Select Country
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45226387
type: UnansweredQuestion

http://stackoverflow.com/q/28495849
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28496269
possible better answer: http://stackoverflow.com/a/28496133
has title: Confirmation before running a Grunt task
has answer: http://stackoverflow.com/a/28496133
tagged with: node.js
accepted answer: http://stackoverflow.com/a/28496269
upvote count: 1
has body: I have a task in Gruntfile.js which can potentially wipe my project and I want to protect it with a "Are you sure you want to run this task?" question before running it, just to be safe. Something like: grunt.registerTask('install', 'Run this only once when starting a project!', function() { console.log('Are you sure? Y/n:'); // If yes, continue with task grunt.task.run('copy_install'); }); But I don't know how to make it wait for keyboard input and read the input. Could not find this documented either.
type: Question
type: AnsweredQuestion
score: 1
tagged with: gruntjs
answer count: 2

http://stackoverflow.com/tag/html
tags question: http://stackoverflow.com/q/28583777
tags question: http://stackoverflow.com/q/28460760
tags question: http://stackoverflow.com/q/28556559
tags question: http://stackoverflow.com/q/28467708
tags question: http://stackoverflow.com/q/28484549
tags question: http://stackoverflow.com/q/28561929
tags question: http://stackoverflow.com/q/28445131
tags question: http://stackoverflow.com/q/28535364
tags question: http://stackoverflow.com/q/28566868
tags question: http://stackoverflow.com/q/28570694
tags question: http://stackoverflow.com/q/28535421
tags question: http://stackoverflow.com/q/28566368
tags question: http://stackoverflow.com/q/28514044
tags question: http://stackoverflow.com/q/28485351
tags question: http://stackoverflow.com/q/28512721
tags question: http://stackoverflow.com/q/28557234
tags question: http://stackoverflow.com/q/28444728
tags question: http://stackoverflow.com/q/28582856
tags question: http://stackoverflow.com/q/28501935
tags question: http://stackoverflow.com/q/28461852
tags question: http://stackoverflow.com/q/28466017
tags question: http://stackoverflow.com/q/28450398
tags question: http://stackoverflow.com/q/28451655
tags question: http://stackoverflow.com/q/28588879
tags question: http://stackoverflow.com/q/28442531
tags question: http://stackoverflow.com/q/28458015
tags question: http://stackoverflow.com/q/28444271
tags question: http://stackoverflow.com/q/28468430
tags question: http://stackoverflow.com/q/28520046
tags question: http://stackoverflow.com/q/28587136
tags question: http://stackoverflow.com/q/28579298
tags question: http://stackoverflow.com/q/28585245
tags question: http://stackoverflow.com/q/28573760
tags question: http://stackoverflow.com/q/28559744
tags question: http://stackoverflow.com/q/28567307
tags question: http://stackoverflow.com/q/28574453
tags question: http://stackoverflow.com/q/28579118
tags question: http://stackoverflow.com/q/28452866
tags question: http://stackoverflow.com/q/28478470
tags question: http://stackoverflow.com/q/28563001
tags question: http://stackoverflow.com/q/28558614
tags question: http://stackoverflow.com/q/28530859
tags question: http://stackoverflow.com/q/28465555
tags question: http://stackoverflow.com/q/28503785
tags question: http://stackoverflow.com/q/28501931
tags question: http://stackoverflow.com/q/28527052
tags question: http://stackoverflow.com/q/28462120
tags question: http://stackoverflow.com/q/28553362
tags question: http://stackoverflow.com/q/28450483
tags question: http://stackoverflow.com/q/28483712
tags question: http://stackoverflow.com/q/28467941
tags question: http://stackoverflow.com/q/28438448
tags question: http://stackoverflow.com/q/28548898
tags question: http://stackoverflow.com/q/28455194
tags question: http://stackoverflow.com/q/28556114
tags question: http://stackoverflow.com/q/28497458
tags question: http://stackoverflow.com/q/28546358
tags question: http://stackoverflow.com/q/28454567
tags question: http://stackoverflow.com/q/28542238
tags question: http://stackoverflow.com/q/28437095
tags question: http://stackoverflow.com/q/28507404
tags question: http://stackoverflow.com/q/28528693
tags question: http://stackoverflow.com/q/28578180
tags question: http://stackoverflow.com/q/28502341
tags question: http://stackoverflow.com/q/28461180
tags question: http://stackoverflow.com/q/28580946
tags question: http://stackoverflow.com/q/28488357
tags question: http://stackoverflow.com/q/28533797
tags question: http://stackoverflow.com/q/28527370
tags question: http://stackoverflow.com/q/28486670
tags question: http://stackoverflow.com/q/28582597
tags question: http://stackoverflow.com/q/28525834
tags question: http://stackoverflow.com/q/28460069
tags question: http://stackoverflow.com/q/28449240
tags question: http://stackoverflow.com/q/28477127
tags question: http://stackoverflow.com/q/28569913
tags question: http://stackoverflow.com/q/28446821
tags question: http://stackoverflow.com/q/28556461
tags question: http://stackoverflow.com/q/28501367
tags question: http://stackoverflow.com/q/28589809

http://stackoverflow.com/q/28476389
has answer: http://stackoverflow.com/a/28476669
accepted answer: http://stackoverflow.com/a/28476669
has answer: http://stackoverflow.com/a/28476603
has body: I am using $.Deferred to load mulitiple files: $.when( $.getScript("/assets/libs/swal/sweet-alert.min.js"), $.getScript("/assets/js/jquery.form.js"), $.getScript("/assets/js/jquery.preloader.js"), $.getScript("/assets/js/item_inventory.js"), $.Deferred( function(defer) { $(defer.resolve); }).promise() ).done(function() { }); But when i see in the console, files are not loaded in serial way like sweet-alert.min.js jquery.form.js jquery.preloader.js item_inventory.js Then problem is the last item_inventory.js has some dependency related to jquery.preloader.js so its generate error sometimes, is there any way i can load then in serial without any third-party library?
downvote count: 1
type: Question
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/45275859
score: -1
has answer: http://stackoverflow.com/a/28476578
has answer: http://stackoverflow.com/a/28476468
upvote count: 0
possible better answer: http://stackoverflow.com/a/28476603
tagged with: jquery
favorite count: 0
has title: Load Multiple Javascript files in serial
has answer: http://stackoverflow.com/a/28476794
answer count: 5

http://stackoverflow.com/a/28575696
type: Answer
answers question: http://stackoverflow.com/q/28575628
score: 0
has body: You have a typo in the window.open. There is an = sitting outside the spec parameter: popupWindow = window.open(url,'popUpWindow',='height=700, should be: popupWindow = window.open(url,'popUpWindow','height=700,

http://stackoverflow.com/comment/45327198
comment on: http://stackoverflow.com/a/28503450
type: Comment
score: 0
has text: I will change the answer and work this in for you.
type: AnswerComment

http://stackoverflow.com/q/28563133
has title: Mobile detection failing
has comment: http://stackoverflow.com/comment/45436732
has answer: http://stackoverflow.com/a/28563374
tagged with: php
type: AnsweredQuestion
tagged with: browser-detection
has comment: http://stackoverflow.com/comment/45436697
type: Question
tagged with: mobile
tagged with: javascript
has comment: http://stackoverflow.com/comment/45436761
score: 0
accepted answer: http://stackoverflow.com/a/28563374
has body: I am trying to detect if my user is using a smartphone. I have tried so many different methods but nothing seems to detect if it is a smartphone. The one below does not even echo $_SERVER['HTTP_USER_AGENT']; &lt;?php echo $_SERVER['HTTP_USER_AGENT']; $iphone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone"); $android = strpos($_SERVER['HTTP_USER_AGENT'],"Android"); $palmpre = strpos($_SERVER['HTTP_USER_AGENT'],"webOS"); $berry = strpos($_SERVER['HTTP_USER_AGENT'],"BlackBerry"); $ipod = strpos($_SERVER['HTTP_USER_AGENT'],"iPod"); if ($iphone || $android || $palmpre || $ipod || $berry == true) { header('Location: http://mobile.site.com/'); } ?&gt; This is another script I tried that did not echo anything back. &lt;script type="text/javascript" &gt; if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { &lt;?php echo "I should redirect"; ?&gt; } &lt;/script&gt; I have also tried getting the screen size, but that does not show anything. &lt;script type="text/javascript"&gt; document.write(screen.width); if (screen.width &lt;= 800) { window.location = "http://m.domain.com"; } &lt;/script&gt; I have also tried the very popular php script below, but it also echo's nothing for $detect. &lt;?php require_once 'Mobile_Detect.php'; $detect = new Mobile_Detect; echo $detect; if($detect-&gt;isMobile()) { header('Location: http://mobile.example1.com/'); exit; } ?&gt;
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45436809
answer count: 1

http://stackoverflow.com/comment/45343452
type: Comment
comment on: http://stackoverflow.com/a/28512522
has text: http://www.reddit.com/dev/api#fullnames according to this i should have gotten `15bfi0` for string `aww` .. can you explain it..
type: AnswerComment
score: 0

http://stackoverflow.com/a/28524982
has body: Since you are invoking callback with callback.apply(socket, args); "this" in the callback will be the socket, not the controller. Try var SupportCtrl = function($state, SocketFactory){ var self = this; self.user = "Will" self.customers = ['will','tom']; SocketFactory.on('queue', function(queue){ console.log(queue) self.customers = queue }) }
answers question: http://stackoverflow.com/q/28524822
type: Answer
accepted answer of: http://stackoverflow.com/q/28524822
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45365919
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45365899
upvote count: 2

http://stackoverflow.com/q/28495959
tagged with: http://stackoverflow.com/tag/csv
type: AnsweredQuestion
has body: I want to use some library, that can work with csv format. I've found this But I have a problem with it's require. I do npm install csv then do require csv = require('csv'); When I run my project, I get in terminal follow error: TypeError: Cannot read property 'prototype' of undefined at Object.exports.inherits (util.js:538:43) at Object. (/.../node_modules/csv/node_modules/csv-generate/lib/index.js:122:6) Who does know, what problem is?
has title: Can't require csv lib in node.js
type: Question
has answer: http://stackoverflow.com/a/28496202
score: 0
answer count: 1
tagged with: node.js
accepted answer: http://stackoverflow.com/a/28496202
tagged with: javascript

http://stackoverflow.com/q/28593143
has comment: http://stackoverflow.com/comment/45492851
score: 0
has answer: http://stackoverflow.com/a/28593390
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45492844
tagged with: textarea
has comment: http://stackoverflow.com/comment/45492858
type: Question
has title: use JavaScript to copy and edit rows
answer count: 2
has answer: http://stackoverflow.com/a/28958406
has body: I have two textareas and a button that copy the value of textarea 1 to textarea 2 and I need to add "$" in front of every line in the textarea 2 after copy?

http://stackoverflow.com/a/28538590
score: 0
has body: @Jules for angular $scope.click=function(){ $http.post("http://localhost:3000/hello"+ids+"").success(function(data){ //console.log(data); $scope.load=angular.fromJson(data); }).error(function(){alert("Error"); }); } and node server app.all( '/*', function(req, res, next) { res.setHeader('Access-Control-Allow-Origin', '*'); res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type' ); next(); }); app.post('/hello/:ids', function ( req, res ) { //console.log( "HEADER: ", req.headers ); console.log( "QUERY: ", req.param.ids ); // console.log( "BODY: ", req.body ); var metrics = {someData: "to send back to Angular"}; res.send(metrics); } );
answers question: http://stackoverflow.com/q/28536395
type: Answer
has comment: http://stackoverflow.com/comment/45408094
has comment: http://stackoverflow.com/comment/45492410

http://stackoverflow.com/comment/45462803
has text: Thanks for the pointers, the word new being there twice is a typing mistake(more of a copy paste mistake). I guess I will go with the curl for now as it seems to get the job done.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28575849
type: AnswerComment

http://stackoverflow.com/q/28445516
answer count: 1
has body: I have a function that animates an image turning by the amount specified by the "totalAngle" parameter. The function uses requestAnimFrame to call itself until the animation is done. function clockwise(imageObj, canvas, context, angleTurned, totalAngle) { // only repeat if the angle turned is less than the total angle to be turned if (angleTurned &lt; totalAngle) { // turn context.rotate(totalAngle / 180); // update the angle angleTurned += totalAngle / 180; // clear the previous image context.clearRect(0, 0, canvas.width, canvas.height); // draw the new image context.drawImage(imageObj, -imageWidth / 2, -imageHeight / 2, imageWidth, imageHeight); // request new frame requestAnimFrame(function() { clockwise(imageObj, canvas, context, angleTurned, totalAngle); }); } } If I call the function several times elsewhere, the animations get blended together, rather than completing the first one before the next one begins. How do I get it to complete the first call before the next one begins?
tagged with: canvas
has answer: http://stackoverflow.com/a/28445765
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28445765
type: AnsweredQuestion
has title: HTML Canvas - Make animations happen one at a time, rather than multiple at the same time
type: Question
tagged with: animation
score: 0

http://stackoverflow.com/comment/45440992
type: Comment
comment on: http://stackoverflow.com/q/28564334
score: 0
has text: @AlvaroMontoro - I debugged it, but I don't understand why it increases size at every step. It's like whole `body` originally had 500, 400 size and then on next step started to have 507, 407 size, and etc, and etc and etc, but the calculations of new element sizes are correct. The purpose of the code to fix element size that for some "only God know reason" has `minimal to fit inner content` size, while it's size set to some percents.
type: QuestionComment

dom
tags question: http://stackoverflow.com/q/28513827
tags question: http://stackoverflow.com/q/28490863
tags question: http://stackoverflow.com/q/28592241
type: Tag
tags question: http://stackoverflow.com/q/28518190
tags question: http://stackoverflow.com/q/28473616
tags question: http://stackoverflow.com/q/28567351
tags question: http://stackoverflow.com/q/28545793
tags question: http://stackoverflow.com/q/28465905
tags question: http://stackoverflow.com/q/28573786
tags question: http://stackoverflow.com/q/28511627
tags question: http://stackoverflow.com/q/28590441
tags question: http://stackoverflow.com/q/28474754
tags question: http://stackoverflow.com/q/28510268
tags question: http://stackoverflow.com/q/28453196
tags question: http://stackoverflow.com/q/28437468
tags question: http://stackoverflow.com/q/28531487
tags question: http://stackoverflow.com/q/28560445
tags question: http://stackoverflow.com/q/28501935
tags question: http://stackoverflow.com/q/28468430
tags question: http://stackoverflow.com/q/28481826
tags question: http://stackoverflow.com/q/28534943
tags question: http://stackoverflow.com/q/28480982
tags question: http://stackoverflow.com/q/28555173
tags question: http://stackoverflow.com/q/28583253
tags question: http://stackoverflow.com/q/28573329
tags question: http://stackoverflow.com/q/28475202
tags question: http://stackoverflow.com/q/28550944
tags question: http://stackoverflow.com/q/28538294
tags question: http://stackoverflow.com/q/28542345
tags question: http://stackoverflow.com/q/28538570
tags question: http://stackoverflow.com/q/28504011
tags question: http://stackoverflow.com/q/28533661
tags question: http://stackoverflow.com/q/28522091
tags question: http://stackoverflow.com/q/28532626
tags question: http://stackoverflow.com/q/28517771
tags question: http://stackoverflow.com/q/28501924
tags question: http://stackoverflow.com/q/28464198
tags question: http://stackoverflow.com/q/28495757
tags question: http://stackoverflow.com/q/28443827
tag name: dom
tags question: http://stackoverflow.com/q/28589809
tags question: http://stackoverflow.com/q/28537427
tags question: http://stackoverflow.com/q/28579347
tags question: http://stackoverflow.com/q/28528729
tags question: http://stackoverflow.com/q/28487226
tags question: http://stackoverflow.com/q/28540797
tags question: http://stackoverflow.com/q/28447052
tags question: http://stackoverflow.com/q/28584915
tags question: http://stackoverflow.com/q/28566559

http://stackoverflow.com/q/28531064
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28531199
type: AnsweredQuestion
has title: Why jshint alerts Read only on lastSelectedRow
has body: Code below pasted to jshint.com site causes error Read only at line lastSelectedRow = 1; Why this error occurs and how to fix it? jslint does not thow this error. /*global lastSelectedRow */ function main() { lastSelectedRow = 1; return 'Hello, World!'; } main();
tagged with: jshint
type: Question
tagged with: jslint
answer count: 1
has answer: http://stackoverflow.com/a/28531199

http://stackoverflow.com/comment/45252551
score: 0
type: QuestionComment
type: Comment
has text: @Brett, are you referring to why an example is needed? To prevent things like XY questions. To better understand this question. For example, the factory function runs when it is being injected and it runs only once. The most trivial thing to do would be to set a variable there.
comment on: http://stackoverflow.com/q/28462955

http://stackoverflow.com/comment/62784324
comment on: http://stackoverflow.com/a/28677106
has text: Awesome, thank you @mattpolicastro for the trouble, I will have a look :)
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45273829
comment on: http://stackoverflow.com/q/28474701
has text: thanks for this info, SignalR may probably what i need, i will do the research about it.
score: 0
type: Comment
type: QuestionComment

twitter-bootstrap
tags question: http://stackoverflow.com/q/28592797
tags question: http://stackoverflow.com/q/28463188
tags question: http://stackoverflow.com/q/28467847
tags question: http://stackoverflow.com/q/28474857
tags question: http://stackoverflow.com/q/28570013
tags question: http://stackoverflow.com/q/28470554
tags question: http://stackoverflow.com/q/28465334
tag name: twitter-bootstrap
tags question: http://stackoverflow.com/q/28445942
tags question: http://stackoverflow.com/q/28468918
tags question: http://stackoverflow.com/q/28550811
tags question: http://stackoverflow.com/q/28461181
tags question: http://stackoverflow.com/q/28504350
tags question: http://stackoverflow.com/q/28563317
tags question: http://stackoverflow.com/q/28527135
tags question: http://stackoverflow.com/q/28529361
tags question: http://stackoverflow.com/q/28465442
tags question: http://stackoverflow.com/q/28575972
tags question: http://stackoverflow.com/q/28525155
tags question: http://stackoverflow.com/q/28488235
tags question: http://stackoverflow.com/q/28489798
tags question: http://stackoverflow.com/q/28564581
tags question: http://stackoverflow.com/q/28509387
tags question: http://stackoverflow.com/q/28561004
tags question: http://stackoverflow.com/q/28567160
tags question: http://stackoverflow.com/q/28558201
tags question: http://stackoverflow.com/q/28447837
tags question: http://stackoverflow.com/q/28480410
tags question: http://stackoverflow.com/q/28487654
tags question: http://stackoverflow.com/q/28539610
tags question: http://stackoverflow.com/q/28592790
tags question: http://stackoverflow.com/q/28490322
tags question: http://stackoverflow.com/q/28446398
tags question: http://stackoverflow.com/q/28516905
tags question: http://stackoverflow.com/q/28465157
tags question: http://stackoverflow.com/q/28517630
tags question: http://stackoverflow.com/q/28589373
tags question: http://stackoverflow.com/q/28507344
tags question: http://stackoverflow.com/q/28472544
tags question: http://stackoverflow.com/q/28516263
tags question: http://stackoverflow.com/q/28581630
tags question: http://stackoverflow.com/q/28448160
tags question: http://stackoverflow.com/q/28475792
tags question: http://stackoverflow.com/q/28592303
tags question: http://stackoverflow.com/q/28519123
tags question: http://stackoverflow.com/q/28467006
tags question: http://stackoverflow.com/q/28441798
tags question: http://stackoverflow.com/q/28530151
tags question: http://stackoverflow.com/q/28577487
tags question: http://stackoverflow.com/q/28543144
tags question: http://stackoverflow.com/q/28587356
tags question: http://stackoverflow.com/q/28501562
tags question: http://stackoverflow.com/q/28516746
tags question: http://stackoverflow.com/q/28590770
tags question: http://stackoverflow.com/q/28527171
tags question: http://stackoverflow.com/q/28585405
type: Tag
tags question: http://stackoverflow.com/q/28573965
tags question: http://stackoverflow.com/q/28573084
tags question: http://stackoverflow.com/q/28495266
tags question: http://stackoverflow.com/q/28449801
tags question: http://stackoverflow.com/q/28496373
tags question: http://stackoverflow.com/q/28447524
tags question: http://stackoverflow.com/q/28469454
tags question: http://stackoverflow.com/q/28532287
tags question: http://stackoverflow.com/q/28554349
tags question: http://stackoverflow.com/q/28439396
tags question: http://stackoverflow.com/q/28447496
tags question: http://stackoverflow.com/q/28506610
tags question: http://stackoverflow.com/q/28470078
tags question: http://stackoverflow.com/q/28547102
tags question: http://stackoverflow.com/q/28472815
tags question: http://stackoverflow.com/q/28446140
tags question: http://stackoverflow.com/q/28489025
tags question: http://stackoverflow.com/q/28525014
tags question: http://stackoverflow.com/q/28540175
tags question: http://stackoverflow.com/q/28475972
tags question: http://stackoverflow.com/q/28479180
tags question: http://stackoverflow.com/q/28470317
tags question: http://stackoverflow.com/q/28535482

http://stackoverflow.com/q/28441539
tagged with: firefox
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/77690057
upvote count: 6
has title: Opening TCP socket from Firefox plugin
possible better answer: http://stackoverflow.com/a/77690057
tagged with: tcp
tagged with: sockets
score: 6
has answer: http://stackoverflow.com/a/28441705
tagged with: plugins
has body: I'm afraid I'm having trouble opening a socket from my Firefox plugin. My goal is to have my plugin listen on the port, and a Python script will send it a short string once in a while to act on. I have checked and no firewalls are running, and if I set netcat to listen on my desired port before launching this plugin, it behaves differently (it will print "opened port!"). Unfortunately I really am trying to have the plugin be the listener/server. //TCPSocket API: https://developer.mozilla.org/en-US/docs/Web/API/TCPSocket //Got me started: http://stackoverflow.com/q/28326301 const {Cu,Cc,Ci} = require("chrome"); var tcpSocket = Cc["@mozilla.org/tcp-socket;1"].createInstance(Ci.nsIDOMTCPSocket); var socket = tcpSocket.open("127.0.0.1", 64515); socket.ondata = function (event) { console.log('port received data!!!'); if (typeof event.data === 'string') { console.log('Got: ' + event.data); } } socket.onopen = function() {console.log('opened port!');} socket.onerror = function(event) { console.log('port error!'); console.log(event.data) } socket.onclose = function() {console.log('port closed!');} socket.ondrain = function() {console.log('port drained!');} Right now though the immediate output is: console.log: my-addon: port error! console.log: my-addon: DOMError {} console.log: my-addon: port closed! where "DOMError" is the error received by socket.onerror. I'm unsure whether this is my lack of understanding sockets or if there is something special to do with Firefox addons and permissions when it comes to opening a port.
linked to: http://stackoverflow.com/q/28326301
type: AnsweredQuestion
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/28441705

http://stackoverflow.com/comment/45388168
type: Comment
comment on: http://stackoverflow.com/a/28537010
has text: @computerguy what exactly is the problem? This is the right answer. You just need to add your `+ '/videos'` to the end.
type: AnswerComment
score: 0

http://stackoverflow.com/a/28480390
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/28455464
downvote count: 1
answers question: http://stackoverflow.com/q/28455464
has body: This is the exactly problem of my other answer, the asyncronous of gulp/node try to read the file before the file could be created... The easy form is with node (yeah, I'm right :P) fs.readFile('path/to/file.txt', {encoding: 'utf-8', flag: 'rs'}, function(e, data) { if (e) return console.log(e); console.log(data); });
type: AcceptedAnswer
score: 1

http://stackoverflow.com/q/28547297
has answer: http://stackoverflow.com/a/28547502
has comment: http://stackoverflow.com/comment/45408059
linked to: http://stackoverflow.com/q/16344354
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I've been working on this html code that allows an image to blink as well as auto resize to the browser size. I have the code working that will allow it to blink: And the code that will resize: But, I can't seem to get them working together. Any help to get these to work together (or using alternative method) would greatly appreciated.
type: Question
answer count: 1
has title: Make an image blink and auto resize to browser
score: 0

http://stackoverflow.com/comment/45443356
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28563879
type: Comment
has text: lambdas are `Proc`s. non-lambda `Proc`s behave like blocks ("fuzzy" parameter binding semantics and `return` returns from the enclosing method), lambdas behave like methods (strict parameter binding semantics and `return` returns from the lambda), but they are both `Proc`s, distinguished only by the return value of calling `Proc#lambda?` on them.

http://stackoverflow.com/a/28525043
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/45366278
has body: I'm not sure what you're expecting to. The width value is not changing because the zooming, it would be weird to do so. When your zooming in Firefox, the same value (e.g. 100px) is just displayed bigger or smaller, depends by the scale factor, but if you query the element you'll get the same size: It's like high density display. In fact, you can actually use devicePixelRatio to get the scale factor.
score: 1
answers question: http://stackoverflow.com/q/28524494
has comment: http://stackoverflow.com/comment/45366176
has comment: http://stackoverflow.com/comment/45366074
upvote count: 1

http://stackoverflow.com/q/28500987
has body: Thought I would open this question to the javascript community. Does anyone know if its possible to combine CKEditor into 1 file? I want to try and integrate it in one of my desktop applications which uses a web viewer - I can execute one flat file in my web viewer internally in my application otherwise I'll have to reference to the CDN which I'm hoping to avoid. I want to develop an app that does not require external web service. Performance should not be an issue as the file would be in my application running locally - I would include all the licenses/readme etc etc. Is there a tool out there that can help me to achieve this, and has anyone done it or is not possible due to the architecture - the way CKEditor has been written? Thanks
type: Question
has answer: http://stackoverflow.com/a/28501864
accepted answer: http://stackoverflow.com/a/28501864
tagged with: javascript
tagged with: ckeditor
answer count: 1
downvote count: 0
favorite count: 0
has title: Combine CKEditor into 1 file
type: AnsweredQuestion
score: 3
linked to: http://stackoverflow.com/q/15301099
upvote count: 3

http://stackoverflow.com/a/28603938
type: Answer
downvote count: 0
score: 1
has body: Here is woking example of your code: Plunk Selecting is done by: var second_element = this.shadowRoot.querySelector('#second_element'); More explanation on Automatic node finding here.
answers question: http://stackoverflow.com/q/28587327
accepted answer of: http://stackoverflow.com/q/28587327
has comment: http://stackoverflow.com/comment/45542208
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45534540

http://stackoverflow.com/q/28456431
linked to: http://stackoverflow.com/q/111102
answer count: 1
has comment: http://stackoverflow.com/comment/45239477
has title: Lexical environment constructor function
type: AnsweredQuestion
has body: Here are the usual constructor function. My question is, how she will lexical environment when calling through new? Namely this.method he gets there or not? function Func() { var a = 10; this.method = function() { // code }; function f() { } } Right? Lexical environment = { a: undifined, f: function } Scope -&gt; window
has comment: http://stackoverflow.com/comment/45240942
has comment: http://stackoverflow.com/comment/45239706
has comment: http://stackoverflow.com/comment/45242651
has comment: http://stackoverflow.com/comment/45239853
accepted answer: http://stackoverflow.com/a/28458396
type: Question
has comment: http://stackoverflow.com/comment/45242885
tagged with: javascript
has answer: http://stackoverflow.com/a/28458396
score: 0

http://stackoverflow.com/a/28465808
answers question: http://stackoverflow.com/q/28465775
has body: You take care of hiding rows, but you never show them back. This is why your table sooner or later will have all rows invisible.
has comment: http://stackoverflow.com/comment/45257638
upvote count: 2
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/q/28523267
has answer: http://stackoverflow.com/a/28548173
answer count: 2
tagged with: sweet.js
has title: sweet.js how to match function statement with infix
tagged with: javascript
score: 0
has body: I can't seem to get a match let function = macro { case infix {$name:ident $[=] | _ ($params ...) { $body ...} } =&gt; { return #{ $name = function $name ($params ...) { console.log($name.name); $body ... } } } } var add = function (x, y){ return x+y; } SyntaxError: [macro] Macro `function` could not be matched with `() {} ...` 11: var add = function (x, y){ ^ Macro works fine without var. I'm aware that 1 non-expr term is allowed in expression position but var $name:ident $[=] doesn't work. If this is impossible with infix is there another way to match a function statement and capture the name of the function?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28531795
type: Question

http://stackoverflow.com/q/28591324
downvote count: 1
tagged with: selenium-webdriver
type: AnsweredQuestion
tagged with: selenium
has title: How to click on a flash object
type: Question
score: 0
has body: I need to click on a flash object. This is my javascript code below, currently, which is not working. I am not too familiar with js, hence, please bear with me. JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript("document.querySelectorAll('a[title='Banner - Flash']').click();"); A screenshot of the page html:
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/28591881
accepted answer: http://stackoverflow.com/a/28591881
favorite count: 0
has comment: http://stackoverflow.com/comment/45491612
possible better answer: http://stackoverflow.com/a/28591589
upvote count: 1
has answer: http://stackoverflow.com/a/28591589

http://stackoverflow.com/comment/45371727
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28521807

http://stackoverflow.com/a/28542947
answers question: http://stackoverflow.com/q/28542849
score: 1
downvote count: 0
has body: with this ar["index"].push("data1"); javascript tries to push "data1" into an array. The problem is that it expects an array, which ar["index"] is not as it is undefined. You first need to initialize it ar["index"] = []; ar["index"].push("data1"); push() documentation here
type: AcceptedAnswer
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28542849

http://stackoverflow.com/q/28478806
has body: If I have this: My Title Link I know that I will have an external link to http://mylink.com in the caption but I dont want that. I want an external link on the thumbnail. How do I acomplish that? Am I wrong to think that I must add something to the u=prototype div?
tagged with: jssor
type: Question
tagged with: javascript
score: 0
has title: JSSOR - External links on thumbnails
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28495103
type: UnansweredQuestion

http://stackoverflow.com/comment/45412851
type: QuestionComment
comment on: http://stackoverflow.com/q/28549819
has text: It's your .accordian-content.default CSS rule, it's killing you. The click, toggles it shut, but then the CSS overrules what jQuery did, causing it to be displayed again. So just remove the !important, and you should be good.
score: 0
type: Comment

http://stackoverflow.com/q/28562846
tagged with: html2canvas
has comment: http://stackoverflow.com/comment/45436705
has body: I Have a page where i am getting dynamically generated html part. $viewData['html'] = '&lt;div class="row martop26"&gt;&lt;div class="col-xs-12 co.... &lt;/div&gt;'; $this-&gt;load-&gt;view('advertise/advertise_preview',$viewData); This "Advertise_preview" is a html page where i get that html part separately. $viewData['html'] is huge html portion. almost like an another page which is stored in a variable. Now what i want to do with is that i want to convert that html portion on client side into image and without storing it into the data base, i want to show that generated image in a box. On that box, i am applying jquery.zoom.js to zoom the image on hover. I have already used html2canvas. that doesn't suffice my requirement. The problems with html2canvas are below: I have to hide html part that i want to have screenshot of. where html2canvas doesn't accept hidden part to convert it to canvas Second problem is that it generate image with either with black background or transparent. If above both problem are solved then my work is done there. Else, please suggest me some other JS or any other conversion idea. My code for converting from html to canvas is below: $(document).ready(function() { var hello = $("#none"); // Whole html part in hello variable html2canvas(hello, { onrendered: function(canvas) { // hello.hide(); // document.body.appendChild(canvas); // var cc = canvas.getImageData(); // var can = document.getElementById('canvas1'); /*var ctx = canvas.getContext('2d'); ctx.fillRect(50,50,50,50);*/ var img = new Image(); img.src = canvas.toDataURL(); // document.body.appendChild(img); // var jpegUrl = canvas.toDataURL("image/jpeg"); // console.log(jpegUrl); $("#zoom").children().attr({ src: img.src }); $('.zoom').zoom(); } }); }); You guys have always been helpful to me. So Thank you so much.
favorite count: 0
has comment: http://stackoverflow.com/comment/45437148
answer count: 0
type: UnansweredQuestion
tagged with: codeigniter
upvote count: 1
tagged with: php
tagged with: webpage-screenshot
has title: Generate image from dynamically created html from controller to view side, HOW?
score: 1
has comment: http://stackoverflow.com/comment/45436600
has comment: http://stackoverflow.com/comment/45438045
type: Question
has comment: http://stackoverflow.com/comment/45436876
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/28540424
answers question: http://stackoverflow.com/q/28539479
has comment: http://stackoverflow.com/comment/60030026
has comment: http://stackoverflow.com/comment/45396437
has body: Check your cordova js loading properly? is the path for cordova js is proper? give path like this in your index.html: &lt;script type="text/javascript" src="cordova.js"&gt;
has comment: http://stackoverflow.com/comment/45439788
score: 0
has comment: http://stackoverflow.com/comment/45396477
has comment: http://stackoverflow.com/comment/45396792
type: Answer
has comment: http://stackoverflow.com/comment/45395541

http://stackoverflow.com/a/28520302
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28520121
answers question: http://stackoverflow.com/q/28520121
has body: The easiest would be to simply call ShowPopup('XXX'): page.evaluate(function(){ ShowPopup('XXX'); }); setTimeout(function(){ // do something with it }, 1000); You could also click the link with a specific attribute CSS selector a[onclick*="XXX"]. The [attribute*=value] selector matches the element where the attribute contains the value anywhere.
score: 0

http://stackoverflow.com/a/28576175
score: 2
upvote count: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45480484
accepted answer of: http://stackoverflow.com/q/28575949
has comment: http://stackoverflow.com/comment/45480518
has body: Modern JS would be: function filter(array1, array2) { // to filter array1 based on array2 return array1.filter(function(elt) { // retain an elt in array1 var groups = elt.groups; // if its groups property return groups.length === array2.length &amp;&amp; // has the same length as array2 groups.every(function(e) { // and every element in it return array2.indexOf(e) &gt; -1; // is found in array2 }); }); } var array1 = [ {"name":"a","groups":["xxx","yyy"]}, {"name":"abc","groups":["xxx","yyy"]}, {"name":"abcd","groups":["zzz","xxx","yyy"]} ]; var array2 = ["xxx","yyy"]; document.writeln(JSON.stringify(filter(array1, array2)));
answers question: http://stackoverflow.com/q/28575949
type: Answer

http://stackoverflow.com/a/28582865
score: 0
has comment: http://stackoverflow.com/comment/45473786
has body: need to prevent default, otherwise browser immediately navigates away function s(event) { var a=document.getElementById('txt').value; var url= 'http://localhost:9737/RestServiceImpl.svc/xml/'+a; window.location = url; event.preventDefault(); } alternatively you could return false; from function s()
has comment: http://stackoverflow.com/comment/45475226
has comment: http://stackoverflow.com/comment/45474190
has comment: http://stackoverflow.com/comment/45473918
type: Answer
has comment: http://stackoverflow.com/comment/45474473
has comment: http://stackoverflow.com/comment/45474280
has comment: http://stackoverflow.com/comment/45474685
has comment: http://stackoverflow.com/comment/45474364
answers question: http://stackoverflow.com/q/28582122
has comment: http://stackoverflow.com/comment/45475136
has comment: http://stackoverflow.com/comment/45473620

http://stackoverflow.com/a/28474203
score: 1
has comment: http://stackoverflow.com/comment/45274575
upvote count: 1
answers question: http://stackoverflow.com/q/28472095
type: AcceptedAnswer
has body: Friends ONLY show up if they authorized your App too, that´s very important to know. But my guess is that you forgot to ask for the user_friends permission in the login. I don´t see it in the scope. Btw, you should also use the latest code for the JS SDK: https://developers.facebook.com/docs/javascript/quickstart/v2.2
accepted answer of: http://stackoverflow.com/q/28472095
type: Answer
downvote count: 0

http://stackoverflow.com/q/28437913
downvote count: 1
has comment: http://stackoverflow.com/comment/46007533
upvote count: 3
has comment: http://stackoverflow.com/comment/45997767
has comment: http://stackoverflow.com/comment/45953200
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/45953548
tagged with: javascript
has title: HTML5 Synchronise File System With Backend
tagged with: html5-filesystem
favorite count: 0
score: 2
has body: Actually I have to synchronise my local File System (Browser FS) with the server one each time I connect to the app: Below is the root folder structure on the server that I get as a JSON Object: { "rootFolder":{ "childrens":[ { "path":"/RTW", "name":"RTW", "type":"DIR", "updateDate": "01/01/2015", "childrens":[ { "path":"/RTW/rtw.pdf", "name":"rtw", "type":"PDF", "updateDate":"02/01/2015" } ] }, { "path":"/Silk", "name":"Silk", "type":"DIR", "updateDate": "01/02/2015", "childrens":[ { "name":"silk1", "path":"/Silk/silk1.pdf", "type":"PDF", "updateDate":"02/02/2015" }, { "path":"/Silk/silk2.pdf", "name":"silk2", "type":"PDF", "updateDate":"03/02/2015" } ] }, { "path":"/Leather", "name":"Leather", "type":"DIR", "updateDate": "01/03/2015", "childrens":[ { "path":"/Leather/leather1.pdf", "name":"leather1", "type":"PDF", "updateDate":"02/03/2015" }, { "path":"/Leather/leather2.pdf", "name":"leather2", "type":"PDF", "updateDate":"03/03/2015" }, { "path":"/Leather/leather3.pdf", "name":"leather3", "type":"PDF", "updateDate":"04/03/2015" } ] }, { "path":"/Soie", "name":"Soie", "type":"DIR", "updateDate": "0104/2015", "childrens":[ { "path":"/Soie/SoieSubdirectory", "name":"SoieSubdirectory", "type":"DIR", "updateDate":"02/04/2015", "childrens":[ { "path":"/Soie/soie.pdf", "name":"soie", "type":"PDF", "updateDate":"02/04/2015" } ] } ] } ] }, "baseUrl":"https://int-myhpad-deu.atlas.hermes/Documents/FFR/180" } I have to compare the local file system structure with the root structure given by the JSON Object, Delete extra files or directories from the FS browser. If the file or directory is already on the file system, I have to compare the corresponding updateDate to decide if I download the folder or file again. Thank you for your help in Advance.
has answer: http://stackoverflow.com/a/28899037
type: UnansweredQuestion

registration
tags question: http://stackoverflow.com/q/28556757
type: Tag
tag name: registration

http://stackoverflow.com/q/28469552
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28481829
type: Question
tagged with: ecmascript-6
score: 0
tagged with: javascript
has title: Creating a method that calls a promise OR completes an action quickly
tagged with: promise
has comment: http://stackoverflow.com/comment/45275109
answer count: 3
has answer: http://stackoverflow.com/a/28475587
has body: I'm creating an method that takes on the following form: login() { var token = this.cookieManager.getCookie("token"); if(!token) { client.post(url, data).then(response =&gt; { this.accessToken = response.content; }); } else { this.accessToken = token; } } The problem I can see right away is that the !token path could take awhile and so really my login method should return a promise. The question is what to do about the else path? I could create and return a promise but this promise wouldn't have any actual return value other then a hardcoded 'success'. This seems odd so is there another option for handling this scenario?
has answer: http://stackoverflow.com/a/28469672

http://stackoverflow.com/q/28521993
has answer: http://stackoverflow.com/a/28524641
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28522672
has comment: http://stackoverflow.com/comment/45365147
has comment: http://stackoverflow.com/comment/45360964
has answer: http://stackoverflow.com/a/28522672
accepted answer: http://stackoverflow.com/a/28524641
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45361604
has comment: http://stackoverflow.com/comment/45360693
has comment: http://stackoverflow.com/comment/45361737
has title: javascript increment var not working
type: Question
has comment: http://stackoverflow.com/comment/45360711
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45360869
linked to: http://stackoverflow.com/q/6537323
has body: i have this following script : $(function() { var no_of_file = {{$image_counter}}; $('#remove-file').click(function() { no_of_file--; }); if (no_of_file >= '5'){ $("#dv1").hide(); $("#imageLabel").hide(); }else{ /* Append More Input Files */ $('#anc_add_more').click(function() { no_of_file++; // alert(no_of_file); if(no_of_file < {{$role_pic_limit}}) { $('#spn_inputs').append(' Remove '); } else{ alert("You can upload only {{$role_pic_limit}} images"); } }); } }); When i click "Add more file" i append more input and add +1 to no_of_file,my problem is when i try press Remove , it's should down -1 to no_of_file var , why it's not down increment ? EDIT 15/02: $(function() { var no_of_file = {{$image_counter}}; if (no_of_file >= '5'){ $("#dv1").hide(); $("#imageLabel").hide(); }else{ /* Append More Input Files */ $('#anc_add_more').click(function() { no_of_file++; // alert(no_of_file); if(no_of_file < {{$role_pic_limit}}) { $('#spn_inputs').append(' Remove '); } else{ alert("You can upload only {{$role_pic_limit}} images"); } }); $(document).on('click', '#remove-file,.anc_delete_more', function() { no_of_file--; }); } }); This is now working , but decrease is not perfect is like that : Click add more file +1 Click add more file +1 Click add more file +1 Click remove more file -1 Click remove more file nothing no decrease Click remove more file nothing no decrease jsfiddle: https://jsfiddle.net/dgh3ndpm/2/ please view jsfiddle i have uploaded what i am using , and you can see clearly the issue , press add more 5 times , then press remove and then press add more again. thanks a lot You can see how it's work not that good why ?
has comment: http://stackoverflow.com/comment/45360747

http://stackoverflow.com/a/28546827
type: AcceptedAnswer
has body: scaleFontColor is used to change the color of the labels. Instead of putting it in your datasets you should add it as a parameter in your function, like this: window.myLine = new Chart(ctx).Line(lineChartData, { responsive: true, scaleFontColor: "#FFFFFF" } });
upvote count: 8
type: Answer
answers question: http://stackoverflow.com/q/28546677
accepted answer of: http://stackoverflow.com/q/28546677
downvote count: 1
has comment: http://stackoverflow.com/comment/63673696
score: 7
has comment: http://stackoverflow.com/comment/45406878

http://stackoverflow.com/a/44651675
type: Answer
has body: You can use ui-router filters in template. https://github.com/angular-ui/ui-router/wiki/Quick-Reference#filters-1 In your case: ng-class="{ active: 'user' | includedByState }"
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28580827

http://stackoverflow.com/comment/45314623
comment on: http://stackoverflow.com/q/28497236
type: QuestionComment
type: Comment
score: 0
has text: @DemoUser it is not same always. I checked it in page view source. it is different in `JS function` but not working in `button onclick` so not displaying in `strPwd` `textbox`.

http://stackoverflow.com/q/28525189
linked to: http://stackoverflow.com/q/18490026
has title: twitter widget only working in the first loading , then fails
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45366426
has comment: http://stackoverflow.com/comment/45366867
tagged with: twitter
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28525641
has comment: http://stackoverflow.com/comment/45366776
has body: I have a web application which is developed using the Play Framework. There I have used Ajax to load most of the view html pages to a div called 'container' . $( "#container" ).load("/contactUs"); // contactUs is the page which contains the widget I have this html page which includes the widget for my twitter feed. Tweets by @@XXXX When I click that page to load to the container it will load and the twitter feed will display correctly. then HTML would be But after I load another html page to that same container div and then again if I load the twitter page to the same div it wont render properly. ex : first call $( "#container" ).load("/contactUs"); // working properly then call $( "#container" ).load("/home"); and then again $( "#container" ).load("/contactUs"); // not working properly It still shows Tweets by @@XXXX Not the coverted a tag to an Iframe. Why is this happening ? EDIT My contactUS page is like below Tweets by @@XXXX EDIT 2 I solved this issue using Mouser's solution So now my main page is more like below. and my contactUS page is like, Tweets by @@XXXX
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/45366952
upvote count: 2
has comment: http://stackoverflow.com/comment/45366957
linked to: http://stackoverflow.com/q/14010188
accepted answer: http://stackoverflow.com/a/28525641
tagged with: css
has comment: http://stackoverflow.com/comment/45366945

http://stackoverflow.com/q/28543489
tagged with: css-transforms
score: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45400480
possible better answer: http://stackoverflow.com/a/69818593
answer count: 3
has answer: http://stackoverflow.com/a/28543716
has answer: http://stackoverflow.com/a/69818593
has comment: http://stackoverflow.com/comment/45400447
favorite count: 0
has answer: http://stackoverflow.com/a/28544659
downvote count: 2
tagged with: css
type: AnsweredQuestion
has title: Is it possible to skew HTML element by a number of pixels using CSS transform?
accepted answer: http://stackoverflow.com/a/28544659
type: Question
upvote count: 4
has body: My problem is: there's a block containing variable number of HTML elements. Something like this... &lt;ul class="list"&gt; &lt;li class="item"&gt;...&lt;/li&gt; &lt;li class="item"&gt;...&lt;/li&gt; &lt;li class="item"&gt;...&lt;/li&gt; &lt;/ul&gt; This block must have a skew on the right side (the content must not be skewed). The horizontal size of this skew must be fixed. So adding CSS rules like... .list { position: relative; background: #A0A0FF; } .list:after { content: " "; display: block; position: absolute; top: 0; bottom: 0; right: -10px; width: 20px; transform: skewX(-15deg); background: #A0A0FF; } ...won't do because in this case the skew will have variable horizontal size depending on the number of items in the list. The only solution that comes to my mind is to calculate the number of degrees in js. But this is kinda meh. So my question is: is it possible to somehow skew an element by a number of pixels instead of degrees/radians using CSS?
has comment: http://stackoverflow.com/comment/45400748

http://stackoverflow.com/a/28510435
has body: Store bought count as private variable // store reference to your function returned from self invoking anonymous function enclosure (to prevent internal vairables from leaking into global scope) var buyItem = (function(){ // store local reference to number of items already bought var bought = 0; // return the function to be assigned to buyItem return function (name) { // if we reached the maximum, don't buy any more - just log a warning and return if(bought &gt;= 2){ console.log("your hands are full!!"); return; } else { // otherwise increment the bought counter bought++; }; if (name === "Axe") { console.log("Axe"); } else if (name === "Sword") { console.log("Sword"); } else if (name === "Dagger") { console.log("Dagger"); } }; })(); // try it out buyItem('Dagger'); buyItem('Sword'); buyItem('Axe');
downvote count: 1
answers question: http://stackoverflow.com/q/28510252
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28510252
score: 0
type: Answer
upvote count: 1

http://stackoverflow.com/a/28459991
has comment: http://stackoverflow.com/comment/45247856
has comment: http://stackoverflow.com/comment/45247118
has body: A downfall is that all code (templates, core, ...) are downloaded upon first page load. An upside is that navigating after the first page load is (almost) instant.
answers question: http://stackoverflow.com/q/28459382
has comment: http://stackoverflow.com/comment/45247573
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45255588
has comment: http://stackoverflow.com/comment/45250066

http://stackoverflow.com/comment/45331095
type: AnswerComment
has text: And to answer fully your question, I also use the DIV .camp in order to append here the results resulting from my first jQuery call.
comment on: http://stackoverflow.com/a/28505665
type: Comment
score: 0

http://stackoverflow.com/a/28587300
has comment: http://stackoverflow.com/comment/45482381
has comment: http://stackoverflow.com/comment/45482239
has comment: http://stackoverflow.com/comment/45482105
has comment: http://stackoverflow.com/comment/45482216
has comment: http://stackoverflow.com/comment/45482276
score: 0
answers question: http://stackoverflow.com/q/28587171
type: Answer
has body: To remove class use removeClass EDITED if($('div[role="toolbar"]').hasClass("ndfHFb-c4YZDc-aSZUA-Wrql6b")){ $('div[role="toolbar"]').removeClass("ndfHFb-c4YZDc-aSZUA-Wrql6b"); } Refer Link Explanation : Grab Div with role toolbar and check if it has class XYZ if yes remove the class from that div.

http://stackoverflow.com/a/28442476
answers question: http://stackoverflow.com/q/28442301
has body: When using the transition shorthand property, the delay is placed at the end. In your code, your transition will last 20s with no delay. If you want it to be delayed by 20s, it should be written like this: transition:all 2s ease-in 20s; EDIT Here is a demo
score: 0
upvote count: 1
downvote count: 1
type: Answer

http://stackoverflow.com/q/28565334
tagged with: jquery
favorite count: 0
tagged with: angularjs
has body: I want to draw a chart from the metronic theme (/admin/pages/scripts/index.js), using angular directive. The problem is I can see the grid but not dots. I can't figure out what is missing angular.module('app').directive('drawChart', function() { return { scope: { chartdata: "=" }, restrict: 'E', template: ' ', link: function (scope, element, attrs) { $.plot($("#graph-holder"), [{ data: scope.chartdata, lines: { fill: 0.6, lineWidth: 0 }, color: ['#f89f9f'] }, { data: scope.chartdata, points: { show: true, fill: true, radius: 5, fillColor: "#f89f9f", lineWidth: 3 }, color: '#fff', shadowSize: 0 }], { xaxis: { tickLength: 0, tickDecimals: 0, mode: "categories", min: 0, font: { lineHeight: 14, style: "normal", variant: "small-caps", color: "#6F7B8A" } }, yaxis: { ticks: 5, tickDecimals: 0, tickColor: "#eee", font: { lineHeight: 14, style: "normal", variant: "small-caps", color: "#6F7B8A" } }, grid: { hoverable: true, clickable: true, tickColor: "#eee", borderColor: "#eee", borderWidth: 1 } }); var previousPoint = null; function showChartTooltip(x, y, xValue, yValue) { $(' ' + yValue + '<\/div>').css({ position: 'absolute', display: 'none', top: y - 40, left: x - 40, border: '0px solid #ccc', padding: '2px 6px', 'background-color': '#fff' }).appendTo("body").fadeIn(200); } $("#graph-holder").bind("plothover", function (event, pos, item) { $("#x").text(pos.x.toFixed(2)); $("#y").text(pos.y.toFixed(2)); if (item) { if (previousPoint != item.dataIndex) { previousPoint = item.dataIndex; $("#tooltip").remove(); var x = item.datapoint[0].toFixed(2), y = item.datapoint[1].toFixed(2); showChartTooltip(item.pageX, item.pageY, item.datapoint[0], item.datapoint[1] + ' visits'); } } else { $("#tooltip").remove(); previousPoint = null; } }); } } }); my html: I have added the following scripts to the page: And there are no errors in the console;
accepted answer: http://stackoverflow.com/a/28568144
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45441992
upvote count: 1
has title: Data is not showing up in flot chart (metronic theme)
type: Question
has answer: http://stackoverflow.com/a/28568144
tagged with: flot
downvote count: 0
answer count: 1
tagged with: javascript
score: 1

http://stackoverflow.com/comment/45626905
has text: Thanks, good information. But, it doesn't help much. I got a non-windows config.h from running `./configure` and I'm including it now with -DHAVE_CONFIG_H but the problem remains the same.
comment on: http://stackoverflow.com/a/28622485
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/45451998
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28570586
has text: Importing jQuery multiple times is always going to be highly risky and fragile. You're now importing another copy of jQuery, and for all we know that might cause similar breakage inside other stuff that Bokeh relies on.
type: QuestionComment

http://stackoverflow.com/comment/45489324
score: 2
has text: possible duplicate of [Access JavaScript property case-insensitively?](http://stackoverflow.com/questions/12484386/access-javascript-property-case-insensitively)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28591356

http://stackoverflow.com/comment/45384288
type: Comment
type: QuestionComment
score: 1
has text: @JudsonTerrell: Thanks for your reply. No, How should I clone canvas element?
comment on: http://stackoverflow.com/q/28534866

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

http://stackoverflow.com/comment/131073182
score: 2
comment on: http://stackoverflow.com/a/28570700
has text: 2022 update. I came here looking for a way to stub a getter for cypress (which uses sinon under the hood). Accepted answer didn't work for me. @PaulRazvanBerg did. Life saver :D
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28568524
has body: This should get you started on your way. There are of course many different ways to set things up, but this should give you the idea. In your app you can setup some objects: $scope.thevals = ['meters','kms']; $scope.values = { meters:{value:undefined,conv:'meters'}, kms:{value:undefined,conv:'km'} }; And then use it in a repeat like this: &lt;div ng-repeat="obj in thevals"&gt; {{obj}} &lt;input type="text" ng-model="values[obj].value" ng-keyup="Speed.Convert(values[obj].conv)"&gt; &lt;/div&gt;
answers question: http://stackoverflow.com/q/28567351
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45512919

http://stackoverflow.com/a/73478424
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/134558655
upvote count: 3
answers question: http://stackoverflow.com/q/28474288
has body: Okay I finally found the easy answer. For iOS what will work is webkitEnterFullscreen(). const docEl = document.getElementById('player') as any; // Remove as any if not using typescript if (!docEl) return; if (docEl.requestFullscreen) docEl.requestFullscreen(); else if (docEl.webkitRequestFullscreen) docEl.webkitRequestFullscreen(); else if (docEl.mozRequestFullScreen) docEl.mozRequestFullScreen(); // Careful to the capital S else if (docEl.msRequestFullscreen) docEl.msRequestFullscreen(); else if (docEl.webkitEnterFullscreen) docEl.webkitEnterFullscreen(); // Magic is here for iOS
has comment: http://stackoverflow.com/comment/134519484
type: Answer

http://stackoverflow.com/a/29483071
has comment: http://stackoverflow.com/comment/47271764
answers question: http://stackoverflow.com/q/28507315
has comment: http://stackoverflow.com/comment/47249542
score: 0
has body: i would like to suggest to check the permission of your "b.php" page. Please make sure the page has "w" permission for all users. this is a chance for not making a "POST" request.
type: Answer
has comment: http://stackoverflow.com/comment/47258974

http://stackoverflow.com/comment/45483833
has text: Well quirks mode issues can be hard to fix, but unfortunately there's no way to get the browser to behave "half way" between quirks mode and "good" mode. A lot of old pages are simply broken, and the only way to really eliminate the problems are to fix the page code.
type: Comment
comment on: http://stackoverflow.com/q/28587238
score: 0
type: QuestionComment

http://stackoverflow.com/q/28484448
tagged with: php
has comment: http://stackoverflow.com/comment/45290872
accepted answer: http://stackoverflow.com/a/28485096
score: 1
has title: How do i get a json string in js from a jquery ajax call?
upvote count: 1
type: Question
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has answer: http://stackoverflow.com/a/28484589
has answer: http://stackoverflow.com/a/28485096
possible better answer: http://stackoverflow.com/a/28484572
answer count: 3
has answer: http://stackoverflow.com/a/28484572
downvote count: 0
has body: Why is the console log: {} I have a in js the following ajax call: $.ajax({ url: '.../models/user.php', type: 'POST', dataType: "json", data: {username: username, password:password, func:func}, success: function(data) { console.log(data); } }); and in my user.php switch ($_POST['func']) { case 'register': $user = new User(); $a = $user-&gt;register($_POST['username'], $_POST['password']); $b = json_encode($a); echo $b; break; } class User { private $username = ''; private $password = ''; Function register($user, $code) { //..database things... if(succes){ $newUser = new User(); $newUser-&gt;username = $user; $newUserInJason = json_encode($newUser); return $newUser; } } } the console log is only {} but I want the User object in JSON. Am i missing something?
tagged with: jquery
favorite count: 0
tagged with: ajax

http://stackoverflow.com/a/28529360
has comment: http://stackoverflow.com/comment/45374438
has comment: http://stackoverflow.com/comment/45374093
has comment: http://stackoverflow.com/comment/45374816
score: 1
has comment: http://stackoverflow.com/comment/45374127
upvote count: 1
has comment: http://stackoverflow.com/comment/45374735
has comment: http://stackoverflow.com/comment/45374359
answers question: http://stackoverflow.com/q/28529219
has body: I have to disagree with the answers provided here. The best way to do something like this is: var a = new Array(7); for (var i = 0; i &lt; a.length; i++) { a[i] = i + 1; } console.log(a);
has comment: http://stackoverflow.com/comment/45374642
downvote count: 0
has comment: http://stackoverflow.com/comment/45374021
has comment: http://stackoverflow.com/comment/45373981
has comment: http://stackoverflow.com/comment/45373992
has comment: http://stackoverflow.com/comment/45374846
type: Answer

http://stackoverflow.com/comment/45413029
type: QuestionComment
type: Comment
score: 2
comment on: http://stackoverflow.com/q/28549980
has text: What is a "MathML value" exactly? How are you working with the MathML DOM from Javascript? Please share your code.

http://stackoverflow.com/a/28444383
has body: jQuery's animate needs a starting point, somewhere to animate from, so the left value has to be set before animating, even to zero, as long as it's not auto, the default value. jQuery css() doesn't have this issue, it doesn't need a starting point, it just sets the value. Also, to position an element and make the element actually move, the element must have a position other than the default static set before animating.
accepted answer of: http://stackoverflow.com/q/28444282
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28444282
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45296806
type: Comment
has text: @jamie Here's the most recent changelog I could find: https://hg.mozilla.org/mozilla-central/file/56861f2edc5d/js/src/jit-test/tests/latin1/toLowerCase-toUpperCase.js Which I found here: https://bugzilla.mozilla.org/show_bug.cgi?id=1019543 EDIT: Found the javascript one, added as first link above ;)
comment on: http://stackoverflow.com/a/28484876
score: 1
type: AnswerComment

http://stackoverflow.com/comment/46758371
type: Comment
comment on: http://stackoverflow.com/q/28440676
type: QuestionComment
score: 1
has text: @BlairHippo can you elabourate on "Research hinted that instances of translate3d and keyframe in the CSS files might be to blame"? Any links that indicate this etc? I've hit the same problem in our app that consistently crashes (taking developer tools with it, frustratingly) Safari with this error.

http://stackoverflow.com/comment/47532009
type: Comment
has text: If this solved your problem, can you please accept the answer?
type: AnswerComment
comment on: http://stackoverflow.com/a/28510289
score: 0

http://stackoverflow.com/comment/45454266
comment on: http://stackoverflow.com/q/28572053
has text: No easy way, but having javascript littered in your templates should be easy to find using the eye test.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45245940
type: Comment
comment on: http://stackoverflow.com/a/28458396
has text: No, it references the lexical context that was created by the `Machine()` *call* that also created just this `enable` function. Its environment only contains the `self` variable, no reference to `Machine`.
score: 1
type: AnswerComment

http://stackoverflow.com/comment/45242188
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28456923
has text: I have a button on an html page. If i click the button then it will draw a line like creating a road slowly.
type: AnswerComment

http://stackoverflow.com/q/28464874
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28465070
has title: jQuery getting back NaN and [object Object] from variables
tagged with: nan
accepted answer: http://stackoverflow.com/a/28465070
has comment: http://stackoverflow.com/comment/45255435
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45255460
tagged with: forms
has body: I have some problems getting my script to work. My script calculates the number of orders and the weight of each order. My form is actually created by javascript when pressed the "New Line" button. I am trying to make it so whenever 3 values (number of items, number of items in a box, number of boxes per order) are filled in, it automatically gives you the total number of orders. Also, when given the weight of a single item, it gives you the total weight of the order. All this happens on keyup using jquery. I need help only in the javaScript part. I handle my form with AJAX later on and everything worked but it broke when I tried to implement this. Whenever I use alert() to see what values my code is assigning to the updateForm() function I get for alert($totalitems) -> [object Object] and alert($weightperpal) -> NaN. Could anybody help me solve this? Heres my code: HTML: Add Line JavaScript: $("#addLine").click(function(e){ e.preventDefault(); lineNum++; var cont = ' '+ ' Total # of items '+ ' '+ ' '+ 'Not mandatory'+ ' '+ ' '+ ' '+ ' Items per box '+ ' '+ ' '+ '#'+ ' '+ ' '+ ' '+ ' Boxes per order '+ ' '+ ' '+ '#'+ ' '+ ' '+ ' '+ ' Weight per Item '+ ' '+ ' '+ '#'+ ' '+ ' '+ ' '+ ' Total number of Orders '+ ' '+ ' '+ '# of pallets'+ ' '+ ' '+ ' '+ ' Weight per order '+ ' '+ ' '+ 'Total number of boxes'+ ' '+ ' '+ ' '; $(document).on('keyup','.weightpiF',function(){ var valueField = $(this).attr('no'); updateFormRoe(valueField); }); $(document).on('keyup','.weightppF',function(){ var valueField = $(this).attr('no'); updateFormRoe(valueField); }); $(document).on('keyup','.itemspbF',function(){ var valueField = $(this).attr('no'); updateFormRoe(valueField); }); $(document).on('keyup','.boxesppF',function(){ var valueField = $(this).attr('no'); updateFormRoe(valueField); }); function updateFormRoe(number){ alert(number); var $totalitems = $('#totalitF'+number); alert($totalitems); var $itemspb = $('#itemspbF'+number).val(); var $boxespp = $('#boxesppF'+number).val(); …
type: Question
score: 0
tagged with: function
answer count: 1

http://stackoverflow.com/a/28525548
answers question: http://stackoverflow.com/q/28525332
score: 0
has body: the moment you place php in a HTML file, it is rendered as HTML. You should change the extension to .php then it will be able to run the PHP itself. (The HTML itself will not be affected)
type: Answer

http://stackoverflow.com/a/28522134
upvote count: 1
answers question: http://stackoverflow.com/q/28522091
downvote count: 0
has body: The second approach is the right one because you are caching the selector for your element: var myDomElement = $('myDomElement'); myDomElement.css('height', 500); // do more stuff to myDomElement var In this case jQuery will not parse your DOM again to find something it already has found before. In the first case, every time you call $('myDomElement') jQuery look for the element in DOM and it's totally unnecessary doing this search all the time to get the same element.
type: Answer
score: 1

http://stackoverflow.com/comment/45248026
has text: If you're using jQuery please add the tag to your question.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28460951

http://stackoverflow.com/a/28504611
has comment: http://stackoverflow.com/comment/45330827
has body: Set up the viewport. &lt;meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" /&gt; Put the css in an external file and link to it. &lt;link rel="stylesheet" href="/public/demo.css" /&gt; And take out the only keyword and change to min-width. @media screen and (min-width : 773px) { //instead of (max-width:1320px) } And that should do it.
accepted answer of: http://stackoverflow.com/q/28504005
upvote count: 1
has comment: http://stackoverflow.com/comment/45329517
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45328955
has comment: http://stackoverflow.com/comment/45328973
answers question: http://stackoverflow.com/q/28504005
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45329887
has comment: http://stackoverflow.com/comment/45332104

http://stackoverflow.com/a/28439690
upvote count: 2
has comment: http://stackoverflow.com/comment/45252223
has comment: http://stackoverflow.com/comment/45225706
has body: You can only reference what is passed into the the function in map, unless you use bind, which maintains the instance of this, so that it is the same within the component and the function used within map. This would allow you to use this.props within your mapping function. Since header is using what is directly passed into the function in map, binding is not necessarily needed. In row, in order to access this.props, the function must be bound. For example if you had somedata you wanted to access within this.props: var header = this.props.data.Columns.map(function (columns) { return ( &lt;GridHead data={columns} /&gt; ); }); var Row = this.props.data.Rows.map(function (data, i) { return ( &lt;GridRow data={this.props.somedata} key={i} /&gt; ); }.bind(this)); note that in JSX regular variable names should start with a lowercase letter (as header above), whereas component names should start with uppercase letters.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28438807
answers question: http://stackoverflow.com/q/28438807
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45212141
has comment: http://stackoverflow.com/comment/45209248

http://stackoverflow.com/comment/45417269
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28551053
has text: OK thanks for the pointer to the dupe.
score: 0

http://stackoverflow.com/a/28589319
answers question: http://stackoverflow.com/q/28589155
type: Answer
has body: Object.prototype.fancyString = function(){ var a = [] for(var prop in this) { if(this.hasOwnProperty(prop)) { a.push(prop + '(' + this[prop] + ')' ); } } return a.join('||'); } Then you can just do: var info = {name:"username",age:20}; info.fancyString(); // outputs: "name(username)||age(20)"
score: 0

http://stackoverflow.com/q/28469600
upvote count: 5
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45264204
has comment: http://stackoverflow.com/comment/45264214
favorite count: 0
has answer: http://stackoverflow.com/a/28469739
has answer: http://stackoverflow.com/a/63716771
accepted answer: http://stackoverflow.com/a/28469739
has body: The following function underbar function was rewritten by peer of mine like so: var once = function(func) { var alreadyCalled = false; var result; return function() { if (!alreadyCalled) { result = func.apply(this, arguments); alreadyCalled = true; } return result }; }; Here's how I interpret it. It's a function that takes another function and returns yet another function. If alreadyCalled is false then set result = func.apply(this,arguments) Can someone please help me understand in a simple way what func.apply(this,arguments) is doing in the context of this function. I can't seem to figure it out!
type: AnsweredQuestion
has title: What does func.apply(this, arguments) do in this code for _.once()?
type: Question
possible better answer: http://stackoverflow.com/a/63716771
answer count: 2
score: 5

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

http://stackoverflow.com/q/28532350
has comment: http://stackoverflow.com/comment/45508331
tagged with: javascript
downvote count: 0
has answer: http://stackoverflow.com/a/30113441
has title: Hartl tutorial Ch. 8 the dropdown menu via javascript will not drop down and user cannot log out
favorite count: 0
has answer: http://stackoverflow.com/a/44742677
answer count: 5
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I have checked the code over and over again, but I cannot seem to find why the dropdown menu will not work. And because of that, I can't see if the links in the dropdown menu function correctly. Also, the header now cuts off the . Any help is greatly appreciated. Here is my code. _header.html.erb <%= link_to "sample app", root_path, id: "logo" %> <%= link_to "Home", root_path %> <%= link_to "Help", help_path %> <% if logged_in? %> <%= link_to "Users", '#' %> Account <%= link_to "Profile", current_user %> <%= link_to "Settings", '#' %> <%= link_to "Log out", logout_path, method: "delete" %> <% else %> <%= link_to "Log in", login_path %> <% end %> sessions Controller class SessionsController < ApplicationController def new end def create user = User.find_by(email: params[:session][:email].downcase) if user && user.authenticate(params[:session][:password]) log_in user redirect_to user else flash.now[:danger] = 'Invalid email/password combination' render 'new' end end def destroy end end sessions helper module SessionsHelper def log_in(user) session[:user_id] = user.id end def current_user @current_user ||= User.find_by(id: session[:user_id]) end def logged_in? !current_user.nil? end end application.js //= require jquery //= require bootstrap //= require jquery_ujs //= require turbolinks //= require_tree . Gemfile source 'https://rubygems.org' gem 'test-unit' gem 'rails-perftest' gem 'minitest' gem 'bcrypt' gem 'coffee-script-source', '1.8.0' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.2.0' # Use sqlite3 as the database for Active Record gem 'bootstrap-sass' gem 'sass-rails', '~> 5.0' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' # Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.1.0' # See https://github.com/sstephenson/execjs#readme for more supported runtimes # gem 'therubyracer', platforms: :ruby # Use jquery as the JavaScript library gem 'jquery-rails' # Turbolinks makes foll…
tagged with: railstutorial.org
type: UnansweredQuestion
score: 1
has answer: http://stackoverflow.com/a/29163752
upvote count: 1
has answer: http://stackoverflow.com/a/35708446
tagged with: ruby-on-rails
type: Question
has comment: http://stackoverflow.com/comment/45423945
has answer: http://stackoverflow.com/a/47040271

http://stackoverflow.com/comment/45484637
has text: UglifyJS gives me parse errors if I try it that way. I didn't think you needed to wait for the resolve, because the whole two way data binding thing implies that when the data is available the view will be updated. This is how my list of things to be updated populates, which also includes and API call and works just fine. I can pass hardcoded variables into the view, so maybe your suggestion is the root of the issue and perhaps I have to wait for the promise somewhere else. However, the code provided is not the correct answer.
comment on: http://stackoverflow.com/a/28505398
type: Comment
score: 0
type: AnswerComment

google-chrome-devtools
tags question: http://stackoverflow.com/q/28465118
tags question: http://stackoverflow.com/q/28465134
tags question: http://stackoverflow.com/q/28512580
tags question: http://stackoverflow.com/q/28588388
type: Tag
tags question: http://stackoverflow.com/q/28492539
tag name: google-chrome-devtools
tags question: http://stackoverflow.com/q/28454417

http://stackoverflow.com/a/30710201
score: 0
has body: For me the official Kendo way works: I implemented the templateLoader.js. And in the HTML template file, you can do:
type: Answer
answers question: http://stackoverflow.com/q/28461501

http://stackoverflow.com/q/28535742
possible better answer: http://stackoverflow.com/a/74648542
has comment: http://stackoverflow.com/comment/45385695
has comment: http://stackoverflow.com/comment/45385758
has comment: http://stackoverflow.com/comment/45385698
favorite count: 0
has answer: http://stackoverflow.com/a/28535881
has comment: http://stackoverflow.com/comment/45386130
has comment: http://stackoverflow.com/comment/45386095
has comment: http://stackoverflow.com/comment/45386082
score: 2
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/74648542
has comment: http://stackoverflow.com/comment/45385845
accepted answer: http://stackoverflow.com/a/28535876
has comment: http://stackoverflow.com/comment/45385917
has comment: http://stackoverflow.com/comment/45385716
type: Question
upvote count: 2
has title: set focus after append new row in table not working with jquery
has body: i have write this code function addNew(){ $('#container').append( ' ' +' '); $('table#myTable tr:last td:first input').focus();} the HTML code No. this the button on even click : but nothing happened,can anyone help me
has answer: http://stackoverflow.com/a/28535876
tagged with: javascript
has comment: http://stackoverflow.com/comment/45386013
tagged with: jquery
has comment: http://stackoverflow.com/comment/45385691
answer count: 3

http://stackoverflow.com/comment/45318737
has text: I think, you can just do a `.hide()` instead of `.slideUp()`. That would reduce the overlap. BTW, if this answer worked for you, would you accept this? :)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28498804
score: 0

http://stackoverflow.com/q/28572937
tagged with: php
score: 0
type: Question
has body: I need to put the value of "Grand Total without shipping and tax" into a JavaScript on the success.phtml-page. To add the Grand Total i use the following code: &lt;?php echo $this-&gt;__('%s', $this-&gt;escapeHtml($this-&gt;getGrandTotal())) ?&gt; I was thinking about using getSubtotal instead, but that will not be correct in case of any Shopping Cart Price Rule being used. So I think the approach must be something like: "GrandTotal minus shipping minus tax" But how can I add these parameters to the code above? EDIT: About using getSubtotal... I would then need to know how to subtract any discount given by coupon, anyone know how to do this? I was thinking about something like this: &lt;?php echo $this-&gt;__('%s', Mage::getModel('checkout/cart')-&gt;getQuote()-&gt;getSubtotal() - getDiscount()); ?&gt; ...however "getDiscount()" should be something more correct.. Thanks -Espen
tagged with: magento
tagged with: javascript
has answer: http://stackoverflow.com/a/28670500
answer count: 1
has title: How to get GrandTotal without shipping and tax in Magento
type: UnansweredQuestion

http://stackoverflow.com/comment/45319586
type: Comment
comment on: http://stackoverflow.com/a/28500102
has text: Just edited my answer to include a link to some angular filters.
type: AnswerComment
score: 0

http://stackoverflow.com/q/28444247
has answer: http://stackoverflow.com/a/28462873
type: Question
accepted answer: http://stackoverflow.com/a/28462873
tagged with: cytoscape.js
tagged with: javascript
answer count: 1
has body: I would like to have an overlay that is not over the label and that has the same shape than the node it is on. How could I extend cytoscape.js or reuse existing functionnality to do so? I tried to use border to achieve this result, but what I don't like about that is the fact that border goes inside the shape as you can see in the attached image.
has title: How can I change the shape and z-index of the overlay in cytoscape.js?
type: AnsweredQuestion
score: 0

http://stackoverflow.com/comment/45295138
score: 0
type: AnswerComment
type: Comment
has text: Yes, TSC (the compiler) prints any type errors it encounters as it transpiles the files in JS. You can (and at work I do) use this to fail the build, just as if it were a compile error in some other language.
comment on: http://stackoverflow.com/a/28486677

http://stackoverflow.com/comment/45327930
type: Comment
has text: To get the greatest variation in possible assignments, look up an integer partitioning algorithm. Choose a random partition and fill the remaining values with 0's.
comment on: http://stackoverflow.com/q/28504157
score: 0
type: QuestionComment

http://stackoverflow.com/q/28583765
has title: What to do when function need to be called before script load
downvote count: 1
favorite count: 0
upvote count: 0
has body: I'm calling this function: at many sites on a page but the script is loaded at bottom as follow: which causes this error: Uncaught ReferenceError: OA_show is not defined Note I can't call the function after script loads because it needs to be called on specific position where Ads will be show, take a look here to see what I'm talking about Is there any way to get ride of the error? Should I load the script at top even if it's obtrusive and prevent the page to load before it loads completely? Any advice?
possible better answer: http://stackoverflow.com/a/28583826
has answer: http://stackoverflow.com/a/28583826
accepted answer: http://stackoverflow.com/a/28583852
type: AnsweredQuestion
tagged with: performance
type: Question
has answer: http://stackoverflow.com/a/28583852
answer count: 2
tagged with: javascript
tagged with: jquery
score: -1
tagged with: optimization
tagged with: openx

http://stackoverflow.com/comment/45459396
type: Comment
type: QuestionComment
has text: The error implies that the value of `selectedPlan` is not a property name of `plans`. For example, you are initializing it to `"free"` but `plans` doesn't have such a property. `plans["free"]` is `undefined` and thus you "Cannot read property 'basePrice' of undefined"
comment on: http://stackoverflow.com/q/28575039
score: 4

http://stackoverflow.com/q/28585862
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45479065
tagged with: angularjs-ng-repeat
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45479220
accepted answer: http://stackoverflow.com/a/28586049
has body: Im currently trying to nest a inside a div with a ng-repeat something like this: In the controller im adding the item to a new list with selected items. I also want to add the value from the dropdown as a new value to the list in the controller. $scope.add = function (item) { //New value with the value from the dropdown item.recipientType = typemodel; $scope.selected.push(item); }; The list : $scope.items = [ { "Name":"Name1", "userGroups":[ { "type": "gruop1" }, { "type": "gruop2" }, { "type": "group3" } ] }, { "Name":"Name2", "userGroups":[ { "type": "gruop1" }, { "type": "gruop2" }, { "type": "group3" } ] } ] In short i need the selected value from the dropdown when i hit the "add", the value of the current typemodel. This is how it looks now, but it dont work. I know i have to get the correct model and maybe track the items list by $index, but after searching the web the whole day for a solution, im still stuck! All help is appreciated. -Thanks! ps. please comment if something is missing from the question, or something more is needed to solve this.
has comment: http://stackoverflow.com/comment/45479301
has title: Nested ng-option inside angular ng-repeat
type: AnsweredQuestion
tagged with: select
has answer: http://stackoverflow.com/a/28586049
type: Question
tagged with: ng-options
answer count: 1

http://stackoverflow.com/comment/45475328
type: AnswerComment
type: Comment
score: 2
has text: The cons of this approach outweigh the pros: you will end up in completely loosing control over your website and data.. Even knowing how many users have been recently registered, can be a nightmare, if not impossible, with this approach!!!
comment on: http://stackoverflow.com/a/28552696

http://stackoverflow.com/a/28488233
has body: The Javascript that you have doesn't change the page at all. It reads the content of the body into a string, then changes the string. That doesn't affect the content. The reason that the page changes is that the value of the script is the value of the string, so that is used as content for a new page. As that is just a HTML snippet without the head tag where all the styles and scripts are defined, you get an unstyled page with just the content. If you want to change the page, you should put the string back as content in the body, then use void(0); as the last statement to prevent the creation of a new page: javascript:var a=document.getElementsByTagName('body')[0].innerHTML;a=a.replace(/Program(\w\w+)*/gmi,'curse').replace(/language/gmi,'word');document.getElementsByTagName('body')[0].innerHTML=a;void(0);
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28488047
answers question: http://stackoverflow.com/q/28488047
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28462675
tagged with: javascript
has answer: http://stackoverflow.com/a/28462714
accepted answer: http://stackoverflow.com/a/28462714
tagged with: jquery
favorite count: 0
type: AnsweredQuestion
downvote count: 0
has title: Javascript: Monitor Queue / Continuously Run Function
has body: I have a queue that I push messages to that I'd like to continuously process. The reason why I need a queue, is because the messages come in too fast for me to finish processing them! Here's my code: var messageQueue = []; var ws = ...; //When I get a socket.io message... ws.on('message', function(data) { //Add it to the queue addToQueue(data); }); //Function that adds it to the queue: function addToQueue(fullMessage) { messageQueue.push(fullMessage); }, //Function that I'd like to run constantly function fetcher() { while (messageQueue.length &gt; 0) { //get the next message on the queue var msg = messageQueue.shift(); handleMessage(msg); } //fetcher()? } //Function that works with the message function handleMessage(fullMessage) { //do things with the message } Any ideas on how I can get "fetcher" to run anytime there are items in the queue? Every try I do I end up accidentally calling it recursively and breaking the page :(
type: Question
score: 1
upvote count: 1
answer count: 1

http://stackoverflow.com/a/28496491
answers question: http://stackoverflow.com/q/28496351
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: Try this : find parent li of productRelatedToAdditional matched, then find productRelatedTo and remove it. $("ul").find('li .productRelatedToAdditional:contains("Account")').each(function(){ var $parentLi = $(this).closest('li'); $(this).remove(); $parentLi.find(".productRelatedTo").remove(); });
accepted answer of: http://stackoverflow.com/q/28496351

http://stackoverflow.com/a/28593300
type: Answer
score: 13
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28539182
upvote count: 13
answers question: http://stackoverflow.com/q/28539182
type: AcceptedAnswer
has body: In your fiddle you've used an ArrayStore which isn't intended for this purpose - rather a two-dimensional array in a data set whereby no model exists. Please note that I've used a regular store in the following example. Regardless of whether you explicitly create a model for the data or not, a store will look for values against a key (field name) in an object. i.e. if you specified the fields name and description then it will look for an array of data structured as follows: { name: 'Record Name', description: '...' } In order to work around this on the front-end you could apply a transform to the reader configuration which allows you to manipulate the raw data object before it is processed by any other components. For example: var store = Ext.create('Ext.data.Store', { fields: ['name'], autoLoad: false, proxy: { type: 'ajax', url: 'data.json', reader: { type: 'json', rootProperty: 'GetDepartementsResult', transform: function(data){ var key = this.getRootProperty(); data[key] = data[key].map(function(val){ return { name: val }; }); return data; } } } }); This way you have a clear field called name which you can use to configure both the displayField and the valueField on your combo box. &raquo; fiddle
has comment: http://stackoverflow.com/comment/45507578

knockout.js
tags question: http://stackoverflow.com/q/28529020
tags question: http://stackoverflow.com/q/28519984
tags question: http://stackoverflow.com/q/28546347
tags question: http://stackoverflow.com/q/28556439
tags question: http://stackoverflow.com/q/28462543
tags question: http://stackoverflow.com/q/28490283
tags question: http://stackoverflow.com/q/28492077
tags question: http://stackoverflow.com/q/28464408
tags question: http://stackoverflow.com/q/28443115
tags question: http://stackoverflow.com/q/28567647
tags question: http://stackoverflow.com/q/28511559
tags question: http://stackoverflow.com/q/28500697
tags question: http://stackoverflow.com/q/28506951
tags question: http://stackoverflow.com/q/28517590
tag name: knockout.js
tags question: http://stackoverflow.com/q/28538294
tags question: http://stackoverflow.com/q/28561004
tags question: http://stackoverflow.com/q/28514159
tags question: http://stackoverflow.com/q/28497057
tags question: http://stackoverflow.com/q/28531310
tags question: http://stackoverflow.com/q/28579347
tags question: http://stackoverflow.com/q/28566296
tags question: http://stackoverflow.com/q/28581931
tags question: http://stackoverflow.com/q/28559970
tags question: http://stackoverflow.com/q/28488524
tags question: http://stackoverflow.com/q/28582262
tags question: http://stackoverflow.com/q/28541672
type: Tag
tags question: http://stackoverflow.com/q/28591922
tags question: http://stackoverflow.com/q/28547734
tags question: http://stackoverflow.com/q/28503693
tags question: http://stackoverflow.com/q/28461079
tags question: http://stackoverflow.com/q/28560694
tags question: http://stackoverflow.com/q/28530681
tags question: http://stackoverflow.com/q/28509647
tags question: http://stackoverflow.com/q/28462262
tags question: http://stackoverflow.com/q/28558244

http://stackoverflow.com/a/28580562
has comment: http://stackoverflow.com/comment/45474676
has comment: http://stackoverflow.com/comment/45507255
has comment: http://stackoverflow.com/comment/45476462
has comment: http://stackoverflow.com/comment/45504977
answers question: http://stackoverflow.com/q/28580354
upvote count: 2
has comment: http://stackoverflow.com/comment/45504809
has comment: http://stackoverflow.com/comment/45505596
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45471574
has comment: http://stackoverflow.com/comment/45504038
type: Answer
has comment: http://stackoverflow.com/comment/45507536
has comment: http://stackoverflow.com/comment/45474913
score: 2
has comment: http://stackoverflow.com/comment/45503967
downvote count: 0
has comment: http://stackoverflow.com/comment/45503588
has body: $( document ).ready(function() { //select options for spending amount select = document.querySelectorAll("#amount0, #amount1, #amount2, #amount3, #amount4"); var selCount = select.length; for(var sC=0; sC<selCount; sC++){ var opt1 = document.createElement('option'); opt1.value = 35; opt1.innerHTML = 35; select[sC].appendChild(opt1); var opt = document.createElement('option'); opt.innerHTML = 50; opt.value = 50; select[sC].appendChild(opt); //loop for 100 to 1000 for (var i = 1; i<=10; i++){ var opt = document.createElement('option'); var x = 100; x = x*i; opt.value = x; opt.innerHTML = x; select[sC].appendChild(opt); } } }); Hope you got, what to change.
has comment: http://stackoverflow.com/comment/45471776
accepted answer of: http://stackoverflow.com/q/28580354

http://stackoverflow.com/comment/45280144
type: Comment
has text: Its better not to use ng app and ng controller in one
comment on: http://stackoverflow.com/a/28478403
type: AnswerComment
score: 0

http://stackoverflow.com/a/31147677
answers question: http://stackoverflow.com/q/28545465
type: Answer
upvote count: 0
has comment: http://stackoverflow.com/comment/84771703
has body: I got it to work by clearning my cookies. --Solution posted in this similar issue here: Google+ API "400 (Bad Request)" and "Refused to display ... in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'." errors
downvote count: 2
score: -2

http://stackoverflow.com/comment/135740302
type: Comment
comment on: http://stackoverflow.com/a/28592392
type: AnswerComment
score: 0
has text: This actually work really good, just remember to use `encodeURI()` when you have space in file name

http://stackoverflow.com/comment/45463049
type: QuestionComment
has text: When i'm checking the CAPTCHA checkbox it is saying "I'm not a robot" without popup of images or numbers to verify...@JamesMassey
comment on: http://stackoverflow.com/q/28576874
score: 0
type: Comment

http://stackoverflow.com/q/28495566
type: Question
has answer: http://stackoverflow.com/a/28501200
score: 5
has answer: http://stackoverflow.com/a/28495625
upvote count: 5
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28501200
has body: Actually, I'm doing a script which removes row duplicates from an array. And it works properly, but I don't know why :) Here is a string of my code: if (refValues[i].join() == uniqueAddrs[n].join())
tagged with: google-apps-script
answer count: 2
downvote count: 0
favorite count: 0
has title: What .join() method does in Google App Script?
accepted answer: http://stackoverflow.com/a/28495625
type: AnsweredQuestion

http://stackoverflow.com/q/28585743
type: Question
tagged with: typescript
has title: Web Storm 9.0.3 typescript file watcher not work
has answer: http://stackoverflow.com/a/28595130
tagged with: javascript
tagged with: webstorm
upvote count: 0
answer count: 1
has body: I install typescript from npm and create typescript file watcher. But web storm do not compile ts to js and show error in output tool window. (cmd.exe /D /C "C:/Users/Muhammad Ali/AppData/Roaming/npm/tsc.cmd" --sourcemap "F:\M.Ali\Projects\Web Storm\Practice\js\file1.ts" 'C:/Users/Muhammad' is not recognized as an internal or external command, operable program or batch file.) Program path in filewatcher = C:\Users\Muhammad Ali\AppData\Roaming\npm\tsc.cmd
favorite count: 0
score: -1
has comment: http://stackoverflow.com/comment/45479401
type: UnansweredQuestion
downvote count: 1

http://stackoverflow.com/a/28454244
has comment: http://stackoverflow.com/comment/45236002
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45235910
answers question: http://stackoverflow.com/q/28453706
score: 0
has comment: http://stackoverflow.com/comment/45235819
type: Answer
has body: The problem come from the &lt;script&gt; tag that you want to include, it's a behavior from the browser, you could do a little trick to avoid this. First remove the semi-colon at the end of the function declaration, and replace the last &lt;script&gt; with a splitted one. $('body').append('&lt;script&gt;'+function PreviewImage2() { var oFReader = new FileReader(); oFReader.readAsDataURL(document.getElementById("uploadImage2").files[0]); oFReader.onload = function (oFREvent) { document.getElementById("uploadPreview2").src = oFREvent.target.result; }; }+'&lt;/scrip'+'t&gt;');

http://stackoverflow.com/q/28482021
type: Question
has body: Am still getting the hang of promises.. Here are the models of the db collections involved: var itemSchema = new Schema({ label : String, tag : { "type": Schema.ObjectId, "ref": "tag" } }); var tagSchema = new Schema({ label : String, }); And here's the series of Promises (map, map, map, join): Right now, the Promise.join saves&amp;completes before the 'items' map finishes running, and so the 'senders' map doesn't include the 'itemsArray' javascriptObject on save .. how can this be resolved? var reqItems = req.body.items; var itemsArray = []; var items = Promise.map(reqItems,function(element){ var existingItem = Models.Item.findOneAsync({ "label": element }); existingItem.then(function (value) { if ( (existingItem.fulfillmentValue != null) ) { // if this item exists var itemObject = [ { "item" : existingItem.fulfillmentValue._id }, { "label" : existingItem.fulfillmentValue.label } { "tag" : existingItem.fulfillmentValue.tag } ]; itemsArray.push(itemObject); } else { // first instance of this item .. create newItem var existingTag = Models.Tag.findOneAsync({ "label": element }); existingTag.then(function (value) { if ( (existingTag.fulfillmentValue != null) ) { // if this tag exists var newItem = new Models.Item( { label : element, tag : existingTag.fulfillmentValue._id, } ); newItem.save(function (err) { // save the newItem with existing tag console.log(err); var newSavedItem = Models.Item.findOneAsync({ "label": element }); newSavedItem.then(function (value) { // ensure existence of newItem var itemObject = [ { "item" : newSavedItem.fulfillmentValue._id }, { "label" : newSavedItem.fulfillmentValue.label }, { "tag" : newSavedItem.fulfillmentValue.tag } ]; itemsArray.push(itemObject); // push item to array }); }); } else { // else this tag does not exist var newTag = new Models.Tag( { label : element } ); newTag.save(function (err) { console.log(err); var newSavedTag = Models.Tag.findOneAsync({ "label": element }); newSavedTag.then(function (value) { // ensure existe…
has comment: http://stackoverflow.com/comment/45297914
has comment: http://stackoverflow.com/comment/45288710
tagged with: mongoose
tagged with: javascript
score: 0
answer count: 1
has title: Promise.map not finishing because subsequent Promise.join finishes first? Promise.all?
tagged with: promise
linked to: http://stackoverflow.com/q/25751723
has answer: http://stackoverflow.com/a/28482565
tagged with: node.js
type: AnsweredQuestion
tagged with: bluebird
accepted answer: http://stackoverflow.com/a/28482565

http://stackoverflow.com/comment/45275070
has text: I'm doing similar thing, but getting "Cannot read property '0' of undefined".
comment on: http://stackoverflow.com/a/28475274
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28461949
tagged with: extjs
tagged with: timefield
accepted answer: http://stackoverflow.com/a/28463580
answer count: 1
downvote count: 0
has body: I need to show hours as 07:00, 15:00, 23:00 (8 hrs increment) in EXTJs timefield, but when I used the following code, it is not giving the desired output, can some one help me, if I am missing something. Ext.create('Ext.form.Panel', { title: 'Time Card', width: 300, bodyPadding: 10, renderTo: Ext.getBody(), items: [{ xtype: 'timefield', name: 'in', fieldLabel: 'Time In', format : 'H:i', minValue: '07:00', maxValue: '23:00', increment: 480, anchor: '100%' }] }); Thanks in Advance.
favorite count: 0
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has title: Need to show hours as 07:00, 15:00, 23:00 (8 hrs increment) in EXTJs timefield
tagged with: javascript
has answer: http://stackoverflow.com/a/28463580

http://stackoverflow.com/comment/45300572
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28489549
has text: @Cyclone I did `window.open(my_global_link, '_blank');` and on the first click it opens in the new tab but on the second click it will load on the same page. What is the reason for that?
score: 0

http://stackoverflow.com/q/28533042
has body: I want to display a select element when an option of another select element is selected, and hide it when another option is selected. To be more specific, I have 3 dropdowns, one for country, one for province/state and one for city. I want the city dropdown to display when the country is United States and the dropdown should be according to the state selected. I also want the city dropdown to disappear when Canada is selected, regardless of the province selected. So far, I've got the state/provinces to change according to the country, but I don't know how to remove the whole city element when Canada is selected. I have this in a jsFiddle - https://jsfiddle.net/jascd6ue/ This is my select html code Country: Canada United States Province/State: British Columbia Ontario And this is the Javascript: $('.country').on('change', function (e) { var optionSelected = $("option:selected", this); var valueSelected = this.value; if(valueSelected == "Canada") { $('.pro').html(' British Columbia Ontario '); // remove the city dropdown } else if (valueSelected == "United_States") { $('.pro ').html(' Florida New York '); } }); $('.pro').on('change', function (e) { var optionSelectedb = $("option:selected", this); var valueSelectedb = this.value; if(valueSelectedb == "Florida") { // write Miami Orlando } else if(valueSelectedb == "New York") { // write New York Buffalo } }); Any and all help is appreciated. Thanks
answer count: 1
tagged with: javascript
tagged with: drop-down-menu
tagged with: jquery
upvote count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45381594
accepted answer: http://stackoverflow.com/a/28533514
favorite count: 0
has title: How do I display a select dropdown list when one option on another select dropdown is selected
has answer: http://stackoverflow.com/a/28533514
has comment: http://stackoverflow.com/comment/45381576
type: AnsweredQuestion
score: 3
downvote count: 0
type: Question

http://stackoverflow.com/q/28559380
upvote count: 0
has comment: http://stackoverflow.com/comment/45431260
has title: Everytime I click on my website, it redirects to home.html then back to desired url I have clicked on
type: AnsweredQuestion
score: -1
type: Question
has body: As the title suggests. I am having troubles with my website. When ever I click on a link, I would get my home.html showing up. Then it will go to the desired link. It is only for a few seconds. However it gets really annoying when I am trying to back up on my searches that I have done. My code for index.html is as follows. M3TA4.NET I have also uploaded a youtube video to show what is happening. video of the issue(Note youtube video has been deleted.) If you need any more information I am happy to give it to you. Also like to note that I pretty new to coding web pages.
accepted answer: http://stackoverflow.com/a/28559523
has comment: http://stackoverflow.com/comment/45430562
answer count: 1
has comment: http://stackoverflow.com/comment/45431617
has comment: http://stackoverflow.com/comment/45430341
has comment: http://stackoverflow.com/comment/45430420
tagged with: javascript
has answer: http://stackoverflow.com/a/28559523
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
favorite count: 0

http://stackoverflow.com/a/28545758
answers question: http://stackoverflow.com/q/28541050
has body: What if you would get it in one go using by.xpath(): element(by.xpath('//div[@class="text-label" and . = "SomeText"]/following-sibling::div')) Or, you can combine it with cssContainingText(): element(by.cssContainingText('div.text-label','SomeText')).element(by.xpath('following-sibling::div'))
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45507720
has comment: http://stackoverflow.com/comment/45506884
has comment: http://stackoverflow.com/comment/45716032
upvote count: 10
type: Answer
has comment: http://stackoverflow.com/comment/45726857
downvote count: 0
has comment: http://stackoverflow.com/comment/45445334
score: 10
has comment: http://stackoverflow.com/comment/45507863
has comment: http://stackoverflow.com/comment/45421334
accepted answer of: http://stackoverflow.com/q/28541050
has comment: http://stackoverflow.com/comment/45716581

http://stackoverflow.com/comment/45312174
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28474907
type: AnswerComment
has text: The AirBnB article seems to insinuate that Meteor is one of the few isomorphic frameworks that is doing the "hybrid approach" that the article refers to.

http://stackoverflow.com/comment/45476895
type: QuestionComment
has text: Are you using some package which interferes with collections? Like collection-hooks or collection2?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28581994

http://stackoverflow.com/q/28567503
has title: Setting 'src' of img tag dynamically using backbone templating
answer count: 1
has body: I am trying to set the src of img tag dynamically with backbone templating, but / is appended automatically for which img not loaded.The part of template looks like - &lt;script type="text/template" id="home"&gt; ....... &lt;% var d=names[0].get("image_link")+".jpg" //d=d.substring(0 , d.length-1); tried to cut down last char %&gt; &lt;a href="#" class="thumbnail"&gt;&lt;img class="img-responsive ui-corner-all" width="100%" height="auto" src=&lt;%=d%&gt; /&gt; ....... &lt;/script&gt; The output - &lt;a href="#" class="thumbnail"&gt;&lt;img class="img-responsive ui-corner-all" width="100%" height="auto" src="image1.jpg/" /&gt; I couldn't figure it out how to exclude that / in img src. Any suggestion please.
type: AnsweredQuestion
tagged with: javascript
has answer: http://stackoverflow.com/a/28567548
type: Question
tagged with: backbone.js
score: 0
accepted answer: http://stackoverflow.com/a/28567548

http://stackoverflow.com/q/28525063
accepted answer: http://stackoverflow.com/a/28525133
tagged with: jquery
has title: Trouble with ajax script using onClick to submit form
type: Question
tagged with: php
has body: I have several forms on a page that submit values from radio buttons using jquery/ajax. All works fine when a Submit button is used, but I would like to eliminate the Submit button. I tried using onClick to submit. However, trying it this way causes the forms to get submitted prior to the processing script picking them up. I would very much appreciate advice (and example if possible). Thank you, Brian Script: $(document).ready(function() { // process the form $('form').submit(function(event) { // get the form data var formData = $(this).serialize(); // process the form $.ajax({ type : 'POST', // define the type of HTTP verb we want to use (POST for our form) url : 'process.php', // the url where we want to POST data : formData, // our data object dataType : 'json' // what type of data do we expect back from the server }) // using the done promise callback .done(function(data) { if (data.success) { // success. // hide form container $("#"+data.message).hide(); $("#"+data.message+"hr").hide(); } // log data to the console so we can see //console.log(data); // here we will handle errors and validation messages }); // stop the form from submitting the normal way and refreshing the page event.preventDefault(); }); }); Form: &lt;method="post" action="process.php" enctype="multipart/form-data"&gt; &lt;input type="radio" name="answer" value="yes" onClick="onClick="this.form.submit()"&gt;
score: 0
has answer: http://stackoverflow.com/a/28525133
tagged with: javascript
tagged with: forms
has comment: http://stackoverflow.com/comment/45366360
type: AnsweredQuestion
answer count: 1

http://stackoverflow.com/q/28438883
has comment: http://stackoverflow.com/comment/45207725
has body: Trying to display the cover art with the results. Something in the img src tag is causing the app not to load. If I just point the img to data.tracks[i].album.name (obviously not a real url, but enough to test if it's working) it pastes it in just fine, but the moment I change it to paste the url in place, it makes the whole app stop working. $('#findTracks').click(function (e) { e.preventDefault(); // override/don't submit form $('#recommendations').empty(); var artist = $('#artist').val(); var userid = ""; var playlistid = ""; $.ajax({ url: 'http://ws.spotify.com/search/1/track.json?q=' + artist, type: 'GET', dataType: 'json', success: function(data) { if (data.tracks.length > 0) { var tracksLength = data.tracks.length, html = ''; for (var i=0; i<tracksLength; i++) { var href = ''; if (data.tracks[i].album.availability.territories.indexOf(' GB ') !== -1) { // data.tracks[i].href href = data.tracks[i].href; href = 'makeReq(\''+data.tracks[i].name + ' by '+data.tracks[i].artists[0].name+'\')'; html += ' ' +data.tracks[i].name + ' by '+data.tracks[i].artists[0].name+ ' ';html += ' '; html += ' '; } } $('#third').css('display', 'block'); $('#recommendations').append(html); } else { $('#recommendations').append(' No matches returned. '); $('#third').css('display', 'none'); } }, error: function(err) { alert("The Spotify API failed to return a response."); } }); }); This is my first time ever coding in javascript so please go easy on me! lol EDIT: This seems to be running well! However, many of the songs do nothing when I click on them For example, type "Don't Stop" and only "The Black Eyed Peas - Don’t Stop The Party" works out of the first ten...anybody know why? also, anybody known why "if (data.tracks[i].album.availability.territories.indexOf(' GB ') !== -1)" is in there? If I take it out this all stops working...I am not in G.B.
score: 0
accepted answer: http://stackoverflow.com/a/28439185
answer count: 1
tagged with: ajax
has answer: http://stackoverflow.com/a/28439185
has title: Displaying images from JSON
tagged with: http://stackoverflow.com/tag/json
type: Question
type: AnsweredQuestion
tagged with: javascript

http://stackoverflow.com/comment/45380052
has text: I see what you mean. I did try Router.onBeforeAction(requireLogin... without the () and it works fine. Let me think about this a little more...
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28532397
type: Comment

http://stackoverflow.com/a/28462280
has body: You can also use bind function to attach event handler. For Example $( "#abc" ).bind( "onblur", function() { alert('b'); });
has comment: http://stackoverflow.com/comment/45250663
answers question: http://stackoverflow.com/q/28462120
has comment: http://stackoverflow.com/comment/45250479
has comment: http://stackoverflow.com/comment/45250668
score: 0
has comment: http://stackoverflow.com/comment/45250716
has comment: http://stackoverflow.com/comment/45251209
has comment: http://stackoverflow.com/comment/45250528
type: Answer
has comment: http://stackoverflow.com/comment/45250987

http://stackoverflow.com/comment/45397210
comment on: http://stackoverflow.com/q/28541866
score: 0
type: Comment
type: QuestionComment
has text: What's the problem/error? You probably also need to parse `sse` as JSON.

http://stackoverflow.com/comment/45238735
has text: @NaeemShaikh What in the world are you talking about?.
comment on: http://stackoverflow.com/a/28456087
type: AnswerComment
score: 2
type: Comment

http://stackoverflow.com/a/28554014
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45420927
has body: When defer present, it specifies that the script is executed when the page has finished parsing. It doesn't include async scripts. If I have the following situation which all scripts will log the date when it was executed: I may have this output: Body script executed at : Tue Feb 17 2015 00:05:08 GMT-0300 script2.js:2 Script 2 executed at :Tue Feb 17 2015 00:05:08 GMT-0300 script.js:2 Script 1 executed at:Tue Feb 17 2015 00:05:08 GMT-0300 script3.js:2 Script 3 executed at :Tue Feb 17 2015 00:05:08 GMT-0300 script3.js (defer) will wait for ' ', but not for script1.js (async), script2.js(async). Here is a PLUNKER
has comment: http://stackoverflow.com/comment/45420938
accepted answer of: http://stackoverflow.com/q/28553889
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28553889
has comment: http://stackoverflow.com/comment/45421015
has comment: http://stackoverflow.com/comment/45421034
type: Answer

button
tags question: http://stackoverflow.com/q/28585593
tags question: http://stackoverflow.com/q/28521397
tags question: http://stackoverflow.com/q/28474433
tags question: http://stackoverflow.com/q/28516360
tags question: http://stackoverflow.com/q/28545398
tags question: http://stackoverflow.com/q/28491967
tags question: http://stackoverflow.com/q/28455032
tags question: http://stackoverflow.com/q/28498090
tags question: http://stackoverflow.com/q/28563939
type: Tag
tags question: http://stackoverflow.com/q/28491583
tags question: http://stackoverflow.com/q/28438430
tags question: http://stackoverflow.com/q/28521759
tags question: http://stackoverflow.com/q/28522327
tag name: button

http://stackoverflow.com/q/28492852
has answer: http://stackoverflow.com/a/28493060
has comment: http://stackoverflow.com/comment/45635375
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45635040
has title: See if xml has attribute and value
downvote count: 0
answer count: 1
tagged with: javascript
score: 1
has body: I have some xml that looks like this <?xml version="1.0" encoding="UTF-8"?> Oatmeal I have shortened the xml for this example to make it simpler. Now in javascript I want to check if this xml has value and tags after the meal tag.I am using sax.js xml parser and xmlreader.js to read the xml. Now here is what I have and I am very confused why it is not returning true? I read the xml and save it as var res And then to check whether there are values and tags after meal tag I do this. if (res.html.body.menu.day.at(dayNumber).meal) { console.log('IT IS TRUE'); } And it should come true for this xml correct, but it is not what am I missing? Thanks for the help in advance.
favorite count: 0
tagged with: http://stackoverflow.com/tag/xml
type: UnansweredQuestion

http://stackoverflow.com/comment/45506136
has text: I apologize. His question seemed to me something similar to mine and I assumed that perhaps it will be helped to him by that decision which I used (i.e. to use 4f instead of 1f).
comment on: http://stackoverflow.com/q/28584589
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28492511
score: 0
answers question: http://stackoverflow.com/q/28492422
type: Answer
has comment: http://stackoverflow.com/comment/45327468
has comment: http://stackoverflow.com/comment/45307322
has comment: http://stackoverflow.com/comment/45305719
has comment: http://stackoverflow.com/comment/45305881
has body: You should be able to cancel an angular timeout with $timeout.cancel(promise) So something like this should work: var promise = ItemService.checkStatus(); promise.then(function(status) { // do somethin when item is ready. }); $scope.$on('destroy', function(){ if(typeof promise.then === 'function') { $timeout.cancel(promise); } });

http://stackoverflow.com/comment/45325500
has text: About the problem with the `this` context: Use `onclick="res.call(this, 0900);"`.
comment on: http://stackoverflow.com/q/28457319
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/a/28545431
upvote count: 1
has body: The simplest way to do this is to accept a "clicked" option in your sub view: var DateView = Backbone.View.extend({ events: { 'click': 'clicked' }, initialize: function (options) { // allow parent to pass in a click handler this.clicked = options.clicked; } // snip... }) var DatesView = Backbone.View.extend({ render: function () { this.collection.each(function (date) { // pass parentView's click method to child, // binding context to parent var dateView = new DateView({ model: date, clicked: this.clicked.bind(this) }); this.$el.append(dateView.render().el) }, this); return this; }, // snip... jsfiddle
type: Answer
answers question: http://stackoverflow.com/q/28544956
downvote count: 0
score: 1

http://stackoverflow.com/q/28583043
favorite count: 0
tagged with: input
downvote count: 0
answer count: 0
tagged with: orientation
type: UnansweredQuestion
score: 2
has body: I'm using CSS background-image to preview taken photos. (not ) HTML: Upload CSS: .image { position: absolute; top: 0; left: 0; width: 300px; height: 300px; background-size: 100%; background-size: cover; } JS : function readImage(el) { if (el.files && el.files[0]) { var reader = new FileReader(); reader.onload = function (e) { var base64 = e.target.result; $('.image').css('background-image', 'url(' + base64 + ')'); }; reader.readAsDataURL(el.files[0]); } } $('#upload').change(function() { readImage(this); }); When photo taken, the preview gives wrong orientation on mobile Safari. Any know how to fix ? Any trick ? Demo : http://jsfiddle.net/015oek13/
tagged with: mobile-safari
type: Question
upvote count: 2
has title: iOs Safari : Photo preview gives wrong orientation
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28520514
has answer: http://stackoverflow.com/a/28521272
has comment: http://stackoverflow.com/comment/45371354
has title: innerHTML strips classes?
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45371140
tagged with: javascript
has comment: http://stackoverflow.com/comment/45357803
accepted answer: http://stackoverflow.com/a/28521272
has body: I have a div with HTML, that I am trying to push inside an empty div. The new div should acquire all the content and styling from the original. Existing content: Does not show up in new div Shows up in new div New, empty div - where I push everything from "existing_id" into: I am targeting the elements through JS: var existing = document.getElementById("exisiting_id") var existing_li = existing.getElementsByTagName("li") var empty_div = document.getElementById("empty_div") var myArray = [] empty_div.innerHTML = "" // Pushing each existing li element inside myArray for (var i=0; i < existing_li.length; i++) { myArray.push(existing_li[n]; } function make_it_happen() { empty_div.innerHTML += myArray.innerHTML } I am getting the content from #existing_id inside the new div - but not the styling associated with each element. Some elements are also ignored such as Does not show up in new div
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/45358090
has comment: http://stackoverflow.com/comment/45358060

http://stackoverflow.com/comment/45407706
type: QuestionComment
has text: How to resolve that then ? Put the result into this.timer for example ?
comment on: http://stackoverflow.com/q/28543659
score: 0
type: Comment

http://stackoverflow.com/a/28460181
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has body: According to MDN: The HTML element prevents a text from breaking into a new line automagically, so it is displayed on one long line and scrolling might be necessary. This tag is not standard HTML and should not be used. Instead use the CSS property white-space. Instead of nobr why not use display: inline-block: ul li, a { display: inline-block; } Button 3 Button 1 Button 2 Button 3 If you want all to be in the same line use float: left: ul li, a { display: inline-block; float: left; } Button 3 Button 1 Button 2 Button 3
accepted answer of: http://stackoverflow.com/q/28458349
type: Answer
answers question: http://stackoverflow.com/q/28458349

http://stackoverflow.com/q/28506278
type: Question
score: 3
tagged with: timeout
accepted answer: http://stackoverflow.com/a/28533408
upvote count: 3
tagged with: firefox-addon
tagged with: firefox
answer count: 1
tagged with: javascript
has body: I'm trying to make POST request from a Firefox addon var Request = require("sdk/request").Request; Request({ url: "http://127.0.0.1/api", content: "test", onComplete: function (response) { console.error("onComplete " + response.status); } }).post(); but onComplete never runs. How i may fix this? Set network.http.response.timeout = 5 does not work.
favorite count: 0
has answer: http://stackoverflow.com/a/28533408
tagged with: firefox-addon-sdk
type: AnsweredQuestion
downvote count: 0
has title: How set request timeout setting in firefox sdk?

http://stackoverflow.com/comment/45234040
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28451398
has text: when i click first time in url i get http://localhost:60664/Countries/388/10 second time i get http://localhost:60664/Countries/388/20 but then third time it returns to http://localhost:60664/Countries/388/10
score: 0

http://stackoverflow.com/q/28518042
has comment: http://stackoverflow.com/comment/45353662
has comment: http://stackoverflow.com/comment/45353722
has comment: http://stackoverflow.com/comment/45436623
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45353757
tagged with: vim
answer count: 0
linked to: http://stackoverflow.com/q/473478
has title: configure js linter to warn on missing variable definition
type: Question
tagged with: jslint
tagged with: javascript
tagged with: jshint
has body: Suppose I'm working with the javascript below: var mapOptions = { zoom: 6 }; new google.maps.Map('#map', mapOption); I've mistakenly passed mapOption instead of mapOptions. Is there a javascript linter that will pick up on this mistake? Either warning me that mapOption is undefined or that mapOptions is unused? I would love to have this functionality with jshint and vim, but I'm not sure how to set it up.
score: 0
has comment: http://stackoverflow.com/comment/45353771

http://stackoverflow.com/comment/45309892
score: 0
has text: I dont understand what above piece of `<a ... > Resource ` is about? And what you want to achieve with this. Is this the icon or the notification number
type: Comment
comment on: http://stackoverflow.com/a/28494993
type: AnswerComment

http://stackoverflow.com/a/28538934
has comment: http://stackoverflow.com/comment/45560795
has comment: http://stackoverflow.com/comment/45425544
has comment: http://stackoverflow.com/comment/45401395
has comment: http://stackoverflow.com/comment/45434972
has comment: http://stackoverflow.com/comment/45398351
has comment: http://stackoverflow.com/comment/45434900
score: 0
has comment: http://stackoverflow.com/comment/45400293
has comment: http://stackoverflow.com/comment/45415101
has comment: http://stackoverflow.com/comment/45401140
has comment: http://stackoverflow.com/comment/45395944
has comment: http://stackoverflow.com/comment/45396390
has comment: http://stackoverflow.com/comment/45395664
type: Answer
has comment: http://stackoverflow.com/comment/45398921
has body: 1) Create a PHP script that will open and read the json from the live URL: File: get_lightnings.php <?php header('Content-Type: application/json'); echo file_get_contents("http://www.lightningmaps.org/live/"); ?> This will read and echo the json. 2) Query that URL with javascript by using AJAX. Here is an example map script that will query the PHP file with jQuery.ajax() and create a marker for each lightning: function initialize() { var mapOptions = { zoom: 2, center: new google.maps.LatLng(0, 0), mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); $.ajax({ dataType: "json", url: "relative/path/to/get_lightnings.php" }).done(function (data) { data.d.forEach(function (lightning) { new google.maps.Marker({ position: new google.maps.LatLng(lightning.lat, lightning.lon), map: map, title: 'Lightning' }); }); }); } google.maps.event.addDomListener(window, 'load', initialize); Below is the full HTML page for you can copy it right away and test it. Lightnings This was tested and is working fine.
accepted answer of: http://stackoverflow.com/q/28505453
has comment: http://stackoverflow.com/comment/45405211
answers question: http://stackoverflow.com/q/28505453
has comment: http://stackoverflow.com/comment/45434775
type: AcceptedAnswer

http://stackoverflow.com/comment/45458279
type: Comment
type: QuestionComment
has text: u can access the value u working on by using "this" in the function
score: 0
comment on: http://stackoverflow.com/q/28574376

http://stackoverflow.com/a/28541100
has comment: http://stackoverflow.com/comment/60532377
has comment: http://stackoverflow.com/comment/45395866
type: Answer
has body: You can do something like this HTML CLICK ME Controller function TodoCtrl($scope) { $scope.callFunction = function (name){ if(angular.isFunction($scope[name])) $scope[name](); } $scope.testClick = function(){ alert("Called"); } } Working Fiddle Hope this could help you. Thanks.
accepted answer of: http://stackoverflow.com/q/28540598
has comment: http://stackoverflow.com/comment/45395726
score: 29
downvote count: 1
has comment: http://stackoverflow.com/comment/60532331
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/77286958
has comment: http://stackoverflow.com/comment/45395770
has comment: http://stackoverflow.com/comment/77287322
upvote count: 30
answers question: http://stackoverflow.com/q/28540598

http://stackoverflow.com/q/28445453
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has body: input type='file' , when I use it in hybirdApp how to control the images quality. I use ionic and cordova to build app, use angular-file-upload to choose pictures and upload to my serve.
linked to: http://stackoverflow.com/q/8212041
type: UnansweredQuestion
downvote count: 2
tagged with: web-applications
has comment: http://stackoverflow.com/comment/45220336
score: 1
upvote count: 3
has answer: http://stackoverflow.com/a/53279986
has title: input type='file' how to control the images quality
tagged with: ionic-framework
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28445619

http://stackoverflow.com/comment/45304803
score: 0
type: Comment
type: QuestionComment
has text: Is it possible that the modal is not in the DOM (not being shown, or set to display:none) while the script tries to set the id? This would cause that error.
comment on: http://stackoverflow.com/q/28491577

http://stackoverflow.com/q/28447355
score: 0
has answer: http://stackoverflow.com/a/28447402
accepted answer: http://stackoverflow.com/a/28447402
has answer: http://stackoverflow.com/a/28447407
tagged with: php
type: AnsweredQuestion
type: Question
answer count: 2
has body: This is my code in view file in CodeIgniter <?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 " "; } ?> I want to know how to I handle vouchertype[] and mode[] in JavaScript and pass them to controller using AJAX?? This is my javascript code
tagged with: javascript
has title: how to handle html array elements in javascript and pass them to controller using ajax
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28447407

http://stackoverflow.com/comment/45439659
score: 1
has text: Seems like a job for the web server.
comment on: http://stackoverflow.com/q/28564542
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28584773
has answer: http://stackoverflow.com/a/64949111
has answer: http://stackoverflow.com/a/43893305
type: Question
has answer: http://stackoverflow.com/a/58378922
tagged with: javascript
has answer: http://stackoverflow.com/a/64655450
downvote count: 0
answer count: 7
accepted answer: http://stackoverflow.com/a/43893305
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/63931630
possible better answer: http://stackoverflow.com/a/33527729
upvote count: 30
has body: I want to test AJAX methods (vanilla XHR) and I can't find the way to do it with Jest framework. I found mock-ajax.js for Jasmine. The problem is I can't find the way to install it. Is there maybe a better way to unit test Ajax functions in Jest?
has answer: http://stackoverflow.com/a/33527729
tagged with: jestjs
tagged with: xmlhttprequest
has answer: http://stackoverflow.com/a/72940691
score: 30
type: AnsweredQuestion
has title: XMLHttpRequest testing in Jest

http://stackoverflow.com/a/28573330
has body: I'm really not sure why I got downvoted for this but I figured out how to simply copy from one row to another: function copyValuesOnly() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var source = ss.getRange('List!C2:C10'); source.copyTo(ss.getRange('List!D2'), {contentsOnly: true}); }
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45456278
answers question: http://stackoverflow.com/q/28573065

http://stackoverflow.com/comment/45371587
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28528015
has text: ok. so i prefer to empty the object of scope after add: `$scope.books.push(newBook);$scope.aBook={};` thanks.

http://stackoverflow.com/comment/45385822
score: 0
type: Comment
has text: If you look at the list of `joint.js` bundles at https://github.com/DavidDurman/joint/tree/master/dist then there seems to be also `joint.nojquery.min.js` version which OP could use instead of the `joint.min.js`. Do you see a problem with using this bundle?
type: AnswerComment
comment on: http://stackoverflow.com/a/28483178

http://stackoverflow.com/q/28514208
has body: I am doing a leapmotion webapp on PHP and javascript.it is based on gesture recognition. The values of the leapmotion must be stored into the database and when the corresponding gesture is matched the description of the gesture must be displayed. The values from the leapmotion is converted to JSON format. How can I store the JSON data to the mysql database 5.0.? The JSON file content is: {"name":"HA","pose":true,"data":[[{"x":0.16616291409773337,"y":-0.061424365133667,"z":-0.014198921561969446,"stroke":1},{"x":0.058005894163526694,"y":-0.05005164610312531,"z":0.029463953896938344,"stroke":1},{"x":-0.05015112577067998,"y":-0.03867892707258362,"z":0.07312682935584591,"stroke":1},{"x":-0.1583081457048866,"y":-0.02730620804204193,"z":0.1167897048147537,"stroke":1},{"x":-0.2664651656390933,"y":-0.01593348901150024,"z":0.16045258027366138,"stroke":1},{"x":-0.3746221855732999,"y":-0.00456076998095855,"z":0.20411545573256906,"stroke":1},{"x":0.6253778144267002,"y":0.19795540534387668,"z":-0.5697496025117985,"stroke":1}]]} The error which i get is Syntax error. The work is based on Rob O'leary's leaptrainer.js which can be found on https://github.com/roboleary/LeapTrainer.js/tree/master.
type: AnsweredQuestion
tagged with: mysql
has title: Storage of Json data to mysql database using php
type: Question
has comment: http://stackoverflow.com/comment/45346680
answer count: 1
accepted answer: http://stackoverflow.com/a/28514286
has comment: http://stackoverflow.com/comment/45346330
tagged with: javascript
has comment: http://stackoverflow.com/comment/73064083
has comment: http://stackoverflow.com/comment/45346400
has comment: http://stackoverflow.com/comment/45346481
has comment: http://stackoverflow.com/comment/45346450
score: 0
tagged with: php
has answer: http://stackoverflow.com/a/28514286
tagged with: leap-motion

http://stackoverflow.com/a/28530576
score: 1
has comment: http://stackoverflow.com/comment/45408711
upvote count: 1
has body: Try this: if(parseInt(document.getElementById('actual').value) &lt; parseInt(document.getElementById('min').value) || parseInt(document.getElementById('actual').value) &gt; parseInt(document.getElementById('max').value)) { alert("not in range"); }
type: Answer
answers question: http://stackoverflow.com/q/28530274
downvote count: 0

http://stackoverflow.com/q/28545597
has answer: http://stackoverflow.com/a/28545798
score: 0
tagged with: directive
type: Question
tagged with: angularjs-directive
possible better answer: http://stackoverflow.com/a/28545798
has body: I apologize if the question is vague, I'm not quite sure how else to explain what I need. There are some dirty options which come to mind, but I'm a novice AngularJS coder and I feel there is a clean simple method to implement this with directives maybe? What I need is an input box that waits for an ENTER keypress, and fires, and action when it gets it. The action is a simple get from an external JSON object based on the input entered before the enter was pressed. The field should also reset to empty on each newline keypress. :
accepted answer: http://stackoverflow.com/a/28545750
has answer: http://stackoverflow.com/a/28545794
tagged with: javascript
answer count: 3
tagged with: angularjs
has title: AngularJS directive to make input respond on enter
has comment: http://stackoverflow.com/comment/45410102
has answer: http://stackoverflow.com/a/28545750
type: AnsweredQuestion

http://stackoverflow.com/q/28506951
has comment: http://stackoverflow.com/comment/45351227
tagged with: jquery-ui
tagged with: javascript
has comment: http://stackoverflow.com/comment/45351074
score: 0
has body: I´m using the jQuery UI buttonset with knockout. Somehow it works nice with a single "layer" (or scope) but when I apply the selection for an array the UI formatting disappears. I guess it has something to do with ID, but cannot quite manage to figured it out. My view model consists of two items: self.items = ko.observableArray([ new Title( {ID: 1, name: 'The first one', isBold: true, isItalic: false }), new Title( {ID: 2, name: 'The second one', isBold: false, isItalic: true, isUnderlined: true }) ]); self.selected = ko.observable(); HTML: B I U The binding goes like this: ko.bindingHandlers.jqButtonset = { init: function (element) { $(element).buttonset(); // Turns the element into a jQuery UI button }, update: function (element, valueAccessor) { var currentValue = valueAccessor(); $(element).buttonset("option", "disabled", currentValue.enable === false); } }; Fiddle: http://jsfiddle.net/AsleG/cq0fvpe2/ All hints and suggestions are highly appreciated!
has comment: http://stackoverflow.com/comment/45341516
has title: How to make jQuery UI buttonset work with knockoutJS
tagged with: jquery
has comment: http://stackoverflow.com/comment/45333337
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45353215
answer count: 0
has comment: http://stackoverflow.com/comment/45353879
tagged with: knockout.js
type: Question

http://stackoverflow.com/comment/45441932
score: 0
comment on: http://stackoverflow.com/q/28565715
type: Comment
type: QuestionComment
has text: It's exactly the same as just removing the function wrapper and the onload handler, so why use it ?

http://stackoverflow.com/a/28547363
type: Answer
has body: Yes, functions are first class objects. function one() { alert("Hello"); } function runAnotherFunction(anotherFunction) { anotherFunction(); } runAnotherFunction(one); The return value of the prompt function, however, is a string. A string containing JavaScript code is still a string and can't be called as if it was a function. You could eval it, but that is usually a terrible idea (as is asking users to write raw JS to inject into your program in the first place).
has comment: http://stackoverflow.com/comment/45408030
answers question: http://stackoverflow.com/q/28547317
downvote count: 1
score: 4
upvote count: 5
has comment: http://stackoverflow.com/comment/45409781

http://stackoverflow.com/q/28488047
type: Question
has comment: http://stackoverflow.com/comment/45297953
tagged with: javascript
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28488233
linked to: http://stackoverflow.com/q/2579666
tagged with: innerhtml
tagged with: innertext
has title: Is there a way to only replace the innerText of all elements on a page?
has answer: http://stackoverflow.com/a/28488233
type: AnsweredQuestion
has body: Background Based on today's XKCD I created the below script: javascript:var a=document.getElementsByTagName('body')[0].innerHTML;a=a.replace(/Program(\w\w+)*/gmi,'curse').replace(/language/gmi,'word'); If you go to a site (e.g. http://en.wikipedia.org/wiki/Programming_language) and paste the above code (re-adding the javascript: if required) this performs a regex replace on the document's content, whilst preserving most formatting, creating some fun reading. However, the look of the site is affected; presumably because I'm replacing innerHTML rather than just innerText (I guess; though not sure). I can't simply replace innerText as all elements include their child's innerText in their own; doing this on the body element would remove all formatting, and doing it on every element would duplicate huge amounts of content. Question Is there a way to iterate through all nodes in an HTML document, via (minimal) javascript, replacing words in their immediate child text values whilst preserving their remaining content?
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45297875

http://stackoverflow.com/comment/45267202
type: Comment
score: 0
type: AnswerComment
has text: still the same problem, if i try to change the language, the first try will not work, but if i reload the page, will work.. =/
comment on: http://stackoverflow.com/a/28471199

http://stackoverflow.com/q/28453677
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/28453915
has comment: http://stackoverflow.com/comment/45234820
tagged with: hide
has comment: http://stackoverflow.com/comment/45235913
has comment: http://stackoverflow.com/comment/45236671
has answer: http://stackoverflow.com/a/28454928
type: Question
tagged with: html-table
has comment: http://stackoverflow.com/comment/45238628
downvote count: 0
tagged with: javascript
tagged with: show
has comment: http://stackoverflow.com/comment/45234523
has comment: http://stackoverflow.com/comment/45235426
answer count: 3
has comment: http://stackoverflow.com/comment/45235476
linked to: http://stackoverflow.com/q/1392068
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28454928
has answer: http://stackoverflow.com/a/28455332
has comment: http://stackoverflow.com/comment/45235975
favorite count: 0
has title: How to hide multiple (thousands) rows in the html table
upvote count: 3
has comment: http://stackoverflow.com/comment/45239605
has answer: http://stackoverflow.com/a/28453915
has body: I have html page with many rows (is about 40000) row 1 row 2 .... row 30000 I need a fast way to hide/show set of rows (10 000 or 20 000) with the specified name. Platform requirements: IE8-9 and Mozila Firefox. I tray many methods: using tbody, block tags, hiding rows, and stop at one: loop trow the rows and hide/show it: curLevel=root.getAttribute("Name"); var nextElement=curElement.nextElementSibling; while(nextElement!=null) { curElement=nextElement; nextElement=curElement.nextElementSibling; if(curElement.tagName=="TR") { i++; childLevel=curElement.getAttribute("Name"); if(childLevel<=curLevel) break; curElement.style.display = blockStyle; } } But this method is very slow!! Takes is about 2 minutes... Loop goes fast, the slowest part is curElement.style.display = blockStyle; it repaints document every time. Could I change display style for selection rows and then show changes? P.S. without jQuery

http://stackoverflow.com/comment/49961356
score: 0
type: AnswerComment
type: Comment
has text: Thank you, I had the same issue and can confirm this solves it.
comment on: http://stackoverflow.com/a/29404777

http://stackoverflow.com/comment/45443473
type: Comment
type: QuestionComment
score: 0
has text: Check out iframe sandboxing http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/
comment on: http://stackoverflow.com/q/28566559

http://stackoverflow.com/comment/45429075
has text: Don't search anyfurther, you exactly need : http://jqueryui.com/accordion/. Documentation is well made, and provide an example which feets your need.
comment on: http://stackoverflow.com/q/28558649
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28587595
upvote count: 3
score: 3
has body: .load() must be called on an element, like this: $('#element').click(function() { $('#element').load('.../script.php', function(e){ console.log(e); }); });
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28587358
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28587358
type: Answer

http://stackoverflow.com/a/41206267
type: Answer
answers question: http://stackoverflow.com/q/28458052
has body: I have struggled with the same problem for some time now, but I finally cobbled together another solution, using bits of code from others, who have addressed this problem, and it works. It may not be perfect, and I would welcome any improvement suggestions. The concept is that you have two Javascript Functions, which are identicle called Resize0 and Resize1, and they call each other until all photos have been resized then the Function which resizes the last image Submits the Form. The two Functions pass parameters between each other so that one of them will know when to Submit the Form. Two of those parameters are, Number_Of_Images and current Image_Number. You can also download a working Example Web page from http://www.wantitconsulting.co.nz/ExampleResizeUpload.zip . You will need to create a folder in the base directory of your test web site for the Images to go into. The foldername is TestResizeUpload. The Server side uses php.
score: 0

http://stackoverflow.com/a/28516589
score: 1
has comment: http://stackoverflow.com/comment/45352807
has body: Jest does automatic mocking. Just i18n = require('../support/i18n') should be enough. That's why you usually have to call jest.dontMock in the first place. You can find more information here: https://facebook.github.io/jest/docs/automatic-mocking.html
upvote count: 3
downvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/45350603
answers question: http://stackoverflow.com/q/28514868
has comment: http://stackoverflow.com/comment/45350458
has comment: http://stackoverflow.com/comment/82837742

http://stackoverflow.com/q/28537427
tagged with: arrays
tagged with: javascript
tagged with: sorting
type: AnsweredQuestion
has body: In Javascript How do you create an Array of all the elements in the DOM, ordered by their depth, so it something like this... &lt;body&gt; &lt;1stChild&gt; &lt;1stGrandchild&gt; &lt;2ndChild&gt; &lt;3rdChild&gt; &lt;2ndGrandchild&gt; &lt;3rdGrandchild&gt; &lt;1stGreatgrandchild&gt; &lt;2stGreatgrandchild&gt; &lt;4thGrandchild&gt; &lt;4thChild&gt; &lt;etc etc&gt; would look like this... ["body", "1stChild", "2ndChild", "...", "lastChild", "1stGrandchild", "...", "lastGrandchild", "1stGreatgrandchild", "...", "lastGreatgrandchild" "etc. etc."] I have a jQuery solution but would like a pure javascript one
possible better answer: http://stackoverflow.com/a/28537794
favorite count: 0
has answer: http://stackoverflow.com/a/28537794
type: Question
has comment: http://stackoverflow.com/comment/45388905
has answer: http://stackoverflow.com/a/28560301
score: 0
answer count: 2
upvote count: 1
tagged with: dom
downvote count: 1
has title: Return an array of all the DOM elements, sorted by depth
accepted answer: http://stackoverflow.com/a/28560301
has comment: http://stackoverflow.com/comment/45389654

http://stackoverflow.com/a/28445777
has comment: http://stackoverflow.com/comment/45477156
answers question: http://stackoverflow.com/q/28445675
has body: You simply need to bind to the arrangedContent property instead of the model directly. {{#each post in arrangedContent}} {{post.title}} {{post.body}} {{/each}} Please see the documentation for arrangedContent here. Dom Cristie has written a nice overview here.
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28445675
type: AcceptedAnswer
upvote count: 2
has comment: http://stackoverflow.com/comment/45220910
type: Answer
score: 2

http://stackoverflow.com/q/28541893
has comment: http://stackoverflow.com/comment/61573514
has comment: http://stackoverflow.com/comment/54687192
type: Question
tagged with: ios
tagged with: javascript
linked to: http://stackoverflow.com/q/11979156
has comment: http://stackoverflow.com/comment/45802335
possible better answer: http://stackoverflow.com/a/28776254
has answer: http://stackoverflow.com/a/44829409
upvote count: 3
answer count: 3
has comment: http://stackoverflow.com/comment/104048412
downvote count: 0
has title: iOS Safari Mobile doesn't trigger pageshow firing only once
favorite count: 0
linked to: http://stackoverflow.com/q/20899274
has comment: http://stackoverflow.com/comment/61575853
has answer: http://stackoverflow.com/a/28776254
tagged with: safari
has comment: http://stackoverflow.com/comment/61573078
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/61565780
has body: The iOS Safari doesnt't seem to trigger pageshow event in the following situation. Lets say I have 3 pages Page A : (has some code code on pageshow event) Page B Page C User navigates from A -&gt; B. Presses the back button. (pageshow triggers fine) User then navigates to another page could be Page B or Page C. Then presses the back button again. (pageshow doesn't trigger) On the contrary if the user minimizes and maximizes the window again or switches to another window and back (by pressing the middle button on iPhone) the pageshow event is triggered again. Everything seems to work fine on Android window.onpageshow = function(e) { alert('hello'); } Did anyone else face it? I spent hours on this thing and couldn't think of a workaround. Any help would be greatly appreciated.
has answer: http://stackoverflow.com/a/37011941
accepted answer: http://stackoverflow.com/a/37011941

http://stackoverflow.com/comment/45403046
type: Comment
type: QuestionComment
has text: @JustinMorgan I tested it in Chrome, IE and Firefox and I still notice the jump. It only occurs when the number of columns change as that is when the Isotope container is resized. It is more apparent when there are many items in the isotope grid. Here is a video showing the jumping effect: https://drive.google.com/file/d/0B5OxMCWiLhrMdGZXNno5U0xiTDQ/view?usp=sharing
comment on: http://stackoverflow.com/q/28530204
score: 0

http://stackoverflow.com/comment/45466283
has text: is getNodeType asynchronous? Otherwise, do you even need a watch?
comment on: http://stackoverflow.com/q/28578866
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45408596
type: Comment
has text: Sorry, I unintentionally used the minified version. Here's a fiddle with the proper one: http://jsfiddle.net/vf7adn54/7/ easy to understand.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28547604

http://stackoverflow.com/a/28636319
score: 0
type: Answer
has body: Once you have your heightmap image data, you need to read the pixels in like this: http://www.w3schools.com/tags/canvas_getimagedata.asp That method will transfer your image to a canvas where you can do imageData lookup to see what each pixel's RGBA value is. var imgData = context.getImageData(0,0,canvas.width,canvas.height); function lookUpPixelColor( imageData, ux, uy ){ var px = Math.floor( ux * imageWidth ); var py = Math.floor( uy * imageHeight ); var index = (uy * imageWidth + ux) * 4; if( index &lt; 0 || index &gt;= imageData.data.length ){ return 0; } return { r: imageData.data[ index ] , g: imageData.data[ index + 1 ], b: imageData.data[ index + 2 ] }; } This function will now be used to look up any pixel, between a 0 to 1 value. Then, for every pixel or nth pixel, read the heightmap color value. Assuming a grayscale image with pixel values between 0-255, you can have that many 'levels' of elevation, so 255 would be the tallest peak and 0 would be the lowest possible value. Now that you've done this, you can loop through each vertex in your plane and solve for the lookup: geometry.vertices.forEach( function( v ){ var ux = v.x / planeWidth; var uy = v.y / planeHeight; var rgb = lookUpPixelColor( imageData, ux, uv ); var height = rgb[ 0 ] / 255; var z = height * maxHeight; v.z = z; }); This assumes the plane geometry's first vertex is 0,0 and goes to planeWidth/planeHeight. That might not be the case with generated PlaneGeometry from THREE.js, as it may be from -width/2 to width/2 So it would look like: geometry.vertices.forEach( function( v ){ var ux = (v.x + planeWidth * 0.5) / planeWidth; var uy = (v.y + planeHeight * 0.5) / planeHeight; var rgb = lookUpPixelColor( imageData, ux, uv ); var height = rgb[ 0 ] / 255; var z = height * maxHeight; v.z = z; }); Another quirk is that plane might be generated along XZ instead of XY, so if that's the case then simply replace v.y with v.z during the lookup. Alternatively, you can use the UVs from faceVertexUVs to do …
answers question: http://stackoverflow.com/q/28568608

http://stackoverflow.com/comment/45398358
comment on: http://stackoverflow.com/a/28541846
type: AnswerComment
has text: @dan_paul — The colour, from the question, is -16777216. That converts to -1000000, which isn't anything like a valid CSS colour.
score: 0
type: Comment

http://stackoverflow.com/comment/45274490
comment on: http://stackoverflow.com/q/28474402
score: 0
type: Comment
type: QuestionComment
has text: @kanor1306 : Indeed, my bad when copying, but this solution does not work

http://stackoverflow.com/a/28440809
type: AcceptedAnswer
type: Answer
has body: Just use a class, and add some inner logic. For example - using data-* attrs would be the cleanest: click me! Here's a demo: $(document).ready(function(){ $(".knapp").on('click', function() { var $this = $(this), // so I only call $(this) once target = $this.data('target'), // grab target text = $this.data('text'); // grab text $(target).text(text); // finally, execute }); }); * { font-family: sans-serif; } button { background: white; border: 1px solid #c1c1c1; border-radius: 3px; padding: 5px; } div { margin: 5px; } Dog goes Cat goes Gris(?) goes hund katt gris
downvote count: 1
accepted answer of: http://stackoverflow.com/q/28440769
answers question: http://stackoverflow.com/q/28440769
score: -1
upvote count: 0

http://stackoverflow.com/q/28554349
has answer: http://stackoverflow.com/a/37421984
has answer: http://stackoverflow.com/a/37955852
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/45421641
answer count: 10
has comment: http://stackoverflow.com/comment/45423634
has comment: http://stackoverflow.com/comment/45421584
favorite count: 0
has answer: http://stackoverflow.com/a/39262263
has comment: http://stackoverflow.com/comment/45421791
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/69522909
score: 6
has answer: http://stackoverflow.com/a/33282384
accepted answer: http://stackoverflow.com/a/31440750
tagged with: css
has comment: http://stackoverflow.com/comment/45421677
upvote count: 6
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29045898
has comment: http://stackoverflow.com/comment/45421627
has comment: http://stackoverflow.com/comment/45421623
has title: Bootstrap 3 navbar links not working
linked to: http://stackoverflow.com/q/38044481
has answer: http://stackoverflow.com/a/35700393
has comment: http://stackoverflow.com/comment/45421687
has body: I have a navbar with links in it. The "brand" link is working but nothing in the ul does. I have read things about e.preventDefault(); being a problem when it is with the $('ul.nav > li').click(function (e) {. I also have read where it has something to do with the z-index. I don't find any of those to be the case (unless I couldn't find it embedded in a js file loaded with the application and not residing in my assets folder). What could cause this? I'm not sure whether it would be in the css or the js file. Also, the toggle works fine, it's just the active links. Welcome <!--[if lt IE 9]> <![endif]--> Toggle navigation Brand About Services Contact Portfolio This That The other Blog Bikes Planes Trains Other Pages Candy Fruit Lost Found Hair Cuts While inspecting elements, I found an error... TypeError: undefined is not an object (evaluating '$(target).offset().top') which points to this part of the jquery.js file. //smooth scroll $('.navbar-nav > li').click(function(event) { event.preventDefault(); var target = $(this).find('>a').prop('hash'); $('html, body').animate({ scrollTop: $(target).offset().top // this line here }, 500); }); However, when I look at the jquery documentation (http://api.jquery.com/event.preventdefault/), it say, "If this method is called, the default action of the event will not be triggered.". So it seems that might be the case, but I'm not sure how to get around it.
type: Question
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/24024539
has answer: http://stackoverflow.com/a/31440750
possible better answer: http://stackoverflow.com/a/37421984
has answer: http://stackoverflow.com/a/28555743
has answer: http://stackoverflow.com/a/34286696

http://stackoverflow.com/q/28517609
has body: Is possible to translate in Javascript the auto-recall function draw() in Processing? How to simulate that behavior in JS?
type: Question
tagged with: draw
answer count: 1
downvote count: 0
tagged with: javascript
has title: draw() function of Processing in Javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45352425
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/52032506
tagged with: processing
score: 3
upvote count: 3

http://stackoverflow.com/q/28454430
type: Question
tagged with: dynamics-crm-2011
has answer: http://stackoverflow.com/a/28476126
tagged with: javascript
answer count: 3
has title: How to disable form selector in ms crm
type: UnansweredQuestion
score: 0
has answer: http://stackoverflow.com/a/75799204
has body: I am trying to disable form selector so that few users should not switch to other forms. I tried using document.getElementById("crmFormSelector").disabled = true; and document.getElementById("formselectorcontainer").disabled = true; but these two lines not working. Any help appreciated.
has answer: http://stackoverflow.com/a/58101362

http://stackoverflow.com/comment/45340874
type: AnswerComment
has text: No problem, you can also look at a Grunt plug in called ngAnnotate, it could do this automatically for you.
type: Comment
comment on: http://stackoverflow.com/a/28490992
score: 1

http://stackoverflow.com/comment/45298066
has text: Can you post a link to the site? the file downloader is giving me trouble
comment on: http://stackoverflow.com/a/28463565
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28496813
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: angularjs
tagged with: android
tagged with: http://stackoverflow.com/tag/html
tagged with: cordova
answer count: 0
type: UnansweredQuestion
upvote count: 1
has body: I have a Cordova application running on an Android 4.4.2, using AngularJS. I have an HTML5 time input element that shows up as a native time-picker once clicked. The text in the screen (before selecting the control) shows up as 24-hour format (independent of how I set the device time format), but the native control shows the format as 12 or 24 hour based on the device setting. In the code below, the wakeupTime.hhmmss is a text-value for example equal to "22:34" (no sec). When selecting the control and setting for example 10:15PM in the control, 22:15:00 is shown on the web page. &lt;input class="form-inline form-control" ng-model="wakeupTime.hhmmss" type="time" size="10" name="usr_time" ng-change="setWakeupTime()" value="{{wakeupTime.hhmmss}}"&gt; I am struggling with this at multiple levels, but my main problem now is the time-format consistency. I must be doing something wrong in how I've approached it. I also struggle with the initial value of the control not being initiated correctly, so I'm doing something wrong here also, but I can live with that one. I have screen shots, but I'm not allowed to include as I have no reputation :(
score: 1
type: Question
has title: Time input field in form on android is inconsistent for 12/24 hour setting

http://stackoverflow.com/a/28458444
downvote count: 1
upvote count: 12
accepted answer of: http://stackoverflow.com/q/28458208
answers question: http://stackoverflow.com/q/28458208
score: 11
has comment: http://stackoverflow.com/comment/45243410
type: AcceptedAnswer
has body: As innerHTML suggests you can also add HTML. You could for instance add a span tag with a class that you style via CSS. JS/CSS and HTML document.getElementById('error-message').innerHTML = "my error"; .error { color: red; font-size: 24px; }
type: Answer

http://stackoverflow.com/q/28472456
has answer: http://stackoverflow.com/a/28524428
upvote count: 3
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45269369
tagged with: intel-xdk
type: Question
tagged with: magento
tagged with: javascript
has body: I have an issue with my mobile application that I'm building using phonegap. I will be connecting this app to Magento and fetch products' details and display in the app. Oauth is configured for this url i.e. http://localhost/Basava/api/rest/products it gives me the json output if I type this url in address bar. Now I've written an ajax query in my app to request the same url to fetch json that I'll use to display images in the app. &lt;script type="text/javascript"&gt; function imageLoad() { $.ajax({ type: 'GET', url: 'http://localhost/Basava/api/rest/products', data: { get_param: 'value' }, dataType: 'json', success: function (data) { alert('success'); .... .. }, error: function() { alert('error'); } }); } &lt;script&gt; &lt;/head&gt; &lt;body onload="imageupload()"&gt; &lt;div id="afui"&gt; ...` I've removed the logic in the success function and &lt;body&gt; since that is not part of my problem. Since I'm developing it in phonegap environment, I tested it using intel xdk. case 1: While using the debug tab in intel xdk I get the error alert. case 2: Using the app emulator in intel xdk I get success alert. case 3: Opening the app in my browser gives the error alert. Now I cannot understand these. Can anyone please explain this? What I'm doing wrong? I want to be able to load the app page in browser for debug purposes. Edit: Even if I change the error handler to look like this alert: function(jqXHR, textStatus) { alert(textStatus); } I just get an alert box, which displays nothing but plain error written on it.
downvote count: 0
answer count: 1
favorite count: 0
tagged with: cordova
type: UnansweredQuestion
has title: API request not working while debugging using phonegap but works in emulator, why?
score: 3

http://stackoverflow.com/comment/123321308
score: 0
type: AnswerComment
type: Comment
has text: @QianChen FYI nothing is listed on MDN in order of execution https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
comment on: http://stackoverflow.com/a/28481113

http://stackoverflow.com/a/28491462
has body: Two options: Either specify the function when you remove the event (i.e., $(this).off('click', nameReset)). Example Here jQuery .off() A handler can be removed by specifying the function name in the handler argument. When jQuery attaches an event handler, it assigns a unique id to the handler function. var nameReset = function () { alert(this.className); } var grow = function () { $(this).toggleClass('grow'); $(this).off('click', nameReset); } $('.square').on('click', grow); $('.square').on('click', nameReset); Alternatively, you could namespace the events, ($(this).off('click.square.nameReset')) in order to remove the desired event: Example Here var nameReset = function () { alert(this.className); } var grow = function () { $(this).toggleClass('grow'); $(this).off('click.square.nameReset'); } $('.square').on('click.square.grow', grow); $('.square').on('click.square.nameReset', nameReset);
answers question: http://stackoverflow.com/q/28491439
accepted answer of: http://stackoverflow.com/q/28491439
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/28553306
tagged with: jquery
tagged with: parallax
tagged with: gsap
favorite count: 0
has comment: http://stackoverflow.com/comment/45472506
tagged with: scrollmagic
possible better answer: http://stackoverflow.com/a/28553411
has answer: http://stackoverflow.com/a/28553411
has body: I'm trying to create this "parallax" effect : https://www.laruchequiditoui.fr/fr (like the .homeSection--collection section). It's a div containing three layers with an effect of perspective on scroll. This website uses TweenMax but it seems heavy to me to make just this effect. What is the easiest and lightest way to recreate this parallax scrolling effect ? I tried to clean the laruchequiditoui.fr example to keep only the necessary code : http://is.gd/r0JNHl I need to have multiple instances on a page, like laruchequiditoui.fr website ; andenter code here iPad compatible if possible. Thanks in advance !
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28553385
has comment: http://stackoverflow.com/comment/45419474
downvote count: 1
type: Question
has title: What is the lightest JavaScript plugin for parallax scrolling layers animations?
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45419622
answer count: 2
has comment: http://stackoverflow.com/comment/45419513
has comment: http://stackoverflow.com/comment/45419589
has answer: http://stackoverflow.com/a/28553385
upvote count: 0

http://stackoverflow.com/comment/45438786
has text: when I use static keyword. then textbox1 get underlined and giving an error that textbox1 is non static field.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28563755
score: 0

http://stackoverflow.com/comment/45459197
type: Comment
score: 1
has text: Yes, but attempting to access any property on a primitive results in its conversion (via [`ToObject`](http://es5.github.io/#x9.9)) to an object.
comment on: http://stackoverflow.com/q/28574376
type: QuestionComment

http://stackoverflow.com/q/28547713
downvote count: 1
type: Question
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/28547743
tagged with: replace
has comment: http://stackoverflow.com/comment/45408491
answer count: 2
tagged with: url
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28547826
favorite count: 0
has answer: http://stackoverflow.com/a/28547826
has comment: http://stackoverflow.com/comment/45408423
has comment: http://stackoverflow.com/comment/45408506
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45408664
has body: I am a beginner for Javascript, read several post here but could not get my codes work. Hope you can explain the solution :) So basically I have four set of images, but I need to replace all of the $_12.JPGto $_57.JPG in their URL so I get bigger size of pictures (only images that are assigned to class="ebay" / id="ebay"). I need this to be executed when the browser starts reading the page, no events or buttons involved. The following is my source code: &lt;div&gt; &lt;img class="ebay" id="ebay" u="image" src="http://i.ebayimg.com/00/s/NzgwWDc4MA==/z/neAAAOSwrklU28I8/$_12.JPG?set_id=880000500F"&gt; &lt;img u="thumb" src="http://i.ebayimg.com/00/s/NzgwWDc4MA==/z/neAAAOSwrklU28I8/$_12.JPG?set_id=880000500F"&gt; &lt;/div&gt; &lt;div&gt; &lt;img class="ebay" id="ebay" u="image" src="http://i.ebayimg.com/00/s/NzgwWDc4MA==/z/r8cAAOSwNSxU28I9/$_12.JPG?set_id=880000500F"&gt; &lt;img u="thumb" src="http://i.ebayimg.com/00/s/NzgwWDc4MA==/z/r8cAAOSwNSxU28I9/$_12.JPG?set_id=880000500F"&gt; &lt;/div&gt; &lt;div&gt; &lt;img class="ebay" id="ebay" u="image" src="http://i.ebayimg.com/00/s/NzgwWDc4MA==/z/HLgAAOSwPhdU28I-/$_12.JPG?set_id=880000500F"&gt; &lt;img u="thumb" src="http://i.ebayimg.com/00/s/NzgwWDc4MA==/z/HLgAAOSwPhdU28I-/$_12.JPG?set_id=880000500F"&gt; &lt;/div&gt; &lt;div&gt; &lt;img class="ebay" id="ebay" u="image" src="http://i.ebayimg.com/00/s/NzgwWDc4MA==/z/6VkAAOSwPYZU28I-/$_12.JPG?set_id=880000500F"&gt; &lt;img u="thumb" src="http://i.ebayimg.com/00/s/NzgwWDc4MA==/z/6VkAAOSwPYZU28I-/$_12.JPG?set_id=880000500F"&gt; &lt;/div&gt; I also like to loop the function so when I have more than 4 sets of pictures (maximum 15 sets) and the javascript can still replace the URL for me. The following is what I had tried: window.onload = function() { for ( var i = 0; i &lt; currentLink.length; i++) { var currentLink=document.getElementByClassName('ebay'); var newLink = currentLink.src.replace('$_12.JPG','$_57.JPG'); currentLink.src = newLink; } }
has title: javascript replace url link loop
has answer: http://stackoverflow.com/a/28547743
has comment: http://stackoverflow.com/comment/45408630
has comment: http://stackoverflow.com/comment/45408540
upvote count: 2
tagged with: loops

http://stackoverflow.com/a/28466518
answers question: http://stackoverflow.com/q/28466312
upvote count: 2
has body: I tried to click the Stripe button that opens the pop-window on my site, with Javascript turned off, and nothing happens. There's a short delay between the clicks but other than that, nothing happens. Might be helpful to add a &lt;noscript&gt; tag.
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/q/28484850
has body: I have a small Angular app that I'm writing that makes use of Underscore to look over each object in an array, and remove the object if it does not match the keyword (user input). $scope.search = function() { $scope.posts = _.reject($scope.posts, function(p) { var i = 0; if ($scope.keywords.indexOf(p.author) &lt; 0 ) { i++; } if ($scope.keywords.indexOf(p.id) &lt; 0 ) { i++; } if(i &gt; 0) { return true; } }); }; As you can see I'm setting a counter, and then adding to the counter if the keyword is found in the index, then at the end checking the counter to return true or false to remove the object from the array. $scope.posts is array of objects with my data and $scope.keywords is the user input. I'm wanting to lookup the input from $scope.posts.author object and $scope.posts.id object. If I remove one of the if statements the function performs as expected: everything not matching the keyword is removed from the array. However, as soon as I add another if statement to the function (as seen in my example above), ALL objects are removed from the array.
tagged with: underscore.js
score: 0
has title: Underscore reject Function with IndexOf removes all objects from array
type: Question
has answer: http://stackoverflow.com/a/28484934
tagged with: javascript
has comment: http://stackoverflow.com/comment/45292016
has comment: http://stackoverflow.com/comment/45291665
answer count: 3
accepted answer: http://stackoverflow.com/a/28484934
has answer: http://stackoverflow.com/a/28485235
has answer: http://stackoverflow.com/a/28484966
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/28484966
type: AnsweredQuestion

http://stackoverflow.com/a/28463863
type: Answer
answers question: http://stackoverflow.com/q/28463796
downvote count: 0
score: 1
has body: According to https://developer.mozilla.org/en-US/docs/Web/API/Location.reload you should pass true as an argument to location.reload() to suppress caching.
has comment: http://stackoverflow.com/comment/45254021
upvote count: 1

http://stackoverflow.com/q/28531555
has answer: http://stackoverflow.com/a/28531571
favorite count: 0
has comment: http://stackoverflow.com/comment/45378843
has body: .change() event doesn't work in Chrome when using autocomplete script and work when enter another value doesn't exist in autocomplete ... but my code is totally working fine in Firefox my code as the below $('body').on('change', 'input[name^="itemNo"]', function(){ var currentquantity = $(this).val(); var maxquantity = $(this).data('maxquant'); alert(currentquantity); alert(maxquantity); }) and my html code as the below &lt;input type="text" data-type="product_serial" name="itemNo[]" data-maxquant="" id="itemNo_1" class="form-control autocomplete_txt serial_number_append" autocomplete="off"&gt;
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45378150
has title: .change() doesn't work in Chrome when using autocomplete
tagged with: google-chrome
has answer: http://stackoverflow.com/a/28531736
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/64437847
has comment: http://stackoverflow.com/comment/45378161
upvote count: 2
score: 0
downvote count: 2
answer count: 2
tagged with: jquery
has comment: http://stackoverflow.com/comment/45378239
has comment: http://stackoverflow.com/comment/45378105

http://stackoverflow.com/comment/46728354
score: 0
type: Comment
has text: Great. FYI In general, jQuery has trouble with consistently calculating dims of display: none elements. Around a year ago, Cycle2 switched to using visibility: hidden for inactive slides, which leaves elements in the render tree and thus makes them measurable. See: https://github.com/malsup/cycle2/pull/419. The wrinkle with this is that you need to set your css on your hidden slides thoughtfully, because visibility doesn't inherit intuitively.
comment on: http://stackoverflow.com/a/29111950
type: AnswerComment

http://stackoverflow.com/comment/45424184
has text: when i click remove it removing first div, not removing current clone div
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28555673
type: AnswerComment

http://stackoverflow.com/comment/45417453
comment on: http://stackoverflow.com/a/28552168
has text: Updated my answer with some possible solutions. They aren't great options. I'm not familiar with this theme to know where the problem is being introduced. So I can't offer more specific help other than what I've outline above.
type: Comment
score: 0
type: AnswerComment

css
tags question: http://stackoverflow.com/q/28458208
tags question: http://stackoverflow.com/q/28565041
tags question: http://stackoverflow.com/q/28521417
tags question: http://stackoverflow.com/q/28531563
tags question: http://stackoverflow.com/q/28554750
tags question: http://stackoverflow.com/q/28587609
tags question: http://stackoverflow.com/q/28512966
tags question: http://stackoverflow.com/q/28561192
tags question: http://stackoverflow.com/q/28577558
tags question: http://stackoverflow.com/q/28545817
tags question: http://stackoverflow.com/q/28535302
tags question: http://stackoverflow.com/q/28547110
tags question: http://stackoverflow.com/q/28495309
tags question: http://stackoverflow.com/q/28517056
tags question: http://stackoverflow.com/q/28529361
tags question: http://stackoverflow.com/q/28551624
tags question: http://stackoverflow.com/q/28440930
tags question: http://stackoverflow.com/q/28589940
tags question: http://stackoverflow.com/q/28516586
tags question: http://stackoverflow.com/q/28517287
tags question: http://stackoverflow.com/q/28458157
tags question: http://stackoverflow.com/q/28518307
tags question: http://stackoverflow.com/q/28485953
tags question: http://stackoverflow.com/q/28558649
tags question: http://stackoverflow.com/q/28506109
tags question: http://stackoverflow.com/q/28567073
tags question: http://stackoverflow.com/q/28577741
tags question: http://stackoverflow.com/q/28512488
tags question: http://stackoverflow.com/q/28588719
tags question: http://stackoverflow.com/q/28542203
tags question: http://stackoverflow.com/q/28463834
tags question: http://stackoverflow.com/q/28450557
tags question: http://stackoverflow.com/q/28506955
tags question: http://stackoverflow.com/q/28466259
tags question: http://stackoverflow.com/q/28465495
tags question: http://stackoverflow.com/q/28482874
tags question: http://stackoverflow.com/q/28443104
tags question: http://stackoverflow.com/q/28522687
tags question: http://stackoverflow.com/q/28457812
tags question: http://stackoverflow.com/q/28442995
tags question: http://stackoverflow.com/q/28590265
tags question: http://stackoverflow.com/q/28575615
tags question: http://stackoverflow.com/q/28491840
tags question: http://stackoverflow.com/q/28484706
tags question: http://stackoverflow.com/q/28562114
tags question: http://stackoverflow.com/q/28553246
tags question: http://stackoverflow.com/q/28549555
tags question: http://stackoverflow.com/q/28447837
tags question: http://stackoverflow.com/q/28441466
tags question: http://stackoverflow.com/q/28586618
tags question: http://stackoverflow.com/q/28551087
tags question: http://stackoverflow.com/q/28512001
tags question: http://stackoverflow.com/q/28556559
tags question: http://stackoverflow.com/q/28570694
tags question: http://stackoverflow.com/q/28515990
tags question: http://stackoverflow.com/q/28514044
tags question: http://stackoverflow.com/q/28477022
tags question: http://stackoverflow.com/q/28443814
tags question: http://stackoverflow.com/q/28485351
tags question: http://stackoverflow.com/q/28531633
tags question: http://stackoverflow.com/q/28442109
tags question: http://stackoverflow.com/q/28451655
tags question: http://stackoverflow.com/q/28444271
tags question: http://stackoverflow.com/q/28525639
tags question: http://stackoverflow.com/q/28531652
tags question: http://stackoverflow.com/q/28510310
tags question: http://stackoverflow.com/q/28465555
tags question: http://stackoverflow.com/q/28503785
tags question: http://stackoverflow.com/q/28483712
tags question: http://stackoverflow.com/q/28450736
tags question: http://stackoverflow.com/q/28567642
tags question: http://stackoverflow.com/q/28536878
tags question: http://stackoverflow.com/q/28453117
tags question: http://stackoverflow.com/q/28438448
tags question: http://stackoverflow.com/q/28546358
tags question: http://stackoverflow.com/q/28461780
tags question: http://stackoverflow.com/q/28592407
tags question: http://stackoverflow.com/q/28514243
tags question: http://stackoverflow.com/q/28459887
tags question: http://stackoverflow.com/q/28528693

http://stackoverflow.com/a/28495293
type: Answer
answers question: http://stackoverflow.com/q/28472715
score: 0
accepted answer of: http://stackoverflow.com/q/28472715
has comment: http://stackoverflow.com/comment/45310690
has body: Jssor slider will duplicate 'outer container' and 'slides' container while initialize. And it will remove id attribute from duplication. Duplicate 'outer container' is to scale the slider. Duplicate 'slides' container is for slideshow purpose. I see. Please replace &lt;div id="slider_container" with &lt;div id="slider_container" class="slider_container" And replace div#slider_container { with div.slider_container {
type: AcceptedAnswer

http://stackoverflow.com/comment/45276967
score: 0
type: QuestionComment
type: Comment
has text: You want to preserve the link in the address bar and want to show the user a different page?
comment on: http://stackoverflow.com/q/28476841

http://stackoverflow.com/q/28517076
type: UnansweredQuestion
tagged with: php
type: Question
has body: Here is my code: function addTag(name, attributes, sync, cond) { var el = document.createElement(name), attrName; for (attrName in attributes) { el.setAttribute(attrName, attributes[attrName]); } sync ? document.write(outerHTML(el)) : headEl.appendChild(el); } function outerHTML(node){ // if IE, Chrome take the internal method otherwise build one return node.outerHTML || ( function(n){ var div = document.createElement('div'), h; div.appendChild(n); h = div.innerHTML; div = null; return h; })(node); } Here is my call: addTag('script',{"src":"\/\/oss.maxcdn.com\/html5shiv\/3.7.2\/html5shiv.min.js"},1,'lt IE 9'); How do I place less than tags in my code? The argument is cond
has answer: http://stackoverflow.com/a/28517147
answer count: 1
tagged with: javascript
score: 0
has title: append lt IE using document.createElement

http://stackoverflow.com/q/28463644
answer count: 2
has comment: http://stackoverflow.com/comment/45253038
upvote count: 0
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/3173666
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28463672
tagged with: css
has body: I have an element (input) that has this code to give it a background on a small area (like a badge) jQuery(this).css("background", "url(data:image/png;base64,&lt;BASE64_ENCODED_DATA&gt;) 99% 50% no-repeat scroll rgb(231, 248, 231)"); I want to make it so that when you hover the background the cursor will change to a pointer. Thank you
has comment: http://stackoverflow.com/comment/45253728
has title: Change cursor on background hover
downvote count: 2
type: Question
score: -2
tagged with: javascript
has answer: http://stackoverflow.com/a/28463688
has comment: http://stackoverflow.com/comment/45253026

http://stackoverflow.com/comment/45352731
comment on: http://stackoverflow.com/q/28517771
type: Comment
type: QuestionComment
has text: No error in the console, and document.ready not being executed seems highly unlikely, are you sure about this, and is the code exactly as posted ?
score: 3

http://stackoverflow.com/a/28582794
upvote count: 5
has body: You should change code to this :
accepted answer of: http://stackoverflow.com/q/28582520
score: 5
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28582520

http://stackoverflow.com/q/28464949
favorite count: 0
has answer: http://stackoverflow.com/a/28465147
accepted answer: http://stackoverflow.com/a/28465147
type: AnsweredQuestion
downvote count: 0
tagged with: mootools
type: Question
score: 3
tagged with: javascript
has title: Mootools morph using variable
upvote count: 3
has body: I'm creating a javascript function for my website that accepts several parameters, and then uses said parameters to perform a morph. Rather normal stuff, however the morph doesn't work. It seems that by getting the css attribute I want to morph (ie height) as a variable, I am bugging. Base code being used: window.addEvent('load', function() { var box = $('box'); var sfx = new Fx.Morph(box, { duration: 1000, transition: Fx.Transitions.linear }); var cssParam = 'height'; var endVal = '100'; sfx.start({cssParam endVal}); console.log(sfx); }); #box { width:200px; height:200px; background-color: #FFFFFF; border: 1px solid #000000; } &lt;div id="box"&gt;&lt;/div&gt; The morph is taking the variable cssParam literally, and is trying to morph cssParam to 100. Obviously I am doing this wrong, how do I fix this issue?
answer count: 1

http://stackoverflow.com/q/28438029
answer count: 1
favorite count: 0
has body: I'm trying to detect if part of a string exists, with: if (loopCache.indexOf('&lt;ul class=\"bullet-list-round\"&gt;') &gt; -1){ } Where the whole string as an example is: var loopCache = 'Active Life&lt;ul class=\"bullet-list-round\"&gt;'; indexOf won't detect at all, probably due to escape issues?
has comment: http://stackoverflow.com/comment/45205959
type: UnansweredQuestion
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28438246
tagged with: escaping
has comment: http://stackoverflow.com/comment/45206150
tagged with: indexof
tagged with: javascript
has title: Javascript indexOf string with escaping
score: 0
has comment: http://stackoverflow.com/comment/45205971
has comment: http://stackoverflow.com/comment/45205920

http://stackoverflow.com/comment/45663179
has text: @daniellmb Last I heard they're working on it for the version of SignalR that will be part of ASP.NET 5. That issue was closed because they're moving it to a repo under the aspnet Github organisation.
score: 0
comment on: http://stackoverflow.com/q/28487517
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28485614
answers question: http://stackoverflow.com/q/28485398
accepted answer of: http://stackoverflow.com/q/28485398
has body: You should be able to use the Array.indexOf on the images collection. function srcSend(){ var index = Array.prototype.indexOf.call(document.images, this); }
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/28451565
score: 0
has body: Changing the html code in your browser does not change your code! You have to change the source code of your gwt application. The html code which is loaded in your browser is the compiled/generated html code from your gwt application source code. So, if you are using UiBinding, then you have to find the ui.xml file which contains the element you want to remove. If you are not using UiBinding then the element is created in a gwt/java view class. So you have to find the gwt/java view class which creates the element.
type: Answer
answers question: http://stackoverflow.com/q/28451286
has comment: http://stackoverflow.com/comment/45566463

http://stackoverflow.com/comment/45257980
type: Comment
type: QuestionComment
has text: There is an url there for the file `contact_form.php`. What is in there? There should be the email address.
score: 0
comment on: http://stackoverflow.com/q/28466073

http://stackoverflow.com/comment/45729028
comment on: http://stackoverflow.com/a/28553956
type: AnswerComment
score: 0
type: Comment
has text: If you send me your current code I can take another look at it tonight... I'm not sure how much more can be done.. in general scroll effects are finicky and not easy to get a nice effect across multiple platforms for.

http://stackoverflow.com/a/28445227
score: 1
has comment: http://stackoverflow.com/comment/45220203
upvote count: 1
has comment: http://stackoverflow.com/comment/45220159
answers question: http://stackoverflow.com/q/28445131
downvote count: 0
has body: The code you have will handle the response. You just have to do something with it. If you're returning a string of text, you can do something like this: .done(function(response){ alert(response); }); If you are returning some HTML, maybe something like this: .done(function(response){ $(response).insertAfter('div'); }); EDIT Of course, if you submit the form, then there is no point in trying to retrieve a response from the server. But right now your code is submitting the form and trying to do an AJAX request. Might as well stop the form from submitting and doing the AJAX request so you can do something with the response.
type: Answer

http://stackoverflow.com/q/28482535
has title: Cannot invoke Java applet methods from Javascript
has comment: http://stackoverflow.com/comment/45292771
tagged with: javascript
has comment: http://stackoverflow.com/comment/45291132
score: 0
tagged with: applet
has body: I am trying to load an applet in a browser and invoke it's methods from JavaScript. The applet is called as follows: var attributes = { id: 'applet1', name: 'applet1', code: 'com.applet.MyApplet.class', archive: '../applet.jar', width: 0, height: 0, mayscript: 'yes', scriptable: 'true', separate_jvm: 'true'}; var parameters = {tokenType: "'" + jQuery("#tokenType").text() + "'"}; var version = '1.6'; var appletTag = deployJava.getAppletTag(attributes, parameters, version); jQuery('body').append(appletTag); and I can see the tag when I reference the above in the console using "document.applet1". But when I try to invoke a simple public method I have exposed in the MyApplet class, I get the following: TypeError: "document.applet1.isActive()" is not a function The init() method never seems to be called either. I see all of the security prompts but go ahead and allow the applet to be loaded. I am using Firefox 35.0.1 with the Java Applet Plugin version 7 update 45. Edit: The following is the JS code that first tries to access the applet: function issueNewToken(wrongPasswordMessage) { console.log('issueNewToken() called at ' + new Date().getTime()); try { if (!document.applet1.isActive()) { // ERROR OCCURS HERE! setTimeout(function () { issueNewToken(wrongPasswordMessage); }, 1000); console.log('applet not ready yet. call rescheduled at ' + new Date().getTime()); return; } // the applet is not ready to call yet } catch (err) { console.error(err); if (err instanceof TypeError) { setTimeout(function () { issueNewToken(wrongPasswordMessage); }, 1000); console.log('applet not ready yet (exception caught). call rescheduled at ' + new Date().getTime()); return; } // all other errors such as user do not allow applet to run else { hideModalCover(); alert(err.message); return; } } /// We have access to applet.. more work done here... } Any suggestions would be greatly appreciated.
has comment: http://stackoverflow.com/comment/45313796
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45288372
tagged with: java
type: Question

http://stackoverflow.com/q/28569543
type: AnsweredQuestion
score: 0
has body: I am bringing angularjs in using require but the problem is, the angular tags show for a moment until the angular script is parsed. Do I have to bring angularjs out of requirejs and have it defined before requirejs is initialized or is there a better way to do it? Here is my requirejs: require.config({ map: {}, paths: { "angular": [ "angular" ], "jquery": [ "jquery" ], 'bootstrap': [ 'bootstrap' ], 'kendo': [ 'kendo' ] }, shim: { 'bootstrap': ['jquery'], 'kendo': ['jquery'], 'angular': { exports: 'angular' } } })
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28570131
answer count: 2
has title: AngularJS with RequireJS tags showing breifly
accepted answer: http://stackoverflow.com/a/28570131
possible better answer: http://stackoverflow.com/a/28570039
tagged with: angularjs
has answer: http://stackoverflow.com/a/28570039
tagged with: requirejs

http://stackoverflow.com/comment/45271192
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28473688
score: 0
has text: Please be more specific and show some code. What have you tried? What is TableSorter?

http://stackoverflow.com/q/28485714
has title: CSS Positioning a table and blocks
has answer: http://stackoverflow.com/a/28486090
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28486160
has comment: http://stackoverflow.com/comment/45293327
tagged with: css-position
type: UnansweredQuestion
tagged with: css
has body: ¡Hello! I designed a Budget Calculator and implemented it in Drupal 7. You can see the result here: http://www.delengua.es/curso-espanol-espana/calculadora-de-precios I'm sure it has a lot of errors. But the one i want to fix is related to the position of the blocks. You may see that if you click on some option in the optgroup called "Cursos" (or in another one), you'll se an information square sided to the right of the table (i mean the table that contains the form). Specifically, if you click on "Cursos específicos" and you select something in the new optgroup, you'll get two information blocks. As you can see if you inspect them, they're positioned like this: display: none; position: absolute; right: 6.5%; top: 12.5%; margin: 15px 15px; width: 220px; height: auto; padding: 10px 10px; Though that looks as working fine, it changes the position in firefox, and i'm frightened that it will cause more trouble. So my question is... would it be any other way to position it in relation to the table? I mean, the 'y' position should be the same as the table, and the 'x', the same + some number of pixels. I think it can be done through two ways: a) With JavaScript (i don't know how, but i guess i could learn googling it). b) Just with html and css. As i prefer this option, i've tried to group the table and the information labels in only one '&lt;div&gt;', to declare the labels as 'inline:block;', to float them to the right, but when i do one of those things, i cannot modify the "top" position property. I got that ideas from other threads in Stackoverflow, but i don't know what can i try else. So i'll really thank any help.
type: Question
answer count: 2
tagged with: javascript

http://stackoverflow.com/comment/45271218
type: QuestionComment
has text: @Arunprasanth KV Nothing is impossible. Check out this fiddle http://jsfiddle.net/56a7711y/ and my answer
comment on: http://stackoverflow.com/q/28473373
score: 0
type: Comment

http://stackoverflow.com/comment/45494447
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28573225
has text: If you want to intercept data and feedback modified data use nsITraceableChannel: https://github.com/Noitidart/demo-nsITraceableChannel

http://stackoverflow.com/comment/45363274
has text: please check the below code and let me know if that was useful.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28500258
score: 0

http://stackoverflow.com/comment/45455443
type: AnswerComment
has text: @Shamoon: To signal the end of the stream (I had hoped that would be clear from the message :-/). In the example it would then be used to remove the `#more`-button after all chunks are loaded and stuff was done to them. Of course, this is only one method to consume such a stream, and there are other ways of representing a data stream with promises.
comment on: http://stackoverflow.com/a/28550024
type: Comment
score: 0

http://stackoverflow.com/a/28573132
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28573004
score: 0
type: Answer
has body: The only way to achieve this is with the UnityPlayer SendMessage method. You can also call javascript on the page from your game with the Application.ExternalCall function. There is a page in the manual on how to do this : http://docs.unity3d.com/Manual/UnityWebPlayerandbrowsercommunication.html
answers question: http://stackoverflow.com/q/28573004

http://stackoverflow.com/comment/45272174
score: 0
type: Comment
type: QuestionComment
has text: I'm confused. is the causing an issue?
comment on: http://stackoverflow.com/q/28474174

http://stackoverflow.com/comment/45320374
comment on: http://stackoverflow.com/a/28500425
type: AnswerComment
has text: Yet.. when I remove "filter: " I have an error like this: Error: [$injector:unpr] Unknown provider: tagNameFilterProvider <- tagNameFilter
score: 0
type: Comment

http://stackoverflow.com/comment/45238404
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28445743
has text: JQuery would be the only library required which is already being used in the first example. But if you didn't use jQuery waypoints can be used without it as a dependency.

http://stackoverflow.com/comment/45277488
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28476723
has text: In my page, I will have a lot of date picker and client side logic. I'll have to set all your javascript blocks and hidden fields for any datepicker in my app? :( Do you advice me if is better to use pure angularJS date picker? Do you advice me if is better to develop an entire AngularJS / Rest API stack (without bind with Django backend forms)?

http://stackoverflow.com/a/28446042
downvote count: 0
has body: When you pass a string to setTimeout it is resolved to code in the global context. However your calculateHelper is defined as a local variable. $('#buy_vs_rent_calculate').on('click', function(){ if(valuesArr.length === 1){ setTimeout(function () { calculateHelper(valuesArr[0]); },100); } else { alert("Please set three of the four values using the sliders; leave only one field blank to be calculated") } var calculateHelper = function(valueToCalc){ ... }; });
type: Answer
upvote count: 5
answers question: http://stackoverflow.com/q/28445994
score: 5

http://stackoverflow.com/a/28708060
upvote count: 1
type: Answer
downvote count: 0
has body: Basically, never deep copy something until you really need to. So start by sharing your response with everyone. Then if a subsriber needs to modify the data, for instance to complete it in a way that wouldn't break what other subscribers do but can only better serve them, then it is more effective to keep the reference both in term of memory space and performances. However if a subscriber needs to do specific formatting/editing of the data privately, you should still think about weither you really need a deep copy, or could you simply copy the relevant information. For instance let's say you get scope.response = bigDataObject; Somewhere an observer need to edit a specific property: scope.data = angular.copy( bigDataObject.some.deeper.property ); scope.data.name = 'somethingElse'; This way tou didn't share the private edit, but neither did you deep copy the whole data. By only dealing with the smaller subset of data you actually need, you prevent side effects, save performances and memory, and keep the code understandable maintenable.
answers question: http://stackoverflow.com/q/28582783
score: 1

http://stackoverflow.com/q/28585581
favorite count: 0
has comment: http://stackoverflow.com/comment/45478363
has body: I have setup a fiddle here. The following code generates an html list from an object function generateList(data, $e) { // create an inner item function createInner(obj) { var li = $('&lt;li&gt;'); li.text(obj.text); if (obj.children != undefined &amp;&amp; obj.children.length &gt; 0) { innerList = $('&lt;ul&gt;'); for (var i = 0; i &lt; obj.children.length; i++) { var child = obj.children[i]; innerList.append(createInner(child)); }; li.append(innerList); } return li; } for (var i = 0; i &lt; data.length; i++) { $e.append(createInner(data[i])); } } The following dataset has been used as an example - [ { "text": "item1" }, { "text": "item2", "children": [ { "text": "subItem", }, { "text": "another subItem", }, { "text": "last subItem", } ], }, { "text": "item3", "children": [ { "text": "Hello", }, { "text": "Inner List", "children": [ { "text": "innerItem1", }, { "text": "innerItem2", } ] }, { "text": "Bye", } ], } ] The list item which has item3 written should have an inner list containing two more children, but it is not happening. The item labelled Inner List is not shown in the html output. Neither is the item labelled Hello. item3 contains only innerItem1, innerItem2 and Bye. How can I overcome this ?
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/45478565
score: 1
has answer: http://stackoverflow.com/a/28585857
accepted answer: http://stackoverflow.com/a/28585857
has comment: http://stackoverflow.com/comment/45478874
type: Question
has title: Recursive list generator function in javascript
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28585933
has comment: http://stackoverflow.com/comment/45478609
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/45478822
tagged with: web
possible better answer: http://stackoverflow.com/a/28585933

http://stackoverflow.com/q/28528444
answer count: 2
possible better answer: http://stackoverflow.com/a/28528587
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45372250
tagged with: node.js
favorite count: 0
score: 2
upvote count: 2
has answer: http://stackoverflow.com/a/28528587
linked to: http://stackoverflow.com/q/18188083
type: AnsweredQuestion
has body: Im trying to model a product in javascript: var Product = {}; Product.getSku = function() { return this.sku; } Product.getPrice = function() { return this.price } Product.getName = function() { return this.name } module.exports = Product; What is the correct way to create this object with the required properties? Im coming from an oop background, am I thinking of js wrong?
has answer: http://stackoverflow.com/a/28528540
accepted answer: http://stackoverflow.com/a/28528540
has comment: http://stackoverflow.com/comment/45372155
has title: javascript - class with data how to load
type: Question

http://stackoverflow.com/a/28477473
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45290789
type: Answer
has comment: http://stackoverflow.com/comment/45281729
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28476588
has body: You have everything configured fine, when you resize each graph still has its own data. The only thing you didn't take into account that you log only the isolated scope of the second directive. Update the log to: console.log(scope.$parent.data); console.log(scope.$parent.data2); And you will see you can reach each isolated scope data using the parent.
accepted answer of: http://stackoverflow.com/q/28476588
has comment: http://stackoverflow.com/comment/45280516

http://stackoverflow.com/q/28468089
has body: I have a list with both numbers and strings in there. Each element of the list looks something like: { 'name': 'Bob', 'number': 234234 } But, either name or number may be missing. In my sortBy I did something like this: _.sortBy(list, function(element) { if (element.name) { return element.name; } else { return element.number; } }); This sorts the elements with numbers in front of the elements without it. How do I get lodash to deprioritize numbers?
answer count: 3
score: 3
downvote count: 0
has answer: http://stackoverflow.com/a/28590876
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45262003
tagged with: lodash
has title: lodash sortby, how to sort numbers later than letters?
has answer: http://stackoverflow.com/a/28490496
tagged with: underscore.js
upvote count: 3
has comment: http://stackoverflow.com/comment/45261860
type: Question
has comment: http://stackoverflow.com/comment/45487871
tagged with: javascript
has answer: http://stackoverflow.com/a/28490977

http://stackoverflow.com/q/28471323
answer count: 2
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28471472
linked to: http://stackoverflow.com/q/1749272
has title: Sending data to PHP page to make a spreadsheet out of it
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28523392
has body: For some reason, when I try to send JSON data to a PHP page (where it gets downloaded as a spreadsheet), it runs without error, but doesn't bring up the prompt to download the spreadsheet. The JSON has generated without problem (I have made the PHP page create the file on the server, before trying to make it download without creating it). Here is the JavaScript code that sends the JSON data to the server: function writeToSpreadsheet() { // get the json for #theTable var tableJSON = tableToJSON("tr:not(#titleRow)"); //alert(tableJSON); alert("Sending table data to be written to the spreadsheet..."); $.post('/ResearchProject/tableContent/exportTable.php', {'table': tableJSON}).done( function(response) { alert(((response == '') ? response : (tableJSON.title + ' written to file!')));}) .fail(function (xhr, ajaxOptions, thrownError) { alert("ERROR:" + xhr.responseText+" - "+thrownError); }); } and here is exportTable.php <?php function cleanData(&$str) { $str = preg_replace("/\t/", "\\t", $str); // escaping all of the tabs $str = preg_replace("/\r?\n/", "\\n", $str); // escaping any and all cases of carriage return // if there is a single double-quote in the string, we wrap the string in quotes, replace every single double-quote with double double-quotes, and // end with a double-quote if(strstr($str, '"')) $str = '"' . str_replace('"', '""', $str) . '"'; } // the data is coming from a JSON object that is being sent here if (isset($_POST['table'])) { $tableJSON = $_POST['table']; # somehow, this is already a PHP array (exactly the one we need)!! // get the name of the table from the $tableJSON $tableName = $tableJSON['title']; // get the title row from $tableJSON $titleRow = $tableJSON['titleRow']; // fix the titleRow foreach ($titleRow as $heading) { $heading = trim(preg_replace('/\s+/', ' ', $heading)); } // get the rows from $tableJSON $rows = $tableJSON['rows']; // form the filename from the tableName $fileName = $tableName . '.xls'; // here, we download the file wit…
linked to: http://stackoverflow.com/q/16086162
has answer: http://stackoverflow.com/a/28471472
tagged with: excel
type: Question
has answer: http://stackoverflow.com/a/28523392
tagged with: http://stackoverflow.com/tag/json
score: 0

http://stackoverflow.com/q/28582834
accepted answer: http://stackoverflow.com/a/28592401
downvote count: 0
answer count: 1
favorite count: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45485111
score: 1
has answer: http://stackoverflow.com/a/28592401
upvote count: 1
type: Question
has title: How to assign count of number of rows to another value which can be use later in the test cases in Protractor
has body: How to assign count of number of rows to another value which can be use later in the test cases in Protractor. I have written following code but its not returning count value: var rows = element.all(by.repeater('row in renderedRows')); var row1 = rows.count().then(function(rowsn) { return rowsn; console.log(rowsn); }); Now i want to use this count value in for loop
tagged with: protractor
tagged with: javascript
linked to: http://stackoverflow.com/q/21685161

http://stackoverflow.com/comment/45257841
type: Comment
comment on: http://stackoverflow.com/a/28466004
has text: No problem. I guess you can mark this answer as the correct one now.
type: AnswerComment
score: 0

http://stackoverflow.com/q/28503908
has answer: http://stackoverflow.com/a/28504955
has comment: http://stackoverflow.com/comment/45327291
has body: I am trying to use a Bootstrap Popover in an AngularJS ngRepeat directive. The problem is the title attribute isn't being interpolated. How can I resolve this issue? View &lt;div ng-app="app" id="ng-app"&gt; &lt;ul ng-controller="Main"&gt; &lt;li ng-repeat="i in items" data-toggle="popover" title="{{ i.title }}" &lt;!-- Title isn't interpolated so Popover doesn't render a title --&gt; data-content="Events: {{ day.events.length }}" init-popover&gt;{{ i.data }}&lt;/li&gt; &lt;/ul&gt; Code var app = angular.module('app', []); app.controller('Main', ['$scope', function($scope){ $scope.items = [ { title: 'Title 1', data: 'lorem' }, { title: 'Title 2', data: 'ipsum' }, ]; }]); app.directive('initPopover', function() { return function(scope, element, attrs) { if (scope.$last){ $('[data-toggle="popover"]').popover({container: 'ul'}); } }; }); FIDDLE
score: 2
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
downvote count: 0
accepted answer: http://stackoverflow.com/a/28505304
type: Question
has answer: http://stackoverflow.com/a/38316266
has answer: http://stackoverflow.com/a/29606094
linked to: http://stackoverflow.com/q/11656395
has answer: http://stackoverflow.com/a/28505304
tagged with: popover
upvote count: 2
answer count: 7
has answer: http://stackoverflow.com/a/41720592
has comment: http://stackoverflow.com/comment/45329175
possible better answer: http://stackoverflow.com/a/28504314
tagged with: javascript
has comment: http://stackoverflow.com/comment/45326824
has title: Angularjs not interpolating title for Bootstrap Popover
has answer: http://stackoverflow.com/a/28504314
favorite count: 0
has answer: http://stackoverflow.com/a/28505049
tagged with: angularjs

http://stackoverflow.com/comment/45216845
comment on: http://stackoverflow.com/a/28443427
type: Comment
has text: Ideally, your factory would use another service to read the value from a cookie (or similar). You would then mock and inject that service in your test. I'll provide an example
score: 0
type: AnswerComment

http://stackoverflow.com/q/28511670
has answer: http://stackoverflow.com/a/28511704
accepted answer: http://stackoverflow.com/a/28511704
has title: Javascript Functions for Form are not Displaying with textContent
tagged with: getelementbyid
has body: In my current code, I have a form that takes in 4 input quantities. Once inputted, the user will click the purchase button and the total counts of: total items, subtotal, sales tax, total and final discount amount will display based on what the user previously inputted. My current issue is that nothing seems to print. Not even my error checking print. So far all that displays is the current "0" values for each value for the shopping cart. Please help me understand where my issues lie. I have some concern that the getElementsByClassId may be causing my problem too for the class inside the () for it. Not completely sure where to start. Page title Sam's Online Shop 15% discount on all online sales Our World Famous Chocolates Now Available Online Product Unit cost Quantity Milk Chocolate 7.48 Assorted Fine Chocolates 9.98 Assorted Milk & Dark Chocolates 12.98 Assorted Dessert Truffles 15.98 Shopping Cart Total Items 0 Subtotal 0 5% Sales tax 0 Total 0 Final amount (with 15% discount) 0 JAVASCRIPT CODE AT BOTTOM OF HTML CODE
has comment: http://stackoverflow.com/comment/45342043
type: Question
type: AnsweredQuestion
tagged with: function
answer count: 1
tagged with: javascript
score: 0

http://stackoverflow.com/q/28449639
answer count: 1
has comment: http://stackoverflow.com/comment/45264011
tagged with: events
tagged with: onbeforeunload
has body: A client is experiencing a very bizarre bug in Google Chrome. She just called me and it happened for a second time. On the quote page for a CRM I return a string on the onbeforeunload if the quote is not saved yet. The dialog simply warns the user to make sure he/she saved the quote before leaving the page. Now for the second time in 2 weeks the dialog kind of got stuck. Clicking 'Stay on this page' or 'Leave this page' both simply immediately gave the same dialog again. And as the dialog lives on top of the browser even closing the browser (or the tab) as a whole was impossible. Only solution: task manager. Here in the office we use the same CRM (and have used it for a good few months) without any issue. Am I looking at a Google Chrome bug or a faulty Google Chrome installation? $(function() { $(window).on('beforeunload', function() { if (quoteIsDirty) { return 'Warning - You have made changes to the quote, but have not saved your changes yet. Are you sure you want to close this page?'; } }); });
type: UnansweredQuestion
tagged with: dialog
has comment: http://stackoverflow.com/comment/45300614
tagged with: google-chrome
type: Question
tagged with: javascript
has title: Chrome prevents user from closing onBeforeUnload dialog
has answer: http://stackoverflow.com/a/28492410
score: 0

http://stackoverflow.com/q/28495203
has comment: http://stackoverflow.com/comment/45318718
has title: How to bind a complex data structure to Spring Controller
answer count: 0
type: Question
tagged with: bind
has body: I am trying to bind a complex data structure to my controller in spring mvc with javascript. I have this ViewModel; public class LibraryViewModel{ private String idLibrary; private String nameLibrary; private List&lt;Box&gt; listBox; //Getters and setters } And this is the box's class: List listBox; public class Box{ private String idBox; private List&lt;String&gt; booksNames; //Getters and setters } What I want to do? I want to do the form binding idLibrary and nameLibrary with a form in jsp &lt;form:form modelAttribute = "libraryVM" id="bestForm".../&gt; And listBox get a data injection like with a function made in JavaScript. $('#bestForm').submit(function() { completeListBoxInfo(); $('#organizacion').val(a); }); But I allways get null mi List in mi controller but I get fine my idLibrary and nameLibrary attributes. @RequestMapping("/save") protected void guardar(@RequestParam("libraryFM") LibraryViewModel newLibrary) { ... } How can I bind the View Model object with the function result of completeListBoxInfo(); Kind regards.
score: 0
has comment: http://stackoverflow.com/comment/45312893
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45311990
tagged with: spring

http://stackoverflow.com/comment/45461013
type: QuestionComment
has text: Have you made sure your server handle POST requests against `/php/login.php`?
score: 0
comment on: http://stackoverflow.com/q/28575847
type: Comment

http://stackoverflow.com/comment/45501036
has text: Sorry, I wasn't clear about this. goog.require is primarily for "build time" dependencies. It isn't unusual to have runtime dependencies that aren't goog.require'd.
type: Comment
comment on: http://stackoverflow.com/a/28551621
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45486777
has text: @cejast that seems to be a jQuery implementation in Node and I don't want to use jQuery.
type: QuestionComment
comment on: http://stackoverflow.com/q/28589809
score: 0
type: Comment

http://stackoverflow.com/q/28478735
has answer: http://stackoverflow.com/a/28479245
accepted answer: http://stackoverflow.com/a/28478948
answer count: 4
has answer: http://stackoverflow.com/a/28479062
has comment: http://stackoverflow.com/comment/45280608
has answer: http://stackoverflow.com/a/28478948
has answer: http://stackoverflow.com/a/28478939
has title: Convert date into different formats in javascript
has comment: http://stackoverflow.com/comment/45280396
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45280057
linked to: http://stackoverflow.com/q/2573521
has body: How can I convert a date in this format 'Sat Feb 14 2015 00:00:00 GMT+0100 (ora solare Europa occidentale)' into a date in this format '2015-02-05T10:17:13' using javascript?
type: Question
possible better answer: http://stackoverflow.com/a/28478939
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/45425371
comment on: http://stackoverflow.com/a/28556494
score: 0
type: AnswerComment
has text: Sorry but it doesn't work . My texbox names "dr" . `code` protected void Page_Load(object sender, EventArgs e) { dr.Attributes.Add("onkeyup", "myFun('"+dr+"');"); } <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
type: Comment

http://stackoverflow.com/q/28533675
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/33567898
tagged with: jquery
has title: Display child div when hovering over parent div - Javascript
has body: I currently have a div that contains several divs that use the same class. It looks like this, TEST TEST TEST When I hover over the div with the class name deck-box I want the div with the class name deck-hidden to become visible. The problem is I do not know how many deck-box divs there will be. So I can not give them all a different ID name. How can I hover over a deck-box and have its respective child deck-hidden be visible?
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28533688
type: Question
has answer: http://stackoverflow.com/a/28533716
tagged with: javascript

http://stackoverflow.com/comment/45488719
type: Comment
has text: Note that the information here https://code.google.com/p/gmaps-api-issues/wiki/JavascriptMapsAPIv3Changelog says the releases are: Experimental: 3.20, Release: 3.19, Frozen: 3.18. While this page https://developers.google.com/maps/documentation/javascript/basics#Versioning says Version 3.18 (Release), Version 3.19 (Experimental), Version 3.17 (Frozen). This is rather confusing but I would think the Changelog link to be the more up to date source of information - it confused me for a while so thought it worth sharing here.
comment on: http://stackoverflow.com/a/28585991
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45276647
score: 0
type: Comment
type: QuestionComment
has text: `var tr = $('#Table_1').find('tr'); var id = $(event.target).parent().find("td:first").text();` you are working with angular.. please dont do this. you are not **thinking in angular**
comment on: http://stackoverflow.com/q/28476770

http://stackoverflow.com/comment/51759978
score: 2
comment on: http://stackoverflow.com/a/28494112
has text: This only works for the first input field. If you put something in one of them and leave the rest empty, it still thinks they're all filled.
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28581947
type: Answer
score: 0
has comment: http://stackoverflow.com/comment/45471826
answers question: http://stackoverflow.com/q/28581630
has body: I believe that the code in your CSS @media property is playing a role here. Check and confirm. You can manually define how each screen may look. For example: @media screen and (max-width: 300px) { body { background-color: lightblue; } } This will change the screen color if screen size is less than 300.

http://stackoverflow.com/q/28552502
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45430621
has title: window.print() does not execute more than once
has comment: http://stackoverflow.com/comment/45417967
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/45418301
tagged with: javascript
tagged with: jquery
score: 0
tagged with: printing
upvote count: 1
downvote count: 1
has body: I want to print to a printer more than once. I have 2 DIVs one for "Order" and second for "Receipt", and a button "OrderAndPay". what I want is to print this two DIVs one after another. This calls the function print() inside the plugin orderPrint.KappaPrint(); receiptPrint.KappaPrint(); This function is in the plugin that creates the printable DIV Print = function() { $(".printBlock").hide(); printBlock.show(); window.print(false); printBlock.hide(); } The problem is when I print one div it prints without any error. But when I call the print for the 2 divs the print() makes an exception. First exception: NS_ERROR_NOT_AVAILABLE. Second exception: Some printing functionality is not currently available Full Code: Call The Print Function "OrderAndPay": { Text:KappaMainData.Constants.OrderAndPay, OnClick : function(){ var itemsData = $("#ItemsDashBoard").KappaData(); if(itemsData === null) { return; } var receiptData = {}, dat = {}, orderData = {}; dat = {"OrderOp":"Order", "Op":"Save", "SellOp":"OrderAndSell", "Data":itemsData}; var itemsSavedData = GetJsonAjax({Url:"Functions/order.php", Data:dat}); receiptData = GetRecieptData(itemsSavedData); receiptPrint.Fill(receiptData); orderData = GetOrderData(itemsSavedData); orderPrint.Fill(orderData); orderPrint.KappaPrint(); receiptPrint.KappaPrint(); //this one throws the exception //always the second print throws exception } }, Printing function Print = function() { $(".printBlock").hide(); //class for all print blocks printBlock.show(); //current block window.print(); //Or:window.print(false); printBlock.hide(); } NOTE: I used css media print to control the visible things that I want to print.
favorite count: 0

http://stackoverflow.com/q/28464629
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45255574
has comment: http://stackoverflow.com/comment/45255133
type: UnansweredQuestion
answer count: 0
score: 1
has title: How to make a work on a web-page without "freezing" it
has body: I'm developing a google chrome extension that works in facebook. I'm running a function each 10ns myVar = setTimeout(search, 10); search function arranges my friends stories according to an input text element, it puts friend(whose name appears in the textbox) stories at the top. It stops when a button is pressed. search function : function search() { var name = ""; var stories_parent = document.getElementsByClassName("tickerActivityStories")[0]; var last_moved_element = stories_parent.firstChild; if(document.getElementById("srchTxt")!=null) name = document.getElementById("srchTxt").value; if(name != null &amp;&amp; name!=" " &amp;&amp; name !="") { isSearching = true; var stories = document.getElementsByClassName("tickerFeedMessage"); for(i = currentStoryIndex+1 ; i &lt; stories.length ; i++) { // a loop in stories searching for my friend stories currentStoryIndex = i; if(stories[i] != null &amp;&amp; stories[i].firstChild != null) { var personName = stories[i].firstChild.innerText;//getting my friend name if(personName == null) stories[i].firstChild.remove(); if(personName!= null) { if(personName.toLowerCase().indexOf(name.toLowerCase()) == -1) continue; //cheking if name isn't my friend name so continue var element = stories[i].parentNode.parentNode.parentNode.parentNode.parentNode; stories_parent.insertBefore(element, last_moved_element); last_moved_element = element.nextSibling; //moving my friend story up } } } fireEvent(document.getElementsByClassName("pam uiBoxLightblue tickerMoreLink uiMorePagerPrimary")[0],"click"); //load more stories pressing"show more" myVar = setTimeout(search, 10); } } The problem is that when running the function I can't scroll down in facebook unless the button is clicked. How can I run the function and surf facebook simultaneously?
upvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45254979
has comment: http://stackoverflow.com/comment/45255261
tagged with: google-chrome-extension
downvote count: 0
has comment: http://stackoverflow.com/comment/45255208

http://stackoverflow.com/q/28547584
upvote count: 2
answer count: 1
has answer: http://stackoverflow.com/a/28548277
has body: I have the following JS code, which uses jQuery: var anArray=[]; var passIntoFun =100; // calculated value; function ArrayIteratorFun(index, element, thirdParam){ // function code. } I want to call ArrayIteratorFun using .each construct, like: $(anArray).each(ArrayIteratorFun(passIntoFun)); I could only call it like, by wrapping into a function: $(anArray).each(function(i,e){ArrayIteratorFun(i,e,passIntoFun);}); is there any better way to write the code above?
score: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/45408715
has title: How to pass multiple params into a delegate in Javascript?

http://stackoverflow.com/a/28504923
answers question: http://stackoverflow.com/q/28504872
score: 1
has body: click.bs.button.data-api is a click event event with namespace bs.button.data-api
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/q/28553581
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28553626
has title: Javascript math not working, better way to perform operations?
has comment: http://stackoverflow.com/comment/45420429
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/45419956
has body: I included the javascript links above the I'm wondering about doing this in like one line. I try this in a basic .html file and nothing shows up, no alert. I'm probably missing something trivial. Wait, probably just have to put the dollar signs haha
accepted answer: http://stackoverflow.com/a/28553626
score: -4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45419969
tagged with: math
type: Question
has comment: http://stackoverflow.com/comment/45420055
has comment: http://stackoverflow.com/comment/45420627
downvote count: 4
upvote count: 0

http://stackoverflow.com/comment/45327248
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28503303
has text: @Chen. precisely!! Look at this little example I made for you: http://plnkr.co/edit/VuwNZ7j2eion2veWCabI?p=info
type: AnswerComment

http://stackoverflow.com/comment/45371420
has text: you;'re right Pointy - i was hasty in my answer! Have updated with alternative (working) solution. ;-)
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28527898
type: AnswerComment

http://stackoverflow.com/comment/45356730
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28519633
has text: Dude Im made up yeah. sure. but the question im askin requires some background to understand what im tryna achieve... never heard of a **template engine** before, aint got a github link, just cuz im on *Stack* don't mean im a master programmer.. I thought i was on-toipc most of the way? And theres no promotion involved im just after an answer to my question...
score: 0

http://stackoverflow.com/a/28506118
has body: The donut chart is centered in the canvas, so you can calculate the center of the donut like this: // get the canvas element and its context var canvas = document.getElementById("myChart"); var ctx = canvas.getContext("2d"); // calculate the center of the canvas (cx,cy) var cx=canvas.width/2; var cy=canvas.height/2; Then you can tell canvas to draw text vertically &amp; horizontally centered around cx,cy like this: // horizontally align text around the specified point (cx) ctx.textAlign='center'; // vertically align text around the specified point (cy) ctx.textBaseline='middle'; // draw the text ctx.font='14px verdana'; ctx.fillStyle='black'; ctx.fillText("Text Here",cx,cy); But you must wait for any animations to complete before drawing your centered text. To do that you must tell ChartJS that you want a callback function triggered when it completes its animation. You can set the callback by setting the onAnimationComplete property of the chart options: var myDoughnutChart = new Chart(ctx).Doughnut(data, { responsive : true, // when ChartJS has completed all animations then call the addText function onAnimationComplete: addText }); Here's a demo putting it all together: var doughnutData = [{ value: 300, color: "#F7464A", highlight: "#FF5A5E", label: "Red" }, { value: 50, color: "#46BFBD", highlight: "#5AD3D1", label: "Green" }, { value: 100, color: "#FDB45C", highlight: "#FFC870", label: "Yellow" }, { value: 40, color: "#949FB1", highlight: "#A8B3C5", label: "Grey" }, { value: 120, color: "#4D5360", highlight: "#616774", label: "Dark Grey" } ]; window.onload = function() { var canvas = document.getElementById("chart-area"); var ctx = document.getElementById("chart-area").getContext("2d"); window.myDoughnut = new Chart(ctx).Doughnut(doughnutData, { responsive: true, onAnimationComplete: addText }); }; var myDoughnutChart = new Chart(ctx).Doughnut(data); var myDoughnutChart = new Chart(ctx).Doughnut(doughnutData, { responsive: true, onAnimationComplete: addText }); f…
type: Answer
has comment: http://stackoverflow.com/comment/57453313
downvote count: 0
has comment: http://stackoverflow.com/comment/60661408
has comment: http://stackoverflow.com/comment/49906608
score: 16
answers question: http://stackoverflow.com/q/28499475
has comment: http://stackoverflow.com/comment/78411760
accepted answer of: http://stackoverflow.com/q/28499475
has comment: http://stackoverflow.com/comment/80756205
has comment: http://stackoverflow.com/comment/56022887
type: AcceptedAnswer
upvote count: 16

http://stackoverflow.com/q/28509850
has body: Hello and thank you for reading this. Any help is greatly appreciated. I am trying to make a function that, when triggered by the push of a button, starts a timer and then displays a div in a random location. When the div is clicked, JavaScript records the time between the press of the button and the click of the div and returns it in a paragraph. I got the square to work but the timer does not work and affects the performance of the rest of my code. Here is what I have so far. HTML: Click here! JavaScript: function SeeWhatHappens(button) { var startTime = new Date(); var divsize = 50; var posx = (Math.random() * window.innerWidth - divsize).toFixed(); var posy = (Math.random() * window.innerHeight - divsize).toFixed(); var div = document.getElementById('newdiv'); div.style.left = posx + 'px'; div.style.top = posy + 'px'; div.style.display = 'block'; button.style.visibility = "hidden"; var something = document.getElementById('newdiv'); something.style.cursor = 'pointer'; something.onclick = GetTime(startTime) { } function GetTime(startTime){ var endTime = new Date(); var timeDiff = endTime - startTime; var timeDiff /= 1000; var seconds = Math.round(timeDiff % 60); timeDiff = Math.floor(timeDiff / 60); var minutes = Math.round(timeDiff % 60); timeDiff = Math.floor(timeDiff / 60); var hours = Math.round(timeDiff % 24); timeDiff = Math.floor(timeDiff / 24); document.getElementByID('TotalTime') = timeDiff; } EDIT: Here's my JSFiddle in case it helps: http://jsfiddle.net/6hnLx6qc/17/ Thank you so much again for any help you can give me!
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28510126
accepted answer: http://stackoverflow.com/a/28510126
tagged with: javascript
has title: Want to display time between clicking button and clicking div
score: 0
has comment: http://stackoverflow.com/comment/45339567
answer count: 1
tagged with: timer

http://stackoverflow.com/q/28569029
has title: How to call the same function in two different ways?
has answer: http://stackoverflow.com/a/28569132
has answer: http://stackoverflow.com/a/28569137
accepted answer: http://stackoverflow.com/a/28569091
upvote count: 1
tagged with: javascript
answer count: 5
has body: I am trying to combine a function which will display alert (ofcourse I have a lot of code In this function but for this case It will be alert) after: Click on element with class .number Change select[name=receive] I have this code but it doesn't work: $(document).on(("click",".number"),("change","select[name=receive]"),function(){ alert('test'); })
has answer: http://stackoverflow.com/a/28569075
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28569065
downvote count: 0
score: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28569065
has answer: http://stackoverflow.com/a/28569091
favorite count: 0
type: Question

sql
tags question: http://stackoverflow.com/q/28443951
tag name: sql
type: Tag
tags question: http://stackoverflow.com/q/28527126
tags question: http://stackoverflow.com/q/28479309
tags question: http://stackoverflow.com/q/28516374

outlook
tags question: http://stackoverflow.com/q/28497566
tag name: outlook
type: Tag

http://stackoverflow.com/a/28492034
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28481701
answers question: http://stackoverflow.com/q/28481701
score: 1
type: AcceptedAnswer
downvote count: 0
has body: Personally would not recommended running a query against all indexes and fields without explicitly specifying the list of indices and fields since this could adversely impact the cluster performance. However in case you need to you could try using query_string query: Example: "query": { "query_string": { "fields": ["*"], "query": "monitor", "lenient":true, "use_dis_max" : false } }
type: Answer
has comment: http://stackoverflow.com/comment/45308802

http://stackoverflow.com/q/28498014
has comment: http://stackoverflow.com/comment/45315950
linked to: http://stackoverflow.com/q/17861447
has comment: http://stackoverflow.com/comment/45315553
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/17861447
has comment: http://stackoverflow.com/comment/45317293
accepted answer: http://stackoverflow.com/a/28505164
has comment: http://stackoverflow.com/comment/45315391
type: Question
score: 12
tagged with: canvas
upvote count: 12
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45315427
has title: Canvas DrawImage() poor quality
has comment: http://stackoverflow.com/comment/45315482
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I have a problem with Html5 canvas i draw an image but its quality becomes very poor after i draw it with canvas it becomes this my code is here &lt;script type="text/javascript"&gt; $canvasWidth = $('#canvas').width; $canvasHeight = $('#canvas').height; var alpha = 0.0; var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d'); function draw(){ var delta = 0.05; ctx.clearRect(0,0,$canvasWidth, $canvasHeight); ctx.globalAlpha = alpha; var logo= new Image(); WandioLight.onload = function(){ ctx.drawImage(logo, 0, 0, 250, 167); }; logo.src = "logo.png"; alpha += delta; if(alpha &gt; 1.0){ return false; } setTimeout(draw, 50); }
has comment: http://stackoverflow.com/comment/45315514
has answer: http://stackoverflow.com/a/28505164
favorite count: 0

http://stackoverflow.com/a/28554049
has comment: http://stackoverflow.com/comment/45434443
type: AcceptedAnswer
downvote count: 0
has body: When you perform a POST to your route, you need to specify the content type header to be application/json. POST -H Content-type: 'application/json' /post/route What are you using to test your POST?
accepted answer of: http://stackoverflow.com/q/28553823
upvote count: 2
answers question: http://stackoverflow.com/q/28553823
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45439603

http://stackoverflow.com/comment/130311797
has text: Thanks a lot. That was the settings i looking for a long time
type: AnswerComment
type: Comment
score: 2
comment on: http://stackoverflow.com/a/70714091

http://stackoverflow.com/q/28567071
has body: When I try to paging with JavaScript, I get the error [object:Object]. This is my code : function onGetData(page) { $.ajax({ type: "POST", url: "@Html.Toyota().Page.GetActionUrl("onGetBisa")", data: { Display: $("#cbodisplay").val(), Page:page, mat_no : $("#txtMatNoC").val(), mat_desc : $("#txtMatDescC").val(), uom : $("#txtUOMC").val(), mrp_type: $("#txtMRPTypeC").val(), re_order_method : $("#txtReOrdMetC").val(), mrp_flag : $("#cbMRPFlagC").val(), valuation_class : $("#txtValuationC").val(), stock_flag : $("#cbStockFlagC").val(), asset_flag : $("#cbAssetFlagC").val(), quota_flag : $("#cbQuotaFlagC").val(), deletion_flag : $("#cbDelFlagC").val() }, success: function (data) { $("#divtable").html(data); alert("sukses"); }, error:function(data){ alert(data); } }); } I got error object:Object. Can anyone help me?
answer count: 1
has comment: http://stackoverflow.com/comment/45446372
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45446436
has answer: http://stackoverflow.com/a/28567918
tagged with: object
type: Question
has comment: http://stackoverflow.com/comment/45447051
has title: Show error object:Object in get data
has comment: http://stackoverflow.com/comment/45444575
tagged with: javascript
has comment: http://stackoverflow.com/comment/45446509
score: 0
has comment: http://stackoverflow.com/comment/45446689

http://stackoverflow.com/comment/45348283
comment on: http://stackoverflow.com/a/28508460
score: 0
type: AnswerComment
has text: This is not working i'm getting dates like Jan 1970 but actually the timestamp is Feb 2015 not sure what's wrong
type: Comment

http://stackoverflow.com/q/28460754
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45247531
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45247452
accepted answer: http://stackoverflow.com/a/28460917
has comment: http://stackoverflow.com/comment/45247609
tagged with: hta
tagged with: javascript
has body: I have a .hta File containing JavaScript and HTML. My JavaScript Code modifies the HTML with functions like "appendChild", but the HTML does not get updated afterwards; Even if the element was corretly appended in the DOM-Structure (I can alert the .innerHTML, returning the html-code like it should be, but it doesn't show in the browser). If put in an HTML-File, it works completely fine. <hta:application id="prjreq_v1" applicationname="ProjectRequirements"> Date Source Description dd/MM/yyyy Example1 Source Lorem Ipsum dolores est
has comment: http://stackoverflow.com/comment/45247690
tagged with: browser
has comment: http://stackoverflow.com/comment/45247560
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45248058
has answer: http://stackoverflow.com/a/28460917
has title: HTML does not update after being modified with JavaScript in .hta application
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45273208
score: 0
comment on: http://stackoverflow.com/q/28474760
has text: @Funonly, why? either way if it doesnt exist you need to do some error handling, using a for loop would just take up more execution time (albeit small, it would still be more than a try catch)
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45635375
type: QuestionComment
comment on: http://stackoverflow.com/q/28492852
has text: @Qantas94Heavy sure i will have a look at this, thanks for your valid informations
score: 0
type: Comment

http://stackoverflow.com/q/28568293
has answer: http://stackoverflow.com/a/28568459
tagged with: javascript
has answer: http://stackoverflow.com/a/28568514
has body: I want to separate my markup from the behavior but i stuck on how to associate the function i created to all the links in the document after the onclick event without including it directly in the markup. Here is my HTML Image Gallery Snapshots Fireworks Coffee Rose Big Ben and here is my script function showPic(whichPic) { "use strict"; var source = whichPic.getAttribute("href"); var placeholder = document.getElementById("placeholder"); placeholder.setAttribute("src", source); } window.onload = function() { "use strict"; var anchors = document.getElementsByTagName("a"); console.log(anchors); for(var i = 0, count = anchors.length; i < count; i++) { //anchors[i].preventDefault; // anchors[i].onclick = showPic; } } I tried to loop through the links and assign the function to the onclick event of each link but it didn't work. What is the best way this could be done so that behavior is completely separate from markup?
score: 0
answer count: 2
tagged with: events
type: AnsweredQuestion
has title: Assigning a function to each link after the onclick event
accepted answer: http://stackoverflow.com/a/28568514
type: Question
possible better answer: http://stackoverflow.com/a/28568459

http://stackoverflow.com/comment/45494592
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28593371
type: Comment
has text: Ok assuming xAxis is the vertical, I need to plot the cumulative line according to the right xAxis. Sorry I know this is confusing.

http://stackoverflow.com/a/28567517
has comment: http://stackoverflow.com/comment/45445674
answers question: http://stackoverflow.com/q/28567419
has body: If you are going to use json keys is way: treadmill_dict[bowflex] You need to put quotes around the key name: treadmill_dict['bowflex'] Like this: var treadmill_dict = { bowflex: " 5hp 50in 500lbs ", solo: " 4.5hp 45in 450lbs ", nordictrack: " 4hp 40in 400lbs " }; $(document).ready(function() { alert(treadmill_dict['bowflex']); $('#treadmill div.comparison1').html(treadmill_dict[bowflex]); }); See it here
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45445742
accepted answer of: http://stackoverflow.com/q/28567419
type: Answer

http://stackoverflow.com/q/28441107
type: Question
has body: I am now sitting multiple hours in front of a problem that seems rather simple to solve but i just cant get behind it :/ I am defining a small javascript-like language in jison. The problem is that the Parameter rule and the AssignStatement rule both (can) start with an CHAR_SEQUENCE and it always chooses the parameter rule. E.g. even though the code is a = 5; it reaches the throw "reached parameter"; so it seems to parse the a as a Parameter instead of a = 5; as an AssignStatement the relevant part of my grammar: Parameter : InlineVariable { $$ = $1; } | CHAR_SEQUENCE { throw "reached parameter"; checkUndefined($1, @1); $$ = vars[$1]; } ; InlineVariable : NUMBER { $$ = new Runtime.Integer(parseInt($1)); } | '"' CHAR_SEQUENCE '"' { $$ = new Runtime.String($2); } | FUNCTION '(' ParameterList ')' Statement { $$ = new Container($5); } ; AssignStatement : CHAR_SEQUENCE AssignmentOperator Parameter ';' { $$ = function() { if((typeof vars[$1] == 'undefined' &amp;&amp; $3 instanceof Runtime.Integer) || (vars[$1] instanceof Container &amp;&amp; $3 instanceof Runtime.Integer)) vars[$1] = new Runtime.Integer(0, $1); else if(typeof vars[$1] == 'undefined' || (vars[$1] instanceof Container &amp;&amp; !($3 instanceof Container))) vars[$1] = $3.constructor.call(); $2(vars[$1], vars[$3]); } } | CHAR_SEQUENCE SingleAssignmentOperator ';' { $$ = function() { if(typeof vars[$1] == 'undefined') vars[$1] = new Runtime.Integer(0, $1); $2(vars[$1]); }; } ; I posted the full grammar at https://gist.github.com/M4GNV5/36c2550946c1a1f6ec91 So is there a way to solve this problem? I of course already tried using %left, %right, %assoc and %precedence but it didnt work (or i did something wrong?
has comment: http://stackoverflow.com/comment/45215095
tagged with: javascript
has answer: http://stackoverflow.com/a/28442817
score: 0
tagged with: grammar
has title: jison rule precedence doesnt work?
answer count: 1
favorite count: 0
tagged with: jison
accepted answer: http://stackoverflow.com/a/28442817
has comment: http://stackoverflow.com/comment/45213821
tagged with: operator-precedence
type: AnsweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/45214796
downvote count: 1

http://stackoverflow.com/a/28596693
score: 1
answers question: http://stackoverflow.com/q/28533824
upvote count: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28533824
type: Answer
has body: @trekforever: I actually ended up doing this last night before I saw your comment! Here's my end solution: componentWillMount: function(){ // check for a fb-like button and remove it // if it exists! if( window.FB ) { // remove all instances of facebook and elements $("#facebook-jssdk, #fb-root").remove() delete window.FB } // we need to use this method to let facebook-jssdk // know it needs to parse the xfbml after it loads // into our page window.fbAsyncInit = function() { window.FB.init({ xfbml : true, version : 'v2.0' }); }; // we don't have to go through all the checks and balances that // come in the fb jssdk init code by default, we just got rid of them var fjs = document.getElementsByTagName('script')[0], js = document.createElement('script') js.id = 'facebook-jssdk' js.src = '//connect.facebook.net/en_US/sdk.js' fjs.parentNode.insertBefore(js, fjs) } My second language is fr_CA so I just replaced this line: js.src = '//connect.facebook.net/en_US/sdk.js' with this: js.src = '//connect.facebook.net/fr_CA/sdk.js' and now I can re-render the component in either (or any) language and it will show me a Facebook Like button in the correct language as well! For interest's sake, here is the same thing, but Google's Recaptcha: componentWillMount: function(){ // this is stolen directly from the facebook-jssdk // implementation... if( window.grecaptcha ){ $("#grecaptcha-jssdk").remove() delete window.grecaptcha } var gjs = document.getElementsByTagName('script')[0], js = document.createElement('script') js.id = 'grecpatcha-jssdk' js.src = 'https://www.google.com/recaptcha/api.js?hl=fr-CA' gjs.parentNode.insertBefore(js, gjs) } It isn't named grecaptcha-jssdk by default, I just chose to stick with that name for consistency. Happy i18n!

http://stackoverflow.com/comment/45460795
type: Comment
has text: post all the code in a jsfiddle.
score: 1
comment on: http://stackoverflow.com/q/28575761
type: QuestionComment

http://stackoverflow.com/comment/45241438
type: QuestionComment
comment on: http://stackoverflow.com/q/28456707
has text: Please someone tell me, what was wrong with this question. There were no questions same as mine. There was no clear answer. This question also was unsolved. So, what was wrong with this question that I got -6 points? Nobody even read my question completely. Most of the guys just read 1 line of my question and gave negative point!
score: 0
type: Comment

http://stackoverflow.com/comment/45347598
type: Comment
comment on: http://stackoverflow.com/a/28514864
has text: It seems strange that you're calling form.submit() after the form has already been uploaded via AJAX. Also are you 100% sure that you're form_validate function is returning true?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45356467
type: Comment
type: QuestionComment
has text: I guess I still don't understand what you're trying to accomplish. Apparently, it's causing a re-render which is affecting the performance, and hence the warning.
score: 0
comment on: http://stackoverflow.com/q/28512089

redactor.js
tag name: redactor.js
tags question: http://stackoverflow.com/q/28440353
type: Tag

http://stackoverflow.com/q/28499803
answer count: 1
has comment: http://stackoverflow.com/comment/45329604
has answer: http://stackoverflow.com/a/32088421
has comment: http://stackoverflow.com/comment/45331731
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: vertical center Headline - Beetle HTML5 Template
tagged with: css
has comment: http://stackoverflow.com/comment/45330069
tagged with: center
has comment: http://stackoverflow.com/comment/45330120
type: Question
has comment: http://stackoverflow.com/comment/45331350
has comment: http://stackoverflow.com/comment/45330032
has body: I will use the Beetle HTML5 Template. Which looks good after download and view in the browser but when I switch to the chrome mobile view the headline is not centered in the view. Original on http://themes.mokaine.com/beetle-html/home-01.html : and here the downloaded Version: here is the JS Part for center the headline: pxImgCaption.each(function () { var $this = $(this); $this.css({ top: ((pxWrapper.height() + headerHeight / 2) - $this.outerHeight()) / 2 }); }); here the full JS file: http://themes.mokaine.com/beetle-html/js/beetle.js
has comment: http://stackoverflow.com/comment/45330404
tagged with: javascript
has comment: http://stackoverflow.com/comment/45329969
score: 0
has comment: http://stackoverflow.com/comment/45333198

http://stackoverflow.com/q/28447275
upvote count: 1
has answer: http://stackoverflow.com/a/28447695
has comment: http://stackoverflow.com/comment/45223377
score: -1
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/45228067
tagged with: javascript
tagged with: jquery
has body: I am creating a large table with hundreds of rows. Now when i am trying to print this in google chrome then column overflow without header. So i am creating few jquery and css style to avoid this.. it working good but page break taking huge gaps between two page.. how to avoid this problem.. here is my code col1 col2 col3 Here is my screen shot
has comment: http://stackoverflow.com/comment/45235604
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
has title: How to reduce gap when applying css page break properties
type: UnansweredQuestion
downvote count: 2

http://stackoverflow.com/q/28569913
favorite count: 0
has body: I'm doing some intro Meteor stuff, and I'm having trouble getting the correct values from my Collection. I'm trying to track ownership of the central site, as claimed by a button. The program is currently just an extension of the Try Meteor task tutorial. Anyways, here's the HTML and JS: --------------HTML------------ &lt;head&gt; &lt;title&gt;Todo List&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="container"&gt; &lt;header&gt; &lt;h1&gt;Todo List&lt;/h1&gt; &lt;form class="new-task"&gt; &lt;input type="text" name="text" placeholder="Type to add new tasks" /&gt; &lt;/form&gt; {{&gt; ownerclaim}} &lt;h4&gt;Current owner: {{ownerget}}&lt;/h4&gt; &lt;/header&gt; &lt;u1&gt; {{#each tasks}} {{&gt; task}} {{/each}} &lt;/u1&gt; {{&gt; loginButtons}} &lt;/div&gt; &lt;/body&gt; &lt;template name="task"&gt; &lt;li class="{{#if checked}}checked{{/if}}"&gt; &lt;button class="delete"&gt;&amp;times;&lt;/button&gt; &lt;input type="checkbox" checked="{{checked}}" class="toggle-checked" /&gt; &lt;span class="text"&gt;{{text}}&lt;/span&gt; &lt;/li&gt; &lt;/template&gt; &lt;template name="ownerclaim"&gt; &lt;button class="claim"&gt;Claim website&lt;/button&gt; &lt;/template&gt; &lt;template name="ownership"&gt; &lt;span class="text"&gt;{{text}}&lt;/span&gt; &lt;/template&gt; -----------JS--------------- OwnerC = new Mongo.Collection("owner"); Tasks = new Mongo.Collection("tasks"); if (Meteor.isClient) { Meteor.subscribe("own"); console.log(OwnerC.findOne({})); Session.set("currentOwner", OwnerC.findOne({})); Template.body.helpers({ tasks: function () { return Tasks.find({}, {sort: {createdAt: -1}}); }, ownerget: function () { console.log("JOHNNN"); console.log(Session.get("currentOwner")); return Session.get("currentOwner"); } }); Template.body.events({ "submit .new-task": function (event) { var text = event.target.text.value; Tasks.insert({ text: text, createdAt: new Date(), owner: Meteor.userId(), username: Meteor.user().username }); event.target.text.value = ""; return fa…
answer count: 0
type: UnansweredQuestion
upvote count: 1
type: Question
score: 1
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has title: Trouble Accessing Data Added In Server Code from the Client
tagged with: meteor

http://stackoverflow.com/q/28556747
tagged with: dom-events
has answer: http://stackoverflow.com/a/28556961
favorite count: 0
has body: I have recently started using browserify and have created a custom module to toggle two menus based on the ID clicked and apply a transparent overlay effect. behind the menu. I have got it working but just wanted to get some feedback on whether it can improved performance or coding-wise as I am wanting to improve my JS skills. /** * Require modules */ var dullBackground = require('./dullBackground'); /** * Export module */ module.exports = function() { 'use strict'; /** * Selectors */ var menu = document.querySelector('#nav-main'), panel = document.querySelector('#overlay-panel'), productsPanel = document.querySelector('#products-panel'), systemsPanel = document.querySelector('#systems-panel'), close = document.querySelector('#overlay-close'), activeClass = "active", hideClass = "hide"; /** * Methods */ function togglePanel (event) { // Selectors var element = event.target, elementId = element.id; event.preventDefault(); // Conditions if(elementId === 'page-products' || elementId === 'page-systems') { dullBackground(); panel.classList.add(activeClass); } if(elementId === 'page-products') { productsPanel.classList.remove(hideClass); } if(elementId === 'page-systems') { systemsPanel.classList.remove(hideClass); } } function closePanel (event) { // Actions panel.classList.remove(activeClass); event.preventDefault(); // Conditions if (!productsPanel.classList.contains(hideClass)) { productsPanel.classList.add(hideClass); } if (!systemsPanel.classList.contains(hideClass)) { systemsPanel.classList.add(hideClass); } } /** * Events/APIs/init */ menu.addEventListener('click', togglePanel, false); close.addEventListener('click', closePanel, false); };
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45425570
upvote count: 0
has comment: http://stackoverflow.com/comment/45433347
type: Question
tagged with: performance
has comment: http://stackoverflow.com/comment/45425480
tagged with: javascript
score: -1
has title: Are there any improvements I can make to my Javascript?
tagged with: browserify
answer count: 1
downvote count: 1

http://stackoverflow.com/q/28499794
answer count: 3
has body: I've got a problem with filters. I have such files: PostController.js, PostService.js, PostFilers.js - my filter, app.js - routing. Basicly it's a simple blog app and I have an object(returned by 'postService' with blog posts which looks like this: var posts = [ { id: 1, date: '21-12-2014 14:51', title: 'Blog post article title', content: 'Some content', tags: [1, 2, 3, 5], category: 1 }, { id: 2, date: '15-11-2014 9:14', title: 'Some kind of title', content: 'Another content', tags: [2, 3, 5], category: 1} ]; as you can see in tags I have array of tag Id's, but I want to display tag names instead of tag Id's so I decided to create a filter: (function () { var app = angular.module('SimpleBlog'); app.filter("tagName", function () { return function (input) { return input + "_test"; }; }); }); Which should return something like 1_test, 2_test etc. I tried using it like this: and But the problem here is that this filter does not work. I don't see any error, and I don't see my Id with "test" string. Content of my controller looks like this: (function () { var app = angular.module('SimpleBlog'); app.controller('PostController', ['$scope', '$location', '$routeParams', 'postService', function ($scope, $location, $routeParams, postsService) { // something here }); }); HTML of view: {{ post.id }} - {{ post.title }} {{ post.date }} {{ post.content }} Tags: Do I have to inject something somewhere? Hope someone could help. Thanks in advance. :-) PostService.js (function () { var app = angular.module('SimpleBlog'); app.service('postService', function () { var posts = [ { id: 1, date: '21-12-2014 14:51', title: 'Blog post article title', content: 'Some content', tags: [1, 2, 3, 5], category: 1 }, { id: 2, date: '15-11-2014 9:14', title: 'Some kind of title', content: 'Another content', tags: [2, 3, 5], category: 1 } ]; return { getPosts: function () { return posts; } }; }); })(); PostController.js (functio…
has comment: http://stackoverflow.com/comment/45319266
has title: AngularJS - filter not working
downvote count: 0
has comment: http://stackoverflow.com/comment/45318942
favorite count: 0
has comment: http://stackoverflow.com/comment/45320351
has comment: http://stackoverflow.com/comment/45319574
has comment: http://stackoverflow.com/comment/45320117
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28500713
has answer: http://stackoverflow.com/a/28500425
has answer: http://stackoverflow.com/a/28501402
has comment: http://stackoverflow.com/comment/45323794
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45319063
has comment: http://stackoverflow.com/comment/45320768
tagged with: javascript
has comment: http://stackoverflow.com/comment/45320440
has comment: http://stackoverflow.com/comment/45318935

http://stackoverflow.com/comment/45265904
type: Comment
has text: hey thanks alot , how can i make the scrollbar show under the text...not on TOP
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28470580

http://stackoverflow.com/q/28473616
upvote count: 1
downvote count: 1
accepted answer: http://stackoverflow.com/a/28473928
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45271064
tagged with: dom
has comment: http://stackoverflow.com/comment/45271303
answer count: 1
has title: Document query selector for a controller in Angular Js
favorite count: 0
has body: I have a controller named like this : &lt;div ng-controller="MainController as main" class="containerWrap"&gt; I tried this for selecting my controller for further functioning :- var a = document.querySelector('[ng-controller=MainController as main]'); var b = angular.element(chatElement).scope(); It gives an error :- Uncaught SyntaxError: Failed to execute 'querySelector' on 'Document': '[ng-controller=MainController as main]' is not a valid selector. I tried for just MainController as well :- That gives :- a=null b=undefined Can anyone help?
has answer: http://stackoverflow.com/a/28473928
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 0

http://stackoverflow.com/a/28524248
answers question: http://stackoverflow.com/q/28524144
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
has body: Take a look at this thread: How can I get the browser&#39;s scrollbar sizes? When you apply the code from there (originally Alexandre Gomes Blog): function getScrollBarWidth () { var inner = document.createElement('p'); inner.style.width = "100%"; inner.style.height = "200px"; var outer = document.createElement('div'); outer.style.position = "absolute"; outer.style.top = "0px"; outer.style.left = "0px"; outer.style.visibility = "hidden"; outer.style.width = "200px"; outer.style.height = "150px"; outer.style.overflow = "hidden"; outer.appendChild (inner); document.body.appendChild (outer); var w1 = inner.offsetWidth; outer.style.overflow = 'scroll'; var w2 = inner.offsetWidth; if (w1 == w2) w2 = outer.clientWidth; document.body.removeChild (outer); return (w1 - w2); }; You can write: var wW = $(window).width() + getScrollBarWidth();
score: 1
accepted answer of: http://stackoverflow.com/q/28524144

http://stackoverflow.com/q/28532625
tagged with: viewport
tagged with: onresize
tagged with: user-interface
answer count: 1
accepted answer: http://stackoverflow.com/a/28547733
linked to: http://stackoverflow.com/q/504052
has body: I have a right pointing triangle. ▶ On resize, the triangle should move in the direction of the resize, and when it changes direction, the triangle should flip horizontally, without ever going out of the screen. Is there a way to listen to the direction (LEFT / RIGHT) in which the browser is being resized?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28547733
type: Question
has title: Listener for Direction of Resize
has comment: http://stackoverflow.com/comment/45381545
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/45303610
comment on: http://stackoverflow.com/a/28491129
score: 0
type: AnswerComment
has text: Thanks for pointing that out. I've updated the answer to use `Date.parse` instead, since the question states all date strings are in the format `YYYY-MM-DDT00:00:00`.
type: Comment

http://stackoverflow.com/comment/45359386
has text: $scope.books is defined, but the books variable is not
type: Comment
comment on: http://stackoverflow.com/a/28521191
score: 0
type: AnswerComment

http://stackoverflow.com/q/28477787
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45278447
has comment: http://stackoverflow.com/comment/45278399
score: -1
has comment: http://stackoverflow.com/comment/45306793
upvote count: 0
answer count: 1
tagged with: highcharts
has body: i want to create a highchart program,where i need to incorporate various highcharts.one drop down would be there with options listed in it.and those option should be the name of different different highcharts.eg.gauge highvhart,pie highchart,bar ,column,sparkline,line highchart.and a single div tag should be there on the same page.If i select gauge highchart option from the dropdown list then gauge highchart should be displayed on the page. I know how to create these highcharts separately but m not getting any idea regarding the issue where we should use only one div tag to render all the highcharts based on the selected option from the dropdown box. I'am not giving my code because i've no idea about this.so,please suggest me some idea.thanks in advance. here's my complete code .In this code data is displayed in a tabular format but i want to have this in a dropdown manner which i have explained before and i just want one div tag to render all the highcharts based on the selection made. Highcharts Example Sparkline Category Value Trend Category 1 54.4 Category 2 60.4 Category 3 60.4
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45284904
has answer: http://stackoverflow.com/a/28542320
tagged with: http://stackoverflow.com/tag/html
has title: how to render multiple highcharts into one div tag using javascript
has comment: http://stackoverflow.com/comment/45306634
type: UnansweredQuestion

http://stackoverflow.com/a/28485608
has body: One fairly nasty way: loop decreasing the overflowing span until its less that the div width; var divWidth = $("#theDiv").width(); var text = $("#text"); var fontSize = 12; while (text.width() > divWidth) text.css("font-size", fontSize -= 0.5); text.css("display", "inline"); This sentence is too large to fit within the div.
downvote count: 0
score: 15
accepted answer of: http://stackoverflow.com/q/28485351
answers question: http://stackoverflow.com/q/28485351
type: AcceptedAnswer
type: Answer
upvote count: 15

http://stackoverflow.com/comment/45300864
score: 1
has text: What complications? The hidden input should not be changed. The checkbox has a value of `true` and the corresponding hidden input has a value of `false`. If the checkbox is checked, it will post back `true, false` and the ModelBinder sets the property value to true (the second value is ignored). If unchecked, it will post back `false` (unchecked checkboxes do not post back) and the property value is set to `false`
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28489140

http://stackoverflow.com/comment/58864496
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/35573546
type: Comment
has text: I just found a similar answer where you need to use .bind(this)); at the end of the anonymous function as this here refers to window until you make the bind...

http://stackoverflow.com/q/28588898
answer count: 1
tagged with: javascript
has title: Why ng-pattern won't validate correctly on changes from a non user input event?
tagged with: angularjs
has body: I have these inputs inside a form which I'm validating with angular's ng-pattern, ng-required and ng-model directives: Teléfono Celular So the ng-pattern directive will look for strings in the format of 7 digits prefixed by 3 digits and a hyphen, for example: 287-8719423. As I don't want to force user to input the hyphen sign, I got a jQuery function which will put that hyphen when the input has completed the 3 required digits, this is my function: $(".phoneRegexInput").keyup(function() { var phone = $(this).val(); console.log(phone + " didnt match"); if (phone.match(/\d{10}/)) { phone = phone.substr(0, 3) + "" + '-' + phone.substr(3); console.log(phone); $(this).val(phone); } }); It's working properly and it actually changes the input value to a correctly formated one but it won't validate it as correct. If I delete and type again a correct input it will. So I think is is caused because validation is fired from an actual user input, how can I make it listen from any change? Related question. I know this might be related to this question, but the problem is that the model won't change neither as it's not valid. How should I fix it? Workaround I thought, "change the model", so I tried: $(".phoneRegexInput").keyup(function() { var phone = $(this).val(); console.log(phone + " didnt match"); if (phone.match(/\d{10}/)) { phone = phone.substr(0, 3) + "" + '-' + phone.substr(3); console.log(phone); // Attempt to change model if ($scope.personalData) $scope.personalData.phone = phone; else { $scope.personalData = { phone: phone } } console.log($scope.personalData); } }); But now something even more strange happens, I can see an actual object as $scope.personalData when loggin but if I try to debug by {{personalData}} at markup, it won't seem to have the property. Nevermind, I have to make the validation background watch or listen to changes at the model.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28589324
type: Question
linked to: http://stackoverflow.com/q/24802627
score: 0
accepted answer: http://stackoverflow.com/a/28589324
tagged with: validation

http://stackoverflow.com/q/28574865
downvote count: 0
tagged with: ruby-on-rails
has title: Generate unique identifier in rails helper
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28575112
score: 1
tagged with: bootstrap-slider
type: Question
has answer: http://stackoverflow.com/a/28575112
tagged with: ruby-on-rails-4
answer count: 1
has body: I have this rails helper _fields_answer.html.erb <%= answerf.text_area :content, placeholder: "Answer", class: "form-control" %> <%= answerf.hidden_field :question_number, value: qn %> <%= answerf.hidden_field :_destroy %> <%= link_to "remove", '#', class: "remove_fields btn btn-danger btn-xs buttonProjDelBut" %> <% st = Time.now.strftime("%I%M%S%p") %> <%= answerf.text_field :scale, id: 'slf'+st , type: 'text', data: {'slider-id' => 'scale', 'slider-min' => '0', 'slider-max' => '10', 'slider-step' => '1', 'slider-value' => '5' } %> And I render this helper dynamically, but I just can have the slider in the first one. So I tried to had a different Id for each one, but I am not able to do it. With the code above I always get the same Id, even using the Time. Why is the time used in id always the same? There is another way to do this? I want to have a slide for each answer. Edit: The code that renders the helper: In projects.js.coffee $(document).on 'click', 'form .add_fields', (event) -> time = new Date().getTime() regexp = new RegExp($(this).data('id'), 'g') $(this).before($(this).data('fields').replace(regexp, time)) event.preventDefault() In application_helper.rb def link_to_add_fields(name, f, association, locals) new_object = f.object.send(association).klass.new id = new_object.object_id fields = f.fields_for(association, new_object, child_index: id) do |builder| render("fields_" + association.to_s.singularize, answerf: builder, qn: locals[:qn]) end link_to(name, '#', class: "add_fields " + locals[:class], data: {id: id, fields: fields.gsub("\n", "")}) end
tagged with: javascript
tagged with: jquery
upvote count: 1
favorite count: 0

http://stackoverflow.com/q/28511396
answer count: 1
accepted answer: http://stackoverflow.com/a/28511479
has body: I'm trying to get a video feed to only display on Thursdays between 7PM and 8PM because that's when the live feed is playing. For reasons I'll not go into, I'm not allowed to have it up at any other time. Since I'm new to JavaScript I'm sure I'm doing something wrong, but from what I've been able to learn this is what I've got. var hour = getHours() var day = getDay() document.onload=function timechange() { if day==4 &amp;&amp; hour&gt;19 &amp;&amp; hour&lt;21 document.getElementById(livefeed).innerHTML = "Text one" else document.getElementById(livefeed).innerHTML = "Text two" } This is example text obviously but the majority of the content will change on the page. Do I have to add some sort of function in my HTML page to make this work?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28511479
has comment: http://stackoverflow.com/comment/45356518
type: Question
has comment: http://stackoverflow.com/comment/45341605
tagged with: javascript
has title: Time & Date dependent Page Content
has comment: http://stackoverflow.com/comment/45341601
score: 0

http://stackoverflow.com/comment/45396437
has text: Then check while making app do you have cordova.js file in your www folder?
type: Comment
comment on: http://stackoverflow.com/a/28540424
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45365001
type: AnswerComment
score: 0
type: Comment
has text: match(/\/(.+?)\//)[1] seems to give an 'undefined' error when I try to alert. Any idea why?
comment on: http://stackoverflow.com/a/28524324

http://stackoverflow.com/comment/45417808
type: QuestionComment
comment on: http://stackoverflow.com/q/28552353
score: 0
has text: @ArtyMcFly: Actually the data has several type of response. One string, one json and another json array.
type: Comment

http://stackoverflow.com/comment/45370301
comment on: http://stackoverflow.com/a/28524764
type: AnswerComment
has text: Perhaps another option would be to make the Li tags position:absolute in css. Hopefully that would remove the excess height and the script would do the rest as it gracefully loads the images
score: 0
type: Comment

html5-canvas
tags question: http://stackoverflow.com/q/28556503
tags question: http://stackoverflow.com/q/28543775
tags question: http://stackoverflow.com/q/28523374
tags question: http://stackoverflow.com/q/28582699
tags question: http://stackoverflow.com/q/28582945
tags question: http://stackoverflow.com/q/28547048
tags question: http://stackoverflow.com/q/28529925
tags question: http://stackoverflow.com/q/28513137
tags question: http://stackoverflow.com/q/28497274
tags question: http://stackoverflow.com/q/28579298
tags question: http://stackoverflow.com/q/28552385
tags question: http://stackoverflow.com/q/28545140
tags question: http://stackoverflow.com/q/28528885
tags question: http://stackoverflow.com/q/28508302
tags question: http://stackoverflow.com/q/28567079
tags question: http://stackoverflow.com/q/28545747
tag name: html5-canvas
tags question: http://stackoverflow.com/q/28503870
type: Tag
tags question: http://stackoverflow.com/q/28551822
tags question: http://stackoverflow.com/q/28591573
tags question: http://stackoverflow.com/q/28456898

frameworks
tags question: http://stackoverflow.com/q/28536562
tag name: frameworks
type: Tag
tags question: http://stackoverflow.com/q/28459382
tags question: http://stackoverflow.com/q/28539491
tags question: http://stackoverflow.com/q/28497274

http://stackoverflow.com/q/28572798
answer count: 2
downvote count: 0
tagged with: ember-cli
favorite count: 0
has comment: http://stackoverflow.com/comment/45536695
has answer: http://stackoverflow.com/a/28687397
has body: I am using the ember addon called ember-dev-fixtures, and it throws an error when I try and fetch the array saying that it is not one. The way the blueprint is configured is like so: fixtures/model-name.js export default [ /*{ id: 1, // all fixtures must have an ID title: 'test', user: 2, // if it is a relation, put the ID of the related record createdAt: '2015-01-26T09:22:17.657Z' }*/ ]; I have searched everywhere online and no one else seems to have a problem with this addon but me, so I figured I would post here. It seems like a pretty straight forward addon, and Ember usually throws that error when the json is formatted incorrectly. As you can see, I have formatted my json to what the addon blueprint requires, and still I have no luck. Below you will see my fixtures file which is outside of my app directory in the root, as it is suppose to be. Also, I have included my model, and my route, as it seems those are the two that are complaining and have the potential to be incorrect. This is a really a shot in the dark since I assume many have not used this framework, and even less have used this specific addon. Any suggestions, are extremely welcomed. fixtures/state.js export default [ {id: 1, state: 'Alabama', url: 'http://upload.wikimedia.org/wikipedia/commons/5/5c/Flag_of_Alabama.svg', symbol: 'AL'}, {id: 2,state: 'Alaska', url: 'https://upload.wikimedia.org/wikipedia/commons/e/e6/Flag_of_Alaska.svg', symbol: 'AK'}, {id: 3,state: 'Arizona', url: 'https://upload.wikimedia.org/wikipedia/commons/9/9d/Flag_of_Arizona.svg', symbol: 'AZ'}, {id: 4,state: 'Arkansas', url: 'https://upload.wikimedia.org/wikipedia/commons/9/9d/Flag_of_Arkansas.svg', symbol: 'AR'}, {id: 5,state: 'California', url: 'https://upload.wikimedia.org/wikipedia/commons/0/01/Flag_of_California.svg', symbol: 'CA'}, {id: 6,state: 'Colorado', url: 'https://upload.wikimedia.org/wikipedia/commons/4/46/Flag_of_Colorado.svg', symbol: 'CO'}, {id: 7,state: 'Connecticut', url: 'https://upload.wikimedia.org/wiki…
tagged with: ember.js
has title: ember-dev-fixtures ERROR: "Assertion Failed: The response from a findAll must be an Array, not undefined"
has answer: http://stackoverflow.com/a/28597763
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45458556
score: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45503128
upvote count: 1
possible better answer: http://stackoverflow.com/a/28597763
type: Question
accepted answer: http://stackoverflow.com/a/28687397
tagged with: ember-data
tagged with: javascript

http://stackoverflow.com/a/28542860
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28542764
has body: Something like this? for(var i in objects){ var h1 = ' ' + objects[i].title + ' '; var href = 'linkText'; }
score: 1
answers question: http://stackoverflow.com/q/28542764
upvote count: 1
has comment: http://stackoverflow.com/comment/45399425
type: AcceptedAnswer

http://stackoverflow.com/q/28476577
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28476615
type: Question
has title: (Javascript) How to make a image open double link
answer count: 1
tagged with: hyperlink
downvote count: 3
type: UnansweredQuestion
score: -3
tagged with: image
upvote count: 0
has body: How to create a code like this. when an image is being clicked and 2 links will open, one in the same window and another as a pop-up windows.

http://stackoverflow.com/q/28548682
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/45410399
has body: I have add clone (more than 3) and remove clone button. when i try to clone Image* : option* : name1 name2 name3 Add Another remove $(".add").click(function(){ $("#id1").clone().appendTo(".data-add"); $("#id2").clone().appendTo(".data-add"); }); It clone particular div happening proper. when i click remove its not working (not able to remove) $(".remove").click(function(){ $(this).closest("#id1").remove(); $(this).closest("#id2").remove(); }); i have tried this also $(".remove").click(function(){ $(this).parents("#id1").remove(); $(this).parents("#id2").remove(); }); $(".remove").click(function(){ $("#id1").remove(); $("#id2").remove(); }); when i used like this it removing first clone(first id1 and id2). not removing current clone div
downvote count: 0
score: 1
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45411173
answer count: 2
has comment: http://stackoverflow.com/comment/45410434
upvote count: 1
has answer: http://stackoverflow.com/a/28548832
has title: how to remove div from clone(jQuery - remove element's parent row)
has answer: http://stackoverflow.com/a/28555673
favorite count: 0

http://stackoverflow.com/comment/45454547
has text: found the problem is that i forgot to remove the "." before the "[" but again gives the same problem as the solution below
comment on: http://stackoverflow.com/a/28572268
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28578776
score: 1
accepted answer: http://stackoverflow.com/a/28578794
upvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/28578831
has answer: http://stackoverflow.com/a/28578794
tagged with: javascript
has comment: http://stackoverflow.com/comment/45465867
answer count: 3
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28578831
has title: Open link in a new window with javascript
has body: I want to open links in a new pop up, I have my link in a PHP Code but when I try to add a on-click I keep getting errors. This is my code: echo " Edit "; Where exactly do I need to add the on-click function? Because it's easy in html but I keep getting errors because it's in PHP Thanks
has answer: http://stackoverflow.com/a/28578915
tagged with: php
type: AnsweredQuestion

http://stackoverflow.com/a/28529734
score: 1
has body: I am not quite sure how you are getting variables like: lastname, age etc. But the cleanest way would be to put them in an array like you suggested. Like: var controlIds = [ {"id": 'id1', "functions": [updatePreview, showPreview]}, {"id": 'id2', "functions": [updatePreview, updatePostHeader, showPreview]} ]; controlIds.map(function (item){ item["element"] = document.getElementById(item["id"]); return item; }).forEach(function(elem) { elem["element"].oninput = function () { elem["functions"].forEach(function(fn) { fn(); }); } });
has comment: http://stackoverflow.com/comment/45375065
has comment: http://stackoverflow.com/comment/45374859
has comment: http://stackoverflow.com/comment/45379140
answers question: http://stackoverflow.com/q/28529671
downvote count: 0
has comment: http://stackoverflow.com/comment/45374761
type: Answer
has comment: http://stackoverflow.com/comment/45374617
has comment: http://stackoverflow.com/comment/45374689
upvote count: 1

http://stackoverflow.com/comment/45283680
type: AnswerComment
has text: Great, thanks very much! Lastly, is there a piece I need in order to get this to display conditionally? Currently the stylesheet is being brought across for all browsers and we only need it for IE9!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28479149

http://stackoverflow.com/q/28561997
tagged with: mobile-application
tagged with: javascript
tagged with: jquery
answer count: 2
has answer: http://stackoverflow.com/a/28618334
has answer: http://stackoverflow.com/a/28624955
type: UnansweredQuestion
tagged with: slide
tagged with: hybrid-mobile-app
score: 0
has body: Am building mobile app (phonegap) using jquery as a js library. Want to add slide menu that open on either tapping (in corner) or by sliding finger across. I could only find articles on jquery mobile but I dont want to use JQM cause I find all the default styles (theme, data-role ...) messy as I have to overwrite styles with my own CSS. Is there any library just for sliding menu that open on sliding on touch devices other than JQM?
type: Question
has title: how to add slide panel without using JQM for mobile app?

http://stackoverflow.com/comment/45354743
type: Comment
comment on: http://stackoverflow.com/q/28518841
score: 0
has text: Reading the [documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for) might help? And something general about [control flow](https://developer.mozilla.org/en-US/docs/Glossary/Control_flow).
type: QuestionComment

http://stackoverflow.com/comment/45456151
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28572972
type: Comment
has text: @Shamoon: Of course, you can also `throw` an "no data" exception and [use rejections for the control flow](http://stackoverflow.com/a/24663315/1048572). This will especially "not continue the chain" as you requested

http://stackoverflow.com/a/28582632
answers question: http://stackoverflow.com/q/28582405
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28582405
has body: Never ever store passwords on the client! Never store passwords unencrypted! To store the email address in the localStorage you can use this snippet: $(document).ready(function(){ $("#form1").on('submit',function(event){ event.preventDefault(); var data = $(this).serialize(); $.ajax({ type: "POST", url: "log.asp", data: data, success: function(data) { $('#log_msg').html(data); var result = $.trim(data); if(result==="Correct"){ localStorage.setItem('eaddress', $('#email').val()); } } }); }); }); Note: You have to cleanup the localStorage yourself. If you want to store the data for further identification use a sessionId in a cookie or use the sessionStorage for saving temporary data. Edit: To submit the form after page load you can try something like this: $(function(){ var eAddr = localStorage.getItem('eaddress'); if (eAddr !== null) { $('#email').val(eAddr); $('#form1').trigger('submit'); } }); Note: If you store the password encrypted on the client and submit it trough the form, the authentication process is quiet insecure. I think your authentication design is wrong. You should use an authentication cookie (like a session cookie) and validate it on the server side. Without submitting a form every time a page loads nor storing credentials on the client side.
type: Answer
has comment: http://stackoverflow.com/comment/45473791
score: 1
has comment: http://stackoverflow.com/comment/45473113
upvote count: 1
has comment: http://stackoverflow.com/comment/45473356
has comment: http://stackoverflow.com/comment/45473402

http://stackoverflow.com/comment/45488893
type: Comment
comment on: http://stackoverflow.com/q/28589938
has text: I'm not sure where you're looking for the response to be, but jQuery's `success` property is a Javascript callback. If you give it an argument (`success: function(response) { alert(response); }`) you can get the response.
score: 0
type: QuestionComment

http://stackoverflow.com/a/28548262
answers question: http://stackoverflow.com/q/28548058
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45409548
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/45410084
has body: You can using momentjs.com for formatting: moment(Date.parse("2015-02-16T19:00:00")).format("MMMM Do [at] hhA"); // February 16th at 10PM

http://stackoverflow.com/q/28580235
has comment: http://stackoverflow.com/comment/45469727
tagged with: php
has comment: http://stackoverflow.com/comment/45470323
has body: So im using isotope to filter categories on my blog page, when you click on a blog I still have my menu of categories at the top of the single blog post so people can click on a category and it will take them back to the blog page but on the category selected. So on the single blog page ive added an add_query_arg to the link to return a custom url. &lt;a href="&lt;?php echo add_query_arg( 'cat', $category-&gt;name, '/blog' );?&gt;"&gt; this gives me the url on my blog page as mysite.com/blog/?cat=information then on my blog page i call the query like this &lt;?php $cat = get_query_var('cat');?&gt; Then in my javascript for filtering the categories with isotope i have filter: "&lt;?php echo $cat;?&gt;" but this is not returning anything in my javascript when i view source is just filter: "" i have also added this to my functions.php function add_query_vars_filter( $vars ){ $vars[] = "cat"; return $vars; } //Add custom query vars add_filter( 'query_vars', 'add_query_vars_filter' ); anyone got an idea where im going wrong?
has title: get_query_var not returning the value(wordpress)
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45469171
tagged with: wordpress
has comment: http://stackoverflow.com/comment/45472121
has comment: http://stackoverflow.com/comment/45469658
type: Question
score: 0
has comment: http://stackoverflow.com/comment/45470857
has comment: http://stackoverflow.com/comment/45469392
tagged with: url
tagged with: javascript

http://stackoverflow.com/comment/45217402
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28443485
has text: Thanks for the response Cory, but this isn't working. How did you test it? It's still doing the redirect to `/2,1`

http://stackoverflow.com/comment/45493624
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28593226
type: Comment
has text: Ok so `$(this).val()` doesn't work on old IE7 for labelized button element. I wasn't aware about it, so THX for the info! ;)

http://stackoverflow.com/a/28511916
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28491667
upvote count: 1
type: AcceptedAnswer
has body: I is hard to find anything about the stack. I think I could do something like this: var stackString = [ "CompositeError msg - composed of #1:Error msg1 #2:TypeError msg2 #3:Error msg3", " at module.exports.extend.init (http://example.com/example.js:75:31)", " at new Descendant (http://example.com/example.js:11:27)", " at Error (#1:0:0)", " at custom (http://example.com/spec/example.spec.js:222:23)", " at Object.&lt;anonymous&gt; (http://example.com/spec/example.spec.js:224:13)", " at TypeError (#2:0:0)", " at http://example.com/spec/example.spec.js:10:20", ... ].join("\n"); The problem with the whole Composite stack thing, that there are differences in environments. Not just stack format differences (which can be managed with different parsers), but stack creation differences as well... The stack property is set to undefined when the error is constructed, and gets the trace information when the error is raised. If an error is raised multiple times, the stack property is updated each time the error is raised. https://msdn.microsoft.com/en-us/library/ie/hh699850%28v=vs.94%29.aspx For example by nodejs the stack is created by the instantiation of the Error, while in MSIE it is created by throwing the Error instance. var err = new Error(msg); // 1st line //... console.log(err.stack); // by node.js this prints the stack generated by the 1st line // by msie this prints nothing (according to the documentation, I did not try it out yet) try { throw err; // Nth line } catch (err){ console.log(err.stack); // by node.js this prints the stack generated by the 1st line // by msie this prints the stack generated by the Nth line (according to the documentation) } So I have to do something like the following if I want to stay in the business: var Error = extend(NativeError, { id: undefined, name: "Error", message: "", configure: Object.prototype.configure, isOptions: Object.prototype.isOptions, init: function (options, preprocessor) { this.id = id(); if (typeof (options) == "string…
type: Answer
accepted answer of: http://stackoverflow.com/q/28491667

http://stackoverflow.com/q/28455222
tagged with: google-chrome
type: Question
linked to: http://stackoverflow.com/q/4765600
tagged with: javascript
tagged with: canvas
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45237650
linked to: http://stackoverflow.com/q/704758
favorite count: 0
has comment: http://stackoverflow.com/comment/45246939
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45245069
has answer: http://stackoverflow.com/a/28483697
tagged with: http://stackoverflow.com/tag/html
has body: I’m having a problem here since a couple days ago with Google Chrome. I love pixel art and I'm trying to create a huge animated map using html5. Everything was ok until I started to use more than 5 or 6 canvas at same time. In Firefox and Internet explorer the map has no problems, but in Chrome the CPU reaches 70% and sometimes even more. Can you give me some good tips about how solve this kind of issues in Chrome? I've been searching on Internet about improve performance in Chrome but nothing is helping me. Thanks for your help. Just for reference this is the map: http://pixelslivewallpaper.github.io/jadsdsengine/Zelda.htm
has comment: http://stackoverflow.com/comment/45245503
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45243757
has title: Chrome high cpu use when multiples canvas are running at same time

http://stackoverflow.com/q/28577547
has comment: http://stackoverflow.com/comment/45464006
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/45463858
linked to: http://stackoverflow.com/q/2655925
has comment: http://stackoverflow.com/comment/45463909
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45463799
has comment: http://stackoverflow.com/comment/45463923
has title: How can I set a text input's width to 0px with Bootstrap included?
has comment: http://stackoverflow.com/comment/45464185
tagged with: jquery-animate
has body: I want a 0 width input that expands into view, but it seems like Bootstrap's styling is not letting me do this without !important. But when I do mark it !important, I cannot seem to make it expand with jQuery's .animate({width: "170px"}, 200). Perhaps another alternative to make the box expand into view?
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45463803
score: 0
has comment: http://stackoverflow.com/comment/45464104
has comment: http://stackoverflow.com/comment/45464025
tagged with: css
has comment: http://stackoverflow.com/comment/45463863
has answer: http://stackoverflow.com/a/28577701
accepted answer: http://stackoverflow.com/a/28577701

http://stackoverflow.com/q/28466255
type: Question
has answer: http://stackoverflow.com/a/28466664
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45258780
tagged with: php
answer count: 1
has comment: http://stackoverflow.com/comment/45258664
accepted answer: http://stackoverflow.com/a/28466664
has title: How to pull PHP function every second in JS/Ajax
type: AnsweredQuestion
tagged with: highcharts
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has body: I am working with the Highcharts (see: http://www.highcharts.com/demo/dynamic-update) API for a dynamic updating graph to reflect sever load on my webpanel. I have coded a PHP function that will get the current load data every time the function is ran; lets call this get_server_cpu_usage(). My JS code should pull this data every second by using JS so that is supplies the data for the graph, however for some reason it seems that the data isn't being pulled each second and I am only getting one value, causing the live graph to flatline. JS with PHP function being called: events: { load: function () { // set up the updating of the chart each second var series = this.series[0]; setInterval(function () { var x = (new Date()).getTime(), // current time y = &lt;?php echo get_server_cpu_usage(); ?&gt;; series.addPoint([x, y], true, true); }, 1000); } } I was wondering if I was doing something wrong and how I could get the function to echo the data every time it is pulled. Thanks in advance!

http://stackoverflow.com/a/28454309
score: 1
answers question: http://stackoverflow.com/q/28454221
upvote count: 1
has comment: http://stackoverflow.com/comment/45238029
type: AcceptedAnswer
downvote count: 0
has body: If you want to use jQuery then you can do this: Music Dance then you can do this in jQuery: $('#mainTabs a').click(function(e){ e.preventDefault(); $('#div_displayfrom').load(this.getAttribute('href')); });
type: Answer
accepted answer of: http://stackoverflow.com/q/28454221

http://stackoverflow.com/a/28461325
type: Answer
answers question: http://stackoverflow.com/q/28461188
has body: Please let me know if I have misinterpreted your needs, but if you want an alert to fire when pressing the key you need to create an event listener for onkeydown like so window.onkeydown = function ( e ) { if(e.altKey){ alert(5); } }
score: 0

http://stackoverflow.com/q/28448608
has body: Here is javascript for up and down vote click function: &lt;script type="text/javascript"&gt; $(document).ready(function() { //####### on page load, retrive votes for each content $.each( $('.voting_wrapper'), function(){ //retrive unique id from this voting_wrapper element var unique_id = $(this).attr("id"); //prepare post content post_data = {'unique_id':unique_id, 'vote':'fetch'}; //send our data to "vote_process.php" using jQuery $.post() $.post('vote_process.php', post_data, function(response) { //retrive votes from server, replace each vote count text $('#'+unique_id+' .up_votes').text(response.vote_up); $('#'+unique_id+' .down_votes').text(response.vote_down); },'json'); }); //####### on button click, get user vote and send it to vote_process.php using jQuery $.post(). $(".voting_wrapper .voting_btn").click(function (e) { //get class name (down_button / up_button) of clicked element var clicked_button = $(this).children().attr('class'); //get unique ID from voted parent element var unique_id = $(this).parent().attr("id"); if(clicked_button==='down_button') //user disliked the content { //prepare post content post_data = {'unique_id':unique_id, 'vote':'down'}; //send our data to "vote_process.php" using jQuery $.post() $.post('vote_process.php', post_data, function(data) { //replace vote down count text with new values $('#'+unique_id+' .down_votes').text(data); //thank user for the dislike alert("Thanks! Each Vote Counts, Even Dislikes!"); }).fail(function(err) { //alert user about the HTTP server error alert(err.statusText); }); } else if(clicked_button==='up_button') //user liked the content { //prepare post content post_data = {'unique_id':unique_id, 'vote':'up'}; //send our data to "vote_process.php" using jQuery $.post() $.post('vote_process.php', post_data, function(data) { //replace vote up count text with new values $('#'+unique_id+' .up_votes').text(data); //thank user for liking the content alert("Thanks! For Liking This Content."); }).fail(function…
has answer: http://stackoverflow.com/a/28448945
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28448791
type: Question
has answer: http://stackoverflow.com/a/28448743
score: 0
answer count: 3
tagged with: javascript
tagged with: jquery
has title: How to show display and hide text instead of using alert in javascript?

construct-2
tags question: http://stackoverflow.com/q/28548487
tag name: construct-2
tags question: http://stackoverflow.com/q/28530149
type: Tag

http://stackoverflow.com/comment/45262550
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28468504
has text: Correnct! Thank you very much, Sir... Can you explain? What is the meaning of !important ? at css?

http://stackoverflow.com/q/28489817
tagged with: http://stackoverflow.com/tag/html
tagged with: css
possible better answer: http://stackoverflow.com/a/28490138
favorite count: 0
type: AnsweredQuestion
has title: Populate data from an array into an html table
downvote count: 1
has answer: http://stackoverflow.com/a/28490105
type: Question
score: -1
answer count: 2
upvote count: 0
accepted answer: http://stackoverflow.com/a/28490105
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45301241
has comment: http://stackoverflow.com/comment/45301060
has answer: http://stackoverflow.com/a/28490138
has body: Name Relevant Tag Info Rating Track Edit James Bond Relevant Tag Info 4 Stars Track Edit James Bond Relevant Tag Info 4 Stars Track Edit James Bond Relevant Tag Info 4 Stars Track Edit James Bond Relevant Tag Info 4 Stars Track Edit James Bond Relevant Tag Info 4 Stars Track Edit James Bond Relevant Tag Info 4 Stars Track Edit James Bond Relevant Tag Info 4 Stars Track Edit James Bond Relevant Tag Info 4 Stars Track Edit James Bond Relevant Tag Info 4 Stars Track Edit James Bond Relevant Tag Info 4 Stars Track Edit James Bond Relevant Tag Info 4 Stars Track Edit James Bond Relevant Tag Info 4 Stars Track Edit James Bond Relevant Tag Info 4 Stars Track Edit James Bond Relevant Tag Info 4 Stars Track Edit I am trying to grab data from var dResponse = [{"user_id":"1","user_firstname":"Mark","user_lastname":"Woo","user_latitude":"37.7902","user_longitude":"-122.458"}, {"user_id":"2","user_firstname":"Hualong","user_lastname":"Chen","user_latitude":"37.7285","user_longitude":"-122.438"},{"user_id":"3","user_firstname":"TFirst","user_lastname":"TLast","user_latitude":"37.7401","user_longitude":"-122.492"},{"user_id":"4","user_firstname":"Zishan","user_lastname":"Budhwani","user_latitude":"37.7298","user_longitude":"-122.47"},{"user_id":"5","user_firstname":"ibian","user_lastname":"hodgson","user_latitude":"37.8014","user_longitude":"-122.427"},{"user_id":"6","user_firstname":"Amos","user_lastname":"Munoz","user_latitude":"37.7367","user_longitude":"-122.439"},{"user_id":"7","user_firstname":"Brennan","user_lastname":"Ramos","user_latitude":"37.7624","user_longitude":"-122.435"},{"user_id":"8","user_firstname":"Cole","user_lastname":"Lott","user_latitude":"37.7607","user_longitude":"-122.462"},{"user_id":"9","user_firstname":"Slade","user_lastname":"Strickland","user_latitude":"37.796","user_longitude":"-122.451"},{"user_id":"10","user_firstname":"Isaiah","user_lastname":"Gibbs","user_latitude":"37.7536","user_longitude":"-122.464"}]; and assign each piece of data into its…

http://stackoverflow.com/q/28519093
has body: So I've got a function that calls a callback. It is inside another function function otherFunction() { getUserStatus(function(status) { console.log(status); }); } The function getUserStatus() does all the processing I want, and console.log() displays the correct variable. However I can't seem to access the variable outside the scope of the callback function. I want to access it in otherFunction() I tried creating a variable outside of the callback function (inside of otherFunction()) by using var status; and var otherstatus; and assigning status to these variables, but assigning them to what I would think would be a variable in scope didn't work either. So how do I get this variable into the scope of the function?
tagged with: javascript
tagged with: callback
tagged with: scope
has comment: http://stackoverflow.com/comment/45355340
tagged with: asynchronous
has comment: http://stackoverflow.com/comment/45355416
has comment: http://stackoverflow.com/comment/45355506
linked to: http://stackoverflow.com/q/14220321
answer count: 0
score: 0
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/14220321
has title: Getting a variable from inside a callback function
type: Question
has comment: http://stackoverflow.com/comment/45355486
has comment: http://stackoverflow.com/comment/45355236

http://stackoverflow.com/comment/45463729
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28577482
score: 0
has text: You can't stop a `setInterval()` and then start a new one later. You can't "pause" an existing timer and then start the same one again. You can stop one and then create a new one later to start again.

http://stackoverflow.com/q/28578638
favorite count: 0
has comment: http://stackoverflow.com/comment/45465727
has title: What is the difference between a node module and a regular javascript file
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45465659
upvote count: 6
has answer: http://stackoverflow.com/a/28578873
tagged with: node.js
has comment: http://stackoverflow.com/comment/45465810
downvote count: 2
has body: Recently I had some experience in writing a very basic Node.js application. But I am a bit confused about the difference between a Node.js module and a JavaScript one. For instance, I can get advantage of the underscore library in both Node.js and JavaScript like below: Node.js var _ = require("underscore"); _.each([1, 2, 3], console.log); JavaScript _.each([1, 2, 3], console.log); And I get the exact same result. The point which confuses me is that is it really necessary to have client side coding that runs in browser, while we can handle all of them within a node module?
type: Question
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/45465691
has comment: http://stackoverflow.com/comment/45465829
has comment: http://stackoverflow.com/comment/45465861
answer count: 1

http://stackoverflow.com/q/28549907
tagged with: d3.js
tagged with: css
has answer: http://stackoverflow.com/a/28550167
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45413232
has body: I want to highlight every term/word that the user has clicked on with an background box for this particular term/word. I am using the on click function, I can access and set the color of the word itself, but I am not able to set the background of this word. How can I achieve that? Here is my draw function: function draw(words) { d3.select("#interests").append("svg") .attr("width", w) .attr("height", h) .append("g") .attr("transform", "translate(" + [w &gt;&gt; 1, h &gt;&gt; 1] + ")") .selectAll("text") .data(words) .enter().append("text") .style("font-size", function(d) { return d.size + "px"; }) .style("font-family", "Impact") .style("fill", function(d, i) { return fill(i); }) .style("cursor", "pointer") .attr("text-anchor", "middle") .attr("transform", function(d) { return "translate(" + [d.x, d.y] + ")rotate(" + d.rotate + ")"; }) .text(function(d) { return d.text; }) .on("click", function(d) { // d3.select(this).style("fill"); d3.select(this).style("background","yellow"); if (d.inGraph == true){ d.inGraph = false; unloadInterest(d.text); } else { d.inGraph = true; loadInterest(d.text, "#ff0000"); } }); }
has title: D3 wordcloud add background color for each term/word
type: Question
tagged with: javascript
tagged with: word-cloud
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28550167

http://stackoverflow.com/comment/45224243
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28447642
has text: `success: function(){ ... }` is not deprecated according to [this](http://stackoverflow.com/questions/15821141/deprecation-of-success-parameter-in-jquery-ajax)
type: Comment

http://stackoverflow.com/q/28454203
has comment: http://stackoverflow.com/comment/45238292
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/73225039
has comment: http://stackoverflow.com/comment/45236484
tagged with: javascript
has answer: http://stackoverflow.com/a/49822492
has comment: http://stackoverflow.com/comment/45238127
has comment: http://stackoverflow.com/comment/70637819
has answer: http://stackoverflow.com/a/61390128
has title: JQuery Datatables : Cannot read property 'aDataSort' of undefined
has answer: http://stackoverflow.com/a/77903045
tagged with: datatables
has answer: http://stackoverflow.com/a/66226116
tagged with: jquery
answer count: 16
score: 131
has answer: http://stackoverflow.com/a/72144533
upvote count: 132
favorite count: 0
has comment: http://stackoverflow.com/comment/48792283
has comment: http://stackoverflow.com/comment/45236660
linked to: http://stackoverflow.com/q/30348028
has comment: http://stackoverflow.com/comment/45236654
has answer: http://stackoverflow.com/a/73246159
has answer: http://stackoverflow.com/a/73568063
has answer: http://stackoverflow.com/a/57065276
has answer: http://stackoverflow.com/a/67776105
has answer: http://stackoverflow.com/a/32476369
has answer: http://stackoverflow.com/a/62406207
has answer: http://stackoverflow.com/a/72669518
has answer: http://stackoverflow.com/a/50937586
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/44137826
has body: I created this fiddle to and it works well as per my requirements: Fiddle However, when I use the same in my application I get an error in the browser console saying Cannot read property 'aDataSort' of undefined In my application, the javascript reads something like as below: I have checked the controller output...it works well and is printed on the console too. $(document).ready(function() { $.getJSON("three.htm", function(data) { // console.log("loadDataTable &gt;&gt; "+JSON.stringify(data)); }) .fail(function( jqxhr, textStatus, error ) { var err = textStatus + ', ' + error; alert(err); console.log( "Request Failed: " + err); }) .success(function(data){ loadDataTable(data); }); function loadDataTable(data){ $("#recentSubscribers").dataTable().fnDestroy(); var oTable = $('#recentSubscribers').dataTable({ "aaData" : JSON.parse(data.subscribers), "processing": true, "bPaginate": false, "bFilter": false, "bSort": false, "bInfo": false, "aoColumnDefs": [{ "sTitle": "Subscriber ID", "aTargets": [0] }, { "sTitle": "Install Location", "aTargets": [1] }, { "sTitle": "Subscriber Name", "aTargets": [2] }, { "aTargets": [0], "mRender": function (data, type, full) { return '&lt;a style="text-decoration:none;" href="#" class="abc"&gt;' + data + '&lt;/a&gt;'; } }], "aoColumns": [{ "mData": "code" }, { "mData": "acctNum" }, { "mData": "name" }] }); } })
has answer: http://stackoverflow.com/a/30350165

http://stackoverflow.com/comment/45366426
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28525189
has text: also take a look intro [this SO][1] [1]: http://stackoverflow.com/a/18490110/2654789

http://stackoverflow.com/comment/45426582
type: Comment
has text: Thank you. I have tried http://open.mapquestapi.com/sdk/js/v7.2.s/mqa.toolkit.js?key=<myappkey>. But not getting route in this postcodes (10011,10012,10013) using "addRoute" function. But few other postcodes like(80201,80205,80216) are working fine. Is there any limitation of postcodes for Open API ? I have already checked following link for my problem- http://developer.mapquest.com/web/tools/getting-started/platform/licensed-vs-open , but not getting my answer.
type: AnswerComment
comment on: http://stackoverflow.com/a/28545863
score: 0

http://stackoverflow.com/a/28438910
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45208155
accepted answer of: http://stackoverflow.com/q/28438642
answers question: http://stackoverflow.com/q/28438642
type: Answer
has body: Yes - you can do it through javascript. Lets assume you create 1 js file that you include in all your pages: &lt;script language="javascript" src="/js/mymenu.js"&gt;&lt;/script&gt; If you use another javascript, or other css files for your menu, make sure to include the mymenu.js file BEFORE the others in your HEAD tag. Then in your mymenu.js file just have some code like this: var outerDiv = document.createElement("div"); outerDiv.setAttribute("class","navbar navbar-fixed-top"); outerDiv.setAttribute("role","navigation"); var innerDiv = document.createElement("div"); innerDiv.setAttribute("class","container"); outerDiv.appendChild(innerDiv); document.body.appendChild(outerDiv); ... Make sure your css for the main menu uses position: absolute; or instead of doing body.appendChild, append it to the containing element.

http://stackoverflow.com/comment/100635285
has text: Is that site actually using ParticlesJS itself? I'm not sure how you could get it to be centred around the cursor using ParticlesJS (unless they've customised the code?)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28567642
score: 0

http://stackoverflow.com/q/28560907
has answer: http://stackoverflow.com/a/61855494
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/32136567
upvote count: 4
has answer: http://stackoverflow.com/a/28702996
tagged with: linkedin-api
downvote count: 0
tagged with: javascript
tagged with: ajax
type: Question
has comment: http://stackoverflow.com/comment/45588891
favorite count: 0
score: 4
has title: Loading mulitple LinkedIn share buttons dynamically and asynchronously
answer count: 3
has body: I have a page showing thumbnails of posts. The posts are fetched via AJAX and a filter allows for different posts to be fetched. When a thumbnail is clicked, a carousel opens centered on the clicked post. Each post in the carousel has a LinkedIn share button. Linked share buttons don't work properly if loaded into an invisible element and then loaded later. So we must load them at the time of opening the carousel. I do this using the following code: $.getScript('http://platform.linkedin.com/in.js', function() { $('.li-box-1').append('&lt;script type="IN/Share" data-counter="right"&gt;&lt;/script&gt;'); }); Now, if I close the carousel and select a filter, thereby fetching a different set of posts, and then click on one of them, the carousel displays without the LinkedIn share button, and we get this warning in the console: duplicate in.js loaded, any parameters will be ignored This is because we've already loaded LinkedIn's in.js. Does anyone know how to get around this?

http://stackoverflow.com/a/28447144
has body: You need to call refresh and trigger create functions on the table element. Please, try the below: $("#tr1").after(newrow); $('#tab').table("refresh").trigger("create");
upvote count: 2
answers question: http://stackoverflow.com/q/28446871
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/a/28518141
answers question: http://stackoverflow.com/q/28487315
type: Answer
score: 0
has body: I refactor the whole program because it has some design flaws. And I managed to get rid of errors. However, after running for a while, the script will stop saying that it exceeded the time for running a script. I put the sleep function, as it was requested by Google, as many requests are made. However It is not able to finished the 370 rows that I have in my spreadsheet (it stops at 318) Do you know if there is any way to improve the performance of my algorithm? function search() { // Get the active spreadsheet and the active sheet var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getActiveSheet(); // Search the files in the user's Docs List for the search term var startRow = 2; // First row of data to process var numRows = sheet.getMaxRows() ; // Number of rows to process //sheet.getRange(2, 3, 1, 1).setValue(numRows.toString()); var dataRange = sheet.getRange(startRow, 1, numRows-1) // Fetch values for each row in the Range. var data = dataRange.getValues(); k = startRow for (i in data) { // sheet.getRange(2, 3, 1).setValue(data[i].toString()); var files = DocsList.find(data[i].toString()+".txt"); Utilities.sleep(1000); for (var j = 0; j &lt; files.length; j++) { if (files[j].getType() == "other"){ urlBase = "https://docs.google.com/fileview?id="; sheet.getRange(k, 8, 1, 1).setValue(urlBase + files[j].getId()); k = k+1 break; } } } }

http://stackoverflow.com/comment/45284814
comment on: http://stackoverflow.com/q/28477494
type: Comment
type: QuestionComment
has text: i need to check whether it is overlap other div's(svg or out of the area). if it's overlap need to perform trim operation(Rev...)
score: 0

http://stackoverflow.com/q/28528144
has comment: http://stackoverflow.com/comment/45371700
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: ajax
has answer: http://stackoverflow.com/a/28529291
accepted answer: http://stackoverflow.com/a/28528379
has body: I have a ajax json retrieving all query results in a div.I'm not sure how to introduce pagination though. And html as ANy help will be greatly appreciated!
possible better answer: http://stackoverflow.com/a/28529291
favorite count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/45371679
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28528379
has title: incorporating pagination in ajax json
type: Question

http://stackoverflow.com/a/28473608
has comment: http://stackoverflow.com/comment/45271456
type: Answer
has comment: http://stackoverflow.com/comment/45271241
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/45271592
has comment: http://stackoverflow.com/comment/45271367
answers question: http://stackoverflow.com/q/28473516
has comment: http://stackoverflow.com/comment/45270986
downvote count: 0
has body: A canvas doesn't clear itself. At least not a 2D context, like you are using. If you keep drawing on it, the new graphics is placed on top of the old. You need to explicitly clear it: context.clearRect(0, 0, canvas.width, canvas.height);

http://stackoverflow.com/comment/45369513
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28524807
has text: Elements are getting deleted successfully via TestContainer which owns the array. However the remaining array elements are not re-rendered correctly; merely the name labels are being moved and the private state in TestLine is not 'moved over' to the new position in the array.

http://stackoverflow.com/q/28577284
type: UnansweredQuestion
tagged with: php
tagged with: css
has answer: http://stackoverflow.com/a/28578425
has answer: http://stackoverflow.com/a/28577338
has title: defining css elements based on calculations
has comment: http://stackoverflow.com/comment/45463372
type: Question
tagged with: javascript
tagged with: jquery
has body: I would like to know how I can define CSS element dimensions before they are rendered eg. not using offset and jQuery Can I echo php into where the width/height or position values are? eg. &lt;?php $width = 290px; $altwidth = 290; ?&gt; &lt;style&gt; .widget { width: &lt;?php echo $width; ?&gt;; } .altwidget { width: &lt;?php echo $altwidth; ?&gt;px; } Would any of these work, is it completely wrong? Similarly how would I apply JavaScript dimensions using a variable?
has answer: http://stackoverflow.com/a/28577392
score: 0
answer count: 3
tagged with: position

http://stackoverflow.com/q/28577139
tagged with: javascript
has answer: http://stackoverflow.com/a/28628661
has comment: http://stackoverflow.com/comment/45551812
accepted answer: http://stackoverflow.com/a/28628661
has title: Is there any way to handle websocket onmessage handler just like done method handlers attached to XHR deferred objects in jQuery
answer count: 1
downvote count: 0
tagged with: websocket
favorite count: 0
has comment: http://stackoverflow.com/comment/45552119
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45463103
score: 1
upvote count: 1
type: Question
has body: I'm currently doing this hack to handle the websocket's onmessage. $scope.wsCon.onMessage = function(result) { $scope.wsCon.trigger(result.handler, result.data); }; Problem here is that, onmessage is handling all the incoming requests through websocket. But I need something like this: $scope.wsCon. .send(data) .done(data, function (result) { // Deal with the result here }) .fail(data, function() { // Show the error message }) .complete(data, function() { // Do this always }); I know this is not achievable in websocket on single connection. But still, is there any way to produce effect something like the way jQuery does?
linked to: http://stackoverflow.com/q/26299403

http://stackoverflow.com/q/28585975
tagged with: validation
answer count: 1
has answer: http://stackoverflow.com/a/28587717
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45481877
has comment: http://stackoverflow.com/comment/45481514
has body: I'm looking for a way to use yii2s built-in javascript email validator, when I use a form, I can see that yii.validation.email is available, but looking at the source in /vendor/yiisoft/yii2/assets/yii.validation.js I can't figure out how to use it to validate a text string to see if it is valid.
type: Question
has comment: http://stackoverflow.com/comment/45482279
has comment: http://stackoverflow.com/comment/45482787
tagged with: yii2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45481819
has comment: http://stackoverflow.com/comment/45481969
score: 0
has title: Use yii2 built in validators

http://stackoverflow.com/a/28468170
type: Answer
answers question: http://stackoverflow.com/q/28467896
score: 2
has comment: http://stackoverflow.com/comment/45261811
has body: Strict equality === will be faster. If you use ==, the JavaScript interpreter has to attempt to coerce the type into something that makes sense. I do want to note, though, that your function isn't truly checking if the value passed in is 0, 1, false, or true. For example: function isBinary(ins) { return ins == 0 || ins ==1; } var arrayOne = [1]; var arrayOneString = ['1']; console.log(isBinary(arrayOne)); //returns true console.log(isBinary(arrayOneString)); //returns true console.log(isBinary("1")); //returns true I'm just demonstrating that your code isn't doing exactly what you think it's doing. Type safety in JavaScript is difficult, and operators that aren't "strictly equal" can't be counted on to test type.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45261789
accepted answer of: http://stackoverflow.com/q/28467896
upvote count: 2

http://stackoverflow.com/a/28495853
upvote count: 1
has body: You can use 'centerMode' and 'slickGoTo' settings of the slick slider. centerMode will keep your current slide in the center. With your condition get the count of the element which is current and then using slickGoTo(count) you can center that element. For more details see the settings menu http://kenwheeler.github.io/slick/.
score: 1
accepted answer of: http://stackoverflow.com/q/28483217
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28483217
type: Answer

http://stackoverflow.com/a/28578908
has body: Angular services are: Lazily instantiated – Angular only instantiates a service when an application component depends on it. Singletons – Each component dependent on a service gets a reference to the single instance generated by the service factory. It might help you!!! var app = angular.module("myApp", []); app.service('getDemoService', function($http) { this.getDemoResult = function() { return $http({ method: 'GET', url: baseURL + 'Api/AccountPref/Get/' + uid }); }; }); app.controller("MyDemoController", function($scope, getDemoService) { $scope.resultData = []; getDemoService.getDemoResult().then(function(data) { var items = data.items; //TODO: here your logic }); });
type: Answer
answers question: http://stackoverflow.com/q/28578769
score: 0

http://stackoverflow.com/q/28532211
has title: D3 - Multiple wordclouds from the same source file
score: 1
has answer: http://stackoverflow.com/a/28548909
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: word-cloud
has answer: http://stackoverflow.com/a/28549232
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
has body: I'm having some trouble trying to create multiple wordclouds from a single source json using d3. Edit: Forgot to mention, I'm basing the wordclouds on Jason Davies example, here. There are various guides for creating small multiples from the same file, but I can't find anything which involves using a layout model for each chart, as is the case for the word-cloud layout. I want to make a separate wordcloud for each item in the 'results' object: sourcedata = { "results": [ { "category":"spain", "words":[["i", 190], ["the", 189], ["it", 139], ["you", 134], ["to", 133], ["a", 131]] }, { "category":"england", "words":[["lol", 37], ["on", 36], ["can", 35], ["do", 35], ["was", 33], ["mike", 33], ["but", 31], ["get", 30], ["like", 30]] }, { "category":"france", "words":[["ve", 18], ["make", 18], ["nick", 18], ["soph", 18], ["got", 18], ["he", 17], ["work", 17]] }, { "category":"germany", "words":[["about", 13], ["by", 13], ["out", 13], ["probabl", 13], ["how", 13], ["video", 12], ["an", 12]] } ] } Since each wordcloud needs it's own layout model, I'm trying to use a forEach loop to go through each category, creating a model and 'draw' callback method for each one: d3.json(sourcedata, function(error, data) { if (error) return console.warn(error); data = data.results; var number_of_charts = data.length; var chart_margin = 10; var total_width = 800; var chart_width_plus_two_margin = total_width/number_of_charts; var chart_width = chart_width_plus_two_margin - (2 * chart_margin); data.forEach(function(category) { svg = d3.select("body") .append("svg") .attr("id", category.name) .attr("width", (chart_width + (chart_margin * 2))) .attr("height", (chart_width + (chart_margin * 2))) .append("g") .attr("transform", "translate(" + ((chart_width/2) + chart_margin) + "," + ((chart_width/2) + chart_margin) + ")"); d3.layout.cloud().size([chart_width, chart_width]) .words(category.words.map(function(d) { return {text: d[0], size: 10 + (d[1] / 10)}; })) .padding(5) .rotate(function() { re…
accepted answer: http://stackoverflow.com/a/28548909
upvote count: 1
possible better answer: http://stackoverflow.com/a/28549232
type: AnsweredQuestion

http://stackoverflow.com/q/28448096
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45225584
has body: The question link is: http://www.codewars.com/kata/529eef7a9194e0cbc1000255/train/javascript An anagram is the result of rearranging the letters of a word to produce a new word. (Ref wikipedia). Note: anagrams are case insensitive Examples foefet is an anagram of toffee Buckethead is an anagram of DeathCubeK The challenge is to write the function isAnagram (or is_anagram in Python) to return true if the word test is an anagram of the word original and false otherwise. The function prototype is as given below: My answer is: // write the function isAnagram var isAnagram = function(test, orig) { var test = test.toLowerCase().split('').sort().join(''); var orig = orig.toLowerCase().split('').sort().join(''); return test == orig; }; But when i commit this code, i got this error: Test didn't pass: Unknown error Process took 71ms to complete What's wrong with my code?
has comment: http://stackoverflow.com/comment/45225061
has comment: http://stackoverflow.com/comment/45225760
has title: How to compare string is javascript?
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45225545
tagged with: javascript
has comment: http://stackoverflow.com/comment/45224780
has answer: http://stackoverflow.com/a/33030381
score: 0
has answer: http://stackoverflow.com/a/28448680
has comment: http://stackoverflow.com/comment/45224788

http://stackoverflow.com/comment/45208353
type: QuestionComment
comment on: http://stackoverflow.com/q/28438808
score: 0
has text: I think you are trying to achieve something like this to save time. http://www.labnol.org/india/autofill-irctc-forms/21255/ The working example: http://ctrlq.org/irctc/
type: Comment

http://stackoverflow.com/q/28567014
answer count: 1
downvote count: 1
favorite count: 0
has title: how to count clicks on flash banner in site
tagged with: php
linked to: http://stackoverflow.com/q/1789233
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28578233
accepted answer: http://stackoverflow.com/a/28578233
tagged with: flash
has body: I got two swf files. One of them is clickTag enabled, and other is not. I must put them in Wordpress site. I'm using adrotate plugin for banners management. Is there a way to know when the banner is clicked,so that i could changed click counter in adrotate manualy?
tagged with: javascript
score: 0
upvote count: 1

http://stackoverflow.com/comment/45386509
comment on: http://stackoverflow.com/a/28535387
type: Comment
score: 0
type: AnswerComment
has text: @ArunprasanthKV well I didn't show my full code but I actually made it so it shows a final div that tells the user in text that they are done the quiz and that they can view their results by clicking a newly shown button. Thanks for the tip though!

http://stackoverflow.com/comment/45261598
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28467847
has text: ok, i updated my answer too
type: QuestionComment

jvectormap
tags question: http://stackoverflow.com/q/28481129
tags question: http://stackoverflow.com/q/28567465
tags question: http://stackoverflow.com/q/28498307
tags question: http://stackoverflow.com/q/28475549
type: Tag
tags question: http://stackoverflow.com/q/28460994
tag name: jvectormap

http://stackoverflow.com/q/28499447
type: Question
answer count: 1
has title: What is the domain of the plus operator in JavaScript?
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28499515
tagged with: operators
tagged with: addition
type: AnsweredQuestion
has body: I'm looking at the MDN documentation of the plus (a + b) operator in JavaScript. It seems like the operator is defined on all combinations of number, string, and bool arguments. From experimentation, it is also defined on arrays, objects, null, closures ... The question: is there any combination of values for which the plus operator is not defined, i.e. those arguments are not in the domain of the + function? (Where operationally, "not defined" basically means an exception will be thrown or the program will halt with an error if + is applied to those arguments.) Bonus points for answering the equivalent question for the other "arithmetic operators" (which seem to do far more than arithmetic ...).
has answer: http://stackoverflow.com/a/28499515

http://stackoverflow.com/comment/45468469
type: QuestionComment
comment on: http://stackoverflow.com/q/28558334
score: 0
has text: You could fix the fiddle :)
type: Comment

http://stackoverflow.com/comment/45232805
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28452618
type: Comment
has text: Thanks! As I'm cycling through the container can I not use $(this).insertAfter(.className'); If i look in inspector it hasn't moved

http://stackoverflow.com/a/28500290
downvote count: 0
has comment: http://stackoverflow.com/comment/45366120
has body: Please try this. SkillEdit.js var SkillEdit = function(){ _designtemplate= ["", "input", "dropdownlist", "checkbox"], _designTemplateData= {}, readValue = function () { $('#templabel').text(_designTemplateData); return _designTemplateData; }, RequestResponse = function (data) { debugger; return _designTemplateData = data; }, ajaxCall= function () { //return this.RequestResponse(["12", "13"]); $.ajax({ url: "/Home/GetVendorDetails", type: "POST", async: true, contentType: "application/json; charset=utf-8", dataType: "json", error: function (result) { alert(result.statusText); }, success: function (result) { RequestResponse(result); console.log(result); } }); } return { readValue: readValue, RequestResponse: RequestResponse, ajaxCall : ajaxCall } }(); In ViewPage: &lt;script src="~/js/SkillEdit.js"&gt;&lt;/script&gt; &lt;label id="templabel"&gt;&lt;/label&gt; &lt;input type="button" value="stake overflow question" onclick="return SkillEdit.ajaxCall();"/&gt; &lt;input type="button" value="read Value answer" onclick="return SkillEdit.readValue();" /&gt; In Controller: [HttpPost] public ActionResult GetVendorDetails() { return Json("[12,13]"); }
type: Answer
has comment: http://stackoverflow.com/comment/45395404
accepted answer of: http://stackoverflow.com/q/28499324
has comment: http://stackoverflow.com/comment/45385650
has comment: http://stackoverflow.com/comment/45393525
upvote count: 1
answers question: http://stackoverflow.com/q/28499324
score: 1
has comment: http://stackoverflow.com/comment/45394814
type: AcceptedAnswer

http://stackoverflow.com/a/28524166
upvote count: 12
score: 12
type: AcceptedAnswer
downvote count: 0
has body: You need to pass it as 2nd arg in page.evaluate. page.evaluate(function(arg){},arg);
type: Answer
accepted answer of: http://stackoverflow.com/q/28524130
answers question: http://stackoverflow.com/q/28524130

http://stackoverflow.com/q/28530274
has comment: http://stackoverflow.com/comment/45376033
has body: Here is my code below: if (document.getElementById('actual').value &lt; document.getElementById('min').value || document.getElementById('actual').value &gt; document.getElementById('max').value) { alert("not in range"); } This alert works for digits from 10 to 100 or more. Suppose min value is 0 and max value is 10 and actual is 9; then this alert does not work, and it starts showing alerts like 'not in range', even though the actual value is in range. There are 3 editable text boxes in a JSP file: min, max and actual. When the user enter the values in text box, I check the values using the above code.
has answer: http://stackoverflow.com/a/28530576
type: Question
answer count: 2
has title: Alert is not working for single digits
has answer: http://stackoverflow.com/a/28530630
tagged with: javascript
has comment: http://stackoverflow.com/comment/45376051
score: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/45396942
type: QuestionComment
comment on: http://stackoverflow.com/q/28541730
has text: Never. [*void*](http://ecma-international.org/ecma-262/5.1/#sec-11.4.2) is an operator, not a a function, so the grouping operator is redundant. `void 0` is sufficient and generally used as a short way to write `undefined` (it saves 3 characters and avoids use of the identifier *undefined*, which may have been assigned some value other than the *undefined* value).
score: 0
type: Comment

http://stackoverflow.com/comment/45388807
type: Comment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/71001/discussion-between-omri-aharon-and-chirag-fanse).
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28536472

http://stackoverflow.com/comment/45415634
comment on: http://stackoverflow.com/a/28549733
type: AnswerComment
score: 0
has text: Thanks, didn't even know .nextAll existed. You learn something new every day.
type: Comment

http://stackoverflow.com/comment/45288968
has text: I did clean up cache... Doesn't work for me. Nothing really else is going on in the view. There's few datepickers else and that's it...
comment on: http://stackoverflow.com/q/28482373
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45404051
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28545175
has text: @JamesHill yes definitely, but in this instance no as I'm not working with a DB it's just a demo version

http://stackoverflow.com/comment/45252121
score: 0
has text: can you post a image of what you are looking for, or at least a description? i am not going to download the player, just to answer your question
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28463121

http://stackoverflow.com/a/67357808
answers question: http://stackoverflow.com/q/28547288
type: Answer
score: 2
downvote count: 0
has body: Another way to resolve them is adding the below piece of code in the main application class which contains the '@SpringBootApplication' and restart the server if required. This worked for me. @Bean public CorsFilter corsFilter() { CorsConfiguration corsConfiguration = new CorsConfiguration(); corsConfiguration.setAllowCredentials(true); corsConfiguration.setAllowedOrigins(Arrays.asList("http://localhost:4200")); corsConfiguration.setAllowedHeaders(Arrays.asList("Origin","Access-Control-Allow-Origin", "Content-Type","Accept","Authorization","Origin,Accept","X-Requested-With", "Access-Control-Request-Method","Access-Control-Request-Headers")); corsConfiguration.setExposedHeaders(Arrays.asList("Origin","Content-Type","Accept","Authorization", "Access-Control-Allow-Origin","Access-Control-Allow-Origin","Access-Control-Allow-Credentials")); corsConfiguration.setAllowedMethods(Arrays.asList("GET","PUT","POST","DELETE","OPTIONS")); UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource(); urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration); return new CorsFilter(urlBasedCorsConfigurationSource); }
upvote count: 2

http://stackoverflow.com/q/28577829
type: Question
has answer: http://stackoverflow.com/a/28579098
has answer: http://stackoverflow.com/a/28578198
answer count: 2
tagged with: canvas
score: 2
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Saving a large canvas as a data URI after editing
has comment: http://stackoverflow.com/comment/45467806
has comment: http://stackoverflow.com/comment/45465218
has body: I have loaded a 47MB image file from server and rendered it on canvas for editing. After editing, when I try to get image's data URI, the browser freezes up, then asks if the script should be stopped. I'm currently using this code to get the data URI: drawingCanvas.toDataURL("image/png"); It's somewhat faster to get a JPEG data URI, but I need the file to be a PNG format only. Is there any way to make this faster?
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/695151
upvote count: 2
has comment: http://stackoverflow.com/comment/45465683
type: UnansweredQuestion

http://stackoverflow.com/comment/45254704
score: 0
comment on: http://stackoverflow.com/q/28464154
type: Comment
type: QuestionComment
has text: You can open up Developer Tools and see exactly how Fiddle calls it.

http://stackoverflow.com/q/28454606
downvote count: 0
type: Question
tagged with: mootools
has title: mooselecta: Update a select dynamically
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28464867
upvote count: 3
answer count: 1
has body: In our current project we have to maintain other guys codebase based on mootools. We make heavy use of this plugin https://github.com/DimitarChristoff/mooSelecta to style our select tags. Basically this plugin programatically creates a styled div representation of an ordinary select and moves the select-tag out of the viewport. I have the need to populate an select tag based on an ajax call. This works fine for the select itself, but the styled div (created by mooselecta) is not updated - it keeps showing the old values. Is there any chance to update this div using plain javascript? Thanks in advance!
has answer: http://stackoverflow.com/a/28464867
favorite count: 0
type: AnsweredQuestion
score: 3

http://stackoverflow.com/a/28476042
has comment: http://stackoverflow.com/comment/45277620
has comment: http://stackoverflow.com/comment/45276961
has comment: http://stackoverflow.com/comment/45277528
upvote count: 1
has comment: http://stackoverflow.com/comment/45276889
has comment: http://stackoverflow.com/comment/45278648
has body: You can use check event.target.id inside click element and if it is items then only toggle class. jQuery(document).ready(function() { jQuery('#items').click(function(event) { event.preventDefault(); if(event.target.id=="items") { //use this for clicked element instead of finding it again using id $(this).toggleClass("semiCollapsed"); } }); });
has comment: http://stackoverflow.com/comment/45279288
has comment: http://stackoverflow.com/comment/45277025
answers question: http://stackoverflow.com/q/28475972
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/28472935
upvote count: 1
type: Question
tagged with: ios8
tagged with: ios
tagged with: javascript
has title: userContentController didReceiveScriptMessage method is not being called in iOS 8.1
has comment: http://stackoverflow.com/comment/46280964
downvote count: 0
tagged with: objective-c
tagged with: wkwebview
favorite count: 0
has body: I'm implementing iOS 8.1 mobile application using webkit framework, I followed few steps, to call the Javascript function in Objective-C steps: In viewDidLoad i have loaded html page from bundle. [contentWebVew loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:htmlPath]]]; _webConfig = [[WKWebViewConfiguration alloc]init]; WKUserContentController* userController = [[WKUserContentController alloc]init]; [userController addScriptMessageHandler:self name:@"loadingLessonsData"]; _webConfig.userContentController = userController; Calling Javascript function using Objective C NSString *exec_template = @"setLessonData(\"received: '%@'\");"; NSString *exec = [NSString stringWithFormat:exec_template,@"tintintin"]; [_contentWebVw evaluateJavaScript:exec completionHandler:nil]; Here, the issue is: I'm not able to execute any statements in "setLessonData" function. -This method is not calling - (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message The method executes only once, when i have run in multiple times. Please let us know how to call the didReceiveScriptMessage method and how to pass a variable from JavaScript to objective C using iOS 8? // Javascript Code function setLessonData(_iOSBundlePath, _rootPath, _activities) { alert("activity"); activities = _activities; rootPath = _rootPath; bundlePath = _iOSBundlePath; jsonEle = JSON.parse(activities); lessonData = jsonEle.lesson; showActivity(); } function showActivity(){ stopAllSounds(); length = lessonData.activity.length; validateButtons(); var temp = lessonData.activity[wrapper_counter].link; path = bundlePath + '/' + temp + '/'; var activity_path = path + 'index.html'; alert("activity path:...."+activity_path); $(".content").empty(); $(".content").load(activity_path,function(data){ var s; alert("b4 trim content"+$(this).html()); $(".content").each(function () { s = $.trim($(this).html()).replace(/assets/g, path+'assets'); }); alert…
has comment: http://stackoverflow.com/comment/45309975
answer count: 0
type: UnansweredQuestion
score: 1

http://stackoverflow.com/comment/45466821
score: 0
has text: is `videoPlayer` a ` ` element?
comment on: http://stackoverflow.com/q/28579169
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28591907
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28591861
accepted answer of: http://stackoverflow.com/q/28591861
type: Answer
score: 3
upvote count: 3
downvote count: 0
has body: Use closest and the startsWith selector $('.save').click(function(){ var targetId = $(this).closest('div[id^=accord]')[0].id; }); This will find the first matching parent element in the list of parent elements for the element with class=save, access the matched native element with [0], and the native .id property.

http://stackoverflow.com/q/28438624
has comment: http://stackoverflow.com/comment/45207089
has body: I am new to ASP.NET MVC. I was trying to create a page where I was displaying few controls and 3 of them are Country, State and City. Since these are common on few other pages, I did research to find the best way to create them in Razor view and I finally ended up using $.getJSON and then filling the dropdown select with options in javascript, following is the code form JS: $(document).ready(function () { $.getJSON("/Meta/GetCountries", null, function (data) { $.each(data, function (index, optionData) { $("#country").append("&lt;option&gt;" +optionData.Text+"&lt;/option&gt;") }); }); }); And instead of DropDownListFor or EditFor I used normal HTML select for this purpose. But then I wasn't sure how MVC binds each control with the field in the model. Because the HTML is not aware of any model, I know we use something like m =&gt; m.Country, so I looked at the HTML code of Razor view and I didn't see any special things, so I felt that may be it is handled by Name/ID that we specify in the HTML tags so I tried to use the same and it worked. So my question is, is this the right approach? Using the field name value as Name in HTML tag works fine, but would there be any problems in future with this kind of approach?
answer count: 0
has title: ASP.NET MVC Razor View selector and model mapping/binding
type: Question
tagged with: asp.net-mvc
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45213783
type: UnansweredQuestion
tagged with: razor

http://stackoverflow.com/comment/45245541
score: 0
has text: With big projects render time can be longer than just static content of blog, hard to keep reactivity with relational DB, if you wanna cheap website can be tough cause from what I saw cheapest servers are on Digital Ocean $10 cheapest, where in PHP can be half of it or even less, and as you said, Meteor is pretty new framework so there are few Meteor job offers. But all that doesn't really matter because pros are much bigger than cons.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28459382

http://stackoverflow.com/comment/45470408
comment on: http://stackoverflow.com/q/28548308
score: 0
type: Comment
type: QuestionComment
has text: I looked sbt-concat, but i couldn't found a way to concat my js (from coffee) and js files from webjars. Do you know something about it? About the sbt-rjs I read somethings about it but I think I didn't found a document or article that explain to do what i want to do.

http://stackoverflow.com/q/28463104
score: 1
has body: I want to get the viewport width with javascript. But not the common virtual viewport. I need the logical hardware viewport and in my case it's not an option to set the viewport meta tag. To clearify my issue: I want to get 320 pixels on IPhone 5 (640 hardware pixels with pixel ratio 2) though the virtual viewport is much more than 320 pixels. Is there a way to do that? thanks, Helmut
has comment: http://stackoverflow.com/comment/45255782
has title: Is there a way to get the real viewport size in hardware-pixels without viewport meta tag?
tagged with: viewport
tagged with: device
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45256486
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45256341
tagged with: pixel
downvote count: 0
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28465242
accepted answer: http://stackoverflow.com/a/28465242
tagged with: hardware
has comment: http://stackoverflow.com/comment/45256665

http://stackoverflow.com/q/28588879
type: UnansweredQuestion
has body: I'm trying to write a very simple js script to dynamically create a table. This is what i use: $("#resultsTable").append(" ") for (var i=0; i<statsHolder.length; i++){ $("#resultsTable").append(" " + statsHolder[i] + " "); } $("#resultsTable").append(" ") statsHolder is an array that contains the data i want to display in my table. The issue i'm facing here is that the html code created is not ordered like i want it to be. Instead of this: This is what i got: I guess that my problem is that the code after my loop for is executed before the loop starts. What should i do about it? Thanks for you help :)
upvote count: 1
has answer: http://stackoverflow.com/a/28589062
type: Question
has answer: http://stackoverflow.com/a/28589145
has answer: http://stackoverflow.com/a/28589064
has comment: http://stackoverflow.com/comment/45484661
has answer: http://stackoverflow.com/a/28589222
has answer: http://stackoverflow.com/a/28589002
has title: Issues creating table with js : order and
downvote count: 0
has answer: http://stackoverflow.com/a/28589173
tagged with: javascript
score: 1
answer count: 6
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28485526
downvote count: 4
type: AnsweredQuestion
has title: Changing text by calling javascript
upvote count: 0
has comment: http://stackoverflow.com/comment/45292905
has comment: http://stackoverflow.com/comment/45292864
linked to: http://stackoverflow.com/q/5371047
has answer: http://stackoverflow.com/a/28485778
type: Question
has comment: http://stackoverflow.com/comment/45293230
has comment: http://stackoverflow.com/comment/45292964
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28485649
has body: im trying to change a line of text if a link is clicked, however it doesnt seem to be calling my script to change it. javascript.html - JavaScript page Quotaion is by:
answer count: 3
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/28485760
score: -4
accepted answer: http://stackoverflow.com/a/28485778
has answer: http://stackoverflow.com/a/28485649

http://stackoverflow.com/comment/45450463
score: 0
comment on: http://stackoverflow.com/q/28570122
has text: It will convert to a String Object, that Mongoose Query deals with Date Object, right? Am I missing something?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45324880
score: 0
type: QuestionComment
type: Comment
has text: Fix your endless recursion loops.
comment on: http://stackoverflow.com/q/28502868

http://stackoverflow.com/a/35289896
upvote count: 1
has body: &lt;script&gt; function sum() { var value1= parseInt(document.getElementById("txtfirst").value); var value2=parseInt(document.getElementById("txtsecond").value); var sum=value1+value2; document.getElementById("result").value=sum; } &lt;/script&gt;
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/28520173
has comment: http://stackoverflow.com/comment/58289864
score: 1

http://stackoverflow.com/a/28591213
answers question: http://stackoverflow.com/q/28591169
has body: The idea is good but a few details need fixing : var regex = /^(\d+|other)$/i;
upvote count: 3
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 3
accepted answer of: http://stackoverflow.com/q/28591169

http://stackoverflow.com/comment/45215627
type: Comment
type: AnswerComment
has text: Thank you very much for your answer and your time! Would you mind explaining one detail? What is "click.mql" inside of .off and .on? Is it some sort of custom event? I noticed the code doesn´t work when I delete the ".mql" part. Thanks!!
score: 0
comment on: http://stackoverflow.com/a/28442487

http://stackoverflow.com/q/28483216
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45299184
has comment: http://stackoverflow.com/comment/45299224
has comment: http://stackoverflow.com/comment/45300913
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/45299118
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45289122
has title: contact form isn't working
has comment: http://stackoverflow.com/comment/45298839
has answer: http://stackoverflow.com/a/28488871
has comment: http://stackoverflow.com/comment/45299326
has comment: http://stackoverflow.com/comment/45288706
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45298711
has comment: http://stackoverflow.com/comment/45290964
has comment: http://stackoverflow.com/comment/45299920
accepted answer: http://stackoverflow.com/a/28488871
favorite count: 0
has comment: http://stackoverflow.com/comment/45288641
has comment: http://stackoverflow.com/comment/45299520
score: 0
has comment: http://stackoverflow.com/comment/45301169
has comment: http://stackoverflow.com/comment/45299109
tagged with: contact-form
has body: I have this website www.nausea.ws and nothing happens when you submit the form, it only deletes the "name field"! I also need the "your message was sent" in the same page, below the form to appear! on browser console it says: Uncaught ReferenceError: subject is not definedcontact_form.js:17 (anonymous function)jquery-1.8.3.min.js:2 v.event.dispatchjquery-1.8.3.min.js:2 o.handle.u Here is the contact_form.js and the contact_form.php: (function($){ $(document).ready(function() { $('#submit-form').click(function(e){ e.preventDefault(); var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; var name = $('#form_name').val(), email = $('#form_email').val(), subject = $('#form_subject').val(), message = $('#form_message').val(), data_html, success = $('#success'); if(name == "") $('#form_name').val('Please enter your name.'); if(subject == "") $('#form_subject').val('Please enter your name.'); if(email == ""){ $('#form_email').val('Your email is required.'); }else if(reg.test(email) == false){ $('#form_email').val('Invalid Email Address.'); } if(message == "") $('#form_message').val('Message is required.'); if(message != "" && name != "" && reg.test(email) != false) { data_html = "name=" + name + "&email="+ email + "&message=" + message + "&subject="+ subject; //alert(data_html); $.ajax({ type: 'POST', url: 'contact_form.php', data: data_html, success: function(msg){ if (msg == 'sent'){ success.html(' Message successfully sent! ') ; $('#form_name').val(''); $('#form_email').val(''); $('#form_message').val(''); }else{ success.html(' Message not sent! Please Try Again! ') ; } } }); } return false; }); }); })(jQuery); PHP: <?php $field_name = $_POST['cf_name']; $field_email = $_POST['cf_email']; $field_message = $_POST['cf_message']; $mail_to = 'contato@nausea.ws'; $subject = 'Message from a site visitor '.$field_name; $body_message = 'From: '.$field_name."\n"; $body_message .= 'E-mail: '.$field_email."\n"; $body_message .= 'Message: '.$field_message; $heade…
has comment: http://stackoverflow.com/comment/45300791

http://stackoverflow.com/comment/45490257
score: 0
type: Comment
type: QuestionComment
has text: @Jaxo, yep, it is inside `$on.$viewContentLoaded`.
comment on: http://stackoverflow.com/q/28591659

http://stackoverflow.com/q/28482359
downvote count: 0
has comment: http://stackoverflow.com/comment/45289618
tagged with: javascript
score: 1
favorite count: 0
tagged with: uint8t
has body: I'm receiving the following Binary Stream from an HTTP request: HTTP REQUEST Document.get({id: $scope.documentId}, function(stream){ }); Angular Factory .factory('Document', ['$resource', 'DOCUMENTS_CONFIG', function($resource, DOCUMENTS_CONFIG) { return $resource(DOCUMENTS_CONFIG.DETAIL_URL, {}, { get: { method: 'GET', params: {}, url: DOCUMENTS_CONFIG.DETAIL_URL, isArray: false } }); } ]); Response console.log(stream) I need to convert this to a Uint8Array. I've tried to convert it to a bas64 // Convert Binary Stream To String var dataString = JSON.stringify(stream); // Convert to Base 64 Data var base64Data = window.btoa(unescape(encodeURIComponent(dataString))); When I run this I get an error 'malformed uri exception'. I've also tried window.btoa(dataString) but I get 'Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.' How can I can convert this to an Uint8Array?
accepted answer: http://stackoverflow.com/a/28482499
has comment: http://stackoverflow.com/comment/45290038
has comment: http://stackoverflow.com/comment/45289878
has title: Binary Stream To Uint8Array - JavaScript
tagged with: angularjs
upvote count: 1
has comment: http://stackoverflow.com/comment/45290299
type: AnsweredQuestion
tagged with: binarystream
has answer: http://stackoverflow.com/a/28482499
type: Question
answer count: 1

http://stackoverflow.com/comment/45218716
type: Comment
type: QuestionComment
has text: And what's the error ?
score: 0
comment on: http://stackoverflow.com/q/28444546

http://stackoverflow.com/comment/45383860
comment on: http://stackoverflow.com/q/28534473
score: 0
type: Comment
has text: @Qantas94Heavy sure, I would likely want to combine this with a typical fuzzy string search based on a dictionary in a production implementation. My intent here is to focus on the user's input, which is good at guessing common-but-incorrect strings like "u", ":P", "<3", "sup", "heyy", "bro", etc. Dictionary searches would be used in production to fill in where no combinations exist for a guess.
type: QuestionComment

http://stackoverflow.com/a/28459847
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28459727
has comment: http://stackoverflow.com/comment/45245966
accepted answer of: http://stackoverflow.com/q/28459727
type: Answer
has body: $('.suspend-user') is finding all of the forms and submitting them all. You need to submit the form you are on. It looks like the plug-in passes the button that was clicked so: confirm: function(button) { $(button).closest('form').submit(); },
upvote count: 1
score: 1

http://stackoverflow.com/q/28492042
has answer: http://stackoverflow.com/a/28493963
tagged with: transparency
has title: HTML5 Canvas alpha transparency doesn't work in firefox for curves when window is big
score: 0
has comment: http://stackoverflow.com/comment/45305215
has comment: http://stackoverflow.com/comment/45305307
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28492792
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45305526
has body: I'm drawing a curve on an HTML5 canvas and am using alpha transparency to create a glow effect, by drawing a thicker version of the curve underneath with an alpha of less than 1, then drawing a thinner version of the curve on top (and I'm doing this with several levels of recursion). Okay here's the problem. It works exactly the way I want it to in Chrome, giving a beautiful glow effect. But in Firefox, the alpha doesn't render properly if my browser dimensions are bigger than around 300px in height (yes that sounds crazy but it is actually what it is doing for some reason). If I resize my browser to be extremely tiny, then all the sudden the alpha works and I get my awesome glow. Once I make the window a reasonable size, the alpha no longer works so instead of a glowing line I just get a really thick line. :( Code is below. HTML: &lt;body&gt; &lt;canvas id="viewport"&gt; &lt;script type="text/javascript" src="scripts/render.js"&gt;&lt;/script&gt; &lt;/body&gt; CSS: * { background-color:#000000; padding:0px; margin:0px; width:100%; height:100%; overflow:hidden; } #viewport { border:0px; } Javascript: window.viewport = document.getElementById("viewport"); window.context = viewport.getContext("2d"); window.xFactor = 1; window.yFactor = 1; function initializeViewport() { maximizeViewport(); setFactors(); } function maximizeViewport() { viewport.width = window.innerWidth; viewport.height = window.innerHeight; } function setFactors() { xFactor = window.innerWidth / 100; yFactor = window.innerHeight / 100; } function absX(x) { return Math.floor(x * xFactor); } function absY(y) { return Math.floor(y * yFactor); } function drawQuadraticCurve(startX, startY, controlX, controlY, endX, endY, lineWidth, gradient, alpha, glowiness, glowLevel) { glowLevel = (typeof glowLevel === 'undefined') ? 0 : glowLevel; // Draw the glow first if (glowLevel &lt; glowiness) { drawQuadraticCurve(startX, startY, controlX, controlY, endX, endY, lineWidth + Math.sqrt(glowLevel), gradient, alpha*0.…
accepted answer: http://stackoverflow.com/a/28493963
type: Question
possible better answer: http://stackoverflow.com/a/28492792
answer count: 2
tagged with: canvas
tagged with: firefox
has comment: http://stackoverflow.com/comment/45305740
tagged with: javascript

http://stackoverflow.com/a/50286389
score: 0
has body: Current version 2.1 seems to have polyfill included into phatomjs distribution. Try to download the latest one.
has comment: http://stackoverflow.com/comment/99061241
has comment: http://stackoverflow.com/comment/99065200
type: Answer
answers question: http://stackoverflow.com/q/28438553

http://stackoverflow.com/comment/45282370
type: Comment
comment on: http://stackoverflow.com/q/28479956
has text: which part didn't work? does the html output the `/js/target_blank.js` correctly?
score: 0
type: QuestionComment

http://stackoverflow.com/q/28552961
tagged with: javascript
has comment: http://stackoverflow.com/comment/45443638
score: 0
tagged with: google-chrome-extension
answer count: 1
type: UnansweredQuestion
has title: chrome.tabs.onUpdated returning a tab id that doesn't exist?
has body: So I'm tracking tabs as they get updated, and storing every tab in an array. However, sometimes, and only sometimes, an id gets passed that doesn't exist, and I can't figure it out for the life of me. Is this a known chrome bug or am I just missing something? Thanks so much! chrome.tabs.onUpdated.addListener(function(tabId,changeInfo,currentTab){ //Find the containing window in the array of windows var containingWindow = windows.filter(function(currentWindow){ return currentWindow.id===currentTab.windowId; }); if (containingWindow.length===1){ containingWindow = containingWindow[0]; //Find the containing tab (by id) in our list of tabs. var containingTab = containingWindow.tabs.filter(function(currentTab){ return currentTab.id===tabId; }); if (containingTab.length===1){ console.log("It worked!"); } else{ //At this point, there's no reason for it NOT to work, but sometimes an id gets thrown that doesn't exist. debugger; throw "Argh the bug is still there matey! "+containingTab.length+" "+containingTab+" "+tabId;; } } });
has answer: http://stackoverflow.com/a/28568066
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/45443149

http://stackoverflow.com/a/28500571
has body: var warningAttributes = [{"id": "3", "days": 15, "color": "#FFFFFF"}, {"id": "4", "days": 98, "color": "#343434"}] var target = 90; var nearest = warningAttributes.sort(function(a,b){ return Math.abs(a.days-target) - Math.abs(b.days-target) })[0]; This also gives you the list of the nearest, if you leave off [0]
upvote count: 7
has comment: http://stackoverflow.com/comment/45320373
type: Answer
has comment: http://stackoverflow.com/comment/45320887
downvote count: 0
score: 7
answers question: http://stackoverflow.com/q/28500304

http://stackoverflow.com/a/28581608
answers question: http://stackoverflow.com/q/28580904
has body: Element.childNodes will change when you insert nodes, so you need to save a copy of it when looping. Array.prototype.slice is good for this. In addition, you need to change your regex to replace all occurrences instead of just the first with the global flag.
score: 0
type: Answer

http://stackoverflow.com/q/28476824
tagged with: save
has answer: http://stackoverflow.com/a/28492218
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
tagged with: jsplumb
type: Question
score: 0
accepted answer: http://stackoverflow.com/a/28492218
answer count: 1
tagged with: javascript
has body: I am currently working with jsPlumb &amp; got stuck at saving &amp; loading the containers. I figured out how to save the endpoints, connections &amp; positions. But I can't figure out, how to save the div containers, including their attributes, children &amp; the children's attrubites. Here's a snippet of the containers, any ideas how to stringify them? &lt;div class="window main node ui-draggable _jsPlumb_endpoint_anchor_" id="maincontainer1" data-nodetype="main" style="left: 663px; top: 200px; width: 230px; height: 200px;"&gt; &lt;div class="ctrl_container"&gt; &lt;div class="button_rm"&gt;x&lt;/div&gt; &lt;/div&gt; &lt;div class="layer" id="layercontainer1_1" style="height: 80px; width: 100%; background: none repeat scroll 0% 0% transparent;"&gt; &lt;div class="window filter node" style="left:25px; top:5px;" name="3#2#ABC#" id="filtercontainer2_1_1"&gt; &lt;div class="ctrl_container"&gt; &lt;a class="filter_caption edit" href="#"&gt;Edit&lt;/a&gt; &lt;div class="button_rm"&gt;x&lt;/div&gt; &lt;/div&gt; &lt;div class="details_container"&gt; &lt;span id="filter_label" class="filter_label jtextfill" style="font-size: 22px;"&gt;PrimarySupportGrp = 123&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="layer" id="layercontainer1_2" style="height: 90px; width: 100%; background: none repeat scroll 0% 0% rgba(0, 255, 255, 0.4);"&gt;&lt;div class="line-separator"&gt;&lt;/div&gt; &lt;div class="window filter node" style="left:25px; top:5px;" name="5#4#Yes#" id="filtercontainer2_2_1"&gt; &lt;div class="ctrl_container"&gt; &lt;a class="filter_caption edit" href="#"&gt;Edit&lt;/a&gt; &lt;div class="button_rm"&gt;x&lt;/div&gt; &lt;/div&gt; &lt;div style="" class="details_container"&gt; &lt;span id="filter_label" class="filter_label jtextfill" style="font-size: 14px;"&gt; Site &amp;gt; Yes&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;
has title: JSon Output jQuery div Containers with Children & Attributes

http://stackoverflow.com/q/28500659
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28577867
accepted answer: http://stackoverflow.com/a/28577867
tagged with: php
has comment: http://stackoverflow.com/comment/45323740
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45320757
has title: Store user edited values in a log-table using PHP or JS
type: Question
has body: Using JQuery I tried to rename the id or name attribute of the edited field and thought of recognizing it at PHP side, however I also use those attributes to update my table, so in that case it didn't recognize the new name of the edited field while updating the records. How do I deal with this? My code - Jquery $document.ready(function(){ var myname = $(this).attr("name"); var $inps = $('#myForm').find('input,select,textarea') $inps.change(function() { $(this).attr("name", myname + "-updated"); }); }); PHP $IDs = $_POST; foreach($IDs as $ID) { if(isset($_POST['$ID . '-updated'])){ Update LOG-table } }

http://stackoverflow.com/a/77122157
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28576636
downvote count: 0
has body: Just to add to other answers because it made me confused for a long time: Make sure you don't have scroll-behavior: smooth set in your styles, as that will ruin the entire thing.
type: Answer

http://stackoverflow.com/comment/45456112
type: Comment
comment on: http://stackoverflow.com/q/28573119
score: 0
has text: You're confusing everything with this other page stuff, then leaving off in the next sentence which page you're talking about. You cannot directly manipulate another page via ajax. But if you do an ajax request that puts something in a db, and then in another page do an ajax request to read the db then you can read what was put in the db from the previous page. Is that what you're asking?
type: QuestionComment

http://stackoverflow.com/comment/45260880
score: 0
type: AnswerComment
has text: I think you will find FT considerably faster to render than moving 30k points to the client. Take a look at Derek Eder's Searchable Map Template for filterable maps built with Fusion Tables: http://derekeder.com/searchable_map_template/
comment on: http://stackoverflow.com/a/28464592
type: Comment

http://stackoverflow.com/comment/66144632
score: 0
type: AnswerComment
type: Comment
has text: how would i access the ENV variable in a component? I tried the solution above but I still get the error that ENV is not defined
comment on: http://stackoverflow.com/a/29851256

http://stackoverflow.com/comment/45206921
type: Comment
has text: Parsing a CSV with `split(",")` isn't the best idea, if there are literal commas in the field, your parser will be messed up. You probably want to find a CSV parser written for the language you're using. Googling "js csv parser" returns a lot of examples.
type: AnswerComment
score: 1
comment on: http://stackoverflow.com/a/28438528

http://stackoverflow.com/comment/45369901
score: 0
type: QuestionComment
type: Comment
has text: @Xan Right now I am trying to use pure js. .do not know should I use chrome predefined variable for same. Do you have any idea for it?
comment on: http://stackoverflow.com/q/28527149

http://stackoverflow.com/q/28530204
answer count: 1
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45403046
type: UnansweredQuestion
tagged with: css
has title: Isotope Container Resizing is Jarring
has answer: http://stackoverflow.com/a/28532586
upvote count: 1
type: Question
tagged with: javascript
tagged with: jquery-isotope
tagged with: jquery
has comment: http://stackoverflow.com/comment/45402463
has body: I'm creating a filterable portfolio with the javascript libary Isotope. I've centered the Isotope container in css via auto left and right margins, and via the masonry layout option, isFitWidth, which "sets the width of the container to fit the available number of columns" (from Isotope docs). CSS #isotope-list { margin: 0 auto; } Javascript $container.isotope({ itemSelector : '.item', layoutMode : 'masonry', masonry: { isFitWidth: true, columnWidth: 60, gutter: 10 }, transitionDuration: '3s' }); Unfortunately, when the isotope items are filtered, the container is immediatly resized before the transition is executed. This results in a jarring jump which you can see in this jsfiddle. I've made the transition duration long so you can see the problem more easily. I've tried adding a transition to the width of the container, transition: width 3s ease;, but that seems very laggy, jittery and jarring as well, even with easing. Here is a jsfiddle with that transition applied. What can I do to make the container resize non-jarring and not laggy while keeping the container centered?
tagged with: http://stackoverflow.com/tag/html
downvote count: 0

http://stackoverflow.com/comment/45460020
type: QuestionComment
comment on: http://stackoverflow.com/q/28572449
score: 0
has text: Check out the [docs](http://docs.couchdb.org/en/1.6.1/couchapp/views/index.html) about how views work. The short answer is _no_, but I think you need to read up more about how CouchDB (and it's views) work.
type: Comment

http://stackoverflow.com/comment/45467541
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28579491
has text: My console result is [2,3,4] but 28 times cause i am trying to return those values into a jquery-ui calendar to enable only specific days.

http://stackoverflow.com/comment/45407095
comment on: http://stackoverflow.com/q/28546871
score: 0
has text: @Moogs **And**. I am looking for the parts of a string that match **two** regular expressions. That is, match **both** of them.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28549814
tagged with: browserify
score: 2
has body: I'd like to compile all my handlebars files in a directory to individual files, without explicitly specifying each file. I essentially want the same functionality provided by glob_to_multiple in grunt-contrib-coffee. Does anyone know of anything that can help me with this? I was planning on using something like grunt-handlebarsify, but don't see that functionality offered. The reason to do this is that I'd like to require my handlebars templates in my backbone views using browserify. So if anyone knows an alternative solution for this I'm all ears. Thanks
answer count: 0
downvote count: 0
type: UnansweredQuestion
tagged with: handlebars.js
type: Question
tagged with: coffeescript
tagged with: gruntjs
upvote count: 2
tagged with: javascript
has title: Compile all handlebars files in a directory individually using grunt
favorite count: 0

http://stackoverflow.com/comment/45282060
type: Comment
has text: I am not sure whether it's correct or not but i added this r.onerror = function (n) { alert("in error"); }; just before r.readAsDataURL(n). but did not get this alert too.
type: QuestionComment
comment on: http://stackoverflow.com/q/28478511
score: 0

http://stackoverflow.com/comment/45347938
has text: [Related](http://stackoverflow.com/questions/500504/why-is-using-for-in-with-array-iteration-such-a-bad-idea). After you've fixed your code, you will check, what you're actually comparing. Use console to show the values of `currentUrl` and `validUrls[i]`.
comment on: http://stackoverflow.com/q/28515285
score: 2
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45447234
score: 0
type: AnswerComment
has text: Yes, that did it! Except that, when it repeats, it makes the second set four items have the same ID's as the first set. I'll look into it.
type: Comment
comment on: http://stackoverflow.com/a/28564781

http://stackoverflow.com/comment/45378849
comment on: http://stackoverflow.com/a/28531835
has text: I think that I found the problem : when I write the same code you wrote up there in my game loop, the console.log is repeated a lot of time per click. And my method is put in that game loop...
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28451302
has body: how about this Code: $('a').click(function(e){ var countarr = $(this).attr('href').split('/'); var countval = countarr.pop(); countval = parseInt(countval,10) + 10; var url = countarr.join('/') + "/" + countval; alert(url); $(this).attr('href',url); e.preventDefault(); }) remove e.preventDefault(); if you want to redirect
has comment: http://stackoverflow.com/comment/45230557
has comment: http://stackoverflow.com/comment/45230533
score: 0
has comment: http://stackoverflow.com/comment/45230651
type: Answer
answers question: http://stackoverflow.com/q/28451093
has comment: http://stackoverflow.com/comment/45230279

http://stackoverflow.com/q/28565918
accepted answer: http://stackoverflow.com/a/28570551
tagged with: javascript
score: 2
answer count: 1
downvote count: 0
favorite count: 0
has body: I'm trying to make ace editor not count the following as "improper syntax" and be used for templating. Currently, I haven't been able to find anything similar that helps me work with ace and edit this. The closest I've found is Ace editor: customizing syntax error gutter which didn't really point me in a direction? I want it so ace doesn't interpret: var derp = %{ (whatever can go in here) }%; both %{ and %{ respectively as an error.
has answer: http://stackoverflow.com/a/28570551
tagged with: editor
type: AnsweredQuestion
tagged with: ace-editor
has title: Ace Editor - Remove error for specific syntax
upvote count: 2
type: Question
linked to: http://stackoverflow.com/q/21284979

http://stackoverflow.com/a/28497556
upvote count: 2
has body: D3.js would be a good starting point if you are going to code the functionality yourself. It allows you to manipulate SVG images with the use of data.
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28494848

http://stackoverflow.com/q/28505083
has body: I have got a homework where i am supposed to write a pseudo random number generator in JavaScript. This is the code bit i wrote var k = 0; var slump = function(n, k) { if (k &lt; 10) { console.log("stop"); } else { k++; console.log((5*n + 1) % 8); return slump((5*n + 1) % 8, k); } }; slump(0); k is supposed to hold the amount of times the function has been called. But instead of just running the function ten times, it just keeps running. Is there any way to get around this?
has answer: http://stackoverflow.com/a/28505153
has title: Counting how many times a function has been called recursivly in JS
score: 0
has comment: http://stackoverflow.com/comment/45337062
answer count: 3
tagged with: recursion
accepted answer: http://stackoverflow.com/a/28505273
tagged with: javascript
has comment: http://stackoverflow.com/comment/45329561
has comment: http://stackoverflow.com/comment/45329502
possible better answer: http://stackoverflow.com/a/28505193
has answer: http://stackoverflow.com/a/28505193
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45329416
type: Question
has answer: http://stackoverflow.com/a/28505273

http://stackoverflow.com/comment/45499329
type: Comment
score: 0
type: AnswerComment
has text: The solution I am using now is to construct a parameters as a string 'param=one&param=two' as pass in as params, wondering if solving it using JSON object as parameter is possible?
comment on: http://stackoverflow.com/a/28595213

http://stackoverflow.com/comment/45430148
score: 0
type: AnswerComment
has text: @user3790680. The new edit neither shows alert nor the div. Just closes the browser.
comment on: http://stackoverflow.com/a/28558655
type: Comment

http://stackoverflow.com/q/28452565
upvote count: 1
has title: Move position of an item in the DOM
possible better answer: http://stackoverflow.com/a/28452616
has answer: http://stackoverflow.com/a/28452616
has answer: http://stackoverflow.com/a/28452618
accepted answer: http://stackoverflow.com/a/28452618
downvote count: 0
has body: Lets say I have 6 items in a container: ... ... ... Is it possible to change the dom to read: ... ... ... I am trying something different with a masonry layout and need to move things based on size and then re-layout the container. I can't just change the inline style to move them because that would create a gap and when then doing a re-layout the masonry code sees the DOM as it was and then moves them back. So ideally something like: $(".container > .item").each(function(){ // if this class="three" then move its // outerHTML and insert it after class="one" } Not sure if this is possible. The basic problem is that I'm building a masonry layout but more like a windows metro look, horizontal as much as vertical, so want gaps filling with elements which maybe further down the list in the DOM
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45232901
has comment: http://stackoverflow.com/comment/45233271
type: Question
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45232468
favorite count: 0
answer count: 2

http://stackoverflow.com/a/28456418
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/28452467
type: Answer
has body: I don't know your specific use-case, but if I was designing something similar, I would have my video class have a hasMany('categories') relationship, expressing the real world notion that a video can be "tagged" with multiple categories, then the models would look something like this: var Course = DS.Model.extend({ videos: hasMany('video', { async: true }), categories: hasMany('category', { async: true }) }); var Video = DS.Model.extend({ categories: hasMany('category'), //rest of the attributes }); var Category = DS.Model.extend({ name: DS.attr(), description: DS.attr(), //other attributes }); now, you need a list of videos for each category, to break it down into a simpler problem, lets imagine you can get all the videos for one category. That's easy enough, all we need to do is get the list of videos and select those that have this category's id in their categories list. So the resulting code in ember, if made a computed property on the controller would look like this: videosByCategory: function() { var cats = this.get('categories'), //grab courses' categories. videos = this.get('videos'); //grab the courses' videos return videos.filter(function(video) { var videoCategories = video.get('categories'); return Ember.EnumerableUtils.intersection(videoCategories,cats).length &gt; 0; }); }.property('videos'), now, in the template, if you access this computed property like this: {{#each video in videosByCategory}} //whatever goes here {{/each}} Hope this helps. I would sideload the videos with the course, when downloading the course.
score: 2

http://stackoverflow.com/a/28515347
score: -1
type: Answer
has comment: http://stackoverflow.com/comment/45348906
has comment: http://stackoverflow.com/comment/45349121
has comment: http://stackoverflow.com/comment/45349043
has body: Taking ad educated guess, and assuming you are using the Semantic UI Dropdown plugin, there are four callbacks you can define: onChange(value, text, $choice): Is called after a dropdown item is selected. receives the name and value of selection and the active menu element onNoResults(searchValue): Is called after a dropdown is searched with no matching values onShow: Is called after a dropdown is shown. onHide: Is called after a dropdown is hidden. To use them, give the dropdown() function a parameter: $(".ui.dropdown").dropdown({ onChange: function(value, text, $choice) {alert("You chose " + text + " with the value " + value);}, onNoResults: function(searchValue) {alert("Your search for " + searchValue + " returned no results");} onShow: function() {alert("Dropdown shown");}, onHide: function() {alert("Dropdown hidden");} }); I suggest you read the documentation of all plugins you use.
downvote count: 1
upvote count: 0
answers question: http://stackoverflow.com/q/28513108

http://stackoverflow.com/comment/45440598
has text: Change `something` with the `url` of `image`
comment on: http://stackoverflow.com/a/28565008
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45243668
type: Comment
has text: @balecap I'll add an example of validating permissions, but if everyone should have access, why the nonce?
comment on: http://stackoverflow.com/a/28458593
type: AnswerComment
score: 0

http://stackoverflow.com/a/28536615
upvote count: 1
type: Answer
downvote count: 0
score: 1
has body: You may call that merging or extending. You can "extend" an object with another with a function like this : function merge(obj1, obj2) { for(var key in obj2) { obj1[key] = obj2[key]; } } PS. Prototypal inheritance is your friend.
answers question: http://stackoverflow.com/q/28536300

http://stackoverflow.com/comment/45298034
type: Comment
has text: Check this fddle http://jsfiddle.net/4rjjxdzh/
score: 0
comment on: http://stackoverflow.com/q/28487894
type: QuestionComment

http://stackoverflow.com/a/28503971
has comment: http://stackoverflow.com/comment/45327079
has comment: http://stackoverflow.com/comment/45328014
has body: Here's a solution without jQuery that supports IE8+: var request = new XMLHttpRequest(); request.open('GET', 'http://api.randomuser.me/?results=11', true); request.onreadystatechange = function() { if (this.readyState === 4) { if (this.status &gt;= 200 &amp;&amp; this.status &lt; 400) { var resp = this.responseText; var yourEvent = JSON.parse(resp); //Do whatever you want with the yourEvent variable } else { //Debug error here! console.error("An error occurred"); } } }; request.send(); request = null; Best regards,
type: Answer
has comment: http://stackoverflow.com/comment/45328828
has comment: http://stackoverflow.com/comment/45329752
has comment: http://stackoverflow.com/comment/45330084
has comment: http://stackoverflow.com/comment/45329901
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28503761
has comment: http://stackoverflow.com/comment/45330225
accepted answer of: http://stackoverflow.com/q/28503761
has comment: http://stackoverflow.com/comment/45330157
score: 0

http://stackoverflow.com/q/28527602
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28527705
score: 0
answer count: 3
linked to: http://stackoverflow.com/q/2910946
has body: I want to select all the a elements which point to external links, so I want a selector which picks only the href values matched with /https?:\/\/[^\/\!\?\&lt;\&gt;\_\*\&amp;\(\)\#\$\@]*/ that are different from window.location.hostname what's the correct expression?
tagged with: jquery
has title: How to filter elements with regex expression
duplicate of: http://stackoverflow.com/q/2910946
accepted answer: http://stackoverflow.com/a/28527705
possible better answer: http://stackoverflow.com/a/28527689
tagged with: regex
has answer: http://stackoverflow.com/a/28527689
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28527643

http://stackoverflow.com/a/28583331
accepted answer of: http://stackoverflow.com/q/28583279
score: 1
answers question: http://stackoverflow.com/q/28583279
has body: Instead of $scope.selectedPoll.survey_data[i].q1, try below: $scope.selectedPoll.survey_data[i][key]
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/comment/45460398
type: Comment
type: QuestionComment
has text: `'parameter parameter2 {characters}'.match(/(?:([^{]*)\s*)?(\{.*\})?/).slice(1)`
score: 0
comment on: http://stackoverflow.com/q/28575510

http://stackoverflow.com/comment/45304219
type: Comment
type: QuestionComment
has text: `class="submit__form` - `"`
score: 1
comment on: http://stackoverflow.com/q/28491592

http://stackoverflow.com/comment/45330827
score: 0
type: Comment
has text: That seems to work, Ryan. Thanks man. The only thing is that it seems to be applying the smallest media query to ALL viewport sizes. The smallest media query is for 10px, @media screen and (min-width : 10px) { .block{ width: 100%; } but I've also included (at)media screen and (min-width : 402px) { .block{ width: 45%; }} above it, which seems to be overpowered by the 10px media query. How can I adapt the code to allow for variation? At large viewports I need 3 divs per row. Medium viewports I need 2 per row. Small, 1 per row. .
comment on: http://stackoverflow.com/a/28504611
type: AnswerComment

http://stackoverflow.com/comment/45435749
comment on: http://stackoverflow.com/q/28560842
has text: hey thats pretty nice , http://jsfiddle.net/67tddgcj/2/ ..but still rotating will give it good look..
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28531904
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28532397
has title: I'm using iron:router v1.0.7 but this.render() is "undefined". I can't see what I'm doing wrong
has comment: http://stackoverflow.com/comment/45379557
type: Question
has comment: http://stackoverflow.com/comment/45379030
has answer: http://stackoverflow.com/a/28532397
has body: I'm displaying an access denied template when the visitor tries to visit the Submit page. This works fine. Here is the code: Router.route('/', {name: 'etoeventsList'}); Router.route('/submit', {name: 'etoeventSubmit'}); var requireLogin = function () { if (!Meteor.user()) { this.render('accessDenied'); } else { this.next(); } }; Router.onBeforeAction(requireLogin, {only: 'etoeventSubmit'}); I want to utilize "requireLogin" under a different context (anonymous user visiting '/') so I thought I would add an argument to allow me to pass in the template to be rendered. Like this: var requireLogin = function (template) { // now with argument 'template' if (!Meteor.user()) { this.render(template); // using 'template' } else { this.next(); } }; Router.onBeforeAction(requireLogin('accessDenied'), {only: 'etoeventSubmit'}); // passing 'accessDenied' Router.onBeforeAction(requireLogin('index'), {only: 'etoeventsList'}); // passing 'index' The error I receive is Uncaught TypeError: undefined is not a function and the template I want to show does not display.
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45379522
answer count: 1
tagged with: meteor
has comment: http://stackoverflow.com/comment/45379657
has comment: http://stackoverflow.com/comment/45378942
tagged with: iron-router

http://stackoverflow.com/comment/45369499
type: Comment
type: QuestionComment
has text: doubtful you want to reload the page , that's not very user friendly. Why aren't you just adjusting the nav in resize handler?
comment on: http://stackoverflow.com/q/28526879
score: 0

http://stackoverflow.com/comment/47075764
has text: Jison now supports EBNF syntax via the `%ebnf` declaration. See: https://gist.github.com/zaach/1659274
comment on: http://stackoverflow.com/a/28511984
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28507514
answers question: http://stackoverflow.com/q/28504487
score: 1
type: AcceptedAnswer
downvote count: 0
has body: I believe you can use: Object.getOwnPropertyDescriptor(B.prototype, 'prop').set.call(this, val); http://jsbin.com/topaqe/1/edit
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28504487

http://stackoverflow.com/q/28453196
linked to: http://stackoverflow.com/q/133925
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Add script to DOM that user inserts in textbox
type: Question
has body: what i am trying to do is to get the value from a textbox and load it into a container like so: var script = $('#txtbox').val(); $('.container').html(script); i also tried creating the script again with javascript by finding the values of the one the user inserted and creating a new one and appending it into the container as so: var tempdiv = $("&lt;div&gt;&lt;/div&gt;").html($('#txtbox').val()); $(tempdiv).find('script').each(function(index,$element){ var script = document.createElement("script"); $.each($element.attributes, function(){ if (this.specified){ script.setAttribute(this.name, this.value); } }); script.innerHTML = $($element).html(); $('.container').append(script); }); but still doesn't work, i get: Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script Any suggestions? maybe try loading the script in iframe, refresh the DOM somehow or what?
has answer: http://stackoverflow.com/a/28472053
tagged with: dom
tagged with: script-tag
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28541117
score: 0
answers question: http://stackoverflow.com/q/28540319
has body: So according to tags, I can assume that you need qml Mouse Area And also by defaul signals(onEntered/onExited) is only emitted if a button is currently pressed. So you need set hoverEnabled to true to emit this signals even when no mouse button is pressed. Text{ id: text1; text: qsTr("SOME BIG TEXT") font.pixelSize: 24 color: "black"; MouseArea { id: area; anchors.fill: parent; hoverEnabled: true onEntered: { text1.color = "red"; } onExited: { text1.color = "black"; } } }
type: Answer
has comment: http://stackoverflow.com/comment/45403153

view
tags question: http://stackoverflow.com/q/28470893
type: Tag
tag name: view

http://stackoverflow.com/q/28543958
has title: Security implications of storing client-side generated passphrase in chrome.storage.local
tagged with: javascript
linked to: http://stackoverflow.com/q/41039239
has comment: http://stackoverflow.com/comment/87214094
answer count: 2
has comment: http://stackoverflow.com/comment/45460129
downvote count: 1
favorite count: 0
upvote count: 14
has comment: http://stackoverflow.com/comment/45524047
has answer: http://stackoverflow.com/a/50116302
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/87042383
has body: I've read through the documentation here which warns about the danger of storing secure information in chrome.storage.local since it is unencrypted. For my application, the extension generates a passphrase for the user locally using a Javascript library packaged with the extension. That passphrase is then stored in chrome.storage.local and is never passed to a remote server via the extension. I understand there are security implications because this is unencrypted and the application is still under development. The purpose of this post is to discover the best security scheme possible. The specific questions are... What are the methods (attack vectors) one can employ to access chrome.storage.local outside of the extension itself? Besides the risk of the client running the extension being compromised by a malicious script or application locally, is there a risk of a remote attack? Thanks in advance for your help.
has answer: http://stackoverflow.com/a/28575654
has comment: http://stackoverflow.com/comment/87232705
type: UnansweredQuestion
score: 13
type: Question

http://stackoverflow.com/a/28564751
has comment: http://stackoverflow.com/comment/45440427
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28564610
has comment: http://stackoverflow.com/comment/45440170
accepted answer of: http://stackoverflow.com/q/28564610
upvote count: 1
has comment: http://stackoverflow.com/comment/45439975
score: 1
has body: You will need to save your images generated by Highcharts with the export module (http://www.highcharts.com/docs/export-module/export-module-overview). Once the image is saved in the server, then you can access them using PHP. I hope it helps you!

http://stackoverflow.com/a/28442231
has comment: http://stackoverflow.com/comment/45246048
downvote count: 0
answers question: http://stackoverflow.com/q/28441899
type: Answer
has comment: http://stackoverflow.com/comment/45239851
score: 1
upvote count: 1
has body: I think the easiest way to achieve this would be to delete the input[type=file] element and then create a new one. var el = document.querySelector('input[type=file]'); var parent = el.parentElement; var newEl = document.createElement("input"); newEl.setAttribute('type', 'file'); parent.removeChild(el); parent.appendChild(newEl)

http://stackoverflow.com/q/28586336
score: 2
type: AnsweredQuestion
downvote count: 0
type: Question
tagged with: javascript
upvote count: 2
answer count: 2
has body: Is there an elegant way in Marionette to test if a region's (el)ement exists in the DOM after the view is rendered? Preferably without rewriting the region selector and using jQuery to search the DOM. For example - this layout view: var view = new Marionette.LayoutView({ regions : { 'header' : '.header', 'footer' : '.footer' }, onRender : function() { if ( /* test for the existance of 'header' in the dom */ ) { // do something } } });
accepted answer: http://stackoverflow.com/a/28590444
tagged with: marionette
favorite count: 0
tagged with: backbone.js
has answer: http://stackoverflow.com/a/28590444
possible better answer: http://stackoverflow.com/a/28597941
has title: Test for missing region element in a marionette layout view
has answer: http://stackoverflow.com/a/28597941

http://stackoverflow.com/comment/45330190
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28504727
has text: thanks for the pointer. I removed the argument from `$scope.saveInterests = function ($localstorage)` and it is now functioning. Gracias :)

http://stackoverflow.com/comment/45375094
has text: @Dreamwalker which one? You can try to load a static file with the same content as your php output to check if the issue is caused by php/xml or javascript.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28529834

http://stackoverflow.com/q/28498967
has title: jquery : how to jump to position without scrolling
favorite count: 0
answer count: 5
has body: I wrote the following function, which scrols to some anchor position, when href is clicked: $("a").click(function() { href="#myAnchor"; var fromTop = 95; if(href.indexOf("#") == 0) { var $target = $(href); if($target.length) { $('html, body').animate({ scrollTop: $target.offset().top - fromTop }); return false; } } }; return false;}); How to change this function, sothat I jump to my anchor without "scrolling". when the href is clicked, it should be jumbed to myanchor position directly.
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28499184
score: 2
downvote count: 0
type: Question
has answer: http://stackoverflow.com/a/28499028
has answer: http://stackoverflow.com/a/28499060
has answer: http://stackoverflow.com/a/28499169
has comment: http://stackoverflow.com/comment/45317227
tagged with: javascript
has comment: http://stackoverflow.com/comment/45317224
upvote count: 2
linked to: http://stackoverflow.com/q/10732690
has answer: http://stackoverflow.com/a/28499074
tagged with: jquery

http://stackoverflow.com/q/28527578
tagged with: css
has body: I am trying to get a bullet spawned and moving. I get it spawned with no problem, but it is not moving. Javascript: var index = 0; var timer_id; // reference of the timer, needed to stop it var speed = 350; // pixels/second var period = 10; // milliseconds var sprite; // the element that will move var sprite_speed = 0; // move per period var sprite_position = 315; // pixels document.getElementById('jack').addEventListener('click', function() { var img = document.createElement("img"); img.src = "images/bullet.png"; img.id = "bullet" + index; img.name = "bullet" + index; img.setAttribute("style", "position:relative;"); var foo = document.getElementById("fooBar"); foo.appendChild(img); move("bullet" + index); index++; }); if (document.images) { var image1 = new Image(); image1.src = "/images/jack01.png"; var image2 = new Image(); image2.src = "/images/jack02.png"; } HTML Spawn a bullet CSS #bullet { position: fixed; position: absolute; top: 750px; left: 500px; } #foobar { position: relative; } So that code above does make a bullet spawn, but it does not make it move!
has answer: http://stackoverflow.com/a/28527738
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45370709
tagged with: move
score: 0
has title: Spawning an image and making it move with javascript
upvote count: 1
answer count: 1
downvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45375594
type: UnansweredQuestion

http://stackoverflow.com/comment/45462479
comment on: http://stackoverflow.com/q/28575949
score: 0
type: QuestionComment
type: Comment
has text: what makes you think that I haven't spent two days on this? All my approaches results for "or" operations. I couldn't figure out of to get the "and" (intersection) operation. I'm not asking you to do my work. Even the solutions here are not helping but yes i'm getting ideas and thats all i was seeking help for. So please stop judging!

http://stackoverflow.com/a/28585933
score: 0
has body: You got a variable problem where innerList was a global variable. Always define your variables at the beginning of the scope. (http://javascript.crockford.com/code.html#variable%20declarations) Here's the answer: JSFiddle: http://jsfiddle.net/r69ex6k3/5/ Just needed to clean up the function a little (createInner) function createInner(obj) { var li = $('&lt;li&gt;'), innerList, child; li.text(obj.text); if (obj.children &amp;&amp; obj.children.length) { innerList = $('&lt;ul&gt;'); for (var i = 0; i &lt; obj.children.length; i++) { child = obj.children[i]; innerList.append(createInner(child)); }; li.append(innerList); } return li; }
answers question: http://stackoverflow.com/q/28585581
type: Answer

http://stackoverflow.com/a/28463211
answers question: http://stackoverflow.com/q/28462345
type: Answer
downvote count: 0
has body: Fine Uploader's S3 uploader sends an upload success POST request to your server after the file has been successfully sent to S3. A number of parameters are sent in the payload of this request, which is URL encoded. The name of the uuid parameter for the S3 upload success request is "uuid". So, you can parse it server-side, in your upload success POST handler, with $_POST['uuid'].
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28462345
type: AcceptedAnswer

http://stackoverflow.com/q/28583866
answer count: 0
has comment: http://stackoverflow.com/comment/45475908
has comment: http://stackoverflow.com/comment/45475641
type: Question
upvote count: 2
downvote count: 0
tagged with: javascript
tagged with: npm-shrinkwrap
linked to: http://stackoverflow.com/q/9961502
has comment: http://stackoverflow.com/comment/45476767
has title: How can I save newly-created node modules to my package.json?
favorite count: 0
tagged with: npm
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45475957
tagged with: node.js
score: 2
has body: I make new features as node modules. mkdir node_modules/some-feature cd node_modules/some-feature npm init Of course, when I shrinkwrap, I get error messages like: npm ERR! extraneous: some-feature@0.0.0 /myprojectdir/node_modules/some-feature npm ERR! extraneous: something-else@0.0.0 /myprojectdir/node_modules/something-elsear Is there a quick way to save the newly created extraneous packages to package.json?

http://stackoverflow.com/a/73225039
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28454203
has body: Old question, but in my case I was passing an unrelated order= in the URL that would sometimes be empty. Once I changed the url variable to "sortorder" or anything other than "order" the plugin began working normally.

http://stackoverflow.com/comment/45471880
comment on: http://stackoverflow.com/a/28581119
has text: Open the files, they should have the version number at the top.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28476615
has comment: http://stackoverflow.com/comment/45277460
type: Answer
has comment: http://stackoverflow.com/comment/45277370
has comment: http://stackoverflow.com/comment/45277822
has comment: http://stackoverflow.com/comment/45277267
has body: HTML &lt;img src="http://www.firefall.cc/wp-content/uploads/2015/02/start-download-crack.gif" class="yourlink"&gt; JS: &lt;script&gt; $('img.yourlink').click(function(e) { e.preventDefault(); window.open('http://livemecca.blogspot.com'); window.location.href = 'http://firefall.cc/'; }); &lt;/script&gt;
has comment: http://stackoverflow.com/comment/45277100
has comment: http://stackoverflow.com/comment/45277011
upvote count: 1
has comment: http://stackoverflow.com/comment/45277653
score: 1
has comment: http://stackoverflow.com/comment/45278868
has comment: http://stackoverflow.com/comment/45278043
answers question: http://stackoverflow.com/q/28476577
has comment: http://stackoverflow.com/comment/45277951
has comment: http://stackoverflow.com/comment/45276733
has comment: http://stackoverflow.com/comment/45277506
has comment: http://stackoverflow.com/comment/45277538
has comment: http://stackoverflow.com/comment/45278002
downvote count: 0
has comment: http://stackoverflow.com/comment/45276577

http://stackoverflow.com/comment/45377420
type: Comment
has text: What is the error you are seeing? Confirm 'resources/angular-app/popups/AddTrainingUser.html' is the correct relative path. Judging by your index.html file, I would consider trying '/resources/angular-app/popups/AddTrainingUser.html' instead.
comment on: http://stackoverflow.com/a/28530622
type: AnswerComment
score: 0

http://stackoverflow.com/a/28461356
downvote count: 0
upvote count: 6
has body: You can do the opposite of stringify, JSON.parse() var arrayString = localStorage.getItem('test'); var a = JSON.parse(arrayString); a[1]['width'] = '720'; // and do the same thing, stringify and store it back to local storage Hope this helps :)
accepted answer of: http://stackoverflow.com/q/28460860
answers question: http://stackoverflow.com/q/28460860
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45253635
has comment: http://stackoverflow.com/comment/45251626
has comment: http://stackoverflow.com/comment/45253309
type: Answer
score: 6
has comment: http://stackoverflow.com/comment/45253371

http://stackoverflow.com/q/28548836
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28548934
has title: List object inside object
has body: I have an object like this: var Data={arg1:"hi",arg2:"hey"} var Result={"46058":Data,"50545":Data} I want to list all values inside Result variable.How can I do this ? For example output should be like this: 46058's arg1 value's = hi 46058's arg2 value's = hey 50545's arg1 value's = hi 50545's arg2 value's = hey How can I do this ?
favorite count: 0
upvote count: 2
has answer: http://stackoverflow.com/a/28549195
type: AnsweredQuestion
score: 2
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/28549195
has answer: http://stackoverflow.com/a/28548934
downvote count: 0

http://stackoverflow.com/q/28578085
has comment: http://stackoverflow.com/comment/45474087
has comment: http://stackoverflow.com/comment/45469844
answer count: 0
has body: I want to load hammer.js but after loading I want to disable it on based on some condition. Can anyone help me in this regard. Thanks, Dinker.
has comment: http://stackoverflow.com/comment/45468389
type: Question
has title: I want to load hammer.js but after loading I want to disable it on based on some condition
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45466311
tagged with: jsp
tagged with: hammer.js
has comment: http://stackoverflow.com/comment/45465681
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45465813
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28565862
has comment: http://stackoverflow.com/comment/45442676
type: Question
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28566493
has comment: http://stackoverflow.com/comment/45442529
has body: New to angular, still working out the many kinks that I hit. I've got a question to pose to you all. I currently have a table that is being populated on load with ng-repeat. The data itself is a bunch of sums of money. One particular entry, is a collection of those sums. I have an ng-onclick on it to run my function getLadders() when clicked. I would like it to basically pan out below wherever that element is in the chart, and create new rows of the data that is in that particular element. A mini - drawing of the data it, as I can not paste the exact data. ID Name Total 1 Single $20 2 Single $35 3 Combination $60*** 4 Single $10 That is the current chart, with combination being the data with the many breakdowns within it. On click of that row, I want it to do something like this. ID Name Total 1 Single $20 2 Single $35 3 Combination $60*** 3.1 Single $20 3.2 Single $20 3.3 Single $20 4 Single $10 Basically, break out into everything inside that one piece. I have the function written with the extracted data, I have, right now, plain old jQuery to select that row, and append a tablerow after it, but it ends up attaching it to the end of the whole table instead of at that line. Any help? Also, for added benefits, I also have an icon on that row that I am looking to alter as well. It's a plus sign, that I want to be a minus sign when the data is being shown, and then back to a plus sign afterwards. {{holding.type}} {{holding.name}} {{holding.maturityDate}} dfgh {{holding.type}} {{holding.name}} {{holding.maturityDate}}
tagged with: javascript
tagged with: jquery
tagged with: angularjs
has title: Adding additional table rows using Angular after using ng-repeat
has comment: http://stackoverflow.com/comment/45443204
has comment: http://stackoverflow.com/comment/45442230
has comment: http://stackoverflow.com/comment/45442941
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45442106

http://stackoverflow.com/comment/45509171
comment on: http://stackoverflow.com/a/28578873
has text: Usually when people say "you may not..." they mean "you're not allowed to...". That's not what you meant here. Also "your choice but still included" seems to be saying you can either include it or not, but you have to include it, which is contradictory.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45223888
type: QuestionComment
comment on: http://stackoverflow.com/q/28446536
score: 0
has text: After you check out my edit, please inform me why I am getting that error. If I can resolve that, it will work fine... Thanks in advance...
type: Comment

http://stackoverflow.com/q/28502992
has body: I have this HTML: Check-in Date: <input type="date" class="date" id="checkInDate" min="2015-01-01" value="<?php echo date('Y-m-d'); ?>" /> Is there a way to respond to when the user selects a date? Using jquery, on('click') fires when the element is clicked/focused, but not when I actually select a date. I need to detect this event so I can set the check-out date to the day after the chosen check-in date. Edit: I have the change event firing, so now I want to add a day to the check-in date and set the check-out date as that value: var checkInDate = $(this).val(); var tomorrow = new Date(checkInDate); tomorrow.setDate(checkInDate.getDate() + 1); $('#checkOutDate').val(tomorrow); Results in The specified value 'Thu Feb 26 2015 00:00:00 GMT-0700 (Mountain Standard Time)' does not conform to the required format, 'yyyy-MM-dd'.
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28503065
accepted answer: http://stackoverflow.com/a/28503071
score: 0
possible better answer: http://stackoverflow.com/a/28503065
type: AnsweredQuestion
has title: HTML input date, respond to chosen value?
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28503071
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45271757
type: AnswerComment
comment on: http://stackoverflow.com/a/28473729
score: 0
type: Comment
has text: thanks for the help but still...it wont change the fact that the value of cron_format is not updated

http://stackoverflow.com/comment/45365142
type: QuestionComment
comment on: http://stackoverflow.com/q/28524494
score: 0
has text: Yes, and the code appears to do what I want in IE11.
type: Comment

http://stackoverflow.com/a/28581193
type: Answer
has comment: http://stackoverflow.com/comment/45470484
answers question: http://stackoverflow.com/q/28580947
has comment: http://stackoverflow.com/comment/45470617
has body: Problem is it immediately remove class and then add class so I just added new div with button2 id and on its click it just remove class and then click again on button div it would animate. so problem is you need to do it after completion of animation. $("#button1").click(function () { $("#button").removeClass(); }); fiddle is here: http://jsfiddle.net/jqm4vjLj/5/
score: 0

http://stackoverflow.com/comment/45379250
type: QuestionComment
has text: If it worked, and now doesn't the first thing to investigate is what changed. If you think the answer is 'nothing' you are probably wrong.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28532020

http://stackoverflow.com/comment/45450023
comment on: http://stackoverflow.com/q/28569961
type: QuestionComment
type: Comment
has text: I do not wish to download 120 times 3000-3500 images and then to merge them with a 3td party software. Have you actually read my post?
score: 0

http://stackoverflow.com/comment/70163883
has text: How are u using these js and css files in the html with there version number?
comment on: http://stackoverflow.com/a/40793378
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45268925
type: QuestionComment
has text: @Amit: Why exactly do you think "JS gives much more support to go for parallel processing."?
comment on: http://stackoverflow.com/q/28470828
score: 0
type: Comment

http://stackoverflow.com/q/28564236
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I have set the youtube link in the iframe in my website. But there is a error shows in the inspect element. So, I want to know, the reason for that error and how I solve that error. chrome-extension://boadgeojelhgndaghljhdicfkmllpafd/cast_sender.js Failed to load resource: net::ERR_FAILED chrome-extension://dliochdbjfkdbacpmhlcpmleaejidimm/cast_sender.js Failed to load resource: net::ERR_FAILED globalf39e.js:1522 otherbrowser chrome-extension://hfaagokkkhdbgiakmmlclaapfelnkoah/cast_sender.js Failed to load resource: net::ERR_FAILED chrome-extension://fmfcbgogabcbclcofgocippekhfcmgfj/cast_sender.js Failed to load resource: net::ERR_FAILED chrome-extension://enhhojjnijigcajfphajepfemndkmdlo/cast_sender.js Failed to load resource: net::ERR_FAILED Thankz
tagged with: iframe
tagged with: google-chrome
type: Question
has title: How to solve error that is shown after adding you tube link to iframe?
has answer: http://stackoverflow.com/a/35868213
tagged with: javascript
score: 4
upvote count: 4
has answer: http://stackoverflow.com/a/28564297
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/45462519
comment on: http://stackoverflow.com/a/28570362
score: 1
has text: You could probably just use css for the element in this case (`background-color:black`). Besides from that I cannot see any error with the answer so it shouldn't have been downvoted IMHO.
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28528679
has comment: http://stackoverflow.com/comment/45373019
has answer: http://stackoverflow.com/a/28528801
tagged with: function
has answer: http://stackoverflow.com/a/28529001
favorite count: 0
has comment: http://stackoverflow.com/comment/45373073
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28528881
has body: Please, explain to me why functions are objects in javascript? An object is a structure with properties. Value of property may be a function and we call this property - method. But we can NOT execute an object. We can NOT do this: var cat = {name: 'Murzik', age: 17}; cat(); But we can execute the function var func = function() { alert('Hello world!'); }; func(); So, if functions are objects why we can do this? Please, help me to understand! Thank's!
answer count: 4
has comment: http://stackoverflow.com/comment/45372642
score: 2
upvote count: 3
has comment: http://stackoverflow.com/comment/45373009
downvote count: 1
type: Question
tagged with: object
has title: Why functions are objects in javascript?
has answer: http://stackoverflow.com/a/28530079
has comment: http://stackoverflow.com/comment/45373093
tagged with: javascript

http://stackoverflow.com/comment/45294133
comment on: http://stackoverflow.com/q/28485158
score: 0
has text: possible duplicate of [Require.js Build Optimization Configuration](http://stackoverflow.com/questions/28437563/require-js-build-optimization-configuration)
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28568857
has answer: http://stackoverflow.com/a/28568887
accepted answer: http://stackoverflow.com/a/28568887
type: AnsweredQuestion
has body: How do i make my nav bar transparent when I scroll down and come back when I scroll up or when I hover my mouse over it? I tride to do this with jquery but i didn't really work. Here's My HTML and CSS: <DOCTYPE html> Browse Sign Up BHS Lunch Log In Help .nav { height: 35px; font-size: 16px; font-family: Tahoma, Geneva, sans-serif; font-weight: bold; width: 100%; /*border: 1px solid black;*/ /*background-color: #AA3C39;*/ background-color: #AA3C39; /*opacity: 0.7;*/ position: fixed; }
type: Question
upvote count: 2
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
score: 2
downvote count: 0
has title: How do i make my nav bar transparent when I scroll down and come back when I scroll up or when I hover my mouse over is?

http://stackoverflow.com/comment/124970132
has text: Did you change the name? I'm getting 404 when I click the link.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29401555
type: AnswerComment

http://stackoverflow.com/q/28481604
score: 2
type: AnsweredQuestion
upvote count: 2
accepted answer: http://stackoverflow.com/a/28481605
tagged with: http-redirect
type: Question
has title: How to redirect from Facebook browser to Android market?
answer count: 2
has body: In my site, there is a link that once clicked, goes through a series of redirect that eventually should go to the app market. The final redirect URL is something like: market://details?id=APP-IDENTIFIER And it is started by calling: window.open(url,"_blank") On Android, when clicking in a regular browser - all works well. When opening the page in the facebook browser, the redirect fails with the following message: The webpage could not be loaded as" net::ERR_UNKNOWN_URL_SCHEME I am aware that any app may block custom scheme access, but is there a way to overcome this?
downvote count: 0
has answer: http://stackoverflow.com/a/28481605
tagged with: javascript
favorite count: 0
tagged with: google-play
tagged with: android
tagged with: facebook
possible better answer: http://stackoverflow.com/a/28483225
has answer: http://stackoverflow.com/a/28483225

http://stackoverflow.com/comment/45472458
comment on: http://stackoverflow.com/a/28582321
score: 0
type: AnswerComment
has text: i just tried what you said. It is still not working!
type: Comment

http://stackoverflow.com/comment/45421860
type: QuestionComment
score: 0
has text: so you want circle on panel2 also?
comment on: http://stackoverflow.com/q/28554517
type: Comment

http://stackoverflow.com/comment/45287413
has text: Yeah - Here is the raw response. I put it in a jsfiddle simply because it's so ~500 lines. http://jsfiddle.net/Lu5sgae8/
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28482499
type: Comment

http://stackoverflow.com/comment/45382414
type: QuestionComment
has text: You could use [16:9 YouTube thumbnails](http://stackoverflow.com/a/18979282/331137) to get rid of the vast majority of the bars by just not having them in the first place.
comment on: http://stackoverflow.com/q/28533016
score: 0
type: Comment

http://stackoverflow.com/comment/45454297
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28488344
has text: @tomtomtom I should clarify... In the jsfiddle the mask is currently commented out and the bars will appear. If you uncomment the mask to apply it, the bars will disappear. After running the simulation many times, the bars will eventually be taller than the graph area. That is when I want them clipped.

http://stackoverflow.com/comment/45334589
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28507743
has text: why do i keep overlooking that ty so much on that.
score: 0

http://stackoverflow.com/q/28566927
has body: I'm trying to use the jQuery appear plugin. I'm having trouble making it work. I tried to attach it to the (window).scroll event but it makes the page slow. If I don't use the scroll, it only fires once. I need it to work again whenever the element becomes visible. Can you give me some tips on how to make it work. Here's my code: jQuery('.home-section-1').appear(function(){ jQuery('.page-scroll-indicator .fa.fa-circle').removeClass('active-ind'); jQuery('.page-scroll-indicator .section-1').addClass('active-ind'); });
upvote count: 2
type: UnansweredQuestion
score: 2
has title: jQuery Appear Function
has comment: http://stackoverflow.com/comment/45444196
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28567477
favorite count: 0

http://stackoverflow.com/comment/45395511
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28483507
type: Comment
has text: That's true. I should read more carefully :-) Hope you'll find a solution.

http://stackoverflow.com/comment/45406063
comment on: http://stackoverflow.com/q/28546244
score: 0
type: Comment
type: QuestionComment
has text: To know definitively you'll need someone who's familiar with the internals of an ECMAScript implementation because the spec it's self isn't super clear on the subject (or you'll need to test it your self). What I can say is that any variable, pre-defined or not, with no value will be `undefined` - so my guess is no, they don't.

http://stackoverflow.com/comment/45442366
type: Comment
comment on: http://stackoverflow.com/a/28565800
has text: This is a correct way and convetional way to do it without extra libraries. You got my vote.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28524723
tagged with: casperjs
downvote count: 0
has answer: http://stackoverflow.com/a/45273139
type: UnansweredQuestion
has body: I'm having a problem getting casperjs test to exit after execution, I have to hit CTL-C to exit execution. misc.js var require = patchRequire(require); var site = { goToSite: function (url) { casper.start(url, function checkSite() { this.test.assert(this.getCurrentUrl() === url, 'Url is: ' + this.getCurrentUrl()); this.test.assertHttpStatus(200, 'HTTP status code 200 OK'); }); }, login: function () { casper.then(function fillTheForm() { this.fill("form[action='/auth/login']", { 'email': 'login@email.com', 'password': 'pass' }, true); } ); } }; module.exports.site = site; test.js var system = require('system'); var misc = require('./misc'); casper.options.logLevel = "debug"; casper.options.verbose = true; casper.on("resource.error", function(errorCode, errorString, url, id){ this.echo(errorString); }); casper.on("page.error", function(msg, trace){ this.echo(msg); }); casper.on("remote.message", function(message){ this.echo(message); }); casper.test.begin('Cow can moo', 2, function suite(test) { var url = "http://ym.cms2cms/auth/login"; misc.site.goToSite(url); misc.site.login(); casper.run(function () { test.done(); }); }); terminal PASS Url is: http://ym.cms2cms/auth/login PASS HTTP status code 200 OK PASS 2 tests executed in 1.596s, 2 passed, 0 failed, 0 dubious, 0 skipped. http://screencast.com/t/5ZmTZLK3C5Bk
has title: CasperJS test won't return after execution
has comment: http://stackoverflow.com/comment/45370980
type: Question
has comment: http://stackoverflow.com/comment/45399432
has comment: http://stackoverflow.com/comment/45375330
score: 1
linked to: http://stackoverflow.com/q/18482357
has comment: http://stackoverflow.com/comment/45365598
has comment: http://stackoverflow.com/comment/45375233
upvote count: 1
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45370813
favorite count: 0
has comment: http://stackoverflow.com/comment/45376136

http://stackoverflow.com/comment/45472100
type: Comment
has text: possible duplicate of [D3.js packed circle layout - how to adjust child radius](http://stackoverflow.com/questions/22307486/d3-js-packed-circle-layout-how-to-adjust-child-radius)
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/28573136

http://stackoverflow.com/a/28512990
score: 0
has comment: http://stackoverflow.com/comment/45353381
answers question: http://stackoverflow.com/q/28487315
has body: When I ran your code, I got an error on this line: var dataRange = sheet.getRange(startRow, 1, numRows); You are using the wrong syntax for getRange(). I got an error msg that was similar to yours. getRange can take two types of notation parameters, A1 notation or R1C1 notation. A1 notation is a string, you have to put it into quotes: var cell = sheet.getRange("A1"); R1C1 notation takes four settings. You have three. R1C1 notation is: Start Row, Start Column, Number of Rows to Get, Number of Columns to Get It's not explained in the getRange() documentation, but you can see an explanation in the getSheetValues() documentation here: Google Documentation - getSheetValues
type: Answer

http://stackoverflow.com/comment/45472012
type: QuestionComment
comment on: http://stackoverflow.com/q/28581203
score: 0
has text: i have posted an answer check it and let me know if you have still problems
type: Comment

http://stackoverflow.com/comment/45447051
type: QuestionComment
comment on: http://stackoverflow.com/q/28567071
score: 0
has text: Rather than alerting error response, Do console.log(data.d) and post the console result.It might show some useful information in console.
type: Comment

http://stackoverflow.com/comment/45338946
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28507317
has text: @user3842029 np. P.S. Not sure why the answer got down voted. Would the person care to explain?
type: AnswerComment

http://stackoverflow.com/a/28474572
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28474386
answers question: http://stackoverflow.com/q/28474386
upvote count: 1
type: AcceptedAnswer
has body: I'm not sure whether I get your question right, but shouldn't the following work? $('th').find('a').each(function(){console.log($(this).text())}); -> Result in your case Name Name Name1 Name2 Name3 Telephone Bill Gates 555 77 854 555 77 855 -> Result is: Name Name1 Name2 Name3

http://stackoverflow.com/q/28448499
tagged with: struts2
tagged with: servlets
upvote count: 1
has comment: http://stackoverflow.com/comment/45239824
favorite count: 0
has comment: http://stackoverflow.com/comment/45243793
has body: I am developing a simple Struts2 application having AJAX call. I am trying to check each field of a form, while it is being filled up, using AJAX call. I want to get the response from a servlet. To call the servlet, I have used 'exclude url' in struts.xml file and included the ajax call pattern in web.xml file. But my application is unable to find out the servlet. Below are the code snippets: empForm.jsp: Employee Registration Form Employee Registration Form Please provide your details in the appropriate fields. Fields marked with * are mandatory. <s:form action="register"> <s:textfield id="username" name="username" label="Username*" /> <s:textfield name="fullname" label="Full Name*" /> <s:textfield name="emailid" label="Email*" /> validate.js: window.onload = initPage; alert("validate.js page"); function initPage() { document.getElementById("username").onblur = checkUsername; //document.getElementById("register").disabled = true; alert("in initPage();"); } function checkUsername() { request=createRequest(); if(request==null) alert("Unable to create request!"); else{ var theName = document.getElementById("username").value; var username = escape(theName); var url = "http://localhost:8080/PeopleManagement/checkName.do?username=" + username; //var url = "checkName.do?username=" + username; request.onreadystatechange = showUsernameStatus; request.open("GET",url,true); request.send(null); alert("url:" + url); } alert("in checkUsername();"); } function showUsernameStatus(){ if(request.readyState == 4){ if(request.status == 200){ alert("Status:" + request.statusText); alert("Response:" + request.responseText); if(request.statusText == "okay"){ alert("allowed"); } else alert("denied"); } } } struts.xml: /welcome.jsp /adminLogin.jsp /adminMenu.jsp empForm.jsp /registrationError.jsp /registrationSuccess.jsp /viewError.jsp /list.jsp web.xml: <?xml version="1.0" encoding="UTF-8"?> PeopleManagement welcome.jsp struts2 org.apache.struts2.dispatcher.FilterDispatcher struts2 /* Use…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45229010
has answer: http://stackoverflow.com/a/28449016
downvote count: 0
has comment: http://stackoverflow.com/comment/45234515
score: 1
tagged with: java
linked to: http://stackoverflow.com/q/4140448
type: Question
has title: How to invoke a servlet from AJAX call url in struts2 application?
answer count: 1
tagged with: javascript

function
tags question: http://stackoverflow.com/q/28500978
tags question: http://stackoverflow.com/q/28470329
tags question: http://stackoverflow.com/q/28592127
tags question: http://stackoverflow.com/q/28466858
tags question: http://stackoverflow.com/q/28520173
tag name: function
tags question: http://stackoverflow.com/q/28583693
tags question: http://stackoverflow.com/q/28482501
tags question: http://stackoverflow.com/q/28528679
tags question: http://stackoverflow.com/q/28475696
tags question: http://stackoverflow.com/q/28532752
tags question: http://stackoverflow.com/q/28442367
tags question: http://stackoverflow.com/q/28547632
tags question: http://stackoverflow.com/q/28584146
tags question: http://stackoverflow.com/q/28559094
tags question: http://stackoverflow.com/q/28591827
tags question: http://stackoverflow.com/q/28500999
tags question: http://stackoverflow.com/q/28507564
tags question: http://stackoverflow.com/q/28460365
tags question: http://stackoverflow.com/q/28554867
tags question: http://stackoverflow.com/q/28573626
tags question: http://stackoverflow.com/q/28439929
tags question: http://stackoverflow.com/q/28505187
tags question: http://stackoverflow.com/q/28478833
tags question: http://stackoverflow.com/q/28445431
tags question: http://stackoverflow.com/q/28438976
tags question: http://stackoverflow.com/q/28567155
tags question: http://stackoverflow.com/q/28523394
tags question: http://stackoverflow.com/q/28572206
tags question: http://stackoverflow.com/q/28534476
tags question: http://stackoverflow.com/q/28576817
tags question: http://stackoverflow.com/q/28464874
tags question: http://stackoverflow.com/q/28464834
tags question: http://stackoverflow.com/q/28474820
type: Tag
tags question: http://stackoverflow.com/q/28522327
tags question: http://stackoverflow.com/q/28549759
tags question: http://stackoverflow.com/q/28461290
tags question: http://stackoverflow.com/q/28576493
tags question: http://stackoverflow.com/q/28511670
tags question: http://stackoverflow.com/q/28546865
tags question: http://stackoverflow.com/q/28514113
tags question: http://stackoverflow.com/q/28588584
tags question: http://stackoverflow.com/q/28456044
tags question: http://stackoverflow.com/q/28541006
tags question: http://stackoverflow.com/q/28462158
tags question: http://stackoverflow.com/q/28511449
tags question: http://stackoverflow.com/q/28468358
tags question: http://stackoverflow.com/q/28441077
tags question: http://stackoverflow.com/q/28518119
tags question: http://stackoverflow.com/q/28561038
tags question: http://stackoverflow.com/q/28549707
tags question: http://stackoverflow.com/q/28522075
tags question: http://stackoverflow.com/q/28481611
tags question: http://stackoverflow.com/q/28465564
tags question: http://stackoverflow.com/q/28516360
tags question: http://stackoverflow.com/q/28556904
tags question: http://stackoverflow.com/q/28491967
tags question: http://stackoverflow.com/q/28523631
tags question: http://stackoverflow.com/q/28437672
tags question: http://stackoverflow.com/q/28583718
tags question: http://stackoverflow.com/q/28548809

http://stackoverflow.com/comment/63673696
type: AnswerComment
score: 4
type: Comment
has text: Does not work with Chart.js 2.1.3 using Line Chart with time scales.
comment on: http://stackoverflow.com/a/28546827

http://stackoverflow.com/comment/45277709
comment on: http://stackoverflow.com/q/28477304
score: 1
has text: @Teemu I know, I didn't want to give the whole game away `;-)`
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28574785
score: 1
answers question: http://stackoverflow.com/q/28574742
has comment: http://stackoverflow.com/comment/45459367
upvote count: 1
has body: Yes. All users with a defined Role in your App (Administrators, Developers, etc) can conceded all the permissions without having the application approved by Facebook. Source: Do I Need to Submit for Login Review?
has comment: http://stackoverflow.com/comment/45476261
type: Answer
has comment: http://stackoverflow.com/comment/45459483
downvote count: 0

http://stackoverflow.com/a/28517251
has body: Try var results = $("#results"); $("form").on("submit.ajax", function(e) { e.preventDefault(); if ($.active &lt; 1) { // do request stuff } else { // notify request in progress console.log($.active + " requests in progress, please wait") } }); See jQuery.active function var results = $("#results"); $("form").on("submit.ajax", function(e) { e.preventDefault(); if ($.active &lt; 1) { console.log($.active) $.get("http://news.feedzilla.com/en_us/headlines/fun-stuff/comics.rss?" + $.now(), null, "xml") .done(function(data) { results.html("").append($.now() + "&lt;br /&gt;"); $(data.documentElement).find("channel item title").each(function(i, el) { results .append("&lt;br /&gt;" + el.innerHTML + "&lt;br /&gt;") }) }) } else { alert($.active + " requests in progress, please wait") } }) &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;form&gt; &lt;input type="submit" value="click" /&gt; &lt;/form&gt; &lt;div id="results"&gt;&lt;/div&gt;
answers question: http://stackoverflow.com/q/28515945
score: 0
type: Answer

http://stackoverflow.com/q/28480591
has answer: http://stackoverflow.com/a/28513222
has comment: http://stackoverflow.com/comment/45283611
has comment: http://stackoverflow.com/comment/45287056
has comment: http://stackoverflow.com/comment/45324168
type: UnansweredQuestion
tagged with: http-redirect
tagged with: facebook
has comment: http://stackoverflow.com/comment/45284491
has comment: http://stackoverflow.com/comment/45289160
tagged with: php
linked to: http://stackoverflow.com/q/12180437
has comment: http://stackoverflow.com/comment/45284996
has body: Aim : I have a small shortener service. I use links generated using this services as part of the content I post on facebook. Facebook's URL scraper tries to generate a preview by locating the end-point URL and pull relevant information. This, right now works because I simply redirect in PHP with the way it's mentioned below without allowing me to execute JS before that redirection. I want to find out if there is a way to execute that JS. What can I do? Well! redirect from JS using window.location like this solution here... What's the problem? If I do that, Facebook's URL scraper can no longer find the final destination url, resulting in a blank preview of my site(specifically the page where JS executes) instead of the destination site. JS execution is a must so can't omit that. Question : Is there a way I can execute some piece of javascript before I do a redirection via header location and still be able to get correct previews for URLs? Reference Code - in Laravel Controller if($row-&gt;save()){ //i was first doing this and doing a redirect from the view. //return View::make('pages/redirect')-&gt;with('originalUrl',$row-&gt;url); //but then i realized it wasn't fetching the previews. So i do this now. return Redirect::to($row-&gt;url); //assuming it internally uses php's header location. I want to use the JS before this redirect. }
linked to: http://stackoverflow.com/q/7246649
type: Question
has comment: http://stackoverflow.com/comment/45283809
score: 0
answer count: 2
tagged with: url
tagged with: javascript
has answer: http://stackoverflow.com/a/28502511
has title: Execute JavaScript before redirection without damaging preview generated by facebook URL scraper

http://stackoverflow.com/comment/45320165
type: QuestionComment
has text: @Chris..Yes agree...you are right..
score: 0
comment on: http://stackoverflow.com/q/28500318
type: Comment

http://stackoverflow.com/q/28511225
tagged with: javascript-objects
linked to: http://stackoverflow.com/q/750486
has answer: http://stackoverflow.com/a/28511273
has body: i'm trying to create a new object as an attribute of a JSON for all positions of an array that contains JSON objects, but the problem is when run this, it always prints out the last and only the last object created inside for cycle. I can't figure this out... Can anybody explain me why this happens? Here is my code: for(var i = 0; i &lt; data.length; i++){ var clock = new Clock((datesService.parseToClock(data[i].endsAt) / 1000), data[i].id) data[i].clock = clock data[i].interval = setInterval(function(){ clock.decrement() console.log('ID: ' +clock.getAuction() + ' | ' + clock.getDays()+' d '+ clock.getHours()+' h ' + clock.getMinutes() + ' m ' + clock.getSeconds()) }, 1000) } function Clock(tempo, auction){ this.auction = auction this.tempo = tempo this.seconds = this.tempo % 60 this.minutes = (this.tempo / 60) % 60 this.hours = ((this.tempo / 60) / 60) % 24 this.days = (((this.tempo / 60) / 60) / 24) } Clock.prototype.decrement = function(){ this.tempo -- this.seconds = Math.floor(this.tempo % 60) this.minutes = Math.floor((this.tempo / 60) % 60) this.hours = Math.floor(((this.tempo / 60) / 60) % 24) this.days = Math.floor((((this.tempo / 60) / 60) / 24)) }; Clock.prototype.getAuction = function(){ return this.auction }; Clock.prototype.getDays = function(){ return this.days }; Clock.prototype.getHours = function(){ return this.hours }; Clock.prototype.getMinutes = function(){ return this.minutes }; Clock.prototype.getSeconds = function(){ return this.seconds; }; Just can´t understand why... Thanks guys :)
has title: Why does javascript new object in cycle returns the last created and not one for each JSON inside of an array?
tagged with: http://stackoverflow.com/tag/json
downvote count: 2
duplicate of: http://stackoverflow.com/q/750486
upvote count: 1
has answer: http://stackoverflow.com/a/28511289
type: Question
tagged with: object
tagged with: arrays
has comment: http://stackoverflow.com/comment/45341470
tagged with: javascript
score: -1
answer count: 2
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/28514308
has answer: http://stackoverflow.com/a/28514324
has comment: http://stackoverflow.com/comment/45346441
has comment: http://stackoverflow.com/comment/45346658
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28514324
tagged with: javascript
has title: HTML page content designing
type: Question
has body: I have designed a web application for my school, it has a basic layout structure like navigation bar on the top and a side bar with stacked tabs running towards left and a page content area. but every time when a user click on one of those stacked tabs the whole page get reloaded, I was wondering if I could load only the page content area while the top navigation bar and side bar should remain constant? Please help me.. thank you :)
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 0
answer count: 1

http://stackoverflow.com/a/28572447
has body: You have some broken HTML which is probably causing the JS to initialise correctly. Check these lines in your markup Line 139, Column 25: End tag figcaption seen, but there were open elements. Line 138, Column 19: Unclosed element div.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28572292

http://stackoverflow.com/comment/45508863
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28561206
has text: This script works fine, but if I choose first value, and then select second, there is a problem, that it doesn't refresh well(doesn't show for me good values in second and third form). I added 6 countries, and a few cities in each country and a few maps, and doesn't reset good.

http://stackoverflow.com/q/28549164
downvote count: 0
has comment: http://stackoverflow.com/comment/45412145
has answer: http://stackoverflow.com/a/28549843
favorite count: 0
tagged with: promise
has comment: http://stackoverflow.com/comment/45413165
has comment: http://stackoverflow.com/comment/45412163
has comment: http://stackoverflow.com/comment/45412115
tagged with: node.js
type: AnsweredQuestion
tagged with: bluebird
has comment: http://stackoverflow.com/comment/45411756
has title: How can I do pagination with Bluebird Promises?
score: 7
has answer: http://stackoverflow.com/a/28550024
type: Question
has comment: http://stackoverflow.com/comment/45412129
has comment: http://stackoverflow.com/comment/45411778
has answer: http://stackoverflow.com/a/32935845
has comment: http://stackoverflow.com/comment/45412015
tagged with: javascript
has body: I have something like new Promise (resolve, reject) -&gt; trader.getTrades limit, skip, (err, trades) -&gt; return reject err if err resolve trades .each (trade) -&gt; doStuff trade limit is set to some arbitrary number, say 10 and skip starts at 0. I want to keep increasing skip until there are no more trades. The doStuff is a function I'm using to process each trade. This works the first time, but I want to get more trades in a paginated fashion. Specifically, I want to run trader.getTrades with a higher skip until trades.length is 0
accepted answer: http://stackoverflow.com/a/28549843
answer count: 3
upvote count: 7
possible better answer: http://stackoverflow.com/a/28550024

http://stackoverflow.com/comment/45398487
has text: you really should be able to do it with just css, I'll read through your response and see if I can formulate something better
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28511570

http://stackoverflow.com/q/28450786
has answer: http://stackoverflow.com/a/28450930
tagged with: settimeout
has title: setTimeout() multiple JQuery instances
has comment: http://stackoverflow.com/comment/45229411
type: Question
has comment: http://stackoverflow.com/comment/45229388
tagged with: delay
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45229383
score: 0
has comment: http://stackoverflow.com/comment/45229729
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45229366
has body: So I have a block of about 10 lines of code in JQuery. the lines are all independent, and when I execute them (I just type them in the console, its an automated test) i need them to be delayed form each other, like with 2 seconds difference. I started by using JavaScript setTimeout() on each line, but for 10 separate lines of code i assume there's a sexier way to do so... Also JQuery DELAY doesn't work since these aren't effects. Any ideas? here's the general idea of my code block.. $("#tag1").trigger("click"); $('#tag2').val("some text"); $("#tag3").trigger("keyup"); $('#tag4 select option[value="4"]').prop('selected',true); $("#tag5").val(6); $('#tag6').val(3).change(); $('#tag7').val(30).change(); $('#tag8').val("2017-06-29"); $('#tag9').val("2015-06-29"); $('#tag10').val("This is the test tasks' description."); $(".id1").trigger("click"); $(".id2").val("buy oranges"); As you can see all the tags and ID are unique... any idea would be greatly appreciated!

http://stackoverflow.com/a/29176874
answers question: http://stackoverflow.com/q/28466214
type: Answer
score: 0
has body: I've succeeded in doing a feedback loop in three.js using fbo texture swapping aka pingpong, which (as always) brought up new questions- for anybody else trying to achieve texture feedback have a look at my new question where I've posted the code (in the render loop you can delete the if statement and only keep what's in the else block).

http://stackoverflow.com/q/28512986
tagged with: file-upload
upvote count: 2
type: UnansweredQuestion
has body: Using blueimp jquery-file-upload, I'd like to change a variable when clicking the cancel button. The cancel button is displayed at right of the each file added. I tried below but nothing has been happend. How can I do this? $(function () { var file_count = 0 $('#fileupload').fileupload({ acceptFileTypes: /(\.|\/)(pdf|PDF)$/i }).bind('fileuploadadd', function (e, data) { file_count += data.files.length $('td.cancel button.btn-warning').click(function (e) { file_count -= 1 }); }); });
score: 2
has title: blueimp jquery-file-upload how to detect pushing cancel button?
type: Question
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/35384205
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: jquery-file-upload

http://stackoverflow.com/q/28527208
tagged with: javascript
has comment: http://stackoverflow.com/comment/45465397
score: 0
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
tagged with: three.js
has answer: http://stackoverflow.com/a/28566208
has comment: http://stackoverflow.com/comment/45450245
has title: How to automatically update a mesh on changing parameters on THREE.js
tagged with: design-patterns
has comment: http://stackoverflow.com/comment/45486296
type: Question
has comment: http://stackoverflow.com/comment/45483834
has body: I'm new to Threejs and to javascript in general. I'm building a mesh based on a json parameters object and it works great. Now I'm adding some UI components (button, slider, etc) to change the json and rebuild the mesh. I'm writing some monkey-code and I'm sure it can be avoided. Now my stuff works correctly but I'm sure that the problem can be solved more elegantly. This is my actual workflow: on slider change use a callback that callback calls a setter the setter change the JSON parameters and rebuild the mesh I'm sure all this can be automated by simply change the JSON and some javascript magic. Here is the actual pseudocode: sliderWidth.onChange( function(newValue) { MyObject3D.setWidth(newValue); }); and this is a skelton of my MyObject3D: var MyObject3D = function(parameters) { this.parameters = parameters; this.init(); }; MyObject3D.prototype.init = function() { var geometry = this.initGeometry(); var material = new THREE.MeshPhongMaterial( { color: this.parameters.color, shading: THREE.FlatShading } ); this.mesh = new THREE.Mesh(geometry, material); } MyObject3D.prototype.setWidth = function(n) { this.parameters.width = n; scene.remove( this.mesh ); this.init(); scene.add( this.mesh ); } I'm sure that with the javascript high-dinamicity and with all brand new frameworks this piece of code can be easily automated. I've looked mainly at d3.js and at angular.js. In particular d3.js seems to be perfect with the enter-update-exit paradigm (but I didn't find a standard way to conjugate it with Three.js) and angular for sure has to be something in it. Any kind of advice on structure, pattern, specific use case or examples based on one of the frameworks mentioned THREE.js, d3.js, angular.js) can be enlightening. Actually I'd prefer a solution with angular.js..

http://stackoverflow.com/comment/45273145
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28473826
has text: Possibly or a cached version if you don't clear it everytime. Usually it's either that or a weird conflict. I've wasted so many hours just by trying to find out which on my projects. Haha, best of luck man!

http://stackoverflow.com/comment/45238890
has text: yes this shows my variable name in javascript popups...
comment on: http://stackoverflow.com/q/28455013
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45442485
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28565990
has text: What do you mean it's not removed, if you do `Player.weapon = Hammer` it overwrites anything that `Player.weapon` contains. If you want to remove it all together, that would be `delete Player.weapon`
score: 0

http://stackoverflow.com/comment/45389908
has text: Can you please share it?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28537866
score: 0

http://stackoverflow.com/q/28446327
type: AnsweredQuestion
type: Question
has body: I'm writing angular unit tests using Jasmine with angular-mocks' httpBackend. I've managed to properly mock my backend but some one of my tests has some issues with an http call where a value is set to scope after the request is done (in then()). Controller: $scope.startShift is binded to a button click. app.controller('ShiftStartCntl', function($scope, $rootScope, $location, Restangular, $http, shifts) { $scope.shifts = shifts; $scope.startShift = function (category) { $scope.startingShift = true; baseShifts.post({category_number: 2}) .then(function (shift) { $scope.shift = shift; // breaks here if run as the endpoint isn't mocked $http.post('endpointThatIsNotMocked').then(function() {}); $location.path($scope.rootURL + '/shift/' + shift.id + '/'); $scope.startingShift = false; }); }); Test: // module definition and stuff // // [...] // describe('ShiftStartCntl', function() { var scope, rootScope, httpBackend, ShiftStartCntl; beforeEach(angular.mock.inject(function($rootScope, $controller, $httpBackend) { scope = $rootScope.$new(); rootScope = $rootScope; httpBackend = $httpBackend; // mimics the controller's ng-route `resolve` dependency shifts = getJSONFixture('leave_shifts.json'); scope.baseShifts = baseApi.all('shifts'); // used in the controller scope.categories = getJSONFixture('leave_categories.json'); httpBackend.expectPOST('/api/shifts/', {category_number: 2}) .respond(203, {"id": 4, "user": 1, "category_number": 2, "sign_in": "2015-02-10T21:29:06.110Z", "sign_out": null }); $controller('ShiftStartCntl', {$scope: scope, shifts: []}); })); it('should start a shift', function() { expect(shifts.length).toEqual(2); expect(scope.startingShift).toBe(undefined); scope.startShift(scope.categories[1]); rootScope.$apply(); expect(scope.shift.id).toEqual(4); httpBackend.flush(); }); }); The produced error is the following: PhantomJS 1.9.8 (Mac OS X) Shifts ShiftStartCntl should start a shift FAILED Expected undefined to equal 4. at [...]/js/tests/unit/controllers/mai…
accepted answer: http://stackoverflow.com/a/28446477
tagged with: javascript
score: 0
has title: Test spec executing before $rootScope.$apply() is done resolving promise
answer count: 1
tagged with: jasmine
tagged with: angularjs
has answer: http://stackoverflow.com/a/28446477
tagged with: restangular

http://stackoverflow.com/q/28489000
tagged with: ajax
has comment: http://stackoverflow.com/comment/45300012
score: 0
has comment: http://stackoverflow.com/comment/45299976
has title: Reload div content using jquery
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/45299697
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28490676
has comment: http://stackoverflow.com/comment/45300256
has body: I have a website where I'm displaying two tables in one row, one to the second. Above the tables I have a menu where user can choose displayed tables. Problem is when I'm using jquery functions div.remove; div.append; div.load nothing happens - new table is not displayed. HTML code: Choose the first map % of employees cycling to work % of White British residents Choose the second map <li class="div2clear" data-path="contents/work/cycling2.html" data-path2="tables/cycling2_table.html"<>% of employees cycling to work % of White British residents Change content of DIV: File with content of table_div1 File with content table_div2: Also this two js codes with content of both tables i have placed in initial index.html file and after run website both of tables are displaying in a correct way, only after when i try to change table nothing happens. Do you have any idea what can be issue? Thanks in advance.
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45300926
tagged with: jquery
has comment: http://stackoverflow.com/comment/45300229

split
tags question: http://stackoverflow.com/q/28514113
tag name: split
tags question: http://stackoverflow.com/q/28550431
type: Tag

http://stackoverflow.com/comment/110544067
comment on: http://stackoverflow.com/a/28544299
type: AnswerComment
has text: it's good for the example only. if you have a different csv with line breaks in the fields (2 lines address or something it) the code will mess up badly
type: Comment
score: 1

http://stackoverflow.com/q/28564907
accepted answer: http://stackoverflow.com/a/28567950
answer count: 1
downvote count: 0
has body: The log for my script returns no information. I've copy-pasted this script with minimal changes from this stack overflow thread. I confirmed the content from the thread in from the relevant google scripts manual. Can someone shine some light on this problem? function myFunction() { function stripArray(values) { return values.filter(function(d) { return d.length &amp;&amp; d[0] !== ''; }); } function testSheet() { var ssId="1kRdKGDQJXxCW2q1HPclWcpsOpI1BJPvAlMjvLSX6JvY"; var ss = SpreadsheetApp.openById(ssId); var sheet = ss.getSheetByName("Sheet1"); var values = sheet.getSheetValues(3, 2, 21, 23); Logger.log(values); Logger.log(stripArray(values)); } } Thanks
favorite count: 0
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: google-apps-script
tagged with: google-sheets-api
tagged with: google-sheets
has title: getSheetValues not returning data Google Script
has answer: http://stackoverflow.com/a/28567950
tagged with: javascript
linked to: http://stackoverflow.com/q/23310154

http://stackoverflow.com/a/28564781
downvote count: 0
has comment: http://stackoverflow.com/comment/45447234
has comment: http://stackoverflow.com/comment/45447488
upvote count: 2
has comment: http://stackoverflow.com/comment/45447900
has comment: http://stackoverflow.com/comment/45441394
accepted answer of: http://stackoverflow.com/q/28554378
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45441704
answers question: http://stackoverflow.com/q/28554378
has body: Yet another way: var html = '', i = 0; $("#category-table td").each(function(){ if($(this).is("[id^='titlecell']")){ html += '&lt;div id="category-div_'+(i=i+1)+'"&gt;'; html += '&lt;h1&gt;'+($(this).html().replace('id="title_', 'id="new-title_'))+'&lt;/h1&gt;'; }else if($(this).is("[id^='imagecell']")){ html += $(this).html().replace('id="image_', 'id="new-image_')+'&lt;/div&gt;'; } }); $('&lt;div id="categories"/&gt;').append(html).appendTo('body'); EDIT: I forgot about &lt;/div&gt;. Updated. JSFiddle
has comment: http://stackoverflow.com/comment/45441906
type: Answer
has comment: http://stackoverflow.com/comment/45444124
score: 2

http://stackoverflow.com/a/57053318
has comment: http://stackoverflow.com/comment/124023115
answers question: http://stackoverflow.com/q/28552589
type: Answer
upvote count: 0
score: -2
has comment: http://stackoverflow.com/comment/102147738
downvote count: 2
has body: In order to check whether the object is empty or not use this code. if (Object.keys(object_name).length &gt; 0) { // Your code }

http://stackoverflow.com/a/28480235
type: Answer
answers question: http://stackoverflow.com/q/28477270
has comment: http://stackoverflow.com/comment/45307026
has comment: http://stackoverflow.com/comment/45306898
score: 2
has body: You are missing the ending ) on the if statement. if (maVariable.equals("1") should be if (maVariable.equals("1") ) To verify I ran the test with 50 users looping 500 times on 2 servers. Here is the Load Test and the JMX File.
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/45383993

http://stackoverflow.com/a/28583245
has comment: http://stackoverflow.com/comment/45503701
type: Answer
has body: I agree with robin that you should try yourself first, but here it is (with help from lodash library): function combos(arr) { if(arr.length &lt;= 1) return arr return _.flatten(arr.map(function(key, index) { return key.concat( combos(arr.slice(index+1)) .map(function(combo) { return [key].concat(combo) }) ) })) } console.log( combos(["a", "b", "c", "d"]) .map(function(arr) { return arr.join("")}) ) http://jsbin.com/caxowuwuki/3/edit
score: 0
answers question: http://stackoverflow.com/q/28582295

http://stackoverflow.com/comment/45280155
has text: @BenM The first and second theories don't work (tried them already and also just tried them on my snippet). No idea why. But the .add() has worked. Thanks sooooo much, I've been scratching my head for a few days now. **+1,000,000 if I could.**
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28478452

http://stackoverflow.com/comment/45279915
comment on: http://stackoverflow.com/a/28478628
type: AnswerComment
score: 0
type: Comment
has text: I dont know who is doing that, thanks for your answer.

http://stackoverflow.com/comment/45283647
has text: There's nothing special about dynamically created elements as far as accessing them in the DOM. If you don't post your code and don't explain what you mean by "didn't work", then you can't be helped.
type: Comment
comment on: http://stackoverflow.com/q/28480673
score: 1
type: QuestionComment

http://stackoverflow.com/q/28454097
tagged with: select
tagged with: mozilla
has comment: http://stackoverflow.com/comment/45235939
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
has title: Selected option Not Setting in new browser Window Tab
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45235318
has comment: http://stackoverflow.com/comment/45235132
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45235126
has answer: http://stackoverflow.com/a/28454321
has answer: http://stackoverflow.com/a/28454633
has body: IND US JP UK i have the above code. when i select one option it will do some changes to the page.but when i open the page in new tab of browser the already selected option reset. and default selected option set.How do i cop with this?

http://stackoverflow.com/comment/45420039
type: AnswerComment
has text: then it moves little from top to bottom in firefox..But i want it to move right to left like in chrome.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28553499

http://stackoverflow.com/comment/45274525
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28475243
has text: alert(data.aum); or alert(data['aum']);

http://stackoverflow.com/comment/45278450
type: QuestionComment
has text: Is chrome 2 really old? I downloaded it recently
score: 0
comment on: http://stackoverflow.com/q/28474288
type: Comment

http://stackoverflow.com/comment/45466752
has text: Few questions : why do you call twice the `.fullScreen()` method on your first event handler ? And did you tried to use *CSS* instead ?
comment on: http://stackoverflow.com/q/28579169
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45223830
type: QuestionComment
comment on: http://stackoverflow.com/q/28445893
score: 1
has text: You should insert your HTML script so other can check it easily if it relate to javascript issue
type: Comment

http://stackoverflow.com/comment/45372192
type: Comment
comment on: http://stackoverflow.com/a/28528339
has text: I just changed the code and used the response itself as the obj. But now I have the json string in response and other things are still undefined, such as response.result
score: 0
type: AnswerComment

http://stackoverflow.com/q/28549028
tagged with: node.js
type: AnsweredQuestion
score: 2
has title: How to modularize code in node js
has answer: http://stackoverflow.com/a/28549235
type: Question
accepted answer: http://stackoverflow.com/a/28549492
has answer: http://stackoverflow.com/a/28549051
tagged with: javascript
has body: I am new to Node. I have done a sample application where I have done all the code in one file server.js var express = require('express'), nconf=require('nconf'); var app = express() nconf.env().file({ file: 'db-config.json'}); app.use(express.static(__dirname+"\\client")); var dbConfig = nconf.get(); console.log(); var mysql = require('mysql'); var connection = mysql.createConnection({ host: dbConfig.hostname, port: dbConfig.port, user: dbConfig.user, password: dbConfig.password, database: dbConfig.db }); app.get('/', function (req, res) { res.sendFile(__dirname+"\\client\\index.html"); }) app.get('/getTables', function (req, res) { var sql="SELECT table_name as text from information_schema.tables where table_schema = ?"; connection.query(sql,[dbConfig.db],function(err,rows,fields){ if(!err){ var data={ "children":[] }; for(var i=0;i&lt;rows.length;i++){ rows[i].leaf=true; data.children.push(rows[i]); } res.json(data); }else{ console.log("db not connected"); } }); }) 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) }) I want to know how to write all my mysql config code in one file and use where ever i want. And I want to write client response creation in another fie.
has comment: http://stackoverflow.com/comment/45411391
has answer: http://stackoverflow.com/a/28549492
upvote count: 3
downvote count: 1
favorite count: 0
possible better answer: http://stackoverflow.com/a/28549051
has answer: http://stackoverflow.com/a/45981091
has comment: http://stackoverflow.com/comment/45411022
answer count: 4

http://stackoverflow.com/comment/45424515
score: 1
has text: possible duplicate of [ASP.NET MVC JsonResult Date Format](http://stackoverflow.com/questions/726334/asp-net-mvc-jsonresult-date-format)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28556116

http://stackoverflow.com/a/28515425
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28515362
answers question: http://stackoverflow.com/q/28515362
type: Answer
score: 1
upvote count: 1
has body: You have to pass the student name over to the display.jsp (e.g. using a GET parameter). Modify your link as follows: Notify Inside your display.jsp your textbox may look like this:
type: AcceptedAnswer

http://stackoverflow.com/comment/45474908
type: Comment
has text: Can you add your HTML. Also who is calling $scope.tableClick
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28583630

http://stackoverflow.com/comment/45387922
type: AnswerComment
has text: you could use `function(i,n)`
type: Comment
score: 2
comment on: http://stackoverflow.com/a/28536945

http://stackoverflow.com/comment/57410128
type: AnswerComment
comment on: http://stackoverflow.com/a/28461647
has text: Putting every script or css you have on the page on the page, not separate files, is also a way to save a *little* overhead for loading various files, but that's not generally recommended, better to use closure-compiler or something to combine it if you need that speed. Mixing data with model and two different programming languages in one file is not generally best practice either.
type: Comment
score: 0

http://stackoverflow.com/a/28549390
upvote count: 1
answers question: http://stackoverflow.com/q/28549132
score: 1
accepted answer of: http://stackoverflow.com/q/28549132
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: From the documentation Indexes store references to fields in either ascending (1) or descending (-1) sort order. For single-field indexes, the sort order of keys doesn’t matter because MongoDB can traverse the index in either direction. However, for compound indexes, sort order can matter in determining whether the index can support a sort operation. So if you created your index using db.collection.ensureIndex( { orderDate: 1, zipcode: -1 } ) the object will be transmitted to the mongo server with the fields as ordered also note that using db.collection.ensureIndex( { orderDate: 1, zipcode: -1 } ) and db.collection.ensureIndex( { zipcode: -1 , orderDate: 1} ) will create two different compound indexes
has comment: http://stackoverflow.com/comment/45422590

crossfilter
tags question: http://stackoverflow.com/q/28459108
tag name: crossfilter
type: Tag
tags question: http://stackoverflow.com/q/28520353

http://stackoverflow.com/q/28487425
accepted answer: http://stackoverflow.com/a/28491914
has body: I'm having some problems getting the Dojo Grid widget to work. The grid itself is added declaratively: &lt;table data-dojo-type="dojox.grid.DataGrid" data-dojo-attach-point="relationshipsGrid"&gt;&lt;/table&gt; Next, I'm trying to bind the grid to a Memory data store: var relationships = [ { id: 1, market: "SE", entity: "An object" }, { id: 2, market: "SE", entity: "Another object" }, { id: 3, market: "SE", entity: "Yet another object" } ]; var store = new Memory({ data: relationships }); var layout = [[ { 'name': 'ID', 'field': 'id', 'width': '10px' }, { 'name': 'Market', 'field': 'market', 'width': '30px' }, { 'name': 'Entity', 'field': 'entity', 'width': '100px' } ]]; this.relationshipsGrid.structure = layout; this.relationshipsGrid.store = store; this.relationshipsGrid.startup(); However, all I end up with is an empty, 0-height grid. If I explicitly set a height to it I just get an empty grayish area. There is a lot of Dojo markup rendered, but without any items from my store. I'm sure I'm overlooking something trivial (hopefully), but any help is greatly appreciated! :)
tagged with: dojox.grid.datagrid
answer count: 1
tagged with: javascript
score: 0
tagged with: dojox.grid
has title: Using Dojo Grid with a Memory store
has answer: http://stackoverflow.com/a/28491914
tagged with: dojo
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/45359336
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28521167
has text: I don't know. I have angular.min.js file on the same folder with myAppModule.js file

http://stackoverflow.com/comment/45428785
comment on: http://stackoverflow.com/q/28558389
score: 0
type: Comment
type: QuestionComment
has text: Use `e.preventDefault()` to avoid showing the default JS alert...

http://stackoverflow.com/q/28574742
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: facebook
upvote count: 1
has answer: http://stackoverflow.com/a/28574785
score: 1
type: Question
has body: I'm working on a facebook app with a secure canvas url. Is it possible to add login permissions without having to have the app approved? I need the permissions for development reasons, the app is still not available to public.
tagged with: javascript
has title: Facebook: Add Login Permissions for Development
downvote count: 0

http://stackoverflow.com/q/28493694
accepted answer: http://stackoverflow.com/a/28494244
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I have been created simple menu with single button from this link http://codepen.io/MrBambule/pen/jIseg Now i want to reduce the size of the button, So that i changed the code like this, .button { position: relative; width: 50px; height: 50px; border: 1px solid; border-radius: 50%; background: #2E3F47; z-index: 10; } .line { background: #ccc; width: 43px; height: 7px; margin: 5px auto; } .line__first { margin-top: 9px; } index.js: // function to trigger animation $('.button').click(function() { // check if the menu-items are hidden behind the button if ($('.menu__list').hasClass('hidden')) { // add class to make the menu-items drop down $('.item1').addClass('list--animation'); // the following items trigger the animation after a certain delay $('.item2').addClass('list--animation--delay1'); $('.item3').addClass('list--animation--delay2'); // remove the hidden class from the ul container to show that the items are not hidden anymore $('.menu__list').removeClass('hidden'); } else { // remove class to make the menu-items disappear $('.item1').removeClass('list--animation'); $('.item2').removeClass('list--animation--delay1'); $('.item3').removeClass('list--animation--delay2'); // add the hidden class to the ul container to show that the items are now hidden again $('.menu__list').addClass('hidden'); } }); So the button size reduced, but when i click the button, it shows the lists are not properly. Can anybody help me, how to solve this one, thanks in advance.
has title: Issues in animated menu with single click button in javascript
has comment: http://stackoverflow.com/comment/45307899
has comment: http://stackoverflow.com/comment/45307796
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28493888
has answer: http://stackoverflow.com/a/28494244
has answer: http://stackoverflow.com/a/28493888
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45476751
type: QuestionComment
has text: `$(#button).on('click', function(){...})`
score: 0
comment on: http://stackoverflow.com/q/28584711
type: Comment

http://stackoverflow.com/q/28443334
score: 0
has answer: http://stackoverflow.com/a/28444192
answer count: 1
has body: I have a back to top image that popups when the user scrolls beyond 280. The issue is when you reach the bottom the image is over links in the footer. So I want to change the position of the image once the user is about 90px from the very bottom of the page - I want "bottom": '35px' to be 95. The page height is always changing fyi. Code I have: function update() { if ($(window).scrollTop() &gt; 280) { $('#btt').animate({ "bottom": '35px' }, 300); } else { $('#btt').animate({ "bottom": '-80px' }, 300); } } setInterval(update, 500);
type: UnansweredQuestion
tagged with: scroll
tagged with: scrolltop
type: Question
has title: Change Image's Position based on scrollTop
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28450673
has comment: http://stackoverflow.com/comment/45229755
answer count: 0
type: UnansweredQuestion
upvote count: 1
has body: Here is my code: first second function openNewBackgroundTab(type) { debugger; var a = document.createElement("a"); switch (type) { case 'first': a.href = "http://localhost:25282/UpLoadFile.aspx/"; break; case 'second': a.href = "http://www.google.com/"; break; } var evt = document.createEvent('MouseEvents'); evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, true, false, false, false, 0, null); a.dispatchEvent(evt); } This code works perfectly for chrome and Opera for opening link in new tab while keep focusing on current tab,but not on Firefox and IE .Kindly guide me.I googled a lot but could not find solution.Any help is highly appreciated.Thanks.
score: 1
has comment: http://stackoverflow.com/comment/45229817
type: Question
has comment: http://stackoverflow.com/comment/45230725
tagged with: firefox
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has title: Open Link in New Tab Not Working in Firefox and IE
favorite count: 0

http://stackoverflow.com/comment/45388769
type: Comment
comment on: http://stackoverflow.com/q/28534840
type: QuestionComment
has text: did you make it works?
score: 0

parameters
tags question: http://stackoverflow.com/q/28590002
tags question: http://stackoverflow.com/q/28545236
tags question: http://stackoverflow.com/q/28545619
tags question: http://stackoverflow.com/q/28545455
type: Tag
tags question: http://stackoverflow.com/q/28457544
tag name: parameters
tags question: http://stackoverflow.com/q/28591827

http://stackoverflow.com/q/28478198
has comment: http://stackoverflow.com/comment/45279821
has answer: http://stackoverflow.com/a/28478673
tagged with: bookmarklet
has title: bookmarklet to add a parameter to the url and resubmit it?
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45279166
accepted answer: http://stackoverflow.com/a/28478673
type: AnsweredQuestion
upvote count: 3
type: Question
has body: Is the following possible with a bookmarklet? Add an additional parameter to the URL (include_docs=true) Re-submit the URL I have this but it fails silently on firefox. I haven't tried it with another browser: javascript:( function() { key = encodeURI('include_docs'); value = encodeURI('true'); var kvp = document.location.search.substr(1).split('&amp;'); var i=kvp.length; var x; while(i--) { x = kvp[i].split('='); if (x[0]==key) { x[1] = value; kvp[i] = x.join('='); break; } } if(i&lt;0) {kvp[kvp.length] = [key,value].join('=');} //this will reload the page, it's likely better to store this until finished document.location.search = kvp.join('&amp;'); }() );
score: 3

http://stackoverflow.com/comment/45953200
type: QuestionComment
comment on: http://stackoverflow.com/q/28437913
has text: so what is your question? how to compare the date?
type: Comment
score: 7

http://stackoverflow.com/q/28554268
tagged with: firefox-addon
answer count: 1
favorite count: 0
type: UnansweredQuestion
has title: iMacros script not looping correctly when added into a JS script
has answer: http://stackoverflow.com/a/29025263
tagged with: imacros
score: 1
tagged with: loops
has body: I have an iMacros script that loops correctly when run in isolation - reading through all rows of the input table - BUT does not loop at all when included in my JS script. Here is iMacros script that works independently when I set the "Repeat Macro" 'Max:' variable VERSION BUILD=8881205 RECORDER=FX TAB T=1 SET !DATASOURCE Org_Acc_DK.csv SET !DATASOURCE_COLUMNS 4 SET !LOOP 2 SET !DATASOURCE_LINE URL GOTO=http://SOME SITE HERE (replaced the name to protect the guilty) WAIT Seconds=3 TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:form1 ATTR=ID:MainContent_btnNewAcct TAG POS=1 TYPE=SELECT FORM=ID:form1 ATTR=ID:MainContent_ucAddOrganisationAccount_ddOrgList CONTENT= WAIT Seconds=3 TAG POS=1 TYPE=INPUT:TEXT FORM=ID:form1 ATTR=ID:MainContent_ucAddOrganisationAccount_txtOAAccount CONTENT= TAG POS=1 TYPE=SELECT FORM=ID:form1 ATTR=ID:MainContent_ucAddOrganisationAccount_ddlOACountry CONTENT=$** WAIT Seconds=5 TAG POS=1 TYPE=SELECT FORM=ID:form1 ATTR=ID:MainContent_ucAddOrganisationAccount_ddOALessor CONTENT=$** TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:form1 ATTR=ID:btnOASave WAIT Seconds=3 When I added that script to the following JS script - it only runs once then goes back to the JS script and completes. Now I realize it is because I did not set the "Repeat Macro" to the number of rows. BUT what do I need to add to the JAVA script to just set the repeat rows ONLY for this particular script and not those before or after it? var i, retcode; var report; var macrolist = new Array(); macrolist.push("Create Account/0 Login"); macrolist.push("Create Account/01 Create Organisation And Account.iim"); macrolist.push("Create Account - DK Loop.iim"); iimDisplay("Start Self Test"); report = "Self-Test Report\n\n"; for (i = 0; i &lt; macrolist.length; i++) { iimDisplay("Step "+(i+1)+" of "+macrolist.length + "\nMacro: "+macrolist[i]); retcode = iimPlay(macrolist[i]); report += macrolist[i]; if (retcode &lt; 0) { report += ": "+iimGetLastError(); } else { rep…
type: Question
upvote count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/28586613
tagged with: http://stackoverflow.com/tag/html
answer count: 0
type: UnansweredQuestion
has body: When using transitions to navigate between two pages in my jQuery Mobile application, I see a blank page between the two pages. This behavior occurs at least on the Slide transition, fade does not show this behavior. My page structure is like this: ... ... ... ... ... Note: jQuery Mobile wraps these divs into a global div automatically. I am calling the transition with the following link: Please note that I am running ASP.NET and the language is kind of dirty in combination with jQuery Mobile. I am running jQuery Mobile 1.4.5. After spending hours of trying I decided to ask here for a possible solution. Thanks in advance.
type: Question
has comment: http://stackoverflow.com/comment/45480671
tagged with: jquery-mobile
has title: Blank page between transitions jQuery Mobile
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45480517
score: 0

http://stackoverflow.com/comment/45281861
comment on: http://stackoverflow.com/a/28479755
type: Comment
type: AnswerComment
has text: What did you previously do? The answer is not helpful if you don't explain what your mistake was.
score: 0

http://stackoverflow.com/comment/45463139
has text: You are my lord and savior @devendra-soni
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28577125

http://stackoverflow.com/q/28589990
has answer: http://stackoverflow.com/a/28590270
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45486989
has body: To start with, I am trying to mimic a social engineering website. So far, so good, have I implemented the conversation system with PHP (with a touch of Jquery-Ajax). Anyway now for the messages window, where the messages of a specific conversation were to be loaded, I had the overflow:scroll property to that box because it was overflowing after a certain amount of messages. Now there's a scroll bar, Bravo! But I want my custom scroll bar. Preferably one that I make in PS. Is there a CSS solution to this? Something like 'scrollbar-image:url('custombar.png')" I know that most of you will suggest me to go make one in javascript. But I don't want to for the following reasons 1) I'm not good enough with that language and it would be a daunting process 2)Why reinvent the wheel when there already is a solution? See that scroll bar in facebook conversation's area? That gray sexy son of a lady-dog, I'm looking for something like that. Enlighten me?
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: -1
downvote count: 1
type: Question
has title: How do I have a custom scroll bar on a div (overflow:scroll)
tagged with: javascript
has comment: http://stackoverflow.com/comment/45486669

http://stackoverflow.com/q/28437413
score: 0
has comment: http://stackoverflow.com/comment/45245347
answer count: 0
has title: highstocks align ticks cross multiple charts
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45257678
has body: I'm trying to reinvent the wheel apparently >.> But issues I'm having is lining up the two axis, Any help with lining up the multiple charts would be appreciated, I'm drawing a blank. JSFiddle - http://jsfiddle.net/ah8p3581/1/ Please Follow Link - http://jsfiddle.net/ah8p3581/1/
has comment: http://stackoverflow.com/comment/45242384
type: Question
tagged with: charts
tagged with: highcharts
tagged with: javascript

http://stackoverflow.com/comment/45492950
comment on: http://stackoverflow.com/q/28592995
has text: My first guess is that the reason contains a `'` which needs to be escaped.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45262198
has text: If it is doable at all, it would be a security bug in chrome extensions to allow it.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28444337
score: 0

http://stackoverflow.com/comment/45228009
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28448607
type: QuestionComment
has text: Fixed that, but that did not cause the problem.

http://stackoverflow.com/q/28578712
tagged with: angularjs
has answer: http://stackoverflow.com/a/29039567
type: AnsweredQuestion
score: 3
has title: Googlebot and AngularJS websites
upvote count: 3
tagged with: google-index
type: Question
has body: I have a website developed in AngularJS 1.0.7. I´m getting crazy to start dealing with SEO. I have read many posts that say Google Crawlers are not able to index these Javascript based websites. And some other posts that say Google is indexing this sites without problems some time ago, such as this http://ng-learn.org/2014/05/SEO-Google-crawl-JavaScript/. The point is in Google Webmaster Tools I see 0 indexed pages and if I run in tracking menu, explore as Google (I don´t know exactly the name in english, I have it in spanish) I get the next code: &lt;!doctype html&gt; &lt;html lang="en" ng-app="myApp"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;{{'YANPY_META_TITLE' | translate}}&lt;/title&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt; &lt;meta name="google-site-verification" content="U26PrLYE8BjI3scjdk3oTIUR0qK7FVS7XAFByhxwuP8" /&gt; &lt;meta name="author" content="Veepo Travel &amp; Technology Services S.L."&gt; &lt;meta name="description" content="{{'YANPY_META_DESCRIPTION' | translate}}"&gt; &lt;meta name="keywords" content="{{'YANPY_META_KEYWORDS' | translate}}"&gt; &lt;meta property="og:title" content="{{'YANPY_META_TITLE' | translate}}"&gt; &lt;meta property="og:url" content="http://www.yanpy.com"&gt; &lt;meta property="og:description" content="{{'YANPY_META_DESCRIPTION' | translate}}"&gt; &lt;meta property="og:site_name" content="Yanpy"&gt; &lt;meta property="og:type" content="website"&gt; &lt;meta property="og:image" content="http://www.yanpy.com/img/logo.png"&gt; &lt;meta itemprop="name" content="{{'YANPY_META_TITLE' | translate}}"&gt; &lt;meta itemprop="description" content="{{'YANPY_META_DESCRIPTION' | translate}}"&gt; &lt;meta itemprop="image" content="http://www.yanpy.com/img/logo.png"&gt; &lt;!-- css --&gt; &lt;!-- HTML5 shim, for IE6-8 support of HTML5 elements --&gt; &lt;!--[if lt IE 9]&gt; &lt;script src="../assets/js/html5shiv.js"&gt;&lt;/script&gt; &lt;![endif]--&gt; &lt;!-- Fav and touch icons --&…
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45467766
accepted answer: http://stackoverflow.com/a/29039567
tagged with: seo
favorite count: 0
has comment: http://stackoverflow.com/comment/45466237

http://stackoverflow.com/comment/45265701
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/70760/discussion-between-arun-p-johny-and-rob-m).
comment on: http://stackoverflow.com/a/28470346
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45234281
comment on: http://stackoverflow.com/q/28453532
score: 0
type: Comment
type: QuestionComment
has text: obviously.. you need to add another path like `.when("/home", { templateUrl: "views/home.html" })` and point it in your `$location.path('/home')`

http://stackoverflow.com/q/28520756
tagged with: asp.net
has comment: http://stackoverflow.com/comment/45358594
has comment: http://stackoverflow.com/comment/45361968
has comment: http://stackoverflow.com/comment/45358471
answer count: 0
linked to: http://stackoverflow.com/q/857834
has title: Get the ID's of the html textboxes made by javascript using c#
type: UnansweredQuestion
type: Question
tagged with: c#
has body: so far i am successful making multiple html texboxes dynamically using a c# button but now i want to get the id's of those textboxes in codebehind(c#) in order to get their data and save it in the database. if i get a hint to get id's of textboxes then insertion in database is easy. javascript code: &lt;script type="text/javascript"&gt; var counter = 0; function AddFileUpload() { var div = document.createElement('DIV'); div.innerHTML = 'File Name: &lt;input id="_txtFileName' + counter + '" type="text" /&gt;' + 'File Path: &lt;input id="_txtFilePath' + counter + '" type="text" /&gt;' + '&lt;input id="FileUpload' + counter + '" name = "FileUpload' + counter + '" type="file" /&gt;' + '&lt;input id="Button' + counter + '" type="button" value="Remove" onclick = "RemoveFileUpload(this)" /&gt;'; document.getElementById("FileUploadContainer").appendChild(div); counter++; } function RemoveFileUpload(div) { document.getElementById("FileUploadContainer").removeChild(div.parentNode); } &lt;/script&gt;
has comment: http://stackoverflow.com/comment/45410221
score: 0
has comment: http://stackoverflow.com/comment/45358712
has comment: http://stackoverflow.com/comment/45359419
tagged with: javascript

http://stackoverflow.com/q/28583420
has comment: http://stackoverflow.com/comment/45474852
has title: How to hide button when second is pressed and how to make it appear when i click on empty area of page?
has answer: http://stackoverflow.com/a/28583961
type: AnsweredQuestion
has body: I have 2 fields email & password. Also I have 2 buttons Sing in & Sing up. I want "Sing up" button to be hidden when "Sing in" is clicked and vice versa ("Sing in" button to be hidden when "Sing up" is clicked). I tried onmousedown and focus, but then it didn't let me to fill these fields. Here's a fiddle: Demo Sign in Sign up
tagged with: hide
accepted answer: http://stackoverflow.com/a/28583961
tagged with: mouseevent
type: Question
has comment: http://stackoverflow.com/comment/45474392
tagged with: javascript
tagged with: show
tagged with: jquery
has comment: http://stackoverflow.com/comment/45474571
has comment: http://stackoverflow.com/comment/45475064
has comment: http://stackoverflow.com/comment/45474723
score: 0
has comment: http://stackoverflow.com/comment/45474361
answer count: 1
has comment: http://stackoverflow.com/comment/45475155

http://stackoverflow.com/comment/45262992
type: AnswerComment
score: 0
type: Comment
has text: tried this but didn't work. also, the newPocs div exists in the page, but the NumberTypeId element doesn't
comment on: http://stackoverflow.com/a/28467989

arrays
tags question: http://stackoverflow.com/q/28506916
tags question: http://stackoverflow.com/q/28482593
tags question: http://stackoverflow.com/q/28484995
tags question: http://stackoverflow.com/q/28463629
tags question: http://stackoverflow.com/q/28530239
tags question: http://stackoverflow.com/q/28484035
tags question: http://stackoverflow.com/q/28548335
tags question: http://stackoverflow.com/q/28577241
tags question: http://stackoverflow.com/q/28467744
type: Tag
tags question: http://stackoverflow.com/q/28575838
tags question: http://stackoverflow.com/q/28582543
tags question: http://stackoverflow.com/q/28536083
tags question: http://stackoverflow.com/q/28458424
tags question: http://stackoverflow.com/q/28531737
tags question: http://stackoverflow.com/q/28547370
tags question: http://stackoverflow.com/q/28588494
tags question: http://stackoverflow.com/q/28500727
tags question: http://stackoverflow.com/q/28567568
tags question: http://stackoverflow.com/q/28560801
tags question: http://stackoverflow.com/q/28495518
tags question: http://stackoverflow.com/q/28573631
tags question: http://stackoverflow.com/q/28587167
tags question: http://stackoverflow.com/q/28517594
tags question: http://stackoverflow.com/q/28458215
tags question: http://stackoverflow.com/q/28474049
tags question: http://stackoverflow.com/q/28562866
tags question: http://stackoverflow.com/q/28438193
tags question: http://stackoverflow.com/q/28518885
tags question: http://stackoverflow.com/q/28514113
tags question: http://stackoverflow.com/q/28441287
tags question: http://stackoverflow.com/q/28531406
tags question: http://stackoverflow.com/q/28464261
tags question: http://stackoverflow.com/q/28518587
tags question: http://stackoverflow.com/q/28577532
tags question: http://stackoverflow.com/q/28471661
tags question: http://stackoverflow.com/q/28502601
tags question: http://stackoverflow.com/q/28589276
tags question: http://stackoverflow.com/q/28451065
tags question: http://stackoverflow.com/q/28530661
tags question: http://stackoverflow.com/q/28459672
tags question: http://stackoverflow.com/q/28495287
tags question: http://stackoverflow.com/q/28528382
tags question: http://stackoverflow.com/q/28547436
tags question: http://stackoverflow.com/q/28498763
tags question: http://stackoverflow.com/q/28474754
tags question: http://stackoverflow.com/q/28522118
tags question: http://stackoverflow.com/q/28472054
tags question: http://stackoverflow.com/q/28587604
tags question: http://stackoverflow.com/q/28569485
tags question: http://stackoverflow.com/q/28483152
tags question: http://stackoverflow.com/q/28447688
tags question: http://stackoverflow.com/q/28526118
tags question: http://stackoverflow.com/q/28517886
tags question: http://stackoverflow.com/q/28493610
tags question: http://stackoverflow.com/q/28441347
tags question: http://stackoverflow.com/q/28485541
tags question: http://stackoverflow.com/q/28483562
tags question: http://stackoverflow.com/q/28585428
tags question: http://stackoverflow.com/q/28546181
tags question: http://stackoverflow.com/q/28465535
tags question: http://stackoverflow.com/q/28536375
tags question: http://stackoverflow.com/q/28559587
tags question: http://stackoverflow.com/q/28454998
tags question: http://stackoverflow.com/q/28556904
tags question: http://stackoverflow.com/q/28559272
tags question: http://stackoverflow.com/q/28445098
tags question: http://stackoverflow.com/q/28564915
tags question: http://stackoverflow.com/q/28468583
tags question: http://stackoverflow.com/q/28469479
tags question: http://stackoverflow.com/q/28450438
tags question: http://stackoverflow.com/q/28560602
tags question: http://stackoverflow.com/q/28593152
tags question: http://stackoverflow.com/q/28437693
tags question: http://stackoverflow.com/q/28437672
tags question: http://stackoverflow.com/q/28494415
tags question: http://stackoverflow.com/q/28467266
tags question: http://stackoverflow.com/q/28469279
tags question: http://stackoverflow.com/q/28574179
tags question: http://stackoverflow.com/q/28511328

http://stackoverflow.com/a/28567835
score: 2
answers question: http://stackoverflow.com/q/28567307
downvote count: 0
has body: Moving a row over is pretty easy. In your click even for your Add link you need to create a copy of the row that was clicked. var tr = $(this).closest('tr').clone(); This duplicates the clicked row and with our next line we move it to the second table. $('.tbl-two').append(tr); Example As for sessions you'll need to at least store the Part ID into a variable. If the variable doesn't exist in a session, create it, if it does exist append the Part ID to the end of the variable with a delimiter such as ,. However creating a 'shopping cart' table is a bit more complicated than copying a row over.
upvote count: 2
type: Answer

http://stackoverflow.com/comment/45333435
has text: @pQuestions123: Ah, okay. Sorry
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28506174

list
tags question: http://stackoverflow.com/q/28514922
type: Tag
tags question: http://stackoverflow.com/q/28562007
tag name: list
tags question: http://stackoverflow.com/q/28575132
tags question: http://stackoverflow.com/q/28475090
tags question: http://stackoverflow.com/q/28457812
tags question: http://stackoverflow.com/q/28506978
tags question: http://stackoverflow.com/q/28571767

http://stackoverflow.com/a/69818593
score: 1
has body: Sorry if my message is irrelevant to this exact case, but once I searched for &quot;CSS skew in pixels&quot; and although neither this question is about what I tried to find (provide the exact width in px to skew), nor the accepted answer solves my problem, I still believe this can help someone someday. As we know, transform: skew() receives only angles as a parameter. In order to get the exact width when the angle is unknown, one should calculate the angle using arctangent. Luckily, JavaScript 1.0 Math provides atan2() method to return the arctangent (in radians) by given X and Y coordinates. Thus, calculating the skew angle has the solution on JS. The example below draws diagonal lines (via border-bottom/border-left) based on the dimensions of the underlying elements. let prevY = null; document.querySelectorAll('.a').forEach(el =&gt; { const top = el.style.top; const left = el.style.left; const width = el.style.width; const height = el.style.height; const xEl = document.querySelector('#x' + el.id.substr(1)); xEl.style.top = top; xEl.style.left = left; xEl.style.width = width; xEl.style.height = height; applySkew(el); }); window.addEventListener('resize', function(e) { prevY = null; document.querySelectorAll('.a').forEach(el =&gt; { applySkew(el); }); }); function applySkew(el) { const xEl = document.querySelector('#x' + el.id.substr(1)); const top = el.style.top; const w = el.offsetWidth; const h = el.offsetHeight; const directionUp = prevY &amp;&amp; prevY != top; prevY = top; if(w &lt; h) { xEl.style.borderBottom = 'none'; xEl.style.borderLeft = 'black 1px solid'; xEl.style.transform = 'skewX(' + Math.atan2((directionUp ? -1 : 1) * w, h) + 'rad) translateX(' + (w / 2) + 'px)'; } else { xEl.style.borderLeft = 'none'; xEl.style.borderBottom = 'black 1px solid'; xEl.style.transform = 'skewY(' + Math.atan2((directionUp ? -1 : 1) * h, w) + 'rad) translateY(-' + (h / 2) + 'px)'; } } html, body { margin: 0; height: 100%; } body &gt; div { margin: 5% 0 0 5%; background:…
answers question: http://stackoverflow.com/q/28543489
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/q/28519630
tagged with: arrays
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28519693
favorite count: 0
has comment: http://stackoverflow.com/comment/45356152
has comment: http://stackoverflow.com/comment/45356164
accepted answer: http://stackoverflow.com/a/28519712
possible better answer: http://stackoverflow.com/a/28519693
tagged with: regex
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45356163
has title: Compare 2 arrays and if match return 1
linked to: http://stackoverflow.com/q/16312528
has comment: http://stackoverflow.com/comment/45356214
type: Question
duplicate of: http://stackoverflow.com/q/16312528
has comment: http://stackoverflow.com/comment/45356160
downvote count: 5
has answer: http://stackoverflow.com/a/28519712
has comment: http://stackoverflow.com/comment/45356192
answer count: 2
has body: When i console two arrays below is how it look aa= [0: "349",1: "810",2: "863",3: "657",4: "602",5: "317",6: "665",7: "865",8: "624",9: "805",10: "887",11: "659"]; bb=[0: "349", 1: ""]; cc=find_flight(aa,bb); in both arrays 349 is matching, once match it should return 1. Below is how i tried function find_flight(aa,bb) { if(a2.toString() == a1.toString()) { return true; } } console.log(aa+'-'+bb); Output: 349,810,863,657,602,317,665,865,624,805,887,659-349, Its not matching can any one give solution !!!!
upvote count: 0
score: -5

rtmp
tag name: rtmp
tags question: http://stackoverflow.com/q/28574453
type: Tag

http://stackoverflow.com/a/28575927
has body: ([^{]*?)\s*(\{.*\}) Simply use this and grab group 1 and group 2.See demo. https://regex101.com/r/zB3hI5/13 var re = /([^{]*?)\s*(\{.*\})/gm; var str = 'parameter parameter2 {characters}\n\n\n'; var m; while ((m = re.exec(str)) != null) { if (m.index === re.lastIndex) { re.lastIndex++; } // View your result using the m-variable. // eg m[0] etc. }
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28575510
type: Answer
accepted answer of: http://stackoverflow.com/q/28575510

http://stackoverflow.com/q/28526879
has title: How to reload the page only when window width changes from desktop (>1024px) to mobile (<1025px) navigation?
tagged with: javascript
tagged with: resize
has answer: http://stackoverflow.com/a/28526960
score: 0
answer count: 1
type: UnansweredQuestion
has body: I have a mobile navigation only running below 1025px. My problem is when a desktop browser is resized (or an orientation change on bigger tablets happend) from over 1024 to below it does not activate the script any more. I have tried with reload on resize, but this is not ideal because it reloads on every resize. Here's my code: &lt;script&gt; $(window).bind('resize', function(e) { if (window.RT) clearTimeout(window.RT); window.RT = setTimeout(function() { this.location.reload(false); }, 100); }); if (document.documentElement.clientWidth &lt;= 1024) { // Initialize mobile nav } &lt;/script&gt; Thanks!
linked to: http://stackoverflow.com/q/9720294
has comment: http://stackoverflow.com/comment/45369506
tagged with: reload
has comment: http://stackoverflow.com/comment/45369499
type: Question

http://stackoverflow.com/q/28465868
tagged with: promise
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45257569
tagged with: node.js
has comment: http://stackoverflow.com/comment/45257695
tagged with: bluebird
has body: I’m introducing promises using the Bluebird library to my Javascript code, as they seem to be the closest available thing to the flow control combinators I’m used to in Haskell. The following Gulp task works for me: gulp.task('upload', function(callback) { configAWSFromFile(); var functionName = 'redacted', Lambda = new AWS.Lambda(); Promise.promisifyAll(Object.getPrototypeOf(Lambda)); function uploadLambdaFn(lambdaFn, fileStream) { var params = { FunctionName: functionName, Handler: lambdaFn.Configuration.Handler, // snip FunctionZip: fileStream }; return Lambda.uploadFunctionAsync(params); } return Promise.join(Lambda.getFunctionAsync({FunctionName: functionName}), fs.readFileAsync(path.join(destPrefix, uploadPackage)), uploadLambdaFn) .then(function(response) { gutil.log('Response:\n' + util.inspect(response)); }); }); However, when I try to refactor the upload step out of the config object creation function, it breaks down: gulp.task('upload', function(callback) { configAWSFromFile(); var functionName = 'redacted', Lambda = new AWS.Lambda(); Promise.promisifyAll(Object.getPrototypeOf(Lambda)); // rename function function mkLambdaFnConfig(lambdaFn, fileStream) { var params = { FunctionName: functionName, Handler: lambdaFn.Configuration.Handler, // snip FunctionZip: fileStream }; return params; // return immediate value } return Promise.join(Lambda.getFunctionAsync({FunctionName: functionName}), fs.readFileAsync(path.join(destPrefix, uploadPackage)), Promise.method(mkLambdaFnConfig)) // wrap regular function .then(Lambda.uploadFunctionAsync) // add the upload to the chain .then(function(response) { gutil.log('Response:\n' + util.inspect(response)); }); }); Gives the following stack trace (paths have been edited to be relative): TypeError: undefined is not a function at svc.(anonymous function) (./node_modules/aws-sdk/lib/service.js:399:21) at tryCatcher (./node_modules/bluebird/js/main/util.js:24:31) at ret (eval at &lt;anonymous&gt; (./node_modules/bluebird/js/ma…
type: Question
has answer: http://stackoverflow.com/a/28465984
tagged with: javascript
has comment: http://stackoverflow.com/comment/45273794
linked to: http://stackoverflow.com/q/27149034
score: 0
has comment: http://stackoverflow.com/comment/45293189
answer count: 1
has comment: http://stackoverflow.com/comment/45294438
has title: Why aren’t these Bluebird promise chains equivalent?

http://stackoverflow.com/comment/45451729
type: QuestionComment
comment on: http://stackoverflow.com/q/28570661
score: 3
has text: I don't think it's a silly question, nor do I agree with the votes to close. It is broad, but not overly broad that a simple (technical) answer can't cover it.
type: Comment

http://stackoverflow.com/a/47455993
has body: Same issue happen to me. I have data from service and save to another variable. When ever I update my array the copied array also updated. old code is like below //$scope.MyData get from service $scope.MyDataOriginal = $scope.MyData; So when ever I change $scope.MyData also change $scope.MyDataOriginal. I found a solution that angular.copy right code as below $scope.MyDataOriginal = angular.copy($scope.MyData);
score: 0
answers question: http://stackoverflow.com/q/28482593
type: Answer

http://stackoverflow.com/a/28550323
score: 1
type: Answer
answers question: http://stackoverflow.com/q/28549210
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28549210
has body: I took a look at their homepage and downloaded the basic package. I found a file called content.css in the package folder, img.right { border: 1px solid #ccc; float: right; margin-left: 15px; padding: 5px; } img.left { border: 1px solid #ccc; float: left; margin-right: 15px; padding: 5px; } And if you look at the source code of the content snippet on their demo, Apollo 11 The image has a class called right, which is defined in content.css, and therefore it is floating to the right. I think your problem is that the css file in not present/found in your project. Maybe you can try to download the package and see if it works locally, so you can make sure that the problem is caused by the CDN and the missing file. Just in case, I download the package here (no advertisements intended) http://ckeditor.com/download
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45242988
has text: Thank @Cayce K, your code is short and dynamic,I just tested and it's working,so easily if I add anothers checkbox input,:thumb Up: :D
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28457864
type: Comment

http://stackoverflow.com/a/28465847
answers question: http://stackoverflow.com/q/28465157
has body: first your question is ambiguous, simply use $.getJSON() in templates object
score: 0
type: Answer

http://stackoverflow.com/q/28473736
accepted answer: http://stackoverflow.com/a/28624327
has body: I am using groupBy from angular-filter to group an array of objects by their date property. &lt;div ng-repeat="(day, dayEvents) in events | groupBy: 'date' )"&gt; &lt;h3&gt;&lt;/h3&gt; &lt;/div&gt; Which produces the following: Feb 9, 2015 Feb 10, 2015 Feb 11, 2015 Feb 12, 2015 How can I reverse the order to start from the most recent date? When I print to the console the array is printed with the order I want: Object { 1423699200000: Array[1], 1423612800000: Array[7], 1423526400000: Array[11], 1423440000000: Array[1] } I also wrote a custom filter to reverse the order after the groupBy: .filter("reverseOrder", function() { function sortNumber(a,b) { return parseInt(b) - parseInt(a); } return function(collection) { var keys = Object.keys(collection).sort(sortNumber); var reveredCollection= {}; var length=collection.length; angular.forEach(keys, function(key) { reveredCollection[key] = collection[key]; }); return reveredCollection; } }) Which I have applied like this: &lt;div ng-repeat="(day, dayEvents) in events | groupBy: 'date' | reverseOrder )"&gt; &lt;h3&gt;&lt;/h3&gt; &lt;/div&gt;
type: Question
has answer: http://stackoverflow.com/a/70359310
has answer: http://stackoverflow.com/a/28474059
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/30866092
tagged with: angularjs-filter
downvote count: 0
has answer: http://stackoverflow.com/a/38645339
favorite count: 0
has answer: http://stackoverflow.com/a/28579605
tagged with: angularjs
linked to: http://stackoverflow.com/q/15266671
score: 11
upvote count: 11
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/38645339
has answer: http://stackoverflow.com/a/28624327
has title: Angularjs groupBy + orderBy

http://stackoverflow.com/comment/45298728
comment on: http://stackoverflow.com/q/28488497
score: 0
type: Comment
type: QuestionComment
has text: do I have to pass $state as an argument into my SignUpPageCtrl controller?

http://stackoverflow.com/q/28482754
has answer: http://stackoverflow.com/a/28482797
tagged with: javascript
has comment: http://stackoverflow.com/comment/45292142
downvote count: 6
has comment: http://stackoverflow.com/comment/45287560
linked to: http://stackoverflow.com/q/18741177
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/45287763
favorite count: 0
has comment: http://stackoverflow.com/comment/45287690
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45292071
has answer: http://stackoverflow.com/a/28482931
has answer: http://stackoverflow.com/a/28482902
has body: My code: if (calculatedColumn5 &gt;= calculatedColumn) { 'Enough credits.' } { 'Not enough credits.' } Evaluates to 'Not enough credits' even when 'calculatedColumn5' is clearly greater than 'calculatedColumn'. I even tried this: if (calculatedColumn5 &gt;= calculatedColumn) { 'Enough credits.' } else if (calculatedColumn5 &lt; calculatedColumn) { 'Not enough credits.' } else { '' } ...and it always evaluates to ''! So is there a problem with my "if" conditions where they simply always evaluate to false? The variables by the way (calculatedColumn5 and calculatedColumn) are both decimal values.
score: -5
has comment: http://stackoverflow.com/comment/45287695
has comment: http://stackoverflow.com/comment/45288128
type: Question
has comment: http://stackoverflow.com/comment/45312024
has title: Why does my JS "if" statement always evaluate to false?
tagged with: if-statement
tagged with: comparison-operators

http://stackoverflow.com/a/28454933
accepted answer of: http://stackoverflow.com/q/28454605
type: Answer
upvote count: 2
score: 2
type: AcceptedAnswer
downvote count: 0
has body: You can do the above operation easily using selector, so you dont require a counter variable. //function to call when local checkbox is clicked $(".grid").on("click", ".chkLst", function() { callUpdateClassFunction(); }); //function to call when global checkbox is clicked $(".grid").on("click", ".chkLstAll", function() { $(".chkLst").prop('checked',this.checked); callUpdateClassFunction(); }); //function to update class function callUpdateClassFunction(){ if($(".chkLst:checked").length &gt; 0){ $('#btnDeleteLst').addClass("btnDisable"); } else{ $('#btnDeleteLst').removeClass("btnDisable"); } }
answers question: http://stackoverflow.com/q/28454605

http://stackoverflow.com/a/28518932
has comment: http://stackoverflow.com/comment/45365320
has comment: http://stackoverflow.com/comment/45422668
has comment: http://stackoverflow.com/comment/45364513
has comment: http://stackoverflow.com/comment/45364424
answers question: http://stackoverflow.com/q/28517417
type: Answer
has comment: http://stackoverflow.com/comment/137518695
downvote count: 0
has comment: http://stackoverflow.com/comment/45364348
score: 6
has body: Web-components, being used through HTML imports, encapsulate both Shadow DOM HTML and related script. To narrow the terminology, let’s consider we have a Polymer component core-ajax. Here is the code. As you might see, it does not provide any HTML markup at all, encapsulating the script only. Once imported on the host webpage as: &lt;link rel="import" href="https://www.polymer-project.org/components/core-ajax/core-ajax.html"&gt; this component provides an ability to perform AJAX calls without any javascript coding: &lt;core-ajax auto url="http://gdata.youtube.com/feeds/api/videos/" params='{"alt":"json", "q":"chrome"}' handleAs="json" response='{{response}}' &lt;/core-ajax&gt; The above will load (since auto attribute is set) the content of the specified URL and put the response into bound response variable. Another way to communicate with this component is to supply handler instead of binding template variable to response: - response='{{response}}' + on-core-response="{{handleResponse}}" One might implement handleResponse function in the page’s javascript and that’s it. UPD Although currently there is no ability to distinguish main document and one used by shadow DOM, this feature is being discussed for almost three years in w3c mailgroups. The discussion is far from conclusion, though, even in aspects like “whether we never entirely enable them in author space.”
upvote count: 6

storage
tag name: storage
tags question: http://stackoverflow.com/q/28529189
type: Tag
tags question: http://stackoverflow.com/q/28443098

http://stackoverflow.com/a/28558542
type: Answer
accepted answer of: http://stackoverflow.com/q/28558326
has comment: http://stackoverflow.com/comment/45429022
answers question: http://stackoverflow.com/q/28558326
has comment: http://stackoverflow.com/comment/45429164
downvote count: 0
has body: Create array of values; Check array for duplicated values. For example: var bk1 = document.getElementById("block1").value; var bk2 = document.getElementById("block2").value; var bk3 = document.getElementById("block3").value; var bk4 = document.getElementById("block4").value; var bk5 = document.getElementById("block5").value; var test = [bk1, bk2, bk3, bk4, bk5]; var res = true; for(var i = 0; i &lt; test.length; i++) { if (test.indexOf(test[i], i + 1) &gt;= 0) { res = false; break; } } if(res){ alert("yes"); document.block_form.submit(); }else{ alert("wrong"); document.getElementById("block_error").value = "Multiple blocks have same selected option"; }
has comment: http://stackoverflow.com/comment/45429279
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/45397699
score: 1
has text: @Taerus It doesn't show because you have duplicates in array so you need to track items by `$index`.
comment on: http://stackoverflow.com/q/28541961
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28507414
downvote count: 0
has body: Using JMeter, I am trying to get a specific value from an entire HTML response page and store it as a variable. The problem is that the value I need extracted is on the 3rd line of HTML code with the identifier on the 1st line. Total 1,068.00 I am needing to extract the "1,068.00" out of the last line, but still need to match "Total" from the first line.
favorite count: 0
accepted answer: http://stackoverflow.com/a/28507752
tagged with: http://stackoverflow.com/tag/html
tagged with: regex
type: AnsweredQuestion
score: 3
tagged with: jmeter
upvote count: 3
has answer: http://stackoverflow.com/a/28507752
type: Question
tagged with: javascript
has title: JMeter - regular expression extractor - multiple lines of html
answer count: 1

http://stackoverflow.com/comment/45296060
score: 0
comment on: http://stackoverflow.com/a/28484659
type: Comment
type: AnswerComment
has text: If I use this technique, how can I cause my previous page to also have an animation? If I use Template.priorities.destroyed (my previous view), it won't run animations because these are callbacks after the view is removed.

http://stackoverflow.com/comment/45217772
type: AnswerComment
score: 0
has text: Are you using the "Controller as" notation in your app?
type: Comment
comment on: http://stackoverflow.com/a/28443912

http://stackoverflow.com/a/28476407
type: Answer
has body: Find property by its value in loop and use delete operator: for (var key in arr) { if (arr[key] === "bar") { delete arr[key]; break; } } Check the demo. var arr = {}; arr[1234] = 'foo'; arr[2345] = 'bar'; arr[6253] = 'cho'; for (var key in arr) { if (arr[key] === "bar") { delete arr[key]; break; } } document.write(JSON.stringify(arr, null, 4));
upvote count: 1
downvote count: 1
accepted answer of: http://stackoverflow.com/q/28476313
answers question: http://stackoverflow.com/q/28476313
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/45435166
type: Comment
has text: thanks this is a great help. My final question - is it possible to define any global variable. for example global $hompg = true; I assume global would mean the variable can be accessed from other scripts.. Many thanks
type: AnswerComment
comment on: http://stackoverflow.com/a/28561354
score: 0

http://stackoverflow.com/comment/45251032
comment on: http://stackoverflow.com/a/28460038
type: AnswerComment
type: Comment
score: 1
has text: Presumably the game will create a request to the server, to record your score. Change the variable before that happens, and it will send your modified variable.

http://stackoverflow.com/comment/45300982
comment on: http://stackoverflow.com/q/28440676
score: 0
type: Comment
type: QuestionComment
has text: All I can tell you is that you have triggered Segmentation Fault in Safari. Your crash logs suggests it may be JavaScript causing it. Without the code that triggers it, it's impossible to figure out what is crashing it, but it's definitely a bug in Safari.

http://stackoverflow.com/comment/45433102
has text: also after going though that slide deck, it seems I'm using something much closer to the module stub pattern, and always use .call and .apply to carefully control context in the public obj literal. But I'd love more input regarding why to use / not to use this pattern.
type: Comment
comment on: http://stackoverflow.com/q/28560272
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45486193
score: 0
has text: What is the purpose of the line `$("#...").prepend('@Html.HiddenFor(model =>`?, you are prepending the server side code to DOM, which is of no use. No were it will be processed. What are you trying to achieve at first place?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28589267

http://stackoverflow.com/q/28574949
possible better answer: http://stackoverflow.com/a/28574988
answer count: 2
has answer: http://stackoverflow.com/a/28574988
upvote count: 1
has body: I want to use jQuery to add a number to the end of a navigation menu list item. This is the number of products on another page. Currently a single list item looks something like this: New In However I want to add the number of items directly after 'New' for example 'New (20)'. This number is located on items href, in the following place on that page: 174 Each list item has a different href but the same class which contains the unique number that I need. Any ideas? I have tried: $("#ui-id-12 > .ui-accordion > li:eq(0) > a:eq(0)").replaceWith('New In ' + $(this).load("http://m.example.com/shop/clothing/new-in.html .itemcount") + '');
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28575042
downvote count: 0
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/45461382
tagged with: jquery
favorite count: 0
has title: Jquery add HTML from another page
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45459250
accepted answer: http://stackoverflow.com/a/28575042

http://stackoverflow.com/comment/45296579
comment on: http://stackoverflow.com/q/28486082
type: QuestionComment
has text: Please modify your post and add code for trigger('click'); Currently it is not clear where you call it. Also either check CancellationReason or share it too as it might be the reason of the issue.
type: Comment
score: 0

http://stackoverflow.com/comment/45381416
type: QuestionComment
comment on: http://stackoverflow.com/q/28533305
has text: I am trying to call the change event on keyup event. the keyup event is never raised.
score: 0
type: Comment

http://stackoverflow.com/a/28566924
answers question: http://stackoverflow.com/q/28566721
has comment: http://stackoverflow.com/comment/45444434
has comment: http://stackoverflow.com/comment/45444652
has comment: http://stackoverflow.com/comment/45444579
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45444194
upvote count: 2
has body: this is a classic problem in angular. Its because you are using ng-if which is creating a child scope. you need to set your model to someObject.size and change all references to that. And then in the controller put $scope.someObject = {};
has comment: http://stackoverflow.com/comment/45444072
has comment: http://stackoverflow.com/comment/45444641
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28566721
type: Answer

http://stackoverflow.com/comment/69453258
score: 0
has text: Possible duplicate of [Javascript callback for knowing when an image is loaded](http://stackoverflow.com/questions/280049/javascript-callback-for-knowing-when-an-image-is-loaded)
comment on: http://stackoverflow.com/q/28542627
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45474783
has text: There is a little moment. Check my answer. It didn't work in your case because variable `x` is not defined. If it has been defined like `var x`, you can check if it's `undefined` with `=== undefined`.
type: AnswerComment
comment on: http://stackoverflow.com/a/28583634
type: Comment
score: 1

http://stackoverflow.com/q/28470814
type: UnansweredQuestion
has body: // set a cookie to requested locale var setLanguage = function(req, res, next) { if (req.params.locale === undefined) { req.params.locale = 'pt'; res.cookie('locale', 'pt'); } else { req.params.locale = req.params.locale; res.cookie('locale', req.params.locale); } setTimeout(function() { next(); }, 2000); }; app.get('/:locale?', setLanguage, function (req, res) { console.log(req.cookies.locale); res.render('index'); }); I made this custom middleware to load the language depending on the req.params.locale, the renderization is ok, but there is a problem with this code and i don't know exactly what is. When i try to access for example: /, will work the pt, because is the default.. but when i try to access /en after that, the pt will render, but if i try to access the english after that, will work normally. I don't know why is that, someone knows???? UPDATE - I am using morgan to debug and i put a console.log here: app.get('/:locale?', setLanguage, function (req, res) { console.log(req.cookies.locale); res.render('index'); }); When i try access the /: pt GET / 304 28.069 ms - - After that, if i try access /en: GET / 200 21.543 ms - 153 pt GET /en 304 8.730 ms - - pt GET /en 200 2.612 ms - 153 Now, i am going back to /pt: GET /en 200 2.612 ms - 153 en GET /pt 200 3.984 ms - 159 en GET /pt 200 2.498 ms - 159 Anyone knows what is causing that? UPDATE -- I am using this module. And the code to make it work is: app.get('/', function (req, res) { res.render('index'); }); // set a cookie to requested locale app.get('/:locale', function (req, res) { res.cookie('locale', req.params.locale); res.redirect('/'); }); This is an stupid way of change the language, because i am going to repeat my self in every route that receives a locale parameter, so i am trying to use middleware: Middleware: function setLanguage (req, res, next) { req.params.locale = req.params.locale || 'pt'; res.cookie('locale', req.params.locale); next(); } Them i can call this middleware in every route that i w…
has title: Middleware req.params not pulling the right value
type: Question
has answer: http://stackoverflow.com/a/28471199
answer count: 1
tagged with: javascript
tagged with: express
score: 0
tagged with: node.js

http://stackoverflow.com/a/28511482
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28511383
type: Answer
has comment: http://stackoverflow.com/comment/45341818
has comment: http://stackoverflow.com/comment/45341800
has body: There seems to be a lot wrong with your snippet. For one, your submit/add button is not bound to an event listener or anything so it's not doing anything that you'd want (like adding an item to the property on your controller's $scope). Check out the Todo example on Angular's official website, it's more up to date. https://angularjs.org/ (scroll down). Here's the video for it: https://www.youtube.com/watch?v=WuiHuZq_cg4
score: 0
accepted answer of: http://stackoverflow.com/q/28511383
has comment: http://stackoverflow.com/comment/45341741

http://stackoverflow.com/comment/45303684
comment on: http://stackoverflow.com/q/28491401
has text: Did the second thing you tried not work, with the timeout?
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/28554217
answers question: http://stackoverflow.com/q/28554151
has body: This should do the trick: /room=(\w+)&amp;?/ /* find "room=" then match any word characters (at least one) until you possibly hit "&amp;" */ Example: /room=(\w+)&amp;?/.test("?room=any_characters123") // =&gt; true "?room=any_characters123".match(/room=(\w+)&amp;?/) // =&gt; ["room=any_characters123", "any_characters123"]
type: Answer
score: 0

http://stackoverflow.com/comment/45493293
comment on: http://stackoverflow.com/a/28593226
score: 0
type: AnswerComment
type: Comment
has text: Which IE version? Seriously, did you test it before telling that it doesn't work on IE??? And please, don't tell me it doesn't work on IE4...

http://stackoverflow.com/comment/45290426
has text: @Rakesh_Kumar What I want to do is extract the url query parameter pairs from url, and I want to learn how to use non-capture and capture group and apply them to the url to get query prameter key value pair.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28484130

http://stackoverflow.com/a/72769665
has body: The way to deeply copy an array in JavaScript with JSON.parse: let orginalArray= [ {firstName:"Choton", lastName:"Mohammad", age:26}, {firstName:"Mohammad", lastName:"Ishaque", age:26} ]; let copyArray = JSON.parse(JSON.stringify(orginalArray)); copyArray[0].age=27; console.log("copyArray",copyArray); console.log("orginalArray",orginalArray);
answers question: http://stackoverflow.com/q/28482593
score: 0
type: Answer

http://stackoverflow.com/q/28449603
downvote count: 1
answer count: 4
possible better answer: http://stackoverflow.com/a/28449643
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28450169
has answer: http://stackoverflow.com/a/28449643
tagged with: http://stackoverflow.com/tag/json
score: -1
has comment: http://stackoverflow.com/comment/45227341
type: Question
has title: ajax with json how to
upvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28449895
tagged with: jquery
favorite count: 0
tagged with: ajax
has body: I try AJAX and JSON. I have got this very simple scripts. Could you help me to get it work? html file Event click json file, I call it eventresult.json {name: whatever, } and the javascript file $(function(){ $('button').on('click', function(){ $.ajax('/javascript/eventresult.json', { dataType: 'json', success: function(result){ var esemeny = $('.esemeny'); esemeny.find('p').html(result.name); } }); }); }); Thank you
has comment: http://stackoverflow.com/comment/45227223
has answer: http://stackoverflow.com/a/28449753
accepted answer: http://stackoverflow.com/a/28449895

http://stackoverflow.com/comment/45454479
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28572361
has text: What do you have so far? Please show your Javascript/HTML/CSS
type: QuestionComment

http://stackoverflow.com/q/28530526
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45376541
tagged with: ruby-on-rails
has title: Disable Checkbox with javascript
type: Question
tagged with: javascript
tagged with: nested-attributes
score: 0
tagged with: ruby-on-rails-4
answer count: 1
has answer: http://stackoverflow.com/a/28530667
tagged with: jquery
has comment: http://stackoverflow.com/comment/45376374
has body: In my rails application I have this form in profile/_experience_fields.html.erb &lt;div class="form-profile-half-last experselect end-date"&gt; &lt;%= f.label :experience_end, class: "profile_label" %&gt;&lt;br /&gt; &lt;%= f.date_select :experience_end, {start_year: 1945, discard_day: true, order: [ :day, :month, :year ]}, :html=&gt; {class: 'date-select'} %&gt; &lt;/div&gt; &lt;div class="form-checkbox"&gt; &lt;%= f.check_box :experience_current,:class =&gt; 'is_current', id: "checkbox_id" %&gt; Je travail içi &lt;/div&gt; &lt;script&gt; $(document).ready(function(){ $("input[class='is_current']").change(function() { if ($('#checkbox_id').is(":checked")) { $('.end-date select').attr('disabled', true); $('.end-date select').css("background-color", "#D9D8DD"); $('.end-date select').css("color", "#D9D8DD"); $('.end-date select').css("-moz-appearance", "none"); } else { $('.end-date select').attr('disabled', false); $('.end-date select').css("background-color", "white"); $('.end-date select').css("color", "#333"); } }); }); &lt;/script&gt; and this one in profile/edit.html.erb &lt;%= link_to_add_fields "Add another Experience" f, :experiences %&gt; Everything work fine except when I work with checkbox I have this problems 1- When Check the checkbox of the first experience the experience and date is disabled but all others experience and date are disabled two 2- Only the first form that is working others checkbox added with link to add doesn't work 3- If save a form with checked checkbox and try to edit it i find that the experience and date is enabled and not disabled even if the checkbox is checked So I'm wondering on how can resolve all this problems and thank you for any help

http://stackoverflow.com/comment/45388373
type: QuestionComment
type: Comment
has text: If each polygon is a overlaid canvas, you should be able to use imageData because the none filled are should be the default color
comment on: http://stackoverflow.com/q/28536987
score: 0

http://stackoverflow.com/comment/45263278
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28469060
has text: Must it always be 50%, or twice as likely as everything else? e.g., randomNum(1,4) the chances of 4 are 50%, or chances of 4 are 40%?
type: Comment

http://stackoverflow.com/comment/45379949
comment on: http://stackoverflow.com/a/28532178
type: AnswerComment
score: 0
type: Comment
has text: Thank you! I tell you, AJAX is like magic if you ever try using it! @Vipar

http://stackoverflow.com/comment/47030700
type: AnswerComment
has text: Thanks but I do not know where to put the try catch with the scope: `var fe = function(x) { var scope = {x: x}; var expr = math.eval(func_equation, scope); return expr; };`
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28548401

http://stackoverflow.com/comment/45271365
type: Comment
has text: According to the docs (http://jshint.com/docs/options/) globals is most useful when used in conjunction with undef. Have you tried using the two together?
score: 0
comment on: http://stackoverflow.com/a/28473675
type: AnswerComment

http://stackoverflow.com/a/28575487
answers question: http://stackoverflow.com/q/28575322
type: Answer
has comment: http://stackoverflow.com/comment/45491173
downvote count: 0
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45490940
has body: You cannot post data between pages like this using Javascript. You could pass the data in the url: http://example.com/list.html?name=Donald&amp;city=Duckburg To get these values you can use this function (cribbed from this answer): function getParameterByName(name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new RegExp("[\\?&amp;]" + name + "=([^&amp;#]*)"), results = regex.exec(location.search); return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); } You could also use session cookies or localStorage to persist values while the user is browsing in the same window. Look here for info about that.

http://stackoverflow.com/a/28439816
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
has body: To be straight to the point you can't. According to the specification of Mapquest's geocoding response, no bounding box is sent, only a pair of latitude/longitude coordinates.
upvote count: 1
answers question: http://stackoverflow.com/q/28438028
accepted answer of: http://stackoverflow.com/q/28438028

http://stackoverflow.com/q/28569349
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45448657
accepted answer: http://stackoverflow.com/a/28569892
has comment: http://stackoverflow.com/comment/45448704
has body: In my jquery mobile app, I want to run a function when the default page shows. This code works $(document).unbind("pageshow").on("pageshow","#login-page",function(){ GLOBAL_DATA.user = null; alert("reset"); }); But the problem is when I click a button to go to another page, then when I click the back button to go back to the default page, the pageshow function does not trigger. How can I get it to do that? Thanks
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28569892
has comment: http://stackoverflow.com/comment/45448824
tagged with: jquery-mobile
answer count: 1
tagged with: javascript
tagged with: jquery
has title: How to detect page show event when pressing back in jquery mobile?
score: 0

http://stackoverflow.com/a/28515716
score: 0
has body: Got the answer , must read the documentation more carefully. The problem was during the injection of the service in the other module Previous: .controller('topMenuRightClickCtrl',['$scope','$http','commonData','rightClickEventHandler', //function to read the json from local computer //this is to be replaced by the webservice call function($scope,$http,commonData,rightClickEventHandler){ I was injecting the module name instead of the service name Rectified code: .controller('topMenuRightClickCtrl',['$scope','$http','commonData','ServiceName', //function to read the json from local computer //this is to be replaced by the webservice call function($scope,$http,commonData,ServiceName){
type: Answer
answers question: http://stackoverflow.com/q/28515621

http://stackoverflow.com/a/28563779
accepted answer of: http://stackoverflow.com/q/28563413
answers question: http://stackoverflow.com/q/28563413
type: AcceptedAnswer
has body: The problem is with when you call the function. You are trying to find the elements before they are rendered to the page. You can call the function at the end of the html document: &lt;script&gt; initPhotoSwipeFromDOM('.my-simple-gallery'); &lt;/script&gt; Another way to do it is to add to the onload on body tag: &lt;body onload="initPhotoSwipeFromDOM('.my-simple-gallery')"&gt; Or set it to the onload function on window: window.onload="initPhotoSwipeFromDOM('.my-simple-gallery');";
has comment: http://stackoverflow.com/comment/45477497
score: 0
type: Answer

http://stackoverflow.com/comment/45377934
has text: @dandavis: can you elaborate?
comment on: http://stackoverflow.com/q/28531469
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28583084
has title: Remove element from javascript object in angular repeat loop
favorite count: 0
has comment: http://stackoverflow.com/comment/45474872
linked to: http://stackoverflow.com/q/14704147
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45473678
accepted answer: http://stackoverflow.com/a/28584333
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28583833
upvote count: 2
has answer: http://stackoverflow.com/a/28583833
has comment: http://stackoverflow.com/comment/45473854
has comment: http://stackoverflow.com/comment/45474439
type: Question
has body: I have data in the following form: $scope.cart={"4": {"cost": 802.85, "description": "test", "qty": 1}, "5": {"cost": 802.85, "description": "test", "qty": 1}}; I'd like to loop through this data and display it alongside remove button. How can I make the button remove the row from the scope and also trigger angular digest? All of the tutorials seem to have the data in array, and splicing that array, this does not fit my needs. This is what I have so far: http://jsfiddle.net/wbebc4cd/1/
tagged with: javascript
has answer: http://stackoverflow.com/a/28584333
answer count: 3
has comment: http://stackoverflow.com/comment/45475018
downvote count: 0
has answer: http://stackoverflow.com/a/28584180
tagged with: angularjs-ng-repeat

http://stackoverflow.com/q/28477971
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
has body: I'm testing out my chrome plugin and trying to test out chrome.runtime.onInstalled. My code is as following function installed(){ alert("Success"); } chrome.runtime.onInstalled.addListener(installed); But when loading the extensions through loading unpacked extension. I don't get any alert at all. `chrome.runtime.onInstalled doesn't seem to fire. How can I test this? The above code resides in popup.js and is called in a script tag from popup.html. The manifest.json file for that section looks like the following. "browser_action": { "default_icon": { "19": "images/enabled-icon-19.png" //"38": "images/icon38.png" }, "default_popup": "popup.html", "default_title": "mytitle" }
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45281428
tagged with: javascript
has answer: http://stackoverflow.com/a/28479755
tagged with: google-chrome-extension
has title: Does chrome.runtime.onInstalled fire when loading unpacked extensions?
favorite count: 0
has comment: http://stackoverflow.com/comment/45281520
tagged with: google-chrome
accepted answer: http://stackoverflow.com/a/28479755

http://stackoverflow.com/comment/45364843
type: Comment
has text: It turns out there is already an open request for some similar functionality to be added to knockout: https://github.com/knockout/knockout/issues/662 to allow for the use case mentioned. However you already have access to the `$index` within the foreach scope so I do not see why having access to the iterator is a bad thing, it just allows contextual shortcut bindings.
score: 0
comment on: http://stackoverflow.com/a/28523199
type: AnswerComment

http://stackoverflow.com/q/28492167
downvote count: 0
has body: Whe mouse pointer placed on an element I want to show some text. For example if you place your cursor on upvote of an answer, it shows "This answer is useful". You can see it in below image. I did't even know how to search this.
type: AnsweredQuestion
score: 3
tagged with: javascript
type: Question
answer count: 1
accepted answer: http://stackoverflow.com/a/28492183
linked to: http://stackoverflow.com/q/1055581
has title: Display text under cursor
favorite count: 0
upvote count: 3
has answer: http://stackoverflow.com/a/28492183
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28574012
has comment: http://stackoverflow.com/comment/45458569
score: 0
has title: Node js post authentication req.username & password is undefined
has answer: http://stackoverflow.com/a/28574882
answer count: 1
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45458724
has body: So after more or less 4 hours i have finally made some of my calls to work :P Now i have a problem here is a picture of what i am sending my server using postman: If you cannot tell from the picture i am using form-data sending username = arvind@myapp.com password = pass123 Pretty standard. The result of this is: { "status": 401, "message": "Invalid credentials" } Now my server looks like this: Server.js // BASE SETUP // ============================================================================= var express = require('express'), bodyParser = require('body-parser'); var app = express(); var router = express.Router(); var es = require('express-sequelize'); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); // ============================================================================= //Secure app.all('/*', function(req, res, next) { // CORS headers res.header("Access-Control-Allow-Origin", "*"); // restrict it to the required domain res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS'); // Set custom headers for CORS res.header('Access-Control-Allow-Headers', 'Content-type,Accept,X-Access-Token,X-Key'); if (req.method == 'OPTIONS') { res.status(200).end(); } else { next(); } }); var auth = require('./auth.js'); app.all('/login', auth.login); app.all('/api/*', [require('./middlewares/validateRequest')]); // If no route is matched by now, it must be a 404 app.use(function(req, res, next) { var err = new Error('Not Found'); err.status = 404; next(err); }); var env = app.get('env') == 'development' ? 'dev' : app.get('env'); var port = process.env.PORT || 8080; var Sequelize = require('sequelize'); // db config var env = "dev"; var config = require('./database.json')[env]; var password = config.password ? config.password : null; // initialize database connection var sequelize = new Sequelize( config.database, config.user, config.password, { logging: console.log, define: { timestamps: false } } ); //Init models var divisi…
has comment: http://stackoverflow.com/comment/45457957
type: Question
accepted answer: http://stackoverflow.com/a/28574882
tagged with: javascript

http://stackoverflow.com/q/28526464
favorite count: 0
has answer: http://stackoverflow.com/a/40811558
has comment: http://stackoverflow.com/comment/45368772
has comment: http://stackoverflow.com/comment/45368569
has answer: http://stackoverflow.com/a/46572579
type: UnansweredQuestion
tagged with: encryption
upvote count: 23
has answer: http://stackoverflow.com/a/28527509
tagged with: node.js
has comment: http://stackoverflow.com/comment/45369924
has comment: http://stackoverflow.com/comment/45368793
has title: Is end-to-end encryption possible in JavaScript?
score: 23
type: Question
has comment: http://stackoverflow.com/comment/45369889
has body: I'm currently researching the possibilities for creating a (peer2peer) messaging client in terms of encryption thus security. This application will be based on web technologies (if possible). Is end-to-end encryption possible with only JavaScript (client &amp; node.js/peer.js)? If yes, is it correct to look into the HMAC (RSA) kind of encryption techniques? The application is going to be a mobile application. The use of web technologies is a bit proof-of-concept.
downvote count: 0
has comment: http://stackoverflow.com/comment/45369002
tagged with: javascript
answer count: 3
has comment: http://stackoverflow.com/comment/45368896

http://stackoverflow.com/q/28562342
favorite count: 0
has answer: http://stackoverflow.com/a/28562372
has answer: http://stackoverflow.com/a/28562534
tagged with: count
possible better answer: http://stackoverflow.com/a/28562441
answer count: 4
type: AnsweredQuestion
score: 1
tagged with: division
has comment: http://stackoverflow.com/comment/45435845
has title: How to do something 60 times in a second with javascript
type: Question
has body: I believe that it involves setinterval I've got the second using this var s=today.getSeconds(); Then using setinterval I've got this setInterval(function(){ alert("Hello"); }, 3000); The question... I don't think I can divide a second by 60 and use that "asynchronously" I think I'm using that word right, a seconds unit divided 60 times, every 1/60th increment something happens I'm wondering if I should / have to use milliseconds as those units exist, I'd probably just use a ratio or something to make the equivalent of a second / sixty
tagged with: javascript
has answer: http://stackoverflow.com/a/28562441
has comment: http://stackoverflow.com/comment/45436028
has comment: http://stackoverflow.com/comment/45435393
has answer: http://stackoverflow.com/a/28562408
has comment: http://stackoverflow.com/comment/45435396
accepted answer: http://stackoverflow.com/a/28562534
upvote count: 1
downvote count: 0

http://stackoverflow.com/a/28592427
downvote count: 0
has body: Here is a plain javascript way of doing it: var keyFiles = { 0 : false, 1 : true, 2 : false }; var falseExists = false; for (var prop in keyFiles) { if (keyFiles.hasOwnProperty(prop) &amp;&amp; keyFiles[prop] === false) { falseExists = true; break; } } console.log(falseExists); More on hasOwnProperty in this MDN link In modern browsers (i.e, IE 9+, Chrome 5+ etc) the code can be simplified as below: for (var prop in Object.getOwnPropertyNames(keyFiles)) { if (keyFiles[prop] === false) { falseExists = true; break; } }
upvote count: 2
answers question: http://stackoverflow.com/q/28592044
type: Answer
score: 2

http://stackoverflow.com/comment/45281410
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28479474
has text: I want to use jQuery. Can I use tagName ?

http://stackoverflow.com/comment/45261910
score: 0
type: AnswerComment
has text: That was it. My code had it saving the object twice. Thanks!
type: Comment
comment on: http://stackoverflow.com/a/28466562

http://stackoverflow.com/q/28498984
answer count: 6
has answer: http://stackoverflow.com/a/28499228
has answer: http://stackoverflow.com/a/28499316
has answer: http://stackoverflow.com/a/28499344
tagged with: arrays
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has body: I have a constructor where name is a string and details should be an array containing animal type, age and colour.: function animal(name, details) { this.animal_name = name; this.animal_details = details; } I want to create a new object from this prototype: var myPet = new animal("Olly", " /* what goes here? */ "); How do I declare the array in this case (is it like the usual array declaration) How do I use this when creating a new object myPet? NB: This is my previous way of doing this without using an array: function meal (starter, main, side, dessert, drink) { this.starter = starter; this.main = main; this.side = side; this.dessert = dessert; this.drink = drink; } var myMeal = new meal("soup", "chicken", "garlic bread", "cake", "lemonade");
has answer: http://stackoverflow.com/a/28499214
has answer: http://stackoverflow.com/a/28499187
score: 1
has answer: http://stackoverflow.com/a/28499238
upvote count: 1
type: Question
has title: Javascript - Using an array as a parameter to a function and changing values when creating new prototype object
tagged with: javascript

dom-events
tags question: http://stackoverflow.com/q/28547238
tags question: http://stackoverflow.com/q/28454062
tags question: http://stackoverflow.com/q/28513976
tags question: http://stackoverflow.com/q/28465959
tags question: http://stackoverflow.com/q/28566559
tags question: http://stackoverflow.com/q/28470732
tags question: http://stackoverflow.com/q/28532257
tags question: http://stackoverflow.com/q/28545319
tags question: http://stackoverflow.com/q/28442910
tags question: http://stackoverflow.com/q/28552087
type: Tag
tags question: http://stackoverflow.com/q/28437468
tags question: http://stackoverflow.com/q/28571006
tags question: http://stackoverflow.com/q/28556747
tags question: http://stackoverflow.com/q/28439926
tags question: http://stackoverflow.com/q/28466671
tag name: dom-events
tags question: http://stackoverflow.com/q/28591676
tags question: http://stackoverflow.com/q/28545144
tags question: http://stackoverflow.com/q/28524070
tags question: http://stackoverflow.com/q/28548980
tags question: http://stackoverflow.com/q/28585274
tags question: http://stackoverflow.com/q/28529671

http://stackoverflow.com/q/28593303
accepted answer: http://stackoverflow.com/a/28612468
answer count: 1
tagged with: web-audio-api
tagged with: uiwebview
has comment: http://stackoverflow.com/comment/45519888
has body: A simple usage of the Web Audio API: var UnprefixedAudioContext = window.AudioContext || window.webkitAudioContext; var context; var volumeNode; var soundBuffer; context = new UnprefixedAudioContext(); volumeNode = context.createGain(); volumeNode.connect(context.destination); volumeNode.gain.value = 1; context.decodeAudioData(base64ToArrayBuffer(getTapWarm()), function (decodedAudioData) { soundBuffer = decodedAudioData; }); function play(buffer) { var source = context.createBufferSource(); source.buffer = buffer; source.connect(volumeNode); (source.start || source.noteOn).call(source, 0); }; function playClick() { play(soundBuffer); } inside a UIWebView works fine (plays the sound); but when you switch to the Music app and play a song, and then come back to the app with the UIWebView the song stops playing. The same code inside Safari doesn't have this problem. Is there a workaround to avoid this behavior? Here's the full fiddle: http://jsfiddle.net/gabrielmaldi/4Lvdyhpx/
type: AnsweredQuestion
has title: Web Audio API in UIWebView stops Music app's current song
type: Question
tagged with: ios
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28612468

state
tag name: state
tags question: http://stackoverflow.com/q/28466718
type: Tag
tags question: http://stackoverflow.com/q/28534476

http://stackoverflow.com/q/28456981
has answer: http://stackoverflow.com/a/28462629
answer count: 1
tagged with: highcharts
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45250396
favorite count: 0
accepted answer: http://stackoverflow.com/a/28462629
has comment: http://stackoverflow.com/comment/45240894
has comment: http://stackoverflow.com/comment/45250247
has comment: http://stackoverflow.com/comment/45250153
upvote count: 1
has body: I'm trying to have a different marker for each point in my Highcharts area plot. I want the marker to be a wind barb png (shows the average wind direction and speed for a month), which is generated by the icons.php script on-demand. Here is what I have for my data block in my series: series:[{ data:[ { x: 'January', y: 3717.71, marker:{ symbol: 'url(http://sample.ip.address/icons.php?type=barb&amp;size=5&amp;wspd=0&amp;dir=219.38009049774)'}}, { x: 'February', y: 3894.63, marker:{ symbol: 'url(http://sample.ip.address/icons.php?type=barb&amp;size=5&amp;wspd=0&amp;dir=215.49200799201)'}}, { x: 'March', y: 3628.49, marker:{ symbol: 'url(http://sample.ip.address/icons.php?type=barb&amp;size=5&amp;wspd=0&amp;dir=193.80027422303)'}}, { x: 'April', y: 2901.39, marker:{ symbol: 'url(http://sample.ip.address/icons.php?type=barb&amp;size=5&amp;wspd=0&amp;dir=180.85734200743)'}}, { x: 'May', y: 1756.8, marker:{ symbol: 'url(http://sample.ip.address/icons.php?type=barb&amp;size=5&amp;wspd=0&amp;dir=171.72764227642)'}}, { x: 'June', y: 1290.4, marker:{ symbol: 'url(http://sample.ip.address/icons.php?type=barb&amp;size=5&amp;wspd=0&amp;dir=191.62322274882)'}}, { x: 'July', y: 997.85, marker:{ symbol: 'url(http://sample.ip.address/icons.php?type=barb&amp;size=5&amp;wspd=0&amp;dir=187.95557570263)'}}, { x: 'August', y: 1035.04, marker:{ symbol: 'url(http://sample.ip.address/icons.php?type=barb&amp;size=5&amp;wspd=0&amp;dir=180.14449541284)'}}, { x: 'September', y: 1650.05, marker:{ symbol: 'url(http://sample.ip.address/icons.php?type=barb&amp;size=5&amp;wspd=0&amp;dir=173.00561797753)'}}, { x: 'October', y: 3154.83, marker:{ symbol: 'url(http://sample.ip.address/icons.php?type=barb&amp;size=5&amp;wspd=0&amp;dir=188.1064690027)'}}, { x: 'November', y: 3158.45, marker:{ symbol: 'url(http://sample.ip.address/icons.php?type=barb&amp;size=5&amp;wspd=0&amp;dir=192.06400742115)'}}, { x: 'December', y: 4075.64, marker:{ symbol: 'url(http://sample.ip.address/icons.php?type=barb&amp;size=5&…
type: AnsweredQuestion
has title: Highcharts - Different Marker for Each Point of Area Plot
score: 1
type: Question

http://stackoverflow.com/comment/45467782
score: 0
type: Comment
type: QuestionComment
has text: Please find the answers below and mark one as accepted that best solves your problem.
comment on: http://stackoverflow.com/q/28578280

http://stackoverflow.com/comment/45277822
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28476615
has text: Done.. I hope that you are using jQuery?
type: Comment

http://stackoverflow.com/comment/45394693
score: 0
type: Comment
type: QuestionComment
has text: the thing is i was searching a image viewer showing description. please see the original post i will elaborate
comment on: http://stackoverflow.com/q/28525182

http://stackoverflow.com/comment/45279697
comment on: http://stackoverflow.com/a/28478369
type: AnswerComment
has text: Are you trying to hide the `mobileMenu` when anything else gets clicked?
score: 0
type: Comment

http://stackoverflow.com/comment/45405003
comment on: http://stackoverflow.com/a/28545779
type: AnswerComment
score: 0
has text: @AaronBucky that is just `echo` on the PHP side. See [this answer](http://stackoverflow.com/questions/2410773/how-to-return-data-from-php-to-a-jquery-ajax-call) for some examples.
type: Comment

http://stackoverflow.com/q/28568480
tagged with: sails.js
has answer: http://stackoverflow.com/a/28569082
tagged with: waterline
score: 0
answer count: 1
tagged with: javascript
has title: Find multiple random data using promise and recursion
accepted answer: http://stackoverflow.com/a/28569082
tagged with: node.js
has body: I need to retrieve mutliple random data from my DB. I have made a service in Sails.js for that purpose. It's a Recursive function It generate a random number 0 to count of my DB. Stores the random number generated (All questions should be different) Get a random Question Store it in an array calling getQuestion And returning a promise If the random generated array is smaller than the nb Result wanted : We call the function again var RandomizerService= { // get a random single question // return a promise getQuestion: function (limit, skip){ var dfd = q.defer(); Question.find().limit(limit).skip(skip).then(function (question){ dfd.resolve(question); }); return dfd.promise; }, // Recursive function // Generate a random number 0 to count of my DB. // Stores the random number generated (All questions should be different) // Get a random Question and store it in an array calling getQuestion and returning a promise // If the random generated array is smaller than the nb Result wanted : // We call the function again questions: function (count, tabRes, tabRand, nbRes){ var dfd = q.defer(); rand = Math.floor(Math.random() * (count - 1)) + 1; if ( tabRand.indexOf(rand) === -1) { tabRand.push(rand); RandomizerService.getQuestion(-1, rand).then(function (result){ console.log(result[0]); // Is Returning AFTER the Randomizer.questions called in the Controller tabRes.push(result[0]); }); } if (tabRand.length&lt;nbRes){ RandomizerService.questions(count, tabRes, tabRand, nbRes); } dfd.resolve(tabRes); return dfd.promise; } }; module.exports = RandomizerService; When I'm calling this function in my Controller RandomizerService.questions(count, [], [], 30).then(function (randQuestions){ console.log(randQuestions); // Return []; }); randQuestions in returning an empty array. But the console.log(result[0]); inside the getQuestions promise is returning AFTER the RandomizerService.questions (in Controller) promise ! oO (When mocking the find() with a standard promise the whole system wor…
tagged with: promise
type: Question
type: AnsweredQuestion

http://stackoverflow.com/a/28486665
has comment: http://stackoverflow.com/comment/45296019
type: Answer
answers question: http://stackoverflow.com/q/28486217
has body: Use your callback socket inside of the connection. The namespace 'i am client' is never emitted from the front-end client, so it does nothing. On 'new-state' the server should be. socket.on('new_state', function(data) { console.log('From Client ' + data); socket.emit('updated_state', { state: [1,2,3,4] }); });
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/45298410
accepted answer of: http://stackoverflow.com/q/28486217
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45482961
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28570551
has text: Yes, basically since you are using different language, you need to create a new version of worker. You can also try opening an issue on github, in case they agree to add a hook for source transformation before passing it to jshint

http://stackoverflow.com/q/28549210
answer count: 2
tagged with: css
has answer: http://stackoverflow.com/a/28549320
score: 0
has body: i get source code, in CKEDITOR demo, and put in index.html in empty body. Included: But, content dispayed very bad, appears ugly in style and displayed. ---Content source in CKEDITOR demo HERE displayed: https://i.sstatic.net/ATTWO.png why it is displayed not as in a demo as it is correct to me to display content created through CKEDITOR
accepted answer: http://stackoverflow.com/a/28550323
possible better answer: http://stackoverflow.com/a/28549320
has title: Content with CKEDITOR is incorrectly displayed
tagged with: javascript
tagged with: ckeditor
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28550323
type: Question

http://stackoverflow.com/comment/45327280
comment on: http://stackoverflow.com/a/28503940
type: Comment
score: 0
type: AnswerComment
has text: ths guy. so my code is good? Really? just put $('#table-wrapper').html(our_html); instead of mine?

http://stackoverflow.com/q/28504620
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
tagged with: django
answer count: 0
downvote count: 0
score: 1
tagged with: forms
has body: In my Django Admin app I need to populate, with AnuglarJS, one html < select > that has been generated by one Django form. When I submit the form (not with AngularJS) and the django form validation fail, I need to restore the previous selected object on my < select > input. You can notice the 'ng-init="...."' directive. My current vehicles array structure is a bit complicated (I need to use Django Rest Framework to generate it and not standard django serializer). My question is: Is this a tight solution to use AngularJS with Django forms?? How can I recovery the previous selected status of my < select ... > after postback (when Django Form validation fails)?
type: Question
has title: Save ng-options selected state after form post
tagged with: javascript
upvote count: 1

http://stackoverflow.com/comment/45230014
type: Comment
comment on: http://stackoverflow.com/a/28451140
score: 0
type: AnswerComment
has text: @void what about the last lines needs counter.

http://stackoverflow.com/q/28530098
has comment: http://stackoverflow.com/comment/45375467
answer count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45375258
type: Question
tagged with: twitter
has title: How to render embedded tweet widget on the server using node.js?
has body: My goal is to fetch the HTML &amp; CSS for a tweet widget (like the one below) on the server. Calling Twitter's OEmbed endpoint only returns the bare HTML for this tweet: &lt;blockquote class="twitter-tweet" width="500"&gt; &lt;p&gt; Twitter users love tweeting emoji from their phones – now you can view these emoji on web! &lt;a href="https://twitter.com/hashtag/emojiparty?src=hash"&gt;#emojiparty&lt;/a&gt; ✨&lt;/p&gt;&amp;mdash; Twitter Support (@Support) &lt;a href="https://twitter.com/Support/status/451399393850052610"&gt;April 2, 2014&lt;/a&gt; &lt;/blockquote&gt; &lt;script async src="//platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt; Twitter's widget.js seems to only work on the client side. Is it possible to retrieve the full HTML &amp; CSS for an embedded tweet on the server using node.js?
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: oembed
tagged with: node.js
score: 2

http://stackoverflow.com/comment/45277116
comment on: http://stackoverflow.com/q/28477070
type: Comment
type: QuestionComment
has text: are you in charge of the thing that is receiving the http post? In other words can you choose what format to send the response back in? It seems that what you need is an RSS feed isn't it?
score: 0

http://stackoverflow.com/comment/45363301
comment on: http://stackoverflow.com/q/28523321
has text: So, does that resolve your issue?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/67134264
type: Answer
has body: var imageObj = []; for(var i=0;i&lt;images.length;i++){ iy = parseInt(i/6) * 200; ix = parseInt(i%6) * 200; imageObj[i] = new Image(); imageObj[i].src = images[i]; // to set additinal parameter imageObj[i].ix = JSON.parse(JSON.stringify(ix)); imageObj[i].iy = JSON.parse(JSON.stringify(iy)); // console.log(imageObj); imageObj[i].onload = function() { console.log(this.ix); console.log(this.iy); ctx.drawImage(this, this.ix, this.iy, 200, 200); }; }
score: 0
answers question: http://stackoverflow.com/q/28552385

http://stackoverflow.com/comment/45510372
comment on: http://stackoverflow.com/q/28584146
score: 0
type: Comment
type: QuestionComment
has text: @renokl2014 check this jsfiddle and let me know this is what you want to do http://jsfiddle.net/svh1jd99/

http://stackoverflow.com/comment/45457337
comment on: http://stackoverflow.com/q/28573893
score: 0
type: Comment
type: QuestionComment
has text: Have you tried valid HTML in the first place?

http://stackoverflow.com/q/28499737
has answer: http://stackoverflow.com/a/28512914
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28512914
tagged with: magic-quotes-gpc
has comment: http://stackoverflow.com/comment/45321290
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45319750
favorite count: 0
has comment: http://stackoverflow.com/comment/45319461
tagged with: php
score: -1
type: AnsweredQuestion
tagged with: wordpress
has title: Need to escape the json
downvote count: 1
has body: i have situation i am getting this array from post Array([0] =&gt; {"question":"test " jakce"} ) i need to escape the string : Array([0] =&gt; {"question":"test \" jakce"} ) i already try addslash php method it just add slash to everywhere i just need the slash in middle of string "test \" jakce" , also need to escape anystring like contains single quotes double quotes etc. Thanks.
type: Question

http://stackoverflow.com/a/28530280
type: Answer
has body: If it helps, I recently took the first release of the Rogue game written for UNIX in C and rewrote it for javascript to work in a browser. I used a technic called continuation to be able to wait for key entry by the user because in javascript the are no interrupts. So I would have a piece of code like this: void function f() { // ... first part ch = getchar(); // ... second part } that would be transformed in function f() { // ... first part var ch = getchar(f_cont1); return; // the execution stops here function f_cont1 () { // ... second part } } the continuation is then stored to be reuse on a keypressed event. With closures everything would be restarted where it stoped.
answers question: http://stackoverflow.com/q/28530083
score: 0

http://stackoverflow.com/q/28561034
has body: Im new with Angular and have...let´s say a few starter problems. I have made an small app with phonegap, onsen ui and angluarjs using the nfc-plugin. All i want to do is reading a tag-id from a nfc-tag. Everything works fine when i place my whole code within the controller. This looks like that: app.controller('Page3Ctrl', function($scope, Data) { $scope.item = Data.selectedItem.title; $scope.save = function() { Data.selectedItem.title = $scope.item; $scope.ons.navigator.popPage(); }; // Get the ID Number from the tag $scope.onNfc = function(nfcEvent) { var tag = nfcEvent.tag; var taglesen = nfc.bytesToHexString(tag.id); $scope.$apply(function() { $scope.item = taglesen; }); }; nfc.addTagDiscoveredListener( $scope.onNfc, // tag successfully scanned --> call $scope.onNfc function (status) { // listener successfully initialized $scope.nfcok = "NFC Reader ist ready"; }, function (error) { // listener fails to initialize $scope.nfcok = "NFC Reader ist nicht ready"; } ); }); Save Scan NFC But now want to bring the NFC-Reading part to a separte file called services.js and place it into a factory. A there is my problem how to do this. I have tried this but unfortunately it doesn't work. Mybe i just need a small tipp or i am on a completly wrong way?????: myApp.factory('onNfc', function() { this.getNfc = function(nfcEvent) { var tag = nfcEvent.tag; var taglesen = nfc.bytesToHexString(tag.id); return taglesen; } nfc.addTagDiscoveredListener( this.getNfc(), // tag successfully scanned function (status) { // listener successfully initialized $scope.nfcok = "NFC Reader ist ready"; }, function (error) { // listener fails to initialize $scope.nfcok = "NFC Reader ist nicht ready"; } ); }); app.controller('Page3Ctrl', function($scope, Data, onNfc) { $scope.item = Data.selectedItem.title; $scope.save = function() { Data.selectedItem.title = $scope.item; $scope.ons.navigator.popPage(); }; $scope.$apply(function() { $scope.item = onNfc.getNfc(); }); }); I am grateful for any help Best…
has comment: http://stackoverflow.com/comment/45434069
has comment: http://stackoverflow.com/comment/45433712
has answer: http://stackoverflow.com/a/28571994
linked to: http://stackoverflow.com/q/16477123
has answer: http://stackoverflow.com/a/28561569
has comment: http://stackoverflow.com/comment/45434022
tagged with: javascript
type: UnansweredQuestion
has title: AngularJS: Bring the logical part from controller to services (factory)
tagged with: onsen-ui
type: Question
tagged with: cordova
tagged with: angularjs
score: 0
answer count: 2

http://stackoverflow.com/comment/45411756
has text: Show us the docs of `trader.getTrades` and what values `limit` and `skip` have.
comment on: http://stackoverflow.com/q/28549164
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28500569
has comment: http://stackoverflow.com/comment/45441196
answers question: http://stackoverflow.com/q/28500432
has comment: http://stackoverflow.com/comment/45320507
score: 0
has comment: http://stackoverflow.com/comment/45326999
has body: I think you should use a FOR EACH loop instead if you have a collection of students. Please specify the language you are using. This could look something like this in javascript : int i = 0; for(s in studentList){ tree(s, i); i++; } Where "studentList" is a list (or any other collection) containing studend0, student1, student3, etc.
has comment: http://stackoverflow.com/comment/45321684
type: Answer

http://stackoverflow.com/q/28469484
tagged with: javascript
has answer: http://stackoverflow.com/a/28469564
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45264999
has comment: http://stackoverflow.com/comment/45265432
tagged with: jquery
tagged with: listener
type: Question
tagged with: events
has comment: http://stackoverflow.com/comment/45264065
has answer: http://stackoverflow.com/a/28469592
has comment: http://stackoverflow.com/comment/45265031
accepted answer: http://stackoverflow.com/a/28469564
has answer: http://stackoverflow.com/a/28469525
has title: Issue with JavaScript/jQuery event ordering?
has body: I'm having an issue with events not firing in the intended order. I have an event on an input element for focus and focusout. The .focus() shows some content, the .focusout() hides it. I want to be able to .click() on some of the data that I'm showing with the .focus(), however when I click on it, the first thing to fire is the .focusout() event handler, and for some reason the action of hiding the content screws with the .click() event handler. Here are my event listeners: $('#content').click(function(evt) { alert('Yay'); }); $('input').focus(function() { $('#content').show(); }); $('input').focusout(function() { $('#content').hide(); }); If any of this is confusing, you can see the exact behavior in this jsfiddle. When you click the input box, the red box shows. But if you then try to activate the click listener on the red box, the .focusout() takes priority and hides the content, and no .click() event transpires. Desired behavior: Click on input, content shows, click on content, content click listener fires.
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/28469525
has comment: http://stackoverflow.com/comment/45265385
has comment: http://stackoverflow.com/comment/45264067

http://stackoverflow.com/a/28533428
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28532893
answers question: http://stackoverflow.com/q/28532893
score: 2
type: AcceptedAnswer
has body: Sure you don't have an element inside that extends beyond the body with a min-height set on it. This would push the sticky footer down when the body shrinks below that min-height creating the extra space? Look for all elements with a min-height and try shrinking them.
downvote count: 0
type: Answer

http://stackoverflow.com/comment/45282042
comment on: http://stackoverflow.com/q/28479754
has text: All because of execution context... first alert of `3` because `this` refers to global context and thus `this.x` returns 3..and 1 is pretty much obvious..
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/q/28449307
type: Question
has answer: http://stackoverflow.com/a/28449474
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28449595
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28449474
tagged with: arrays
has title: Changing the elements of an array
tagged with: php
has comment: http://stackoverflow.com/comment/45226826
has answer: http://stackoverflow.com/a/28449595
type: AnsweredQuestion
has body: I have the following script: PHP: for($i=1; $i&lt;=100; $i++){ echo '&lt;li id="p'.$i.'" style="display: none;" onclick="click('.$i.')"&gt;'.$i.'&lt;/li&gt;'; } Javascript: var arr_p=[]; function click(x){ for(i=1; i&lt;=10; i++){ a = document.getElementById('p'+i); if(a.style.display=='inline'){ arr_p.push(i); } } if(x==arr_p.length){ document.getElementById('p'+1).style.display='none'; } } As you can see,i declared an array outside of the function so i can change the elements inside(atleast for variable string works).Then i catch each html element that have display inline from 1 to 10 and insert them into arr_p. When a user click on the last element(which is 10),if it's equal with the array length(which is 10),the first html element will get the display none,so when the function goes again,it should check for the first 10 values with display inline,and insert them in arr_p. I checked the array length with console.log , and each time the function do his job,the new array elements are added instead of replacing the old ones.I need the new elements that are pushed into the array,to replace the old ones.

http://stackoverflow.com/comment/45384320
score: 2
has text: voted to close for typographical error.
comment on: http://stackoverflow.com/q/28534943
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45494112
has text: Then you will need to apply a [foolproof](http://foolproof.codeplex.com/) `[RequiredIfTrue]` or similar attribute so that client and server side validation is only applied when the checkbox is checked.
comment on: http://stackoverflow.com/q/28572482
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28588960
upvote count: 4
accepted answer of: http://stackoverflow.com/q/28588707
type: AcceptedAnswer
has body: It looks to me like you can use r+: fs.open('my-file.dwg','r+', function(err,data) { }); From the fs module docs: 'r+' - Open file for reading and writing. An exception occurs if the file does not exist. If the file is already open by someone else, then it should not grant you permission for reading and writing and should return an error. This will not create the file it if does not exist. The r+ option will not truncate or create the file like the w+ option will.
downvote count: 0
answers question: http://stackoverflow.com/q/28588707
type: Answer
score: 4

http://stackoverflow.com/q/28549337
has body: Is there a way I can get WiFi router information (mac address, ip address, and other if possible) of the WiFi router I am connected to using javascript? Preferred browser: chrome If it's not possible, what are my options?
possible better answer: http://stackoverflow.com/a/28563657
has answer: http://stackoverflow.com/a/28563657
accepted answer: http://stackoverflow.com/a/28549432
type: AnsweredQuestion
tagged with: router
upvote count: 1
has comment: http://stackoverflow.com/comment/45411997
type: Question
has answer: http://stackoverflow.com/a/77619248
has comment: http://stackoverflow.com/comment/45411694
has comment: http://stackoverflow.com/comment/45422569
has comment: http://stackoverflow.com/comment/45411806
has answer: http://stackoverflow.com/a/28549432
has title: How to get WiFi router information?
answer count: 3
has comment: http://stackoverflow.com/comment/45417632
downvote count: 0
tagged with: wifi
tagged with: javascript
score: 1
favorite count: 0

http://stackoverflow.com/q/28490041
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: vbo
accepted answer: http://stackoverflow.com/a/28494927
upvote count: 1
type: AnsweredQuestion
score: 1
has title: WebGL VBO error in Firefox
tagged with: webgl
type: Question
has body: I am using Firefox to render a 3D object in a canvas using WebGL. My code was working previously, whereby a textured object was being displayed within the canvas. However upon revisiting my code, without making any changes, the object will not render and the browser console displays the following error: Error: WebGL: drawArrays: no VBO bound to enabled vertex attrib index 1! It is complaining about a line in my drawScene() function, shown below: function drawScene() { gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight); gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); mat4.perspective(90, gl.viewportWidth / gl.viewportHeight, 0.1, 100.0, pMatrix); mat4.identity(mvMatrix); mat4.translate(mvMatrix, [0.0, -0.5, -4.0]); mat4.rotate(mvMatrix, degToRad(xRot), [1, 0, 0]); mat4.rotate(mvMatrix, degToRad(yRot), [0, 1, 0]); gl.bindBuffer(gl.ARRAY_BUFFER, manVertexPositionBuffer); gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, manVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0); gl.bindBuffer(gl.ARRAY_BUFFER, manVertexTextureBuffer); gl.vertexAttribPointer(shaderProgram.vertexTextureAttribute, manVertexTextureBuffer.itemSize, gl.FLOAT, false, 0, 0); gl.activeTexture(gl.TEXTURE0); gl.bindTexture(gl.TEXTURE_2D, manTexture); gl.uniform1i(gl.getUniformLocation(shaderProgram, "uSampler"), 0); setMatrixUniforms(); gl.drawArrays(gl.TRIANGLES, 0, manVertexIndexBuffer.numItems); } The line referred to by the error is: gl.drawArrays(gl.TRIANGLES, 0, manVertexIndexBuffer.numItems); I have older versions of my code which I know to have been working but upon running these now I get the same issue. A link to the live version of my code is here. Any help would be much appreciated on this!
has answer: http://stackoverflow.com/a/28494927
tagged with: firefox

http://stackoverflow.com/a/28526501
has body: The problem is that function is being called twice here: if($.ui.ddmanager.drop(ui.helper.data("draggable"), event)) { .... jQuery already call drop but you are calling it again manually. It is not the right way to check the event but it calls the event again. Just remove that if...else clause that you code will work like a charm! You are also warping an object into $() but the object is also an jquery object. you don't need to do it // NOT $("#dvDest").append($(ui.draggable).clone()); $("#dvDest").append(ui.draggable.clone());
accepted answer of: http://stackoverflow.com/q/28526218
answers question: http://stackoverflow.com/q/28526218
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/45412563
type: QuestionComment
comment on: http://stackoverflow.com/q/28547468
has text: I used northamericanproxy.com
score: 0
type: Comment

http://stackoverflow.com/a/28456240
score: 7
has body: You actually don't need a loop to do this in modern browsers, you can use the Array.reduce function: var sum = input.reduce(function(a,b){ return a+b; }, 0);
has comment: http://stackoverflow.com/comment/45239093
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28456134
upvote count: 7

http://stackoverflow.com/comment/45329897
score: 0
type: AnswerComment
has text: sweet thanks, I'm giving that a go now. How do I stop the hover state from being auto activated on click. I have no js telling it to trigger hover atm and it still triggers :hover on click on mobile.
type: Comment
comment on: http://stackoverflow.com/a/28505036

http://stackoverflow.com/comment/45522532
has text: Thank you very much! I could not have asked for a better answer or explanation of each step. A little tweaking is required within my existing css, but you've provided me with more than enough to stay busy and researching for a while. Thanks again! Really appreciate all of your effort.
comment on: http://stackoverflow.com/a/28565727
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45288211
comment on: http://stackoverflow.com/a/28482361
score: 0
type: AnswerComment
type: Comment
has text: Problem solved ! There was no results because I did a mistake in the name of the table forms...

http://stackoverflow.com/a/28577056
has comment: http://stackoverflow.com/comment/85214407
answers question: http://stackoverflow.com/q/28576253
type: Answer
has body: https://github.com/zeke/an-array-of-english-words This helped me . I used that json file and wrote a simple method to check the validity of the word . Thanks for the people who commented above :)
score: 0
has comment: http://stackoverflow.com/comment/85201898

http://stackoverflow.com/comment/45475556
type: Comment
type: QuestionComment
has text: I decided to implement a new control from scratch following the VTK camera controls style. I will submit a pull request asap.
score: 0
comment on: http://stackoverflow.com/q/28560130

c#
tags question: http://stackoverflow.com/q/28497672
tags question: http://stackoverflow.com/q/28516895
tags question: http://stackoverflow.com/q/28531123
tags question: http://stackoverflow.com/q/28458619
tags question: http://stackoverflow.com/q/28493424
tags question: http://stackoverflow.com/q/28485642
tags question: http://stackoverflow.com/q/28437453
tags question: http://stackoverflow.com/q/28453022
tags question: http://stackoverflow.com/q/28538135
tags question: http://stackoverflow.com/q/28452553
tags question: http://stackoverflow.com/q/28448143
tags question: http://stackoverflow.com/q/28561107
tag name: c#
tags question: http://stackoverflow.com/q/28446292
tags question: http://stackoverflow.com/q/28483539
tags question: http://stackoverflow.com/q/28480045
tags question: http://stackoverflow.com/q/28463622
tags question: http://stackoverflow.com/q/28476120
tags question: http://stackoverflow.com/q/28557227
tags question: http://stackoverflow.com/q/28585538
tags question: http://stackoverflow.com/q/28563755
tags question: http://stackoverflow.com/q/28515968
tags question: http://stackoverflow.com/q/28501455
tags question: http://stackoverflow.com/q/28558148
tags question: http://stackoverflow.com/q/28563623
tags question: http://stackoverflow.com/q/28491897
tags question: http://stackoverflow.com/q/28552272
tags question: http://stackoverflow.com/q/28565777
tags question: http://stackoverflow.com/q/28473978
tags question: http://stackoverflow.com/q/28590809
tags question: http://stackoverflow.com/q/28474387
tags question: http://stackoverflow.com/q/28588937
tags question: http://stackoverflow.com/q/28535851
tags question: http://stackoverflow.com/q/28445867
tags question: http://stackoverflow.com/q/28439628
tags question: http://stackoverflow.com/q/28443951
tags question: http://stackoverflow.com/q/28452504
tags question: http://stackoverflow.com/q/28486082
tags question: http://stackoverflow.com/q/28580090
tags question: http://stackoverflow.com/q/28552397
tags question: http://stackoverflow.com/q/28534756
tags question: http://stackoverflow.com/q/28513198
tags question: http://stackoverflow.com/q/28464207
tags question: http://stackoverflow.com/q/28502643
tags question: http://stackoverflow.com/q/28577602
tags question: http://stackoverflow.com/q/28517223
tags question: http://stackoverflow.com/q/28591704
tags question: http://stackoverflow.com/q/28468208
tags question: http://stackoverflow.com/q/28537278
tags question: http://stackoverflow.com/q/28496829
tags question: http://stackoverflow.com/q/28538920
tags question: http://stackoverflow.com/q/28480217
tags question: http://stackoverflow.com/q/28556391
tags question: http://stackoverflow.com/q/28536366
tags question: http://stackoverflow.com/q/28520756
tags question: http://stackoverflow.com/q/28546724
tags question: http://stackoverflow.com/q/28501725
tags question: http://stackoverflow.com/q/28470893
tags question: http://stackoverflow.com/q/28537906
type: Tag
tags question: http://stackoverflow.com/q/28565889
tags question: http://stackoverflow.com/q/28541795
tags question: http://stackoverflow.com/q/28484066
tags question: http://stackoverflow.com/q/28523197
tags question: http://stackoverflow.com/q/28548025
tags question: http://stackoverflow.com/q/28572482
tags question: http://stackoverflow.com/q/28507573
tags question: http://stackoverflow.com/q/28561931
tags question: http://stackoverflow.com/q/28470098
tags question: http://stackoverflow.com/q/28565702
tags question: http://stackoverflow.com/q/28459712
tags question: http://stackoverflow.com/q/28589969
tags question: http://stackoverflow.com/q/28509647
tags question: http://stackoverflow.com/q/28592717
tags question: http://stackoverflow.com/q/28474701
tags question: http://stackoverflow.com/q/28455040
tags question: http://stackoverflow.com/q/28481423

http://stackoverflow.com/comment/45365955
type: Comment
type: QuestionComment
has text: @MatjažMav He's talking about a pasted log file, so I assume he wants the original lines from the file, not the displayed lines.
comment on: http://stackoverflow.com/q/28524893
score: 1

http://stackoverflow.com/comment/45245013
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28459367
has text: see https://www.vagrantup.com/ You can install on your local machine an image of your production webserver.
score: 0

http://stackoverflow.com/a/28545447
answers question: http://stackoverflow.com/q/28545398
upvote count: 1
score: 1
has body: Syntax Error in .value() It should be var origin = document.getElementById('origin').value; Instead Of var origin = document.getElementById('origin').value();
downvote count: 0
type: Answer

http://stackoverflow.com/comment/45457871
type: QuestionComment
has text: If they do not support CORS/JSONP you are not going to get it without a proxy.
score: 1
type: Comment
comment on: http://stackoverflow.com/q/28574201

http://stackoverflow.com/comment/45245747
has text: Ok great. Hope it helped!
comment on: http://stackoverflow.com/a/28458267
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28450459
accepted answer: http://stackoverflow.com/a/28456804
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45228879
has comment: http://stackoverflow.com/comment/45231251
possible better answer: http://stackoverflow.com/a/28451350
favorite count: 0
has body: In a PhantomJS script, I have a Uint8ClampedArray (image data from a HTML canvas) that I would like to output to stdout as a byte stream. In Node.js I would do: buf = new Buffer(...); process.stdout.write(buf); How would I go about doing the same thing in PhantomJS? I can't just output String.fromCharCode() for each of my bytes, as for example String.fromCharCode(255) outputs two bytes, not one (i.e. any byte between 128 and 255 will output two bytes).
has title: Output a Uint8ClampedArray buffer as a stream of bytes
has answer: http://stackoverflow.com/a/28451350
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28456804
upvote count: 2
tagged with: arraybuffer
type: Question
tagged with: phantomjs
has comment: http://stackoverflow.com/comment/45229212
tagged with: javascript

http://stackoverflow.com/comment/45463819
type: Comment
score: 0
has text: What kind of pagination you need? You can make ajax (or any other kind) call for new pages, or hide some pages and show ones you need
type: QuestionComment
comment on: http://stackoverflow.com/q/28577116

http://stackoverflow.com/a/28546845
answers question: http://stackoverflow.com/q/28546116
has comment: http://stackoverflow.com/comment/45406936
score: 3
has comment: http://stackoverflow.com/comment/45406980
has comment: http://stackoverflow.com/comment/45407440
has body: Assuming this is in the same browser and the same domain a simple way is as follows (pseudo code) Page A -&gt; controller Page B -&gt; page to be refreshed. The steps are:- Page A Calls a Javascript function (via button press for example) that writes a value of 'update: true' to local storage. Page B has a loop of 500ms that checks this value in local storage - when it sees 'update: true' it sets it back to false and then refreshes itself. These are all simple things to look-up how to do but if you get stuck just let me know. Oh and same principle applies on different browsers (i.e. if Page A opened in chrome, Page B opened in Firefox) - just that instead of local storage you use a server and store the state to DB / a file. Below is a quick example - open the two pages in different tabs then click 'refresh' in the controller apge - you will notice the 'page to be refreshed' page refreshes. CONTROLLER PAGE TO BE REFRESHED
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45408075
downvote count: 0
has comment: http://stackoverflow.com/comment/45407019
has comment: http://stackoverflow.com/comment/45407054
type: Answer
has comment: http://stackoverflow.com/comment/45408873
has comment: http://stackoverflow.com/comment/45407635
has comment: http://stackoverflow.com/comment/45407362
accepted answer of: http://stackoverflow.com/q/28546116
upvote count: 3
has comment: http://stackoverflow.com/comment/45407061
has comment: http://stackoverflow.com/comment/45407253

http://stackoverflow.com/a/28457815
answers question: http://stackoverflow.com/q/28456866
has body: JRBurke hangs out around here sometimes, so he would be able to answer better than I will, because I'm just going to make some assumptions. It sounds like you're using multiple script tags in your page, so if I had to guess I would say that the RequireJS dependency is simply loading later than other script tags. Here's a whole bunch of info on the load and execute order of script tags. Otherwise, my understanding of RequireJS is that it loads things as they are needed. Imagine your RequireJS tag looks like this: &lt;script src="lib/require.js" data-main="main.js"&gt;&lt;/script&gt; If your main.js file looks like this: requirejs.config({ /*conf */ }); Then RequireJS loads the main file, which configures RequireJS, and does nothing more. Later, maybe one of your files looks like this: /* code, code code */ require( ['dist/module'], function( distModule ){ /* code code code */ } ); At this point, Require would start firing off requests to resolve any dependency chains for dist/module. If any code before this introduces a delay (like waiting for something to load, or if it's wrapped in a jQuery DOMReady), RequireJS won't start loading modules until all those delays have resolved. My situation is a little different, and it might provide some insight. I have only one script tag in my entire application: &lt;script src="vendor/require.js" data-main="build/app"&gt;&lt;/script&gt; My main file looks like this: requirejs.config({ /*conf */ }); require( ['dist/module1', 'dist/module2'], function( distModule1, distModule2 ){ /* code code code */ } ); distModule1 and distModule2 kick off loading the ENTIRE application, and would fire off every request to get what it needs for the main view. As I move around the application, it fires off a request to get what it needs for subsequent views. I've actually used the r.js whole-project optimizer to compile everything into that one single file, so as soon as it loads, the entire application is loaded (300kb or so). In summary, the Req…
has comment: http://stackoverflow.com/comment/45242882
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/28456866

http://stackoverflow.com/comment/45303879
comment on: http://stackoverflow.com/a/28491464
type: Comment
has text: change it, i didnt count the elements, so if there are 20 = 100/20=5, `.intable td{width:5%}` etc.
score: 0
type: AnswerComment

http://stackoverflow.com/a/28497488
has comment: http://stackoverflow.com/comment/45315035
has body: 2 solutions: -> Using an image -> Using this very usefull frameworks : http://fortawesome.github.io/Font-Awesome/ . Put the icons in a div (50px * 50px) and just border-radius in CSS !
has comment: http://stackoverflow.com/comment/45314749
downvote count: 0
has comment: http://stackoverflow.com/comment/45315300
has comment: http://stackoverflow.com/comment/45315821
has comment: http://stackoverflow.com/comment/45314936
type: Answer
has comment: http://stackoverflow.com/comment/45315673
has comment: http://stackoverflow.com/comment/45314925
score: 1
answers question: http://stackoverflow.com/q/28497411
has comment: http://stackoverflow.com/comment/45314507
upvote count: 1

requirejs
tags question: http://stackoverflow.com/q/28580046
tag name: requirejs
tags question: http://stackoverflow.com/q/28459319
tags question: http://stackoverflow.com/q/28556309
tags question: http://stackoverflow.com/q/28559881
tags question: http://stackoverflow.com/q/28494256
tags question: http://stackoverflow.com/q/28450263
type: Tag
tags question: http://stackoverflow.com/q/28492536
tags question: http://stackoverflow.com/q/28485158
tags question: http://stackoverflow.com/q/28487229
tags question: http://stackoverflow.com/q/28474060
tags question: http://stackoverflow.com/q/28455310
tags question: http://stackoverflow.com/q/28467615
tags question: http://stackoverflow.com/q/28453533
tags question: http://stackoverflow.com/q/28546347
tags question: http://stackoverflow.com/q/28456866
tags question: http://stackoverflow.com/q/28536584
tags question: http://stackoverflow.com/q/28439723
tags question: http://stackoverflow.com/q/28455880
tags question: http://stackoverflow.com/q/28530197
tags question: http://stackoverflow.com/q/28589875
tags question: http://stackoverflow.com/q/28515621
tags question: http://stackoverflow.com/q/28489524
tags question: http://stackoverflow.com/q/28555812
tags question: http://stackoverflow.com/q/28590511
tags question: http://stackoverflow.com/q/28466017
tags question: http://stackoverflow.com/q/28569543
tags question: http://stackoverflow.com/q/28437563

http://stackoverflow.com/comment/45385611
score: 1
comment on: http://stackoverflow.com/q/28535693
type: Comment
type: QuestionComment
has text: show us your form code.

http://stackoverflow.com/q/28486499
type: Question
possible better answer: http://stackoverflow.com/a/28486739
has comment: http://stackoverflow.com/comment/45294831
has answer: http://stackoverflow.com/a/28486628
tagged with: javascript
score: 0
answer count: 3
has title: Fade on mouse out unless mouseover within set time
has comment: http://stackoverflow.com/comment/45294829
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28486628
has body: I am looking for a solution for the following problem: Om mouseover a div fades in. On mouseout it fades out again. Simple and this works, but I would like to set a condition that the fadeing Out only happens if mouseover doesn't occur again within a set time, say 2s. Simple delay() does not work since it will then happen anyway... Is there a way to set some kind of timer to cancel a function from running if an event triggers within this time?
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28486739
has answer: http://stackoverflow.com/a/28486601
has comment: http://stackoverflow.com/comment/45294785

http://stackoverflow.com/q/28456736
type: Question
tagged with: ember.js
answer count: 1
has body: I have a table with data that I sort using ember's built in sortProperties in the controller. I also have a filtering mechanism where I filter the data with the following code: filteredContent: function() { var filter = this.get('filter'), regex = new RegExp(filter, 'gi'), data = this.get('arrangedContent'); return data.filter(function(item) { return item.get('name').match(regex) || item.get('email').match(regex) || (item.get('role') && item.get('role').match(regex)); }); }.property('sortProperties', 'sortAscending', 'filter', '@each.isNew'), I use a plugin called x-editable (http://vitalets.github.io/x-editable/) to make each value in the table editable by simply clicking on it. Unfortunately, this doesn't work when using the filtering and ember's sortProperties. When disabling those functions, x-editable works, but filtering and sortProperties seemingly removes the generated x-editable html/logic and replaces it with new html: It goes from this: dummy_email_214@gmail.com To this: dummy_email_214@gmail.com Now, I get that ember needs to replace the content of the a in order to create the value binding, but it seemingly replaces the whole a and recreates it, but without the x-editable html and logic. Does anyone have a solution to this? Thanks Theo EDIT: Here's the full code for my table: Name Email Password Role Active {{#each user in filteredContent}} {{user.name}} {{user.email}} {{user.password}} {{user.role}} {{user.active}} {{/each}} afterRenderEvent: afterRenderEvent: function() { // set default sorting this.get('controller').send("sortBy", "name", false); // registers the editors, their validators and their respective options this.registerEditors(); },
score: 0
has comment: http://stackoverflow.com/comment/45240851
has title: Ember.js removes x-editable from values in table when using sortProperties
has comment: http://stackoverflow.com/comment/45240521
tagged with: x-editable
has answer: http://stackoverflow.com/a/28457382
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/45256638
has text: Do you understand the duplicate question enough for it to answer your question? Basically, when the click event happens, the for loop has already finished and therefore `i` will be set to the last value in the loop.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28465218

http://stackoverflow.com/comment/45429547
type: AnswerComment
comment on: http://stackoverflow.com/a/28558827
type: Comment
has text: suggest a loop please
score: 0

http://stackoverflow.com/comment/45462628
has text: @Smokingmonkey as super cool mentioned in your question comment create fiddle or plunk and then share it here.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28556725
type: Comment

http://stackoverflow.com/comment/45244528
has text: @Vignesh There is nothing like that in CSS
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28457218

http://stackoverflow.com/q/28470659
tagged with: handlebars.js
has comment: http://stackoverflow.com/comment/45302819
has title: why doesn't the handlebars template reflect change in ember property
score: 0
has comment: http://stackoverflow.com/comment/45273733
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45269040
has body: i'm having some trouble with the handlebars template not updating every time the contents of this component's 'subAllocations' change. it does change the first time the event is triggered ie adding or removing subAllocations, but not after that, even though i can see in the Ember debugger addon for FireFox developer tools that the computed value has changed for 'hasSubAllocations' App.AllocationAllocationRowComponent = App.CollapsableComponent.extend({ layoutName: 'components/allocation/allocation/row', tagName: "tr", hasSubAllocations: Em.computed.notEmpty("allocation.subAllocations"), updateAllocation: function (data) { var newAllo = data.allocation; this.set("allocation.subAllocations", Em.copy(newAllo.subAllocations)); this.sendAction("onRefreshAirSpaces", data.updatedAirSpaces); }, actions: { addSubAllocation: function(){ var alloc = this.get("allocation"); var self = this; Em.$.ajax({ type: 'POST', url: '/allocation/addSubAllocations', contentType: 'application/json', dataType: 'json', data: JSON.stringify(alloc), }).then(function (data) { self.updateAllocation(data); }); }, subAllocationRemoved: function (subAllocation) { var self = this; Ember.$.ajax({ type: 'POST', url: '/allocation/RemoveSubAllocation/', contentType: 'application/json', dataType: 'json', data: JSON.stringify(subAllocation), }).then(function (data) { self.updateAllocation(data); }); }, }, }); from handlebars template `content here` am i missing something? we are not using ember data, so if you could avoid suggesting that as a solution that would be great
has comment: http://stackoverflow.com/comment/45273870
tagged with: ember.js
tagged with: computed-observable
has comment: http://stackoverflow.com/comment/45267193
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/45360212
has text: You might want to look at what `JSON.stringify(obj)` does because it handles nested objects and is an industry standard format. It wouldn't be exactly the output you are asking for (quotes in a few different places), but it is built into all modern browsers so you might want to start with that. `JSON.parse(str)` is the reverse process for parsing.
type: QuestionComment
score: 6
type: Comment
comment on: http://stackoverflow.com/q/28521737

http://stackoverflow.com/q/28516511
has body: I'm trying to build a markers Json with build_markers. It seems to build the hash right when I display it in the page but somehow in javascript it returns null. javascript (not using require tree if that matters) function initialize() { handler = Gmaps.build('Google'); handler.buildMap({ provider: {maxZoom:17, minZoom:5}, internal: {id: 'map'}}, function(){ markers = handler.addMarkers(&lt;%= raw @hash.to_json %&gt;); handler.bounds.extendWith(markers); handler.fitMapToBounds(); }); } google.maps.event.addDomListener(window, "load", initialize); controller def index @apartments = Apartment.all @hash = Gmaps4rails.build_markers(@apartments) do |apartment, marker| marker.lat apartment.latitude marker.lng apartment.longitude end end When checking source it just shows handler.addMarkers(null)
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: gmaps4rails
answer count: 0
has comment: http://stackoverflow.com/comment/45360654
score: 1
has comment: http://stackoverflow.com/comment/60171654
has title: Gmaps4Rails build_markers not working in javascript
upvote count: 1
has comment: http://stackoverflow.com/comment/60180353
type: Question
tagged with: ruby-on-rails-4.2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45358095
has comment: http://stackoverflow.com/comment/60180258
has comment: http://stackoverflow.com/comment/45364823

http://stackoverflow.com/comment/45378544
has text: Try making `i` a global variable and do not reset it to `0` each time. That may give you a hint or two. (Check to ensure that the value of `i` doesn't get too high though...)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28531737

http://stackoverflow.com/comment/45308537
comment on: http://stackoverflow.com/a/28494156
score: 0
type: AnswerComment
has text: Incorrect ! You can't use `=` to check your IF case.
type: Comment

http://stackoverflow.com/comment/45378942
has text: While I figure out how to do that, can you explain why this works without the function argument (the first block of code)?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28531904

http://stackoverflow.com/q/28493975
has body: can we use the each function on multiple child at once? I have the following code and I want to use each function on both the child in single line. $('.right .submission:not(:first)').each(function(){ student += $(this).val()*multiplier; }); $('.right .viewed:not(:first)').each(function(){ student += $(this).val()*multiplier; });
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28494064
has title: using each function on multiple child
has comment: http://stackoverflow.com/comment/45308175
answer count: 1
favorite count: 0
upvote count: 1
has answer: http://stackoverflow.com/a/28494064
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/45458305
comment on: http://stackoverflow.com/q/28574285
type: Comment
type: QuestionComment
has text: Related: https://stackoverflow.com/questions/7911225/fullscreen-background-video-and-keep-it-centered
score: 0

http://stackoverflow.com/q/28466995
type: UnansweredQuestion
tagged with: php
downvote count: 0
tagged with: filenames
has body: I need to write out a file to disk with special ISO-8859-15 characters. For my own testing purposes, I used: —©®±àáâãäåæÒÓÔÕÖ¼½¾§µçðþú–.jpg ...but the em-dash, en-dash, and the 1/2, 1/4, and 3/4 fractions were replaced with garbage when the file was written to disk with this name, while the other characters in the file name were written out correctly. Why some and not others??? Here is a very simple PHP script to write out a file with just copyright symbols and em-dashes in its name. When I run it, the string is written to the file correctly, but the filename's em-dashes are replaced with garbage: &lt;?php // First, create a text file with the em-dash and the copyright symbol, then put the file prefix into the file: $filename1 = "000—©—©.txt"; $content1 = "000—©—©"; file_put_contents($filename1, $content1); ?&gt; What is the most efficient and elegant way to do this using PHP (or Javascript)? I'm targeting the ISO-8859-15 character set ONLY. Many thanks! Tom
score: 1
has comment: http://stackoverflow.com/comment/45259537
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45275011
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/28472066
tagged with: unicode
linked to: http://stackoverflow.com/q/8039232
favorite count: 0
has title: PHP: How to write file to disk with unicode characters

http://stackoverflow.com/comment/45313334
score: 0
type: Comment
type: QuestionComment
has text: I've tried placing the script directly into the main view and the partial , it's still not picking up the validation ?
comment on: http://stackoverflow.com/q/28484066

http://stackoverflow.com/q/28497338
upvote count: 8
type: UnansweredQuestion
tagged with: css
score: 8
has answer: http://stackoverflow.com/a/28502716
has answer: http://stackoverflow.com/a/28497467
has answer: http://stackoverflow.com/a/28507422
type: Question
has comment: http://stackoverflow.com/comment/45314597
tagged with: javascript
has body: In react.js I need to add a dynamic class name to a div. Using react-addons, I tried it the following way but in vain: var addons = require('react-addons'); var cx = addons.classSet; var Overlay = React.createClass({ render: function() { var prod_id = this.props.prop_id; var large_prod_class = 'large_prod_modal_' + prod_id; var modal_classes = cx({ 'large_prod_modal': true, large_prod_class: true, 'hidden': true }); return ( lorem ipsum ); } }); And Overlay component is used in the following way: <Overlay prod_id="9" /> The prop (i.e: prod_id) value is random however. I do not get the large_prod_modal_9 class for the div. All the classes I get are large_prod_modal,large_prod_class and hidden How to get the large_prod_modal_9 class for the div?
tagged with: reactjs
answer count: 3
downvote count: 0
favorite count: 0
linked to: http://stackoverflow.com/q/11508463
has title: Add a dynamic class name

http://stackoverflow.com/comment/45325359
comment on: http://stackoverflow.com/q/28497672
has text: @Dave Becker Yes! It works, but instead Login$LoginButton should be Login$LoginImageButton!! :)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45390104
comment on: http://stackoverflow.com/q/28537760
score: 0
type: Comment
type: QuestionComment
has text: If Rails has this ability So why use the JavaScript?

http://stackoverflow.com/comment/45402616
comment on: http://stackoverflow.com/q/28543824
score: 0
type: QuestionComment
type: Comment
has text: Thanks for the response, but this doesn't really fix my issue. It slows down the flicker in chrome, but also introduces lag into the chat, and breaks the chat completely in Internet Explorer. I could maybe employ some browser hacks so the change is only applied to Chrome, but the chat server pushes more than just chat messages, and in the context of a game, it's important that these are delivered in real time.

http://stackoverflow.com/comment/45562512
has text: Updated, rephrased question with new code..
comment on: http://stackoverflow.com/q/28586875
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45273002
has text: Thanks Anders! I cannot give +1 to you yet (or haven't found the way to do it) but you really pointed me to the right direction. I'll try to test those ideas today. I'm thinking that if I implement local Storage (session maybe) I can deal with this and another issue I had to do! ;) Thanks again!
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28438981

http://stackoverflow.com/comment/45409868
comment on: http://stackoverflow.com/a/28548431
type: AnswerComment
score: 0
type: Comment
has text: Yup it is an issue with versioning

http://stackoverflow.com/comment/45207689
type: Comment
has text: Does appending a script even do anything? If it's not there on page load it won't do anything.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28438860

http://stackoverflow.com/comment/45335614
has text: @vrmc that is also incorrect. If you want to add a string to the end of a variable you need the `+`. The only time you can get away with not having it is if that variable is the start/end of the string.
type: QuestionComment
comment on: http://stackoverflow.com/q/28508226
type: Comment
score: 1

http://stackoverflow.com/q/28469852
tagged with: ionic-framework
upvote count: 2
has answer: http://stackoverflow.com/a/28471122
tagged with: ios
answer count: 1
linked to: http://stackoverflow.com/q/2899699
favorite count: 0
score: 2
type: AnsweredQuestion
tagged with: cordova
downvote count: 0
has title: Open external url in Ionicframework(Phonegap)
has comment: http://stackoverflow.com/comment/45267427
type: Question
accepted answer: http://stackoverflow.com/a/28471122
has body: I try to invoke the native browser in ionicframework to open a url without plugin. the code: if(ionic.Platform.isAndroid()) { navigator.app.loadUrl(url, {openExternal : true}); }else if(ionic.Platform.isIOS()) { window.open(url, '_system'); } In fact, app can invoke the browser in Android, but in ios, it will replace the current app view instead of open the browser. Please suggest.
tagged with: javascript

http://stackoverflow.com/comment/45328278
type: AnswerComment
comment on: http://stackoverflow.com/a/28504314
has text: I see, sorry, I didn't understand what you meant. Sorry, I never used popovers, so can't help you here... More, I see title is interpolated by AngularJS as well as ng-attr-title... I am quite sure some time ago (and angular versions ago) it was not the case... :-(
type: Comment
score: 0

http://stackoverflow.com/q/28573628
tagged with: postgresql
has answer: http://stackoverflow.com/a/28605242
tagged with: sequelize.js
has comment: http://stackoverflow.com/comment/45481634
has title: Sequelize JS custom query with sub selects
type: UnansweredQuestion
upvote count: 1
tagged with: node.js
score: 1
tagged with: orm
has comment: http://stackoverflow.com/comment/45486625
type: Question
downvote count: 0
answer count: 1
has body: I'm new to ORM and I don't know to do this using an ORM. Considering that i have 5 tables: tag, auction, user, user_tag and auction_tag and I'm using SequelizeJS, how can I get a query like this? select A.id, A.title, A.content, A.createdAt, U.id, U.picture, U.name from Auction A, User U, User U2 where A.userId = U.id and U2.id = x and exists (select AT.id from Auction_Tag AT where AT.auction = A.id and AT.tag in ( select T.id from Tag T, User_Tag UT where U2.id = UT.user and UT.tag = T.id ) ); Any ideas? Thank you guys
tagged with: javascript
favorite count: 0

webpack
tags question: http://stackoverflow.com/q/28572380
type: Tag
tag name: webpack
tags question: http://stackoverflow.com/q/28569686
tags question: http://stackoverflow.com/q/28516768
tags question: http://stackoverflow.com/q/28456718
tags question: http://stackoverflow.com/q/28561396

http://stackoverflow.com/q/28550391
has answer: http://stackoverflow.com/a/28550549
has title: How to fill and add text in a text field with drop down selections
downvote count: 1
type: Question
has body: I'm not a coder ut I've found this code here http://jsfiddle.net/kjy112/kchRh/ None text1 text2 text3 text4 var mytextbox = document.getElementById('mytext'); var mydropdown = document.getElementById('dropdown'); mydropdown.onchange = function(){ mytextbox.value = mytextbox.value + this.value; } I'd like to modify it so that I've more than one dropdown and each one add his text in the same field. Practically I'd have to create a compact code easily for the user so that the user select some phrases using the dropdown and the code will fill the text field. If I can be more precise please let me know. As said Iìm not a coder so if you can write down the code to use I'll be very happy. Thanks!
tagged with: javascript
score: 0
answer count: 2
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/28550796

http://stackoverflow.com/q/28441672
score: 0
has title: how to influence the one element of the plurality of dynamic elements
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28441762
type: AnsweredQuestion
tagged with: jquery-ui-sortable
type: Question
has comment: http://stackoverflow.com/comment/45213479
answer count: 1
has body: http://jsfiddle.net/SergeyKozlov/tewyg2js/3/ I use dynamic insertion HTML code using button events: $("#NewItemImg").click(function(e) { e.preventDefault(); itemCount++; var element = $("\ \ img " + itemCount + "\ \ \ \ \ \ \ Submit \ \ \ \ "); Then I try to delete the new dynamic element using the following code: $("body").on('click', '.column .portlet-close', function () { $(this).closest( ".portlet" ).remove(); }); In this case it works. The problem is how to influence the one element of the plurality of dynamic elements. $("body").on('click', '.column #SetImageURL', function () { //e.preventDefault(); // itemCount++; $("#PanelNewImageURL").show(); $("#ImageURL").hide(); }); When I use this code, when you acquired any button, and acts only on the first.
accepted answer: http://stackoverflow.com/a/28441762
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45213097

http://stackoverflow.com/comment/45208631
type: Comment
comment on: http://stackoverflow.com/a/28439121
score: 0
type: AnswerComment
has text: @ChrisJ yes I see what you mean, that would make it much simpler. Unfortunately I'm looking to do this by copy-and-paste.

http://stackoverflow.com/a/28587886
has comment: http://stackoverflow.com/comment/45487556
has comment: http://stackoverflow.com/comment/45498419
upvote count: 1
has comment: http://stackoverflow.com/comment/45497378
has comment: http://stackoverflow.com/comment/45483346
has comment: http://stackoverflow.com/comment/45482780
answers question: http://stackoverflow.com/q/28587604
has body: Code seems ok remove var keyword, maybe a duplicated on z x2? z = [...jpg,...,jpg,...jpg]; x = ["text","text","text"]; if you have that array of images pointing to a /public folder add it also. &lt;td class="image"&gt;&lt;img src="public/{{thumb}}"&gt;&lt;/td&gt; update if(Meteor.isClient){ z = [...jpg,...,jpg,...jpg]; x = ["text","text","text"]; for(var i=0;i&lt;z.length;i++){ console.log(z[i]) } Template.stop.helpers({ 'thumb': function(){ console.log(z[1]; return z[1]; }, 'snippet': function(){ return x[1]; } }); }
type: Answer
has comment: http://stackoverflow.com/comment/45487472
downvote count: 0
has comment: http://stackoverflow.com/comment/45482820
score: 1
has comment: http://stackoverflow.com/comment/45535573
has comment: http://stackoverflow.com/comment/45483831
has comment: http://stackoverflow.com/comment/45535715
has comment: http://stackoverflow.com/comment/45488200
has comment: http://stackoverflow.com/comment/45497913

http://stackoverflow.com/q/28514159
tagged with: mvvm
has answer: http://stackoverflow.com/a/28514685
accepted answer: http://stackoverflow.com/a/28514685
type: AnsweredQuestion
has title: Knockout.js - Updating an array in parent view model, with value in second view model
tagged with: knockout.js
type: Question
has body: So I have 2 view models, one that houses an array I use that binds each data node in dataList to the form, and the other is used as a model for each data node. I'm trying to update the array in the first viewmodel with the data from the second: HTML: &lt;div data-bind="foreach:mainArray"&gt; &lt;select data-bind="options: $root.ourTypes, optionsValue: 'ID', optionsText: 'Name', value: $data.OurTypeId"&gt;&lt;/select&gt; &lt;/div&gt; JavaScript: var dataList = [ { OurTypeId: 4 }, // there are other values here... { OurTypeId: 2 }, // and here... { OurTypeId: 3 } // and here... ]; var ourTypes = [ { ID:"1", Name:"None", Limit:0 }, { ID:"2", Name:"Fruits", Limit:5 }, { ID:"3", Name:"Vegetables", Limit:5 }, { ID:"4", Name:"Meats", Limit:2 } ]; var myViewModel = new MyViewModel(dataList); ko.applyBindings(myViewModel); function MyViewModel(dataList) { var self = this; self.ourTypes = ourTypes; self.mainArray = ko.observableArray([]); if (dataList.length &gt; 0) { for (var i=0; i&lt;dataList.length; i++) { var myDataViewModel = new MyDataViewModel(dataList[i]); //alert(myDataViewModel.OurType); self.mainArray.push(myDataViewModel); } } } function MyDataViewModel(vm) { var self = this; if (vm != null) { var myType = ""; for (var i=0; i&lt;ourTypes.length; i++) { if (ourTypes[i].ID == vm.OurTypeId) myType = ourTypes[i].Name; } self.OurTypeId = ko.observable(vm.OurTypeId); self.OurType = myType; } else { self.OurTypeId = 0; self.OurType = ""; } self.OurTypeId.subscribe(function(newValue) { var updatedItem = 0; var newName = ""; for (var i=0; i&lt;ourTypes.length; i++) { if (ourTypes[i].ID == newValue) { self.OurType = ourTypes[i].Name; // alert(ourTypes[i].Name); updatedItem = i; } } // I want to do something like this to update "OurType" in mainArray... // var theList = MyViewModel.mainArray(); // theList[updatedItem].OurType = self.OurType; // MyViewModel.mainArray(theList); }); } This is actually a slimmed-down version of the code that just focuses on "ourTypes", my fiddl…
tagged with: javascript
score: 0
tagged with: arrays
answer count: 1
tagged with: viewmodel

http://stackoverflow.com/comment/45217989
comment on: http://stackoverflow.com/q/28444139
has text: I've used DropBox to store static `.json` before and never needed to authorize the `GET` if it was in a public folder. Make sure your URL is correct :)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28579591
downvote count: 0
score: 1
type: Answer
has body: The posted code looks in order, but I'm suspecting that you're not responding with application/json, but with text/html. Make sure you're doing the following in json.php. header('Content-Type: application/json');
upvote count: 1
answers question: http://stackoverflow.com/q/28579491

http://stackoverflow.com/q/28564696
has answer: http://stackoverflow.com/a/28649677
has comment: http://stackoverflow.com/comment/45439878
tagged with: draggable
type: Question
type: AnsweredQuestion
tagged with: jquery-ui-sortable
linked to: http://stackoverflow.com/q/21639020
tagged with: jquery-ui
accepted answer: http://stackoverflow.com/a/28649677
score: 0
answer count: 2
has title: Drag out of a sortable
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28564903
possible better answer: http://stackoverflow.com/a/28564903
has body: Site: http://ace.brianhare.com/test/ I want it so cards can be draggable to the bottom of the screen (Players hand). Right now this functionality works but once it is in the players hand it cannot be dragged out of the hand. I want the cards to be able to be dragged onto the table and then be freely draggable. How do I get the cards to be dragged out of the hand and back to the table freely? It really glitches once a card is dragged to the hand it wont even move.

http://stackoverflow.com/comment/45414630
type: Comment
comment on: http://stackoverflow.com/a/28550410
type: AnswerComment
has text: Sure, I edited the original code by adding the piece above the (twttr) one.
score: 0

http://stackoverflow.com/comment/45358776
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28520936
has text: Asker seems to want a reference to `name.name_one.name_one_A`, not `name.name_one.name_one_A.name_one_A_a`, though, which is possible.
type: AnswerComment

http://stackoverflow.com/a/28466664
has comment: http://stackoverflow.com/comment/45260319
answers question: http://stackoverflow.com/q/28466255
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28466255
score: 5
type: AcceptedAnswer
has body: You just can't run php-code clientside using javascript like that. What you need is a ajax-call to pull the data. For instance by using jQuery. events: { load: function () { // set up the updating of the chart each second var series = this.series[0]; setInterval(function () { $.get( 'get_server_cpu_usage.php', function(result) { var x = (new Date()).getTime(), // current time y = result; series.addPoint([x, y], true, true); } ) }, 1000); } } in your project, create a php-file (in this case get_server_cpu_usage.php) that returns the result of get_server_cpu_usage();
type: Answer
upvote count: 5
has comment: http://stackoverflow.com/comment/45260014

http://stackoverflow.com/q/28495920
type: Question
answer count: 2
tagged with: javascript
favorite count: 0
downvote count: 3
has answer: http://stackoverflow.com/a/28496390
tagged with: regex
upvote count: 0
type: UnansweredQuestion
has body: How do I capture repeating letters in a word like abababa = 2matches( a and b is repeating ) I know how to do it when the letters are adjacent like so /(\w)\1+/ . Thanks
has title: Capture non-adjacent repeating letters
score: -3
has answer: http://stackoverflow.com/a/28498480

http://stackoverflow.com/a/28473443
has comment: http://stackoverflow.com/comment/45285180
has comment: http://stackoverflow.com/comment/45271283
has comment: http://stackoverflow.com/comment/45279332
upvote count: 1
has comment: http://stackoverflow.com/comment/45271324
score: 1
has comment: http://stackoverflow.com/comment/45279417
has body: loop through the characters before H until you arrive at a blank space then loop through starting from the character after the blank space (i.e the P in PHP) and go through that word until you arrive at a space :) var stringOld = "javascript and php"; var space = 0; for(x=17; x&gt;0; x--){ if(stringOld [x] === " ") { space = x; break; } } for(y=space; y&lt;stringOld.length; y++){ if((stringOld[y] === " ") ||( y=stringOld.length)) { var newString = stringOld.slice(space,y); console.log(newString); //alert(newString); } } JSFiddle : http://jsfiddle.net/edrcfq8a/1/
has comment: http://stackoverflow.com/comment/45284010
downvote count: 0
answers question: http://stackoverflow.com/q/28473373
has comment: http://stackoverflow.com/comment/45276971
type: Answer

http://stackoverflow.com/q/28480529
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45284908
type: UnansweredQuestion
has title: Highcharts in AngularJS with inline variables (using Pablojim's Highchart-ng)
type: Question
has body: I'm using the Highchart charting library with AngularJS, using Pablojim's 'Highchart-ng' module. Everything is set up properly, and the following code works as intended: &lt;highchart config="{ type : 'line', series : [{ name : 'Visitors', data : [1, 4, 10, 3] }] }"&gt;&lt;/highchart&gt; But &lt;highchart config="{ type : 'line', series : [{ name : 'Visitors', data : {{visitors}} }] }"&gt;&lt;/highchart&gt; does not. (notice the difference at 'data') I keep getting the following error: Error: [$parse:syntax] Syntax Error: Token 'visitors' is unexpected, expecting [:] at column 122 of the expression [{ type : 'line', series : [{ name : 'Visitors', data : {{visitors}} }] }] starting at [visitors}} }] }]. Note: The variable {{visitors}} is set up properly in my controller, and when using it in my template, the data works fine. It also used to work with my previous charting library, Flot. I've tried multiple workarounds: Normally I can work around this (initialization) problem by adding something like ng-repeat="data in visitors | limitTo: 1" to the directive, so it inits only when the variable becomes available (this works with Flot and EasyPieCharts). Adding ui-refresh="visitors" doesn't work, and data: doesn't work either. So, how can I add variables inline, within my template files?
tagged with: highcharts
tagged with: javascript
has answer: http://stackoverflow.com/a/28480641
tagged with: highcharts-ng
score: 0
has comment: http://stackoverflow.com/comment/45284023
answer count: 1

http://stackoverflow.com/q/28490328
type: Question
answer count: 2
downvote count: 5
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28490438
has title: simple jQuery to the color of the word to blue one at a time
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
upvote count: 2
score: -3
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28490438
possible better answer: http://stackoverflow.com/a/28490538
has body: My simple source is $lol = $(".lol"); $lol.each( function(index) { $(this).delay(200*index).css("color", "blue"); } ); The Fiddle is here http://jsfiddle.net/ra53Lzhw/ I am trying to make each of the word to change its colour to blue one at a time. How can I do that? And how can I do that, so it changes gradually, instead of suddenly changing to blue? Thanks a lot, Stack Overflow!!
has answer: http://stackoverflow.com/a/28490538

http://stackoverflow.com/q/28533133
favorite count: 0
tagged with: drag-and-drop
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45457896
has comment: http://stackoverflow.com/comment/45381090
has comment: http://stackoverflow.com/comment/45381169
type: AnsweredQuestion
has title: replace image with drag drop
score: 1
accepted answer: http://stackoverflow.com/a/28707170
type: Question
has body: I've gotten help from several on this site developing a drag/drop educational game where students drag images into the proper order. I was able to accomplish my goals in a Winform with Visual Basic. Now I'm trying to do the same in html. Using the three functions below, I'm able to drag and drop an image from one div into another empty div. But it doesn't work if I attempt to drop an image into a div that already contains an image. I did see a response in StackOverflow about using this line "ev.target.removeChild(ev.target.childNodes[0]" in the drop function. But this just creates an error "Argument 1 of Node.removeChild is not an object." Thanks for your help.
tagged with: javascript
has answer: http://stackoverflow.com/a/28707170
upvote count: 1
answer count: 1
downvote count: 0

http://stackoverflow.com/a/28470467
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/45292332
answers question: http://stackoverflow.com/q/28466718
has body: I created working plunker here. You are almost there. This is the updated state def: $stateProvider .state('root', { //abstract: true, //url: '/', views: { header: { controller: 'HeaderCtrl as Header', templateUrl: 'tpl.header.html', }, } }) .state('root.base', { params: { pl : null, p2: "", p3: "abc" }, resolve: { data: function () { return 1 } }, url: '/{p1:string}/{p2:string}/{p3:string}', views: { 'body@': { controller: "MyCtrl", templateUrl: 'tpl.body.html', } } }); Firstly, very important, we have to use absolute naming for child state view name 'body@'. See: View Names - Relative vs. Absolute Names Behind the scenes, every view gets assigned an absolute name that follows a scheme of viewname@statename, where viewname is the name used in the view directive and state name is the state's absolute name, e.g. contact.item. You can also choose to write your view names in the absolute syntax. For example, the previous example could also be written as: .state('report',{ views: { 'filters@': { }, 'tabledata@': { }, 'graph@': { } } }) Secondly, no url at the parent is specified... that will make it not accessible by url. Also, abstract is not needed... could be ... but if we would like to use .when() it is better to make it non abstract. Check these: Angular UI-Router $urlRouterProvider .when not working when I click Angular UI-Router $urlRouterProvider .when not working *anymore* Working plunker with the above stuff is here
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28466718

http://stackoverflow.com/comment/45373055
type: AnswerComment
score: 0
has text: @Kotik - there is no method call. Functions are just a reference type that have the extra ability to dereference to a procedure.
type: Comment
comment on: http://stackoverflow.com/a/28528801

event-handling
tag name: event-handling
tags question: http://stackoverflow.com/q/28552087
tags question: http://stackoverflow.com/q/28534549
tags question: http://stackoverflow.com/q/28448641
type: Tag
tags question: http://stackoverflow.com/q/28554144
tags question: http://stackoverflow.com/q/28439929

http://stackoverflow.com/q/28513392
has answer: http://stackoverflow.com/a/28513715
type: Question
has body: To prevent having to build the same html for a label and text combination, I have a Handlebar function to generate the HTML for me. So for example I have this {{{labelSpan 'Input Type' inputType}}} {{{labelSpan 'Formula' showFriendlyFormula formula }}} And the handlebar function UI.registerHelper('labelSpan', function(label, value){ return '&lt;p&gt; &lt;label&gt;' + label + ':&lt;/label&gt;&lt;br&gt; &lt;span&gt;' + value + '&lt;/span&gt;&lt;/p&gt;'; }); Now inputType is fine because it is part of the context. However, showFriendlyFormula is derived from another helper method because essentially I need to do a whole of additional things to this Template.create.helpers({ showFriendlyFormula: function(formula) { return share.convertFormulaToAnotherInputField(formula); } }); Obviously, calling {{{labelSpan 'Formula' showFriendlyFormula formula }}} is going to fail, so is there a way for me to pass into labelSpan, the output of showFriendlyFormula(formula)
answer count: 1
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45345699
has title: Can I pass a helper into a handlebar function?
tagged with: meteor
type: UnansweredQuestion
tagged with: handlebars.js

http://stackoverflow.com/a/28592198
score: 0
answers question: http://stackoverflow.com/q/28592104
has body: Define a event handler function ( using jquery for simplicity ): $(".button-dashboard-save").click ( function ( eve ) { return interface.saveChanges ( eve.target ); }); This provides interface.saveChanges with the triggering element as a parameter. Your html slightly simplifies: Save
type: Answer

http://stackoverflow.com/q/28479171
upvote count: 3
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/30462798
has title: svgPanZoom: Disable click listener when panning
score: 3
tagged with: svgpanzoom
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has body: This is a library-specific question for ariutta/svg-pan-zoom. I've got an SVG element with some &lt;a&gt; tags. Via jQuery, I handle clicks on those elements: $('svg').on('click', 'a', function() { ... }). Now I added the library mentioned above for zooming and panning the SVG element. That works great, except every time i pan when the cursor is on an a element, it fires the click listener. How can I prevent the listener from firing when the mouseup resulted from a pan?
has answer: http://stackoverflow.com/a/28528282
favorite count: 0

http://stackoverflow.com/comment/45248489
comment on: http://stackoverflow.com/a/28460226
type: AnswerComment
type: Comment
score: 0
has text: I fail to parse the structure: '[thing] is created once until [condition]'

http://stackoverflow.com/q/28449265
type: Question
has comment: http://stackoverflow.com/comment/45230511
tagged with: javascript
tagged with: jquery
upvote count: 3
has answer: http://stackoverflow.com/a/28449890
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28449890
has body: need to change button font size on window resize. (using bootstrap3). I have menu in left side and when it's full width (240px) it looks like this: and then i resize window, or press button to toggle the side menu it looks like this: And I would like to change that button size and it would be enough for me. button code is: + Add event and css of that button is: .btn { font-size: 13px; padding: 7px 12px; line-height: 18px; text-align: center; white-space: nowrap; vertical-align: middle; cursor: pointer; -webkit-user-select: none; border-radius: 4px; } .btn-addevent { background: #213246; color: #fff; border: 2px solid #5d95ca; text-transform: uppercase; font-weight: 600; transition: .5s; } .btn-block { display: block; width: 100%; } .sidebar-addevent { text-align: center; padding: 30px 30px 15px 10px; }
possible better answer: http://stackoverflow.com/a/28452640
has answer: http://stackoverflow.com/a/28450938
favorite count: 0
has title: bootstrap change button text size on window rezise
tagged with: twitter-bootstrap-3
has answer: http://stackoverflow.com/a/28451629
has answer: http://stackoverflow.com/a/28452640
tagged with: css
answer count: 4
type: AnsweredQuestion
score: 3
downvote count: 0

webbrowser-control
type: Tag
tags question: http://stackoverflow.com/q/28515968
tag name: webbrowser-control

http://stackoverflow.com/comment/45301222
type: Comment
type: QuestionComment
has text: @akonsu That is exactly what I want. I do not want the ? mark, I only need to get the position which follow it(I just want to indicate ? as a position pattern and get what following it. I read some posts, it is called lookahead or something like that)
comment on: http://stackoverflow.com/q/28484130
score: 0

http://stackoverflow.com/comment/45405402
has text: Please define "not working". What you expect your code to do, and what it does instead?
score: 2
comment on: http://stackoverflow.com/q/28546165
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45293552
has text: @Josh Thanks, I will try it and let you know in a bit.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28484979

http://stackoverflow.com/comment/45323448
comment on: http://stackoverflow.com/a/28501296
score: 0
type: Comment
type: AnswerComment
has text: This is tough to describe over words. Here is the situation: {[array], [array], [array], [arra], [array], [[array],[array]], [[array],[array]]}. The two arrays that have two arrays, I'd like to flatten/merge those two arrays so that all of the values of the two arrays are still there but are all together in one array so that the situation looks like: {[array], [array], [array], [arra], [array], [array], [array]} I have created both an object of 7 arrays and an array of 7 arrays so I could easily work with either to get the solution described above. I've not gotten Mac's code to work for me.

http://stackoverflow.com/q/28507445
has title: JQuery wrap() function only correctly wraps links around image first time through a loop
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28507511
type: Question
has body: The following code is simply supposed to loop through a list of artists generating an image and a link for each item. This works the first time through the loop, however for subsequent iterations the wrap() link around the image doesn't seem to be added. I've tried a few various ways, including having all the code to be wrapped in a separate variable and the best I've got is that the link will be generated, but not actually wrapped around the thumb class (*). I'm afraid client-side goings-on aren't my strong point so I'm struggling to see why only the first iteration of the loop is successfully wrapped in a link. *That was using dynamically-generated attribute IDs and wrapping that instead of using the class attribute as follows. function showArtists(adata) { $("#artists").html(""); for (var i = 0; i &lt; adata.artists.length; i++) { var artist = adata.artists[i]; var artistSpan = document.createElement("span"); artistSpan.setAttribute("class", "artistView"); var artistPic = document.createElement("img"); artistPic.setAttribute("class","thumb"); artistPic.setAttribute("src",artistPicture) $('.thumb').wrap(function() {return "&lt;a href='#' onclick ='getAlbums(artist)'&gt; &lt;/a&gt;"}); artistSpan.appendChild(artistPic); $("#artists").append(artistSpan); } }
has comment: http://stackoverflow.com/comment/45334524
has comment: http://stackoverflow.com/comment/45335029
accepted answer: http://stackoverflow.com/a/28507511
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45334914
has comment: http://stackoverflow.com/comment/45335057

http://stackoverflow.com/comment/45338091
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28509479
has text: check input validation on both client and server side @Mex
score: 0

http://stackoverflow.com/a/28464446
type: Answer
answers question: http://stackoverflow.com/q/28464408
score: 2
upvote count: 2
has body: You could attach the event handler to an ancestor that does exist on the page on page load and create a delegated event handler: $(document.body).on('click', '.myLink', function (event) { /* ... */ });
has comment: http://stackoverflow.com/comment/45296889
has comment: http://stackoverflow.com/comment/45295497
downvote count: 0
has comment: http://stackoverflow.com/comment/45296649

asp.net-mvc-4
tags question: http://stackoverflow.com/q/28582863
tags question: http://stackoverflow.com/q/28509647
tags question: http://stackoverflow.com/q/28476986
tags question: http://stackoverflow.com/q/28465248
tags question: http://stackoverflow.com/q/28474701
tag name: asp.net-mvc-4
tags question: http://stackoverflow.com/q/28538062
tags question: http://stackoverflow.com/q/28585541
type: Tag
tags question: http://stackoverflow.com/q/28455767
tags question: http://stackoverflow.com/q/28445867
tags question: http://stackoverflow.com/q/28503199
tags question: http://stackoverflow.com/q/28450330
tags question: http://stackoverflow.com/q/28494504

twilio
tag name: twilio
tags question: http://stackoverflow.com/q/28470699
type: Tag

http://stackoverflow.com/comment/45279332
comment on: http://stackoverflow.com/a/28473443
has text: probably because i added a space at the end of the string by accident. delete that space but also add in the conditional > if(stringOld[y] === " " || y=stringOld.length-1) should work :)
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28552924
tagged with: jquery
has body: I have built an extension that grabs some info from a div on a page and stores it in a variable called 'div'. I now need to pass that value into my background.js file so that I can update the badge to reflect the text in that variable. I have read through the sendMessage info but every time I add the line of code to my page it seems to break the extension so I am definitely doing something wrong. Here is the code without the setBadgeText info in it (currently functioning). getQueue.js var myVar = null; setFunction(); function setFunction() { myVar = setInterval(function () {myTimer();}, 10000); } function myTimer() { var THRESHOLD = 0; var div = document.getElementById("sessions_queued_now_row-000"); var num = parseInt(div.innerText); // Here is where I want to pass div to background.js to update the badge text if (num &gt;= THRESHOLD) { // I do a bunch of stuff here } } My background.js file isnt doing much right now but opening up a URL in a new tab. I am looking for what I need to add to both the getQueue.js file and also the background.js file. Thanks
accepted answer: http://stackoverflow.com/a/28565876
tagged with: google-chrome-extension
has title: Pass Variable to Badge Text in Chrome Extension
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28565876
tagged with: google-chrome
type: Question
score: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/28535290
score: 1
has body: You are missing $http in array:- It should be like: angular.module('sd').controller('CJController', [ '$scope','$http', 'jcreate', function($scope, $http, jcreate) { .. } Second you cannot use $scope inside the service of angular js. Just remove it and use alternative.
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28535271
upvote count: 1

http://stackoverflow.com/comment/45386174
type: AnswerComment
type: Comment
has text: Here's the [Plunkr](http://plnkr.co/edit/gNIOBewedG37dL7VPgTA?p=preview) with your solution added - failing on the `nuke()` function.
comment on: http://stackoverflow.com/a/28502010
score: 0

http
tags question: http://stackoverflow.com/q/28526980
tags question: http://stackoverflow.com/q/28464207
tags question: http://stackoverflow.com/q/28548487
tags question: http://stackoverflow.com/q/28587956
tag name: http
tags question: http://stackoverflow.com/q/28461736
type: Tag
tags question: http://stackoverflow.com/q/28587085
tags question: http://stackoverflow.com/q/28591126
tags question: http://stackoverflow.com/q/28515795
tags question: http://stackoverflow.com/q/28473305
tags question: http://stackoverflow.com/q/28573778
tags question: http://stackoverflow.com/q/28504052
tags question: http://stackoverflow.com/q/28550583
tags question: http://stackoverflow.com/q/28559828
tags question: http://stackoverflow.com/q/28517500

memoization
type: Tag
tags question: http://stackoverflow.com/q/28441821
tags question: http://stackoverflow.com/q/28575315
tag name: memoization

http://stackoverflow.com/comment/45477608
type: Comment
has text: Currenlty the events are on button $('#button') but I need that every button will open different event,how should I do that ? for example button 2 should open event onClick2....
comment on: http://stackoverflow.com/a/28584842
score: 0
type: AnswerComment

http://stackoverflow.com/a/28482830
type: Answer
has body: Solved it. var value = $('input[name="radio"]:checked', '#myForm').val(); $("input[name=radio]:radio").change(function() { $("#table").empty(); $('#input').val(''); });
accepted answer of: http://stackoverflow.com/q/28480152
answers question: http://stackoverflow.com/q/28480152
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/28483650
has answer: http://stackoverflow.com/a/28484256
has title: jQuery .hover and .mouseleave Unintentional looping. How do I fix
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45289969
tagged with: css
type: AnsweredQuestion
downvote count: 0
has body: What I'm looking to do: Hover over image, image fades Out. Text fade In after image fades Out. Text fade-out with mouse-leave. Original image fade-in. End with original image and no text shown Problem: I have the steps working, but they seem to keep looping, show the image and text flash on and off. Any suggestions? $("img").hover(function(){ $(this).fadeOut(); $("p").text("CHAIR").fadeIn(); }); $("p").mouseleave(function(){ $("p").fadeOut(); $("img").fadeIn("slow"); }); p { display: none; position: absolute; left: 100px; top: 150px; font-size:45px; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;img id="chair" src="http://edufurniture.com/images/catalog/category13.jpg" alt=""&gt; &lt;p&gt;&lt;/p&gt; jsfiddle example of steps 1 - 4
score: 1
has comment: http://stackoverflow.com/comment/45289803
type: Question
tagged with: javascript
tagged with: image
accepted answer: http://stackoverflow.com/a/28484256
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45289932
tagged with: jquery
favorite count: 0

object-literal
tag name: object-literal
tags question: http://stackoverflow.com/q/28520906
type: Tag
tags question: http://stackoverflow.com/q/28491708

http://stackoverflow.com/q/28555875
answer count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
tagged with: ajax
has comment: http://stackoverflow.com/comment/45427811
type: Question
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/45451448
score: 0
has body: I have a CarType model with attributes as manufacturere and model, based on which a Car model is specified. Car model has only one attribute as color. I have defined associations as follows: In CarType.rb: has_many :cars In Car.rb: belongs_to :car_type I am using simple_form to create new Car instances. However, since the Car model does not have manufacturer and model attributes, I need to specify the associated CarType and then, specify color. In the form, the user should select the manufacturer first, to enable the list of models, where the list should include only the models related to that manufacturer. Then the user will specify the color. The way I want to implemented defining the manufacturere and model for Car is this: I use a select_tag to specify the manufacturer first and then using jquery and ajax, I get the list of related models of that manufacturere and then I enable the field for model with the list of models based on that manufacturer. Based on the selected model, I specify the association as well to be used later. In summary I have the following in the form for defining new Car: = select_tag "manufacturer", options_for_select(CarType.all.map{|s| s.manufacturer}.uniq, (f.object.car_type_id ? f.object.car_type.manufacturer : nil)), input_html: {id:'manufacturer_ajax'} = f.association :car_type, input_html:{ id:'model_js'} and for jquery I have: javascript: $(function(){ $("#manufacturer_ajax").change(function(){ $.ajax({ url: '#{SETTINGS[:root_path]}admin/car_type/models.json', data: {manufacturer:$(this).val()}, dataType: "json", type: "GET" }).done(function(data){ $("#model_js").html("&lt;option&gt; &lt;/option&gt;"); $.each(data, function(index,item){ $("#model_js").append("&lt;option value="+item.id+"&gt;"+item.model+"&lt;/option&gt;"); }); $("#model_js").removeAttr("disabled"); }); }); }); I have checked ajax in the console and saw that it works well and gets the related models. But after ajax,("#model_js").removeAttr("disabled"); is not doing i…
has title: simple_form association list change by jquery

http://stackoverflow.com/comment/45269432
has text: Please provide your html code for check your elements ;)
score: 0
comment on: http://stackoverflow.com/a/28472458
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45281698
type: Comment
comment on: http://stackoverflow.com/q/28479474
has text: put in `console.log($self);` and it should appear in your browser's console. Alternatively you could put a watch on self and a breakpoint in the browser's debug tool.
score: 1
type: QuestionComment

webpage-screenshot
type: Tag
tag name: webpage-screenshot
tags question: http://stackoverflow.com/q/28562846

http://stackoverflow.com/comment/45282715
score: 1
has text: I don't have issues with selecting a button. I can't simulate click on it. Here is your example: http://i.imgur.com/riFnz1o.png Result the same.
comment on: http://stackoverflow.com/a/28477683
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28572361
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45454657
accepted answer: http://stackoverflow.com/a/28573043
has title: Displaying images in Javascript corresponding to buttons
possible better answer: http://stackoverflow.com/a/28572976
downvote count: 1
has answer: http://stackoverflow.com/a/28572976
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45454479
tagged with: javascript
score: -1
type: Question
has comment: http://stackoverflow.com/comment/45455045
answer count: 2
has body: So far I am able to get a button to create a new image element, but that is about it. I need to have one button display one image, and another button to display a different image in it's place. All of the answers have lead to me to results that just display the new image below the first. Must be in plain Javascript and HTML. function f1() { var img = document.createElement("img"); img.setAttribute("src", "test1.png"); img.setAttribute("width", "256"); img.setAttribute("height", "256"); img.setAttribute("alt", "pic"); document.body.appendChild(x);} function f2() { var img = document.createElement("img"); img.setAttribute("src", "test2.png"); img.setAttribute("width", "256"); img.setAttribute("height", "256"); img.setAttribute("alt", "pic"); document.body.appendChild(x);} Each script is tied to an onclick button in HTML, and it sort of works. I can get my images to appear, but each button click creates a new element and I believe it's due to the append statement, but I don't know how to get it to show up otherwise. Figured it out: by initializing the img variable outside of the functions and having the buttons modify the source of the image. It works fine.
upvote count: 0
has answer: http://stackoverflow.com/a/28573043
favorite count: 0

wordpress
tags question: http://stackoverflow.com/q/28591428
tags question: http://stackoverflow.com/q/28528526
tags question: http://stackoverflow.com/q/28441573
tags question: http://stackoverflow.com/q/28509452
tags question: http://stackoverflow.com/q/28561195
tags question: http://stackoverflow.com/q/28574685
tags question: http://stackoverflow.com/q/28552049
tags question: http://stackoverflow.com/q/28526932
tags question: http://stackoverflow.com/q/28568439
tags question: http://stackoverflow.com/q/28567980
tags question: http://stackoverflow.com/q/28521942
tags question: http://stackoverflow.com/q/28545954
tags question: http://stackoverflow.com/q/28440088
tags question: http://stackoverflow.com/q/28561115
tags question: http://stackoverflow.com/q/28547598
tags question: http://stackoverflow.com/q/28462534
tags question: http://stackoverflow.com/q/28589671
tags question: http://stackoverflow.com/q/28510263
tags question: http://stackoverflow.com/q/28567965
tags question: http://stackoverflow.com/q/28570329
tags question: http://stackoverflow.com/q/28563564
tags question: http://stackoverflow.com/q/28552639
tags question: http://stackoverflow.com/q/28580235
tags question: http://stackoverflow.com/q/28479956
tag name: wordpress
tags question: http://stackoverflow.com/q/28567737
tags question: http://stackoverflow.com/q/28467347
tags question: http://stackoverflow.com/q/28514856
tags question: http://stackoverflow.com/q/28568560
tags question: http://stackoverflow.com/q/28491260
tags question: http://stackoverflow.com/q/28570015
tags question: http://stackoverflow.com/q/28476139
tags question: http://stackoverflow.com/q/28458301
tags question: http://stackoverflow.com/q/28508223
tags question: http://stackoverflow.com/q/28572053
tags question: http://stackoverflow.com/q/28466975
tags question: http://stackoverflow.com/q/28499737
type: Tag
tags question: http://stackoverflow.com/q/28520114

http://stackoverflow.com/a/28537803
score: 4
upvote count: 4
answers question: http://stackoverflow.com/q/28522749
downvote count: 0
type: Answer
has body: Must notice here that the suggested solution converts HTML into image and then the raster image is converted into PDF. If you want to save into PDF that is searchable (so can be archived and printed with best quality) and the text is printed clearly then you should consider one of these options: Ask user to save the page into PDF by providing instruction to do so for Google Chrome or Safari (both browsers are able to "print" page into PDF files). Maybe you may even try to show this instruction and invoke the printing dialog Use some of client side javascript libraries to generate PDF from the data with the tool like jsPDF (free, open source) or similar

http://stackoverflow.com/comment/45208666
comment on: http://stackoverflow.com/q/28439458
score: 0
type: Comment
type: QuestionComment
has text: you need to "yield".

http://stackoverflow.com/a/28697396
answers question: http://stackoverflow.com/q/28583777
has comment: http://stackoverflow.com/comment/64447435
score: 0
has body: Struggling with a similar problem: one thing I noticed about your code, you do not set your Content-Type header to multipart/form-data. I do not have a working sample yet, but I'm pretty sure to use FormData, you need that old multipart/form-data magic.
has comment: http://stackoverflow.com/comment/64460355
type: Answer

http://stackoverflow.com/comment/45291335
comment on: http://stackoverflow.com/q/28484130
score: 0
type: Comment
type: QuestionComment
has text: you cannot get anything from a non-capture group. they are non-capturing. they are only used for grouping.

http://stackoverflow.com/a/28569593
answers question: http://stackoverflow.com/q/28569421
has body: I assume you mean that you are using the express static middleware, in which case you can use the dotfiles option. express.static( 'path', { dotfiles: 'allow' } ); If you're not using static middleware, maybe provide a bit more detail (and some code) – and I can try to help you out. Cheers. EDIT Still don't know what your callback looks like, but I have to assume you're using res.sendFile(). If that's the case, just try res.sendFile( '/my/area/.git', { dotfiles: 'allow' } ); If you're not using sendFile, please post your entire callback. I'm not sure how Express could be automatically 403-ing that request.
downvote count: 0
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/45408664
score: 0
type: Comment
type: QuestionComment
has text: @Rakesh_Kumar Because that property is built in that object ; ). Please read the documentation I've linked above, there's just one property and two methods introduced.
comment on: http://stackoverflow.com/q/28547713

http://stackoverflow.com/comment/45396306
comment on: http://stackoverflow.com/a/28540834
has text: Thanks for the full explanation and the fb parse method, really helped. It didn't really work when parsing a single DOM element but whatever, it gets the job done, as the respective template is quite small.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28491291
has comment: http://stackoverflow.com/comment/45303529
answers question: http://stackoverflow.com/q/28491192
upvote count: 3
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45303904
type: Answer
has comment: http://stackoverflow.com/comment/45329062
downvote count: 0
score: 3
accepted answer of: http://stackoverflow.com/q/28491192
has body: While this isn't a nice solution, what you could possibly do is set the content property for some target element. @media ... #target { content: "sidebar-open"; } Since the element is not a :before or :after, the content will compute to none for rendering, but you can still read the value with Javascript: $('#target').css('content'); //"sidebar-open"

http://stackoverflow.com/a/28560552
has comment: http://stackoverflow.com/comment/45432531
score: -1
has body: Not only performance:) It's because of the minify things. U can read about: Angular Inject minify
downvote count: 1
has comment: http://stackoverflow.com/comment/45432616
answers question: http://stackoverflow.com/q/28560437
type: Answer
upvote count: 0

http://stackoverflow.com/comment/45364927
has text: This is cleaner, use this in combination with the hidden field in model.
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28524453

http://stackoverflow.com/comment/45428082
type: Comment
comment on: http://stackoverflow.com/q/28555812
has text: Is there any reason why you need to include the module? I think you can just reference the js for your tests using a test runner.
score: 0
type: QuestionComment

http://stackoverflow.com/q/28580904
tagged with: javascript
answer count: 3
has body: I want to add span tag with the specific class to all the numbers in my website using JavaScript. However I got the following: But the problem is as below example: If the number is: 45 7320272536 It put like this: 45 7320272536 I want like this: 45 7320272536
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45471194
has answer: http://stackoverflow.com/a/28582027
has comment: http://stackoverflow.com/comment/45470831
has answer: http://stackoverflow.com/a/28581608
has answer: http://stackoverflow.com/a/28582361
score: 2
upvote count: 2
type: UnansweredQuestion
type: Question
has title: adding a span to all the numbers in the body tag of the website using javascript

http://stackoverflow.com/q/28584758
type: Question
has body: I am creating a custom build in DOJO. I need to to keep in the build folder dojoConfig.js file not minified. At the moment I am trying to: - exclude dojoConfig.js from build using miniExclude, this works fine work fine - after copyOnly to final build dojoConfig.js without compression, this does NOT work. I need to copy dojoConfig.js in the build foler. Any idea what is wrong in my profile? miniExclude: function(o, e) { return e in { "aaa/aaa.profile": 1, "aaa/dojoConfig": 1 } }, copyOnly: function(o, e) { return e in { "aaa/dojoConfig": 1 } } var profile = function() { return { basePath: "../", releaseDir: "dist", releaseName: "build", optimize: "closure", action: "release", layerOptimize: "closure", copyTests: !1, stripConsole: "all", version: "0.0.0", cssOptimize: "comments", mini: !0, copyTests: !1, useSourceMaps: !1, staticHasFeatures: { "config-dojo-loader-catches": 0, "config-tlmSiblingOfDojo": 0, "dojo-amd-factory-scan": 0, "dojo-combo-api": 0, "dojo-config-api": 1, "dojo-config-require": 0, "dojo-debug-messages": 0, "dojo-dom-ready-api": 1, "dojo-firebug": 0, "dojo-guarantee-console": 1, "dojo-has-api": 1, "dojo-inject-api": 1, "dojo-loader": 1, "dojo-log-api": 0, "dojo-modulePaths": 0, "dojo-moduleUrl": 0, "dojo-publish-privates": 0, "dojo-requirejs-api": 0, "dojo-sniff": 1, "dojo-sync-loader": 0, "dojo-test-sniff": 0, "dojo-timeout-api": 0, "dojo-trace-api": 0, "dojo-undef-api": 0, "dojo-v1x-i18n-Api": 1, "dojo-xhr-factory": 0, dom: 1, "host-browser": 1, "extend-dojo": 1 }, resourceTags: { amd: function(o) { return /\.js$/.test(o) }, miniExclude: function(o, e) { return e in { "aaa/test.profile": 1, "aaa/dojoConfig": 1 } }, copyOnly: function(o, e) { return e in { "test/dojoConfig": 1 } } }, packages: [{ name: "dojo", location: "dojo" }, { name: "test", location: "test" }], layers: { "dojo/dojo": { include: ["dojo/dojo"], customBase: !0, boot: !0 }, "aaa/aaa-shared": { include: ["test/shared/bootstrapShared"], customBase: !0, boot: !1 }, "aaa/aaa-content":…
accepted answer: http://stackoverflow.com/a/28918318
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28918318
answer count: 1
tagged with: dojo
type: AnsweredQuestion
has title: Dojo Build - copyOnly does not work in profile

http://stackoverflow.com/a/28582562
has comment: http://stackoverflow.com/comment/45473453
score: 3
upvote count: 3
downvote count: 0
has body: I added a button and attached the previous #center mouse events on the button see this working fiddle: http://jsfiddle.net/o0q5nszz/11/ $(document).ready(function(){ $(document).focus(); var keyPressed = false; var mouseovered = false; $("#btn").mouseover(function(e){ doStuff(); mouseovered = true; }); $("#btn").mouseout(function(){ doStuff(); mouseovered = false; }); $(document).keydown(function(e){ doStuff(); if (e.ctrlKey) { keyPressed = true; } else keyPressed = false; }); $(document).keyup(function(e){ if (keyPressed) { keyPressed = false; } doStuff(); }); function doStuff() { if(mouseovered &amp;&amp; keyPressed) $("#center").css({"color": "#000"}); else $("#center").css({"color": "#fff"}); } });
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45473644
answers question: http://stackoverflow.com/q/28582254
accepted answer of: http://stackoverflow.com/q/28582254
type: Answer

http://stackoverflow.com/a/28476559
score: 0
answers question: http://stackoverflow.com/q/28476195
has body: It will be helpful if you ask your question in more detail. However have you tried ng-init="date=''" before input element?
type: Answer
has comment: http://stackoverflow.com/comment/45276526

http://stackoverflow.com/q/28572553
has title: Is it possible to using Javascript prototypes without using the "new" keyword?
answer count: 6
tagged with: prototype
possible better answer: http://stackoverflow.com/a/28572967
downvote count: 0
has answer: http://stackoverflow.com/a/28572745
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28572630
favorite count: 0
has answer: http://stackoverflow.com/a/28572704
has body: The fact that Javascript uses functions to create objects was confusing to me at first. An example like this is often used to highlight how prototypes work in Javascript: function Car(){ this.setModel=function(model){ this.model=model; } this.getModel=function(){ return this.model; } } function Bus(){} Bus.prototype=new Car(); var obj=new Bus(); obj.setModel('A Bus'); alert(obj.getModel('A Bus'); Is it possible to use prototypes without using new FunctionName()? I.e. something like this: var Car={ setModel:function(model){ this.model=model; }, getModel:function(){ return this.model } } var Bus={ prototype:Car; }; var obj=Bus; obj.setModel('A Bus'); alert(obj.getModel()); This does not use functions and new to create objects. Rather, it creates objects directly. Is this possible without deprecated features like Object.__proto__ or experimental functions like Object.setPrototypeOf()?
score: 3
has answer: http://stackoverflow.com/a/28573310
type: AnsweredQuestion
upvote count: 3
has answer: http://stackoverflow.com/a/28574454
linked to: http://stackoverflow.com/q/16063394
has comment: http://stackoverflow.com/comment/45454902
has answer: http://stackoverflow.com/a/28572630
type: Question
has answer: http://stackoverflow.com/a/28572967
tagged with: oop

http://stackoverflow.com/q/28561396
tagged with: papaparse
has comment: http://stackoverflow.com/comment/45448693
upvote count: 4
type: AnsweredQuestion
downvote count: 0
type: Question
has body: I am using PapaParse to load a csv file from a file input. Currently, I have a working version where I load PapaParse using a script tag: &lt;script type="text/javascript" src="papaparse.js" &gt;&lt;/script&gt; And handle the change event: Papa.parse(event.target.files[0], { complete: function(results) { ... } } I now want to use webpack to bundle up my js and I want to load PapaParse dynamically just when I need it, not every time into the global namespace. Something like this: require("./papaparse.js").Papa.parse(event.target.files[0], { complete: function(results) { ... } } Unfortunately this gives me the error Uncaught ReferenceError: Papa is not defined from this line in the PapaParse library: if (!config.chunkSize) config.chunkSize = Papa.LocalChunkSize; Is there any way of making this work? [Edit] I'm completely new to requirejs / webpack, so I'm not sure if this is the right way to fix this, but I managed to get this working (unfortunately still polluting the window namespace) by using the following shim configuration: require("imports?this=&gt;window!exports?global.Papa!./papaparse.js").parse(event.target.files[0], { complete: function(results) { ... } } As I understand it, the first directive (imports?this=&gt;window) uses the imports loader to set the global parameter to be the window object (as opposed to an empty object). This makes the calls in PapaParse to global.document and global.postMessage() work (and also seems to make the unqualified calls to Papa work - ie the ones not prefixed as global.Papa). The second directive (exports?global.Papa) means that the Papa object is exported as the returned object from the require call. I would be interested if someone experienced with webpack could advise whether this is the correct way to deal with this?
accepted answer: http://stackoverflow.com/a/28889607
has comment: http://stackoverflow.com/comment/45480259
has title: Loading PapaParse dynamically with webpack
score: 4
has comment: http://stackoverflow.com/comment/45442137
has answer: http://stackoverflow.com/a/28889607
tagged with: webpack
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/45239076
comment on: http://stackoverflow.com/a/28456290
has text: ahh thanks very much .. thats where i was going wrong .. this has sorted it now thanks very much
type: Comment
type: AnswerComment
score: 0

http://stackoverflow.com/a/28505689
accepted answer of: http://stackoverflow.com/q/28505432
upvote count: 1
answers question: http://stackoverflow.com/q/28505432
has comment: http://stackoverflow.com/comment/45371026
type: AcceptedAnswer
downvote count: 0
score: 1
has body: Assuming that your CSV rather looks like this: Country,Production US,7362 Canada,3003 Mexico,3795 Argentina,900 Brazil,1548 I tried jQuery-csv and it works fine. So make sure that the data in your CSV is on multiple lines and not only one.
type: Answer
has comment: http://stackoverflow.com/comment/45354874
has comment: http://stackoverflow.com/comment/45359240

http://stackoverflow.com/comment/45286619
score: 0
type: AnswerComment
has text: Any string can be stored in the LocalStorage. Grab any values from your DOM with jQuery, store them in the LS and retrieve them on another page. SerializeArray is just a very convenient shorthand to grab and JSONize all the data in a form.
type: Comment
comment on: http://stackoverflow.com/a/28481264

http://stackoverflow.com/q/28437095
has comment: http://stackoverflow.com/comment/45204287
type: Question
has comment: http://stackoverflow.com/comment/45204254
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28437197
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28437197
tagged with: jquery
has answer: http://stackoverflow.com/a/28437339
accepted answer: http://stackoverflow.com/a/28437339
has title: deleting the table after rows are deleted
tagged with: http://stackoverflow.com/tag/html
has body: I m trying to delete the table after all the rows deleted but somehow i cant check if table has children after deleting all the rows. I dont understand why looking for the child elements length doesnt work here ? any suggestions ? table manipulation i m the first row ! destroy ! i m the second row ! destroy ! i m the third row ! destroy ! i m the fourth row ! destroy ! var id ; var table = $(' ').addClass('foo'); function destroy(){ var theParent = document.querySelector("#table1"); var parent = $("#" + id).parent(); $("#" + id).fadeOut( "slow", function() { $(parent).closest('tr').remove(); alert(theParent.innerHTML); }); var row = $('<tr ').addClass('bar').text(parent.siblings().html()); table.append(row); $("#newtable").append(table); parent.siblings().remove(); theParent.addEventListener("click", doSomething, false); } function doSomething(e) { if($("#table1").children().length < 1 ){ theParent.remove(); } } function reply_click(clicked_id) { id = clicked_id; destroy(); }
type: AnsweredQuestion

http://stackoverflow.com/q/28493536
type: Question
tagged with: http://stackoverflow.com/tag/json
tagged with: bundle-layout
has answer: http://stackoverflow.com/a/30597322
has title: d3 js Hierarchical edge bundling Data Format
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
upvote count: 11
accepted answer: http://stackoverflow.com/a/30597322
type: AnsweredQuestion
tagged with: d3.js
has comment: http://stackoverflow.com/comment/49443854
score: 11
has body: I am trying to visualize url to targetURL using hierarchical edge bundling. What type of relation is required between these columns? Here is the sample: Here is my code. I am getting an error as TypeError: node.parent.children is undefined

http://stackoverflow.com/comment/45328746
type: Comment
has text: @mplungjan : I'm not 100% sure what that would change. Would copying the href value into a separate variable and checking that instead of the original be better? Feel free to edit the code.
comment on: http://stackoverflow.com/a/28504703
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45408717
has text: Will give error....As you have done typo mistake `getElementByClassName` instead of `getElementsByClassName`..
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28547743
score: 1

http://stackoverflow.com/comment/45304835
has text: Thank you, and yes I just noticed that it would say `5PM:35`, I will fix that on my own, but this worked. Thanks
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28491952
type: Comment

http://stackoverflow.com/q/28582363
has answer: http://stackoverflow.com/a/28582637
accepted answer: http://stackoverflow.com/a/28582637
has title: Error in conversion code for minutes to days
tagged with: javascript
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/28582617
has body: Found this lovely piece of code on this site and it worked like a charm until it got over 10,000 minutes function minToTime(duration) { /*Call function 2 */ var minutes = parseInt(duration%60) , hours = parseInt((duration/(60))%24) , days = parseInt((duration/(60*24))%7); days = (days &lt; 10) ? "0" + days : days; hours = (hours &lt; 10) ? "0" + hours : hours; minutes = (minutes &lt; 10) ? "0" + minutes : minutes; return days + ":" + hours + ":" + minutes; } Can anyone help me find a way to solve this problem? Please bear in mind I am new to javascript and have very basic knowledge. Thank you in advance
tagged with: converters
has comment: http://stackoverflow.com/comment/45473054
has comment: http://stackoverflow.com/comment/45472881
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28582623
type: Question
has answer: http://stackoverflow.com/a/28582617

http://stackoverflow.com/a/28535267
has comment: http://stackoverflow.com/comment/45386144
has comment: http://stackoverflow.com/comment/45384922
score: 1
has comment: http://stackoverflow.com/comment/45411430
has comment: http://stackoverflow.com/comment/45411291
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45396617
has comment: http://stackoverflow.com/comment/45385859
has comment: http://stackoverflow.com/comment/45385436
has comment: http://stackoverflow.com/comment/45388976
has body: Using jQuery... http://jsfiddle.net/v6kxc2uk/ some text some more text 1 2 $('button').on('click', function(){ $('div').hide(); $('div#'+$(this).attr('linkTo')).show(); });
type: Answer
has comment: http://stackoverflow.com/comment/45385399
has comment: http://stackoverflow.com/comment/45418974
has comment: http://stackoverflow.com/comment/45386489
has comment: http://stackoverflow.com/comment/45385403
has comment: http://stackoverflow.com/comment/45386054
has comment: http://stackoverflow.com/comment/45385897
answers question: http://stackoverflow.com/q/28535196
has comment: http://stackoverflow.com/comment/45411417
accepted answer of: http://stackoverflow.com/q/28535196
upvote count: 1
has comment: http://stackoverflow.com/comment/45397235
has comment: http://stackoverflow.com/comment/45385014
has comment: http://stackoverflow.com/comment/45385919

http://stackoverflow.com/comment/45490422
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28591301
has text: @Tiny Thx for ur example. it's nice article. But i have a question is the URL, Is the URL equal the XHTML path?

http://stackoverflow.com/comment/45488108
type: Comment
type: QuestionComment
has text: It's not used by Closure-compiler: https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/parsing/Annotation.java#L27
score: 2
comment on: http://stackoverflow.com/q/28588591

http://stackoverflow.com/comment/45259794
comment on: http://stackoverflow.com/a/28465579
has text: @BMAC I apologize but I really don't understand what you're asking. The `.slice()` call just gets you a copy of the elements in the jQuery object as a plain array.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45273112
comment on: http://stackoverflow.com/a/28473114
score: 0
has text: @jermina codition to show the first form updated. Take a look
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28487838
upvote count: 1
has title: why this regexp returns match?
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/28487959
has body: http://jsfiddle.net/sqee98xr/ var reg = /^(?!managed).+\.coffee$/ var match = '20150212214712-test-managed.coffee'.match(reg) console.log(match) // prints '20150212214712-test-managed.coffee' I want to match regexp only if there is not word "managed" present in a string - how I can do that?
type: Question
possible better answer: http://stackoverflow.com/a/28488886
answer count: 2
has answer: http://stackoverflow.com/a/28488886
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45297531
has answer: http://stackoverflow.com/a/28487959
tagged with: node.js
favorite count: 0

http://stackoverflow.com/comment/45519086
comment on: http://stackoverflow.com/a/28592714
has text: Maybe I'm wrong with my last point. Assuming I talk to an HTTP API in order to set the value `foo` to 5. That request can fail on multiple levels. It can fail physically (timeout), it can fail on server (404 or 500), it can fail in the application (access denied). I would expect a rejected promise in every one of these cases, because the promise was to set the value `foo` to five, and it didn't work. Resolving the promise with "false" for the "access denied" case does not feel right.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45309650
comment on: http://stackoverflow.com/q/28488189
has text: If thats the case then it sounds like you are sending a response to the clients before the operations finish - you may be activating callbacks before the processes are done.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28528924
accepted answer: http://stackoverflow.com/a/28529044
has body: I'm trying to set cookies in an easy code example, but they don't work as I expect. The problem is that the code doesn't work, it never says "Welcome again Nemo!" Can you help me please? What i am doing wrong? Thank you very much for your time!!! &lt;script&gt; function getCookie() { var name = document.cookie.split('=') if (name[1] != "" &amp;&amp; name[1] != null){ return name[1]; }else{ return ""; } } function checkCookie() { var username=getCookie(); if (username!="") { alert("Welcome again " + username); } else{ username = prompt("Please enter your name:"); if (username != "" &amp;&amp; username != null) { document.cookie = "Username=" + username; } } } checkCookie(); &lt;/script&gt;
linked to: http://stackoverflow.com/q/335244
has comment: http://stackoverflow.com/comment/45373164
type: AnsweredQuestion
tagged with: cookies
has title: Cookies with JavaScript
type: Question
has answer: http://stackoverflow.com/a/28529044
tagged with: javascript
score: 0
answer count: 1
linked to: http://stackoverflow.com/q/12992494

http://stackoverflow.com/comment/45336834
comment on: http://stackoverflow.com/a/28508827
has text: $.when(...).then(...) is not needed.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45330800
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28505665
has text: thanks for your help ! Actually, I thought I had to specify #id_camp_ch because it is the id of the dynamically-generated dropdown menu, and because I wanna handle it. I read the documentation and the forums, and I understood that for handling a dynamically-generated element, it was not possible to use the .change event. Instead they recommend to use an existing tag (like div class="camp") then a zone in this tag (#id_camp_ch) with the event 'change'. The div tag does not have the change listener I agree, but the select does. Could my problem come from this ?
type: AnswerComment

http://stackoverflow.com/comment/45243890
comment on: http://stackoverflow.com/q/28458803
score: 0
type: Comment
type: QuestionComment
has text: you don't need access control headers for same-domain requests. Can you please give us the exact error message, where it occurs, and possibly the request/response headers?

http://stackoverflow.com/q/28439628
score: 1
has body: I have an asp.net website. I want to manipulate a webpage based on return value of a confirmation popup. I have a drop down with some values. "cancel" is one of those values. So when user selects this item, a confirmation box asking user "Are you sure you want to cancel the ticket"? is displayed. Here is my code, HTML: &lt;asp:DropDownList ID="ddlStatus" runat="server" CssClass="selectstyle" DataTextField="Name" DataValueField="ID" onchange ="GetSelectedItem(this);" /&gt; &lt;asp:Panel ID="pnl_Cancel" runat="server" Visible="false"&gt; &lt;tr&gt; &lt;td class="label" align="right"&gt; Cancellation Reason : &lt;/td&gt; &lt;td&gt; &lt;asp:TextBox ID="tbxCancellationReason" runat="server" CssClass="selectstyle" TextMode="MultiLine" Width="400" Height="50"&gt;&lt;/asp:TextBox&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/asp:Panel&gt; JavaScript : &lt;script type="text/javascript"&gt; function GetSelectedItem(x) { if (x.value == 4) { if (confirm("Are you sure you want to cancel support ticket ?") == true) { alert("Yes"); document.getElementById("pnl_Cancel").style.visibility = 'visible'; } } } &lt;/script&gt; which is displaying a popup as I want. Now, I want to make a panel visible if user clicked on "OK" and reset dropdownlist if user clicked on "Cancel". I am getting "Yes" alert message but the panel visibility is not working.
upvote count: 1
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/45209005
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28440276
answer count: 1
downvote count: 0
tagged with: jquery
tagged with: asp.net
favorite count: 0
has title: change asp.net panel visibility based on return value of popup window javascript
has comment: http://stackoverflow.com/comment/45209380
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28440276

http://stackoverflow.com/q/28469871
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28470580
has body: I am using tiny scroll bar function from http://baijs.com/tinyscrollbar/ , Documentation said we can use the horizontal feature by setting the x axis like below $(document).ready(function(){ $("#scrollbar1").tinyscrollbar({ axis: "x"}); }); But Only vertical is working for me , not horizontal.I want to make it work with horizontal scrollbar and custom width. Fiddle : http://jsfiddle.net/874pzsvL/
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28470580
has title: how to use horizontal scroll feature in tinyscroll plugin
tagged with: css
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/q/28514241
tagged with: fouc
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/12866447
has body: I have created a simple app using AngularJS. When I open the page for a second I see the screen below: However, after the load is complete I see the loaded and styled content which is fine: How do I prevent the flash of AngularJS code on my page ? Is this related to FOUC ? Here is the HTML code: Foundation | Welcome Salary Calculator Location United Kingdom Annual Salary Monthly Expenses Yearly Monthly Weekly Daily {{val.rowType}} {{val.yearly}} {{val.monthly}} {{val.weekly}} {{val.daily}} EDIT: Please see my answer as well for an alternative solution in addition to the accepted one.
has answer: http://stackoverflow.com/a/34255687
score: 12
has answer: http://stackoverflow.com/a/28514588
linked to: http://stackoverflow.com/q/16074673
upvote count: 12
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/34255687
favorite count: 0
tagged with: angularjs
linked to: http://stackoverflow.com/q/12866447
tagged with: zurb-foundation
accepted answer: http://stackoverflow.com/a/28514588
answer count: 4
has answer: http://stackoverflow.com/a/28514759
has comment: http://stackoverflow.com/comment/45346307
has title: AngularJS: How to prevent "code flash" in page while loading
has answer: http://stackoverflow.com/a/28514299
type: Question

http://stackoverflow.com/comment/45208619
has text: Sorry, I forgot the line was split up across different ones. Fixed it up there.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28439396

http://stackoverflow.com/q/28581258
has body: In many devices (desktop and mobile) the clock is wrong, hence when try to determine an event time according to the client clock, that is results to inaccurate. Analytics services such as Google Analytics and Mixpanel recommend to use server timestamp to avoid that inaccuracy. In case that the client clock is must (not server clock), what is the solution for that case? For instance, in mobile SDK, a solution might be to execute an API call to time server and ignore the clock on the device.
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28617032
tagged with: localytics
linked to: http://stackoverflow.com/q/6618719
type: UnansweredQuestion
tagged with: mixpanel
has title: How does Google Analytics/Mixpanel/etc. determine the event timestamp when the clock is wrong?
type: Question
tagged with: google-analytics

http://stackoverflow.com/q/28559454
type: Question
has comment: http://stackoverflow.com/comment/45430507
answer count: 1
has comment: http://stackoverflow.com/comment/45430489
tagged with: javascript
tagged with: jquery-events
has comment: http://stackoverflow.com/comment/45430547
has answer: http://stackoverflow.com/a/28559559
has comment: http://stackoverflow.com/comment/45430601
score: 0
accepted answer: http://stackoverflow.com/a/28559559
type: AnsweredQuestion
has body: I need to draw custom dom tooltip over raphael svg element. How to prevent event triggering mouseleave for element, when you hover tooltip? Check this example: $(c.node).mouseenter(function(){ tipText = 'text'; tip.show(); over = true; }).mouseleave(function(){ tip.hide(); over = false; }); http://jsfiddle.net/QK7hw/707/
has comment: http://stackoverflow.com/comment/45430440
has title: Prevent hover triggering for div in raphael
tagged with: raphael

http://stackoverflow.com/comment/45470038
score: 0
type: Comment
has text: `onsubmit` has to be as the `form` attribute, not `input` button... check my answer, then you will have the same answer as me :-)
type: AnswerComment
comment on: http://stackoverflow.com/a/28580829

http://stackoverflow.com/q/28592815
downvote count: 1
type: Question
has title: Is it possible to create a Watchface in pebble js?
has answer: http://stackoverflow.com/a/39744883
tagged with: pebble-sdk
tagged with: javascript
tagged with: pebble-watch
has comment: http://stackoverflow.com/comment/45493722
has comment: http://stackoverflow.com/comment/45494533
answer count: 3
score: 1
favorite count: 0
has body: http://developer.getpebble.com/getting-started/watchface-tutorial/part1/ is in C. Is there a way to do the same thing in JS?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28613762
has answer: http://stackoverflow.com/a/28593270
upvote count: 2
has comment: http://stackoverflow.com/comment/45492378
tagged with: cloudpebble

http://stackoverflow.com/q/28478218
downvote count: 1
has body: I know that several questions about this topic have been asked, but I was unable to find an answer for my case. I have gridview. In that Checkbox. Here, I want to do functionality like When I check on exp_id 1515001101 then others all exp_id 1515001101 get automatically check. function checkUncheckHeaderCheckBoxforSubmit(obj) {var checkboxCell;var expidCell; var grid = document.getElementById("&lt;%=grdViewLocalConvence.ClientID %&gt;"); for (i = 1; i &lt; grid.rows.length - 2; i++) { for (i = 1; i &lt; grid.rows.length - 2; i++) { checkboxCell = grid.rows[i].cells[8]; expidCell = grid.rows[i].cells[0]; var exp_id = expidCell.innerText; for (j = 0; j &lt; checkboxCell.childNodes.length; j++) {if (checkboxCell.childNodes[j].type == "checkbox") { if (checkboxCell.childNodes[j].checked == true) { var exp_id = expidCell.innerText; GridVwHeaderChckbox.rows[i].cells[8].getElementsByTagName("INPUT")[0].checked = exp_id.checked; }}}} Please help me. Thanks.
favorite count: 0
type: UnansweredQuestion
has title: How to dynamically check/uncheck html checkbox by JavaScript in asp.net
type: Question
has answer: http://stackoverflow.com/a/28478349
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45279102
tagged with: asp.net
has comment: http://stackoverflow.com/comment/45279101
score: 0

http://stackoverflow.com/comment/45295392
type: AnswerComment
type: Comment
has text: Strange, glad it works though. Out of curiosity, what browser are you using?
score: 0
comment on: http://stackoverflow.com/a/28474918

dojo
tags question: http://stackoverflow.com/q/28544585
tags question: http://stackoverflow.com/q/28487425
tags question: http://stackoverflow.com/q/28485269
tags question: http://stackoverflow.com/q/28495133
type: Tag
tags question: http://stackoverflow.com/q/28442334
tags question: http://stackoverflow.com/q/28488966
tags question: http://stackoverflow.com/q/28450297
tags question: http://stackoverflow.com/q/28533266
tags question: http://stackoverflow.com/q/28536584
tags question: http://stackoverflow.com/q/28504287
tags question: http://stackoverflow.com/q/28584758
tag name: dojo
tags question: http://stackoverflow.com/q/28578739
tags question: http://stackoverflow.com/q/28467016
tags question: http://stackoverflow.com/q/28563997
tags question: http://stackoverflow.com/q/28580842

http://stackoverflow.com/q/28588698
downvote count: 0
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/28605767
upvote count: 2
accepted answer: http://stackoverflow.com/a/28605767
type: Question
tagged with: arrays
tagged with: javascript
has body: I have an array in my LocalStorage that I manipulate with ngStorage. I am trying to remove items from there but when I use $localStorage.someArrayName.splice(id, 1); only the first removed item works fine, then removing stop working as I would like to. I also tried something like this: if (id === $localStorage.someArrayName.length) { $localStorage.someArrayName.pop(); } else if (id === 0) { $localStorage.someArrayName.shift(); } else { $localStorage.someArrayName.splice(id, 1); } But I get even more buggy result I tried from the example in https://github.com/gsklee/ngStorage like this: delete $localStorage.someArrayName[id]; but it deletes the values and I get null,null,null values in my local storage array. And then I even get ng repeat error about duplicate values: Error: [ngRepeat:dupes] Duplicates in a repeater are not allowed... I cannot handle it. I am not sure if it's some small issue or I am doing something fundamentally wrong. Can you give me some guidance? Thank you in advance! This is how my array looks like saved in the localstorage: [{"content":"something"},{"content":"else"}] //etc...
has title: AngularJS/JavaScript Remove specific element from Localstorage array
answer count: 1

http://stackoverflow.com/comment/45467193
type: AnswerComment
score: 0
type: Comment
has text: Thanks...that does work but I have two grids on top of each other for my real app, when a user clicks on the top grid, data is filtered into the second grid. Lets say the user goes back and clicks on a different row on the top grid, how do I insure that I can change the filter value without having to reload the store and performing a record.beginEdit() again...
comment on: http://stackoverflow.com/a/28579271

http://stackoverflow.com/a/28549320
answers question: http://stackoverflow.com/q/28549210
score: 0
type: Answer
has body: It is rendered by the browser in this way. If you want to add additional styles and modify the look you need to learn some CSS. There is no CSS whatsoever in the source from the editor.

http://stackoverflow.com/a/28488710
has body: This is an interesting issue, and I can offer an interesting workaround and my thoughts on what is going on. I think a better solution may exist, but finding such solutions also proved to be a challenge. Nonetheless, I think the main issue is simply your console.log($templateCache.get('snippet1.html')) is returning undefined because of the race condition with your $http.get's not resolving first. Examining the api for $templateCache, I couldn't find any sort of helpful way of knowing when templates resolve requested via ajax. To see the simple issue, run this in your directive to see some basic information about what is currently stored in your $templateCache console.log($templateCache.info()) With the result of Object {id: "templates", size: 0} For observing the core of the issue, run the same JS in the directive, but with a timeout as such setTimeout(function() { console.log($templateCache.info()) }, 1000); With the result of Object {id: "templates", size: 2} Interesting, so they're in there... but getting a handle on them is now the challenge. I crafted the following workaround to at least give us something for now. Inject $q and $rootScope into your .run function as such myApp.run(['$templateCache', '$http', '$q', '$rootScope', function($templateCache, $http, $q, $rootScope){ $q.all([ $http.get('snippet1.html',{ cache : $templateCache }), $http.get('snippet2.html',{ cache : $templateCache }) ]).then(function(resp){ $rootScope.templateCache = resp }) }] ); Examining this, you'll notice I place an arbitrary var on our $rootScope as such $rootScope.templateCache for the purpose of placing a $watch on it in our directive. Then in our directive, let's call into our $templateCache when we then know there is a value on $rootScope.templateCache, indicating the $q service has resolved our promises as such link: function(scope, element, attrs) { scope.$parent.$parent.$watch('templateCache', function(n, o) { if(n) { element.append($compile($templateCache.get('snippet1.html…
has comment: http://stackoverflow.com/comment/45444444
type: Answer
has comment: http://stackoverflow.com/comment/45320692
has comment: http://stackoverflow.com/comment/45319777
accepted answer of: http://stackoverflow.com/q/28487174
has comment: http://stackoverflow.com/comment/45307055
score: 5
answers question: http://stackoverflow.com/q/28487174
has comment: http://stackoverflow.com/comment/45321598
upvote count: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/45320427
has comment: http://stackoverflow.com/comment/45436835
has comment: http://stackoverflow.com/comment/45416859
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45321326
has comment: http://stackoverflow.com/comment/45421428
has comment: http://stackoverflow.com/comment/45322069

http://stackoverflow.com/q/28502609
has answer: http://stackoverflow.com/a/28503177
answer count: 1
downvote count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45324906
tagged with: angularjs
has body: I try to run JQuery after dom rendering. Here is the code: angular.module('testCtrl', ['testService']) .controller('testController', ['$scope', '$timeout', 'Test', function($scope,$timeout, Test) { var vm = this; Test.getFromServer().success(function(data) { vm.result = data; vm.processing = false; }); }]); &lt;test ng-controller="testController as test" &gt; &lt;note id="note"&gt;{{test.result}}&lt;/note&gt; The "getFromServer" function is an asynchronous call to the server that retrieve some HTML. I want to manipulate this html with JQuery. What should I use ? directive ? $watch ? $broadcast ? Could you please give me a running example ?
tagged with: http://stackoverflow.com/tag/html
upvote count: 0
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45324701
has title: AngularJS manipulate DOM with JQuery after HTML rendering
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45328785
linked to: http://stackoverflow.com/q/15744630

http://stackoverflow.com/comment/45286559
has text: Here you go: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_function_as_a_parameter
comment on: http://stackoverflow.com/q/28482170
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/a/28589062
has comment: http://stackoverflow.com/comment/45485189
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45506388
has comment: http://stackoverflow.com/comment/45485459
answers question: http://stackoverflow.com/q/28588879
has body: You can do this: $("#resultsTable").append("&lt;tr&gt;").attr('id', 'sampletable'); for (var i=0; i&lt;statsHolder.length; i++){ $("#sampletable").append("&lt;td&gt;" + statsHolder[i] + "&lt;/td&gt;"); } And if you want to use it for multiple rows try this: for (var j=0; j&lt; 10; j++) { $("#resultsTable").append("&lt;tr&gt;").attr('id', 'tablenamerow-'+j); for (var i=0; i&lt;statsHolder.length; i++){ $("#tablenamerow-"+j).append("&lt;td&gt;" + statsHolder[i] + "&lt;/td&gt;"); } } Here you can change the limit of var j to the number of rows you want to generate. I just put number 10 arbitrarily. And if you have multiple tables using this set the tablename unique for each table also.

http://stackoverflow.com/a/28482845
type: Answer
has comment: http://stackoverflow.com/comment/45288008
has comment: http://stackoverflow.com/comment/45287848
score: 2
accepted answer of: http://stackoverflow.com/q/28482501
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has body: Your posted code is still missing something, as the first function is missing. The next thing I found was the second call to checkNumbers doesn't pass anything in. function displayResult() { checkNumbers(getWinningNumbers(), getCustomerNumbers()) alert("This Week's Winning Numbers are:\n\n" + getWinningNumbers().toString() + "\n\nThe Customer's Number is:\n\n" + getCustomerNumbers().toString() + "\n\nNumber of Matches:" + checkNumbers()); //&lt;-- where are the parameters? } Working code: function getCustomerNumbers(){ var customerNumbers = []; customerNumbers.push(12, 17, 24, 37, 38, 43); return customerNumbers; } function getWinningNumbers() { var winningNumbers = []; winningNumbers.push(12, 17, 24, 37, 38, 43); return winningNumbers; } function checkNumbers(x, y) { var matches = 0; for (var i=0; i&lt;x.length; i++) { for (var j=0; j&lt;y.length; j++) { if (x[i] == y[j]) { matches++; } } } return matches; } function displayResult() { alert("This Week's Winning Numbers are:\n\n" + getWinningNumbers().toString() + "\n\nThe Customer's Number is:\n\n" + getCustomerNumbers().toString() + "\n\nNumber of Matches:" + checkNumbers(getWinningNumbers(), getCustomerNumbers()) ); } displayResult();
answers question: http://stackoverflow.com/q/28482501

http://stackoverflow.com/comment/45281212
type: Comment
comment on: http://stackoverflow.com/a/28476788
has text: I added the css for you, so you can see the header isn't opacity 1
type: AnswerComment
score: 1

http://stackoverflow.com/comment/45391550
score: 0
type: Comment
type: QuestionComment
has text: Sure, but it will require some hacks for Highcharts. Instead of using `series.update()` you need to upadte `startAngle` in options, then call dummy `point.update()` to apply changes. Example: http://jsfiddle.net/ohfjyhj1/2/ Note: it doesn't look for the closest angle, but for the same points it's always the same rotation.
comment on: http://stackoverflow.com/q/28456973

http://stackoverflow.com/a/28594662
upvote count: 1
answers question: http://stackoverflow.com/q/28593146
has body: With your skill set, I don't think there is a real good way of doing this. However, it is "accordingly easy to do" with nodejs if you are familiar with. If you are not, don't worry. Just try amazing "meteor". If you have knowledge on javascript and html, you will learn it in a very short amount of time. I am suggesting you to learn meteor because they provided a protocol called ddp to get your request done in an easy way. If you are interested in more detailed technical details, check this link.
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/comment/45220434
score: 0
type: Comment
type: QuestionComment
has text: Can you show us the whole code, perhaps in a jsfiddle?
comment on: http://stackoverflow.com/q/28445540

http://stackoverflow.com/comment/45444627
comment on: http://stackoverflow.com/a/28565895
type: Comment
score: 0
has text: I agree, this is a really elegant answer. a 1 liner that works perfectly for my needs. Thanks again, poozolax!
type: AnswerComment

http://stackoverflow.com/q/28461914
tagged with: css
accepted answer: http://stackoverflow.com/a/29111950
type: AnsweredQuestion
tagged with: jquery-cycle
tagged with: jquery-cycle2
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I am using cycle2 (http://jquery.malsup.com/cycle2/) to produce a main slideshow containing a number of other slideshows (which contain images and text of variable heights). I want the height of the parent and current slideshow (and container) to resize to the current slide height. This nearly works but I am having a few problems that I can't for the life of me see why and would be massively grateful if someone could point me in the right direction. You can see a live fiddle at http://jsfiddle.net/deshg/x8xaxx39/ My questions are: 1) Why on first load does it show the 2nd nested slideshow through the first one (when i click on the main pager it fixes it)? 2) Why on first load does cycle-slideshow height not match the current slide height as i'm using the wait command to wait for the images to load and have auto-height set to container (when i click on the main pager it fixes this as well)? 3) Is it a bug that when you manually drag to resize the viewport width sometimes the cycle-slideshow height value is not updated which means the parent height doesn't update or is there a way to solve this? 4) When you click to view gallery 2 and then click back to view gallery 1 the gallery 1 pager (the thumbnails at the bottom) don't work as gallery 2 has a higher z-index despite not being part of the active slide? How do I ensure the active slide has the highest z-index? Thanks so much for any advice you can give, it doesn't seem to be playing nice for me! Dave FYI the related code is: GALLERIES Ipsum dolor sit amet, consectetur adipiscing elit. Integer sagittis laoreet nunc, at malesuada ipsum eleifend non. Donec mattis, neque at venenatis tincidunt, risus velit. div" data-cycle-pager="#custom-pager-galleries" data-cycle-pager-template=" {{name}} " data-cycle-loader="wait" data-cycle-auto-height="container" data-cycle-hide-non-active="true" > div" data-cycle-pager="#custom-pager-gallery" data-cycle-pager-template=" " data-cycle-loader="wait" data-cycle-auto-height="container"…
score: 0
has answer: http://stackoverflow.com/a/29111950
has title: How to prevent overlapping slides and ensure dynamic container resizing in jquery cycle2 nested slideshows?

http://stackoverflow.com/q/28562621
has comment: http://stackoverflow.com/comment/45436293
has comment: http://stackoverflow.com/comment/45435815
favorite count: 0
tagged with: css
type: AnsweredQuestion
has title: HTML select option multiline value
linked to: http://stackoverflow.com/q/4746824
has answer: http://stackoverflow.com/a/28563178
upvote count: 5
has body: I have select and option tags in my HTML page. 1 2 3 Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock. My last option has a big text retrieving from database and it is bigger than the select box. Is it possible to make this value double line or multi line by CSS or Javascript like below ? I found this but I could not understand. UPDATE: Somebody marked my question as already answered here. But this link is not working. I can limit my character count by sql query. But this is not the solution.
has comment: http://stackoverflow.com/comment/45435960
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28562714
linked to: http://stackoverflow.com/q/15368502
linked to: http://stackoverflow.com/q/3587942
linked to: http://stackoverflow.com/q/4258723
has comment: http://stackoverflow.com/comment/45435914
tagged with: javascript
score: 4
possible better answer: http://stackoverflow.com/a/28562714
has comment: http://stackoverflow.com/comment/45435906
accepted answer: http://stackoverflow.com/a/28563178
has comment: http://stackoverflow.com/comment/45436117
answer count: 2
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45489719
has text: You're right that it's not always safe. Fortunately, the data set is "careful" in this way.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28591356

http://stackoverflow.com/q/28487517
tagged with: reactjs.net
has comment: http://stackoverflow.com/comment/45296831
tagged with: reactjs
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45663179
has answer: http://stackoverflow.com/a/28487986
accepted answer: http://stackoverflow.com/a/28487986
tagged with: jquery
tagged with: asp.net
favorite count: 0
has body: I've been going through this tutorial on ReactJS.NET, and hit a snag. It mentions that: We will use simple polling here but you could easily use SignalR or other technologies. While this works when I do client-side rendering, it throws the following error when rendering server-side. Currently, I don't actually need jQuery or SignalR to render the initial state as I'm only using them to subscribe to updates once the app is running. I guess my question is, what is the correct way to structure my React application so that I can render it server-side or client-side at will. Error while loading "~/Scripts/jquery-1.10.2.js": ReferenceError: window is not defined
has comment: http://stackoverflow.com/comment/45609491
has comment: http://stackoverflow.com/comment/45647465
has answer: http://stackoverflow.com/a/38939074
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45665104
upvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/45297290
has title: Is it possible to server-side render jQuery with ReactJS.Net?
tagged with: javascript
possible better answer: http://stackoverflow.com/a/38939074

http://stackoverflow.com/comment/45308132
score: 0
has text: @MythilyM or you want to validate when user leaves the text field then use onblur event it occurs when an object loses focus.
type: AnswerComment
comment on: http://stackoverflow.com/a/28492735
type: Comment

http://stackoverflow.com/comment/49254787
comment on: http://stackoverflow.com/q/28489025
score: 0
type: Comment
type: QuestionComment
has text: did you found the solution yet?

http://stackoverflow.com/comment/45233700
comment on: http://stackoverflow.com/q/28453117
score: 0
has text: @AWolf, stopPropagation doesn't work in my case. Don't know why. Try it with the fiddle
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/91771518
has text: I have not looked at this answer since I wrote it, but yes, it appears he wants to stream the results. There are means, but it depends on the use case. Do we mean to dump HTML in chunks, or are we dealing with continuously changing data that we want to up the client with? Based on his mention of sockets, I suspect its the later. In which, yes he would want sockets. Sails has wonderfull sockets implementation.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28546080
type: AnswerComment

http://stackoverflow.com/a/28449853
downvote count: 0
score: 1
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28449734
has body: You can easily achieve that with broadcasting: var app = angular.module('TestApp', []); app.controller('menuCtrl', function ($rootScope, $scope) { $scope.Click = function () { $scope.$broadcast('MyClickEvent', { someProp: 'Clicking data!' // send whatever you want }); }; }) .controller('pageCtrl', function ($rootScope, $scope) { $scope.getText = function () { $scope.boldText = 'tst'; }; $scope.$on('MyClickEvent', function (event, data) { console.log(data); // 'Data to send' }); });

http://stackoverflow.com/a/28523199
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28517590
has body: So your goal is to make the underlying array accessible within the foreach template? If you asked me, you shouldn't model your code in that way. With that said, all you really need is an alias to your array and make sure you set the alias when you use the foreach binding. Naturally, there's many ways you can do this. Probably the cleanest way would be to create an alias binding handler. Then extend the existing foreach binding to add the aliases or create a new one. ko.bindingHandlers.alias = { update: function(element, valueAccessor, allBindings, viewModel, bindingContext) { var value = valueAccessor(); var aliasValue = value.data; aliasName = value.aliasName || '$alias'; if (ko.isObservable(aliasValue)) { var rawValue = aliasValue, rawAliasName = value.rawAliasName || '$rawAlias'; bindingContext[rawAliasName] = rawValue; aliasValue = rawValue(); } bindingContext[aliasName] = aliasValue; } }; ko.bindingHandlers.foreachex = { preprocess: function (value, name, addBinding) { addBinding('alias', "{ data: "+value+", aliasName: '$source', rawAliasName: '$rawSource' }"); addBinding('foreach', value); } }; Then you can just use the aliases in your view. &lt;div data-bind="foreachex: People"&gt; &lt;!-- $rawSource is the People observable array --&gt; &lt;button data-bind="customBinding: someFunction($rawSource, $data)"&gt; DoSomethingWithArrayAndElement &lt;/button&gt; &lt;/div&gt; fiddle
has comment: http://stackoverflow.com/comment/45364843
downvote count: 0
type: Answer

http://stackoverflow.com/q/28566052
has body: I just realized that I cannot call directly on a URL from my AngularJS application due to CORS. Therefore, I expect I will have to use the Javascript API. The following link provides me with the data I want: https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=' + myPosition.lat + ',' + myPosition.lng + '&amp;rankby=distance&amp;key=' + key + '&amp;sensor=false&amp;type=clothing_store However, I cannot figure how to achieve the same using the Javascript API. I found this in the documentation, but I do not need a map - just the names and coordinates of the nearby stores. How can I get a hold of the same data using the Javascript API?
type: Question
answer count: 2
tagged with: google-maps
tagged with: javascript
tagged with: google-maps-api-3
score: 0
tagged with: angularjs
has title: Google Maps JS API equivalent of URL
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28591122
has answer: http://stackoverflow.com/a/28567871

http://stackoverflow.com/a/28498870
score: 0
has body: I guess so this is an example of what you want: Click the button to add a new row at the first position of the table and then add cells and content. Row1 cell1 Row1 cell2 Row2 cell1 Row2 cell2 Row3 cell1 Row3 cell2 Try it Reference and working example
type: Answer
answers question: http://stackoverflow.com/q/28498775

http://stackoverflow.com/q/28541074
linked to: http://stackoverflow.com/q/17248504
has comment: http://stackoverflow.com/comment/45395707
downvote count: 1
type: Question
tagged with: reactjs
score: 5
has comment: http://stackoverflow.com/comment/45395694
tagged with: jscs
tagged with: javascript
has answer: http://stackoverflow.com/a/28545174
answer count: 1
favorite count: 0
has body: There are exists many beautiful code formatting tools for vanilla Javascript. For example, JSCS. Is there any tool that can validate and format reactjs templates? I have got error like that one at this moment Unexpected token &lt; at static/view/Auth.jsx : 34 | 35 | return ( 36 | &lt;div className="auth-page"&gt;&lt;/div&gt;
has title: Tool for checking codestyle in JSX files
accepted answer: http://stackoverflow.com/a/28545174
upvote count: 6
type: AnsweredQuestion

http://stackoverflow.com/a/28485374
answers question: http://stackoverflow.com/q/28485298
downvote count: 0
type: Answer
score: 4
upvote count: 4
has body: You can use: preg_match('#([.*+?^=!:${}()|\[\]/\\\\])#', $string, $matches); Your error was use of \\ instead of \\\\ in your regex. Matching a backslash requires double escaping. One \\ for PHP and another \\ for PCRE engine.

datetimepicker
type: Tag
tags question: http://stackoverflow.com/q/28449801
tag name: datetimepicker
tags question: http://stackoverflow.com/q/28494071
tags question: http://stackoverflow.com/q/28575972

http://stackoverflow.com/q/28575980
has body: I have the following _renderItem function in jquery where it has &lt;img&gt; tags with inline attributes height and width. However these attributes are NOT working in internet explorer as IE would require them to be written in CSS. So, how do I insert that styling in here? Following is renderItemfunction. .data('autocomplete')._renderItem = function(ul, item) { return $('&lt;li&gt;') .data('item.autocomplete', item) .append("&lt;a&gt;"+"&lt;img src ='/account/"+item.id+"/icon/logo' onerror='$(this).hide()' height='40' width='40' alt=''/&gt;" + " " + " " +item.label+"&lt;/a&gt;") .appendTo(ul); };
has comment: http://stackoverflow.com/comment/45461581
upvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/28576083
answer count: 2
has comment: http://stackoverflow.com/comment/45461235
has comment: http://stackoverflow.com/comment/45461392
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/45461747
has title: How to add styling (CSS) to tags in Javascript/Jquery
has comment: http://stackoverflow.com/comment/45461548
has comment: http://stackoverflow.com/comment/45461353
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/45461323
has answer: http://stackoverflow.com/a/28576131
downvote count: 2
tagged with: css
accepted answer: http://stackoverflow.com/a/28576131
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45461484
has answer: http://stackoverflow.com/a/28576083
has comment: http://stackoverflow.com/comment/45461253

http://stackoverflow.com/a/28504714
accepted answer of: http://stackoverflow.com/q/28504685
answers question: http://stackoverflow.com/q/28504685
upvote count: 5
has body: The whitespace character \s should cover this nicely: \$[A-Z]*\s*$
score: 5
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/28442982
answer count: 1
downvote count: 0
favorite count: 0
tagged with: console
has body: I am currently testing the Ace code editor(http://ace.c9.io/) and embedded into a webpage. I am wondering if it's possible to create a output console to display console.log and output commands. Currently, I am using eval() to evaluate the code but as there is no console, the console.log command won't display. I want the editor to be able to output like in CodeCademy. Thanks!
tagged with: ace-editor
type: UnansweredQuestion
score: 1
upvote count: 1
has title: Ace editor console.log()
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28456999

http://stackoverflow.com/a/28588636
has body: jQuery Here you go, you have to concat the strings in different pieces in order for this to work dynamically in your loop. $(document).ready(function() { var max_fields = 10; var wrapper = $(".input_fields_wrap"); var add_button = $("#add_field_button"); var x = 1; $(add_button).click(function(e) { e.preventDefault(); if (x < max_fields) { x++; $(wrapper).append(' City ' + ' Select ' + ' Remove '); //add input box } }); $(wrapper).on("click", ".remove_field", function(e) { //user click on remove text e.preventDefault(); $(this).parent('div').remove(); x--; }) });
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28588486
answers question: http://stackoverflow.com/q/28588486
type: Answer

http://stackoverflow.com/comment/45227642
comment on: http://stackoverflow.com/q/28449734
has text: possible duplicate of [What's the correct way to communicate between controllers in AngularJS?](http://stackoverflow.com/questions/11252780/whats-the-correct-way-to-communicate-between-controllers-in-angularjs)
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28494613
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45309297
has answer: http://stackoverflow.com/a/28494744
answer count: 1
has comment: http://stackoverflow.com/comment/45309318
has title: Comparing newlines in JS returns false
favorite count: 0
type: UnansweredQuestion
score: -3
has comment: http://stackoverflow.com/comment/45309191
has comment: http://stackoverflow.com/comment/45309288
has comment: http://stackoverflow.com/comment/45309586
has comment: http://stackoverflow.com/comment/45309208
downvote count: 3
has comment: http://stackoverflow.com/comment/45309223
has body: I have a check in js which goes like this: if (a == b) { The value of a is "&lt;br&gt;". The value of b is "↵". And the check goes to else. But you can see that basically both of the strings represent a newline and I need the check to go to if. How can I make this?
type: Question

http://stackoverflow.com/q/28513033
tagged with: google-maps
downvote count: 0
tagged with: javascript
has title: AngularJS and Maps API: stop prompting for computer's location
tagged with: google-maps-api-3
has body: I created my web application, in which I added a map and custom markers with the following Angular loop: <marker position="[{{item.coordinates}}]" icon="./images/icon.png" on-click="showInfoWindow('mbar')" /> {{item.name}} Map This part works correctly and the browser does not ask the authorization to collect the computer's location. On a different page of the same website, I again show a map with custom marker with this simpler code: <marker position="{{selectedItem.coordinates}}" icon="./images/icon.png" /> In this second page, when I open it, all browsers detects that I am asking for computer's location. If I don't answer to the question, my custom marker is correctly shown. As soon as I answer, regardless of sharing or not my position, the marker disappears. I need to clear the cache to show the marker again. No errors appear in the console. Where is the issue?
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28514900
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/q/28568447
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45447795
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45447399
has comment: http://stackoverflow.com/comment/45447300
has body: I want to create a json object on javascript. I want to access using index to add new data. I read some commands that json doesn't allow adding new data using index. How can I do it? I want to do this : datas.days[index].add = hour; <day_id="0"> <hour="00:00"> 10 </hour> <hour="01:00"> 15 8 10 </hour> ...... </day_id> <day_id="1"> <hour="00:00"> 7 9 </hour> <hour="01:00"> 8 10 6 11 </hour> ...... </day_id> .......
tagged with: http://stackoverflow.com/tag/xml
has comment: http://stackoverflow.com/comment/45447012
has comment: http://stackoverflow.com/comment/45447276
has answer: http://stackoverflow.com/a/28568700
downvote count: 1
type: Question
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
score: -1
has title: JSON - Multi dimensional object
upvote count: 0

http://stackoverflow.com/q/28474701
score: 0
has body: Today, i have a tree view for users to edit it, but i want to lock the action to prevent that A user submit the edited node after B user already deleted the A user's edit node; I have searched the approach about this scenario, and i prefer to do it at the action filter, if one user gets in this page then set a flag to record, and after the user leaves this page, release the flag; But i needs help about: (1)how to set the flag when user entering the page by action filter, (2)how to catch the correct timing when user leaves the page and inform the action filter to remove the tag by javascript or razor helper, (3)during the locked period, throw what exception to the other user on the page?
answer count: 1
has comment: http://stackoverflow.com/comment/45273374
has answer: http://stackoverflow.com/a/28474884
type: UnansweredQuestion
tagged with: razor
tagged with: asp.net-mvc-4
has comment: http://stackoverflow.com/comment/45273829
type: Question
tagged with: c#
tagged with: asp.net-mvc
has title: c# mvc only one user to edit tree view at one time
tagged with: javascript

http://stackoverflow.com/q/28570015
tagged with: javascript
answer count: 2
has title: Running Javascript in wordpress
upvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: php
downvote count: 2
tagged with: wordpress
has answer: http://stackoverflow.com/a/28570913
type: Question
score: -2
has body: I'm creating a word press theme , this includes a responsive jquery menu. However, for some reason, I can't get the menu to work. In my functions.PHP file I have included the script below. Please may someone help with advice and a code snippet, i'm trying to: 1) Call Jquery 2) Run the script slimmenu.js script &lt;?php function menu_function() { wp_enqueue_script( 'myscript', get_template_directory_uri() . '/js/jquery.slimmenu.js', array( 'jquery')); } add_action('wp_enqueue_scripts','menu_function'); ?&gt; Many thanks, P
has answer: http://stackoverflow.com/a/28571661

http://stackoverflow.com/comment/45263586
type: Comment
type: QuestionComment
has text: Works for me: `/^[a-zA-Z ' -\`]+$/.test("asdf-'\`") == true`
comment on: http://stackoverflow.com/q/28469240
score: 0

http://stackoverflow.com/comment/45474345
type: Comment
comment on: http://stackoverflow.com/a/28583378
has text: The dropdowns do not pick up the initial value, so you get `$0` until you change one or both of them. At least with OP's original way this problem did not exist
type: AnswerComment
score: 0

http://stackoverflow.com/q/28526886
has answer: http://stackoverflow.com/a/28526916
has body: I've got a basic question which I can't find an answer to by looking at the Angular documentation or Google, so I'm assuming that this is not possible but I would like to know for sure. Basically what I want is to use a variable, for example $scope.loggedIn, like this: Hide me when I'm logged in Show me when I'm logged in So when this is true I want one div to show, and the other one to hide. I know this is possible when using ng-show and ng-hide but that doesn't remove them from the DOM which I would like in my own scenario. One way to achieve this would be to use two separate variables of course but is there a better way?
has title: Is it possible to make ng-if behave like ng-show/ng-hide using the same variable?
tagged with: angularjs
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28526916
type: Question
score: 0
tagged with: angular-ng-if
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/45284206
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28469583
has text: Session hijacking is something else. We call session hijacking when malicious script in user's browser retrieves his session cookie and sends it to somewhere else. This is quite not what I'm talking about.
type: Comment

http://stackoverflow.com/comment/45234552
score: 0
type: Comment
has text: I only tested in Safari, Chrome and IE. Both on mobile and Desktop.
type: AnswerComment
comment on: http://stackoverflow.com/a/28453261

http://stackoverflow.com/q/28512421
has body: I'm using JQVMap, and I have my code to where depending on what state you click, it'll reveal info about that state within a single div below the map. However, I feel there's a simplified, more efficient way to set up this code so there's not a lot of repeat, especially once I start adding more states. Is there? switch(code){ case"tx": $('#info-children').children(':not(#info-tx)').hide("slow"); $('#info-children').children('#info-tx').show("slow"); break; case"il": $('#info-children').children(':not(#info-il)').hide("slow"); $('#info-children').children('#info-il').show("slow"); break; case"fl": $('#info-children').children(':not(#info-fl)').hide("slow"); $('#info-children').children('#info-fl').show("slow"); break; case"ga": $('#info-children').children(':not(#info-ga)').hide("slow"); $('#info-children').children('#info-ga').show("slow"); break; case"pa": $('#info-children').children(':not(#info-pa)').hide("slow"); $('#info-children').children('#info-pa').show("slow"); break; default: $('#state-name').html(region); $('#info-children').children(':not(#info-uhoh)').hide("slow"); $('#info-children').children('#info-uhoh').show("slow"); }
answer count: 1
tagged with: jquery
type: AnsweredQuestion
has title: Simplify jQuery Switch Case
has answer: http://stackoverflow.com/a/28512472
tagged with: switch-statement
accepted answer: http://stackoverflow.com/a/28512472
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/comment/45344453
comment on: http://stackoverflow.com/a/28512968
score: 0
type: AnswerComment
has text: You could use [patterns](http://igorescobar.github.io/jQuery-Mask-Plugin/) i.e. for numbers {pattern: /[0-9*]/}
type: Comment

http://stackoverflow.com/comment/45412286
comment on: http://stackoverflow.com/a/28547720
type: AnswerComment
type: Comment
has text: I agree that saying bad practice is a bit harsh because "Factory" & "Service" are almost the same. Creating a service is being performed by creating a factory.Anyhow I think it is not the best practice because: First, There are some conventions that create a common ground. If developers used to work in certain conventions it is easier to share\hand-over code from one to another. Second, I dont see a need for overriding the constructor if factories are made just for that.
score: 1

http://stackoverflow.com/q/28577970
has comment: http://stackoverflow.com/comment/45466211
has title: How to send value of drop down item to export plugin?
tagged with: export
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I am new in Grails. I have a drop down box and a button which generates PDF. I am able to generate and download PDF using following tag &lt;export:formats formats="['excel', 'pdf']" /&gt; But, now I want to select item from drop down and pass that selected item to the export tag like below &lt;export:formats formats="['excel', 'pdf']" params ="Pass selected item here"/&gt; I tried a lot but no luck. Does anybody know how to pass selected item value of drop down to the export tag?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45465097
has answer: http://stackoverflow.com/a/28589423
tagged with: gsp
type: Question
tagged with: grails

http://stackoverflow.com/q/28446344
has answer: http://stackoverflow.com/a/28446500
upvote count: 0
has comment: http://stackoverflow.com/comment/45221928
answer count: 1
tagged with: jquery
favorite count: 0
has body: I have the following code in Plunkr. http://plnkr.co/edit/8sBafktFzFa8fCLLJgMF this is my js file angular.module('ui.bootstrap.demo', ['ui.bootstrap']); angular.module('ui.bootstrap.demo').controller('ModalDemoCtrl', function ($scope, $modal, $log) { $scope.open = function (size) { var modalInstance = $modal.open({ templateUrl: 'myModalContent.html', controller: 'ModalDemoCtrl', size: size }); var applicantID = 12; }; $scope.submit_info = function (size) { var modalInstance = $modal.open({ templateUrl: 'myModalContent1.html', controller: 'ModalDemoCtrl', size: size }); }; }); this is my html page Set caseID I want to be able to assign applicantID upon clicking the button "setID" and upon clicking button "submit",it displays the applicantID value that was passed which is '12'. But it keeps passing an empty data.
tagged with: angularjs
type: UnansweredQuestion
has title: Calling Data from Controller to HTML view AngularJS
downvote count: 1
type: Question
tagged with: angularjs-directive
tagged with: javascript
score: -1

http://stackoverflow.com/a/28520984
score: 0
type: Answer
has body: Of course yes.You can have nodejs and symfony2 in your server.you can use nodejs inside Symfony2 using CLI method.in front-end you can use angular and nodejs (converted).There is nodejs package,which lets you to convert your nodejs code to browser(browserify) side code and you can use it with angularjs.NodeJs has a package called socket.io.You can use it to have biDirectinal connection between server and client.
answers question: http://stackoverflow.com/q/28519980

sass
tags question: http://stackoverflow.com/q/28578155
tag name: sass
type: Tag

http://stackoverflow.com/a/28592185
type: Answer
answers question: http://stackoverflow.com/q/28592104
score: 0
has body: Use this inside the inline onclick. It will pass the current clicked element in your case. Save

http://stackoverflow.com/q/28504872
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45328913
has body: i was just looking at the source of button.js and came across the following snippet of code : $(document).on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { var $btn = $(e.target) if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') Plugin.call($btn, 'toggle') e.preventDefault() }) I am not new to Jquery but i am quite a beginner , now i understand how the on() function works in Jquery . my question with the above piece of code is , i don't really understand the event being attached to the on() function , let me explain : $(document).on('click.bs.button.data-api' i don't quite understand what this event is : click.bs.button.data-api in normal Jquery code i usually see things like : $('body').on('click' , '.btn' , function(e){ // do something }); but that one handler completely throws me off the hook , can somebody explain what exactly had the author of that code achieved by adding that handler ? heres the link on the git repository of the plugin : Line 106
score: 0
linked to: http://stackoverflow.com/q/11981346
has answer: http://stackoverflow.com/a/28504918
has comment: http://stackoverflow.com/comment/45328904
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/4867589
type: Question
has answer: http://stackoverflow.com/a/28504923
answer count: 2
duplicate of: http://stackoverflow.com/q/4867589
has title: complex on function handler Jquery

http://stackoverflow.com/comment/45314849
has text: Unfortunately not. This is the output I am trying to achieve http://jsfiddle.net/HB7LU/10979/
comment on: http://stackoverflow.com/q/28497592
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28443229
has title: Using D3 to fill an svg with a background image
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
has body: I've posted a few other questions about this and have now abandoned my previous bootstrap framework for a solid svg strip using D3. My goal is to have 3 triangles masking 3 images, that are clickable to page anchor links only inside the triangles. (Ideally I want to add a transition-to-circle effect on hover also, but I'm not worried about that now). I have the jsfiddle below so far, but can't manage to un-rotate the images inside the triangle, or make the background be just one single image instead of the cover like it is now. I tried CSS background-image also, but with no success. Here's a piece of my d3.js code, and a full jsfiddle below. var svg = d3.select(".mydiv").append("svg").attr("width",width).attr("height",height); var defs= svg.append('defs') defs.append('pattern') .attr('id', 'pic1') .attr('patternUnits', 'userSpaceOnUse') .attr('width', 100) .attr('height', 100) .append('svg:image') .attr('xlink:href', 'http://placehold.it/1749x1510') .attr("width", 100) .attr("height", 100) .attr("x", 0) .attr("y", -10); svg.append("a") .attr("xlink:href", "http://www.google.com") .append('path') .attr("overflow","hidden") .attr("d", d3.svg.symbol().type("triangle-up").size(10000)) .attr("transform", function(d) { return "translate(" + 300 + "," + 200 + ") rotate(0)"; }) .attr("fill", "url(#pic1)"); http://jsfiddle.net/5Ldzk5w6/2/ Thank you for any time or help you can give to fix those images!
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45232535
has comment: http://stackoverflow.com/comment/45220044
score: 5
upvote count: 5
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28453553
has comment: http://stackoverflow.com/comment/45226151
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/28453553
tagged with: css
favorite count: 0

http://stackoverflow.com/q/28592785
score: 1
upvote count: 1
type: Question
has body: I have a class that is in charge of changing the mouse cursor when it hovers over a specified element. It takes a string as a parameter which is the relative path where I am keeping my custom cursor (it is .png by the way). But when I run the web site it only shows the regular pointer. Why is that? What am I doing wrong here? Here is the code I am working with: /* * True if the mouse has entered the object */ private _hasEntered: boolean = false; /* * The file name */ private _fileName: string = ""; constructor(fileName: string) { this._fileName = fileName; } /* * Initializes class */ public awake(): void { //...Code to handle mouse enter/exit events goes here } /** * Called when the mouse has entered this object */ private _onMouseEnter(): void { document.body.style.cursor = this._fileName; this._hasEntered = true; }
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/28592897
downvote count: 0
favorite count: 0
has title: How to implement custom cursor
has answer: http://stackoverflow.com/a/28593002
tagged with: css
possible better answer: http://stackoverflow.com/a/28593002
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28592897

http://stackoverflow.com/q/28489071
has comment: http://stackoverflow.com/comment/45300183
answer count: 1
type: UnansweredQuestion
has title: true false quiz controlling dive to be visible or hidden
has answer: http://stackoverflow.com/a/28489651
has comment: http://stackoverflow.com/comment/45300216
type: Question
has body: on one page I have This is the question? True False Then on the final page I have This is the question? You answered: TRUE The correct answer is: TRUE You answered: FALSE The correct answer is: TRUE The answer is showing up in the address bar, but I don't know how to translate it into the site. Usually I would use php and make it an if than situation. But it has to be html, so I imagine I need to use javascript. In the address bar it is showing up ...quiz.html/?q1=T&q2=F&q3=F
tagged with: javascript
score: 0

http://stackoverflow.com/comment/45247304
comment on: http://stackoverflow.com/a/28460599
has text: No need for a downvote. It has some overhead with the `foreach`. You do not need that to add event listeners, however this does mimic the OP's sample completely.
type: Comment
score: 3
type: AnswerComment

http://stackoverflow.com/q/28551275
has title: Getting rid of progress indicator in status bar on ie8
has body: On ie8 there is a green progress indicator below on the status bar, likely indicating download progression based on some static length value from somewhere. Unfortunately due to the nature of "modern" dynamic javascripts, ajax calls etc. this indicator often gets messed up and the bar stays at half full. Is there a way to turn that progress bar off through a javascript command or at least tell the browser we are done so please go away? I know the status bar can be turned off completely, however I still have a need for it to display my own status messages etc.
has comment: http://stackoverflow.com/comment/45415649
has comment: http://stackoverflow.com/comment/45415699
has answer: http://stackoverflow.com/a/28552544
type: AnsweredQuestion
tagged with: internet-explorer-8
score: 0
type: Question
accepted answer: http://stackoverflow.com/a/28552544
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/28450096
has answer: http://stackoverflow.com/a/43673797
has comment: http://stackoverflow.com/comment/45228267
has comment: http://stackoverflow.com/comment/45228223
downvote count: 0
score: 7
has comment: http://stackoverflow.com/comment/45228647
has comment: http://stackoverflow.com/comment/45228188
tagged with: mobile-browser
favorite count: 0
has answer: http://stackoverflow.com/a/28450204
type: Question
has comment: http://stackoverflow.com/comment/45228316
tagged with: javascript
has comment: http://stackoverflow.com/comment/45228435
answer count: 2
upvote count: 7
has title: Detect Mobile Browser Close Event
has body: Is there any way to detect mobile browser close event? I need to forcefully delete a cookie on browser close. I have already tried my luck with window.onbeforeunload and window.unload but they doesn't work for mobile browsers. Search on the web a lot but didn't get any solution. Thanks in advance
tagged with: jquery
linked to: http://stackoverflow.com/q/21227383
linked to: http://stackoverflow.com/q/15202521
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45228394
has comment: http://stackoverflow.com/comment/45228265

http://stackoverflow.com/comment/45479145
type: Comment
score: 0
type: AnswerComment
has text: I have tested it, it submits values. Multiselect: what is binded is string, content of input text. You need to `@Explode` it before processing.
comment on: http://stackoverflow.com/a/28584476

http://stackoverflow.com/comment/45483346
type: AnswerComment
type: Comment
has text: It doesn't seem to print out anything at all even a line break with it. I've also tried to log it outside those template functions but it doesnt seem to print out anywhere in the if (Meteor.isClient) only in the if (Meteor.isServer) but I can't declare those template function in the (Meteor.isServer) can I?
comment on: http://stackoverflow.com/a/28587886
score: 0

http://stackoverflow.com/a/28543139
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28542496
upvote count: 2
has body: With ES6 WeakMap you can do it like this: var items = new WeakMap(); var Cart = function() { items[this] = []; }; Cart.prototype.getItems = function() { return items[this]; }; Cart.prototype.addItem = function(item) { items[this].push(item); }; module.exports = Cart;
type: Answer

http://stackoverflow.com/q/28556265
type: Question
tagged with: if-statement
upvote count: 0
has answer: http://stackoverflow.com/a/28556284
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/28556326
linked to: http://stackoverflow.com/q/359494
has comment: http://stackoverflow.com/comment/45424718
has body: i get stuck with this problem. First, here is the codes : JavaScript function PilihKeterangan(isi) { if (isi = 'A') { $('#keterangan').val("Sangat Baik : sangat aktif mengikuti latihan dan kegiatan ..."); } else if (isi = "B") { $('#keterangan').val("Baik : aktif mengikuti latihan dan kegiatan ..."); } else if (isi = 'C') { $('#keterangan').val("Cukup : cukup aktif mengikuti latihan dan kegiatan Kepramukaan ..."); } else if (isi = 'X') { $('#keterangan').val("Kegiatan ini tidak dipilih oleh siswa / bukan menjadi pilihan siswa"); } else { $('#keterangan').val("Pilihlah predikat A/B/C/X."); } } HTML - Pilih - A B C X The problem is, it just can select first condition. If i click other option, the result is still first conddition. In example : If i select/click 'A' or 'B' or else one the result is always first condition. But if i just passing select's value, it is works but not when i give it IF statement. I just look from this tutorial about using IF statement in w3schools if the JavaScript is using '=' not the '==' : http://www.w3schools.com/js/js_if_else.asp I hope there are any reply. Thanks :)
possible better answer: http://stackoverflow.com/a/28556326
answer count: 4
favorite count: 0
accepted answer: http://stackoverflow.com/a/28556284
has title: If Statement in JavaScript for Getting Value from Select Input
has answer: http://stackoverflow.com/a/28556298
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28556449
downvote count: 1

http://stackoverflow.com/q/28473889
has title: Angularjs merge two objects ignoring null and missing values
tagged with: angularjs
type: UnansweredQuestion
upvote count: 9
has answer: http://stackoverflow.com/a/28474176
has body: For instance, from these two objects : var object1 = { "color": "yellow", "size" : null, "age" : 7, "weight" : null } var object2 = { "color": "blue", "size" : 51, "age" : null } I want this (object 2 overrides object 1 except for null properties or properties he doesn't have) : { "color": "blue", "size" : 51, "age" : 7, "weight" : null } angular.extend(object1, object2) works but overrides age property to null
has comment: http://stackoverflow.com/comment/45271473
type: Question
score: 9
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28474194
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/28547110
tagged with: jquery
has answer: http://stackoverflow.com/a/28547156
has title: What is preventing querySelectorAll from working on all elements with the same class in this code?
has body: I'm trying to produce a swipe delete effect for li elements in a list similar to what you see in ios when you delete text messages. I have here a codepen that demonstrates exactly what I'm looking for. As you can see in this example, the first li element can be dragged to the left revealing a delete button. The problem is, I've been trying to get this effect to be applied to all li elements on a list and not just the first one. As you will see in this example, the second li element regardless of sharing the same classes as the first li element, isn't able to be dragged to the left. It just doesn't work. I've been told a solution would be to put querySelectorAll instead of querySelector in my js to have the same effect work for all li elements that share the same classes however that hasn't worked either. The codepen demo I have a link to above uses querySelector so you will see that the first li element has the effect I want applied to all li elements. So you can drag it to the left and see it working but notice if you change querySelector to querySelectorAll, nothing works. Any ideas? thanks. Lorem ipsum Lorem ipsum dolor sit amet Friday Delete Lorem ipsum Lorem ipsum dolor sit amet Friday Delete
favorite count: 0
downvote count: 2
tagged with: css
possible better answer: http://stackoverflow.com/a/28547156
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28547435
score: -1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28547435
answer count: 2
tagged with: javascript

http://stackoverflow.com/q/28452192
score: 1
has title: prettyphoto undefined is not a function
type: Question
has answer: http://stackoverflow.com/a/28452535
accepted answer: http://stackoverflow.com/a/28452535
tagged with: javascript
has comment: http://stackoverflow.com/comment/45231854
has comment: http://stackoverflow.com/comment/45231858
upvote count: 1
answer count: 1
tagged with: lightbox
has body: I'm attempting to install prettyPhoto lightbox on my site and I keep getting them same error. The following code in the console generates this error "undefined is not a function" Line 18 I've tried it in the footer and the head, both cause the same problem and the lightbox doesn't load. Here's the files in my head tag... <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/css/prettyPhoto.css" type="text/css" media="screen" charset="utf-8" /> <script src="<?php bloginfo('template_directory'); ?>/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"> My site is www.jessicadraws.com Any ideas? Dave.
tagged with: jquery
favorite count: 0
tagged with: prettyphoto
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45231905
downvote count: 0

http://stackoverflow.com/q/28477270
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28480235
type: UnansweredQuestion
has title: I am getting error when I am using Beanshell Sampler with script in jmeter
type: Question
tagged with: javascript
has body: I am getting error when I am using Beanshell Sampler with script in jmeter as: ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval In file: inline evaluation of: //my beanshell script log.info("Example Sample"); String maVariable = vars.get( . . . '' Encountered ";" at line 8, column 22. and WARN - jmeter.protocol.java.sampler.BeanShellSampler: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval In file: inline evaluation of://my beanshell script log.info("Example Sample"); String maVariable = vars.get( . . . '' Encountered ";" at line 8, column 22. and my code is //my beanshell script log.info("Example Sample"); String maVariable = vars.get("VARIABLE_NAME"); if (maVariable.equals("1") { ResponseCode = 2*100 ; ResponseMessage= "Okey" ; vars.put("NAME" , "VALUE") ; } return "Beanshell wrote this message"; I searched for it, I think I need some plugins for this to complete. I downloaded one of it i.e. bsh-2.0b2.jar but I unable to complete my task. I don't no where I went wrong, If anyone have any idea please share it. Thanks In advance for any help.

http://stackoverflow.com/comment/45365177
has text: If you count number of unexplained down votes on some of my imnho completely correct posts you would appreciate that I commented on yours :)
type: AnswerComment
comment on: http://stackoverflow.com/a/28523670
type: Comment
score: 0

http://stackoverflow.com/comment/45316708
comment on: http://stackoverflow.com/a/28498615
has text: The `setTimeout` is not the best solution for this. It didn't even work for me with 10ms. I had to raise it up to 100ms and then it worked.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45387297
has text: http://jsfiddle.net/vv0z7ux5/13/ I think it is abit more cleaner but I dont want to append any text. Removing the variable that container the text destroy the function
type: Comment
comment on: http://stackoverflow.com/a/28536428
score: 1
type: AnswerComment

http://stackoverflow.com/q/28474422
has body: I was wondering if it's possible to resize this timer for mobile while keeping all the buttons and functions working properly. Here is a link to the timer: http://www.intervaltimer.com/timers/1566026 Here is the embed code: 90 Seconds Circuit Timer Create your own interval timer or download our interval timer app var Runloop = window.Runloop || {}; (function() { Runloop.defs = Runloop.defs || {}; Runloop.defs['timer1566026'] = {"soundScheme":5,"type":3,"name":"90 Seconds","intervals":[{"name":"Rotate","duration":90,"rest":false,"music":{"PersistentId":"0","DisplayName":"No Music"},"color":0,"vibration":false}],"intervalRest":{"name":"End of interval","duration":10,"rest":true,"music":{"PersistentId":"0","DisplayName":"No Music"},"color":0,"vibration":true},"numberOfSets":10,"group":false,"setRest":{"name":"End of set","duration":15,"rest":true,"music":{"PersistentId":"0","DisplayName":"No Music"},"color":0,"vibration":true}}; var script = document.createElement('script'); script.src = '//s3.amazonaws.com/widget.intervaltimer.com/1/widget.js'; script.async = true; document.body.insertBefore(script, document.body.firstChild); })(); &lt;/script&gt; I tried with css, I even tried to remove a couple of elements, but it never looks quite right. Here's what I've got so far: /* ## Timer --------------------------------------------- */ .seconds-timer-container { max-width: 100%;} .seconds-timer { max-width: 100%; text-align: center !important;} .seconds-timer, .seconds-share-options, p.seconds-interval-remaining, ul.seconds-dashboard { width: 100% !important;} .seconds-share {display: none;} .seconds-timer ul.seconds-dashboard li.seconds-total-elapsed { display: none;} .seconds-reset, .seconds-start-stop, .seconds-prev, .seconds-next {width: 15% !important;} .seconds-timer ul.seconds-dashboard li.seconds-total-remaining {display:none;} .seconds-interval-remaining { display:none;} Hopefully there's someone here that can help me :) Thank you!
favorite count: 0
answer count: 0
downvote count: 0
type: UnansweredQuestion
tagged with: css
score: 1
type: Question
tagged with: javascript
tagged with: jquery
has title: Resizing script for mobile while keeping the function
upvote count: 1

http://stackoverflow.com/comment/45289864
has text: Does the extension work with Safari on iOS?
score: 0
comment on: http://stackoverflow.com/q/28445596
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28518881
score: 4
upvote count: 4
has body: Right now you're getting the output: ___/''''\______/'\ Without them you'd get two functions looking like this (simplified): var flat = function(size){ result += "_"; }; var mountain = function(size){ result += "/'\\"; }; Hence you'd get the output _/'\_/'\ The size argument for flat() defines how many underscores should be output, and the size argument for mountain defines how many single-quotes (') should be output. Hence you need the loops, or else you'll get smaller mountains and flats. Consider the below "drawing" with F being "flat" and M being "mountain": ___/''''\______/'\ FFFMMMMMMFFFFFFMMM Every mountain is always a minimum of 3 characters long (as it outputs a forward slash, at least one ' and then a backslash). This means that the above output is (along with your code) 3 x F = 3 flats | flats(3) 6 x M = (6 - 2) = 4 mountains | mountain(4) 6 x F = 6 flats | flats(6) 3 x M = (3 - 2) = 1 mountain | mountain(1) To reiterate: // define an anonymous function with a "size" parameter and save it as "flat" var flat = function (size) { // start "count" at 0 (count = 0) and add 1 to "count" (count++) while "count" is less than "size" (count &lt; size) for (var count = 0; count &lt; size; count++) { // Add an underscore to the "result" variable result += "_"; } }; // define an anonymous function with a "size" parameter and save it as "mountain" var mountain = function (size) { // Add a forward slash to the "result" variable result += "/"; // start "count" at 0 (count = 0) and add 1 to "count" (count++) while "count" is less than "size" (count &lt; size) for (var count = 0; count &lt; size; count++) { // Add a single quote to the "result" variable result += "'"; } // Add a backwards slash to the "result" variable result += "\\" }; If you're asking because if (foo) bar(); oof(); Seems weird to you, then always consider a single line condition like this to be similar to if (foo) { bar(); } oof();
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28518841
accepted answer of: http://stackoverflow.com/q/28518841

http://stackoverflow.com/a/28535300
has comment: http://stackoverflow.com/comment/45386129
answers question: http://stackoverflow.com/q/28534304
has comment: http://stackoverflow.com/comment/45397503
score: 0
has comment: http://stackoverflow.com/comment/45388083
has comment: http://stackoverflow.com/comment/45386060
has comment: http://stackoverflow.com/comment/45386578
type: Answer
has comment: http://stackoverflow.com/comment/45548990
has body: I think your problem is that dist is a global variable the way you defined it. change to var dist. You are essentially overwriting it each time. :/ I also edited your fiddle. Keep in mind for body padding :) http://jsfiddle.net/ugxag1wg/2/ html, body{ padding: 0; margin: 0; } This should help.

http://stackoverflow.com/q/28588081
has body: var http = require("http"); var url = require("url"); var path = require("path"); var mongo = require("mongodb"); var Server = mongo.Server, Db = mongo.Db, BSON = mongo.BSONPure; var server = new Server('localhost', 27017, { auto_reconnect: true }); db = new Db('gamedb', server); db.open(function(err, db) { if (!err) { console.log("Connected to gameapp database"); db.collection('games', { strict: true }, function(err, collection) { if (err) { console.log("cant connect to db"); } }); } }); var findAll = function(req, res) { db.collection('games', function(err, collection) { collection.find().limit(10).toArray(function(err, items) { res.send(items); }); }); }; http.createServer(function(req, res) { if (req.url == "/games" &amp; req.method == "GET") { res.writeHead(200, { 'Content-Type': 'text/plain' }); findAll(req, res); res.end('end request\n'); } else { res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end('HI\n'); } }).listen(3000, '127.0.0.1'); console.log('Server running at http://127.0.0.1:3000/'); I keep trying to call findAll() in my create server function but I always get an error message saying undefined is not a function. I double checked my syntax and I can't find any errors. Any insight? EDIT: EXACT ERROR MESSAGE: Connected to gameapp database Server running at http://127.0.0.1:3000/ /Users/Justin/Documents/git/CISC474/gameapp/node_modules/mongodb/lib/mongodb/connection/base.js:246 throw message; ^ TypeError: undefined is not a function at /Users/Justin/Documents/git/CISC474/gameapp/server1.js:29:18 at /Users/Justin/Documents/git/CISC474/gameapp/node_modules/mongodb/lib/mongodb/cursor.js:197:9 at /Users/Justin/Documents/git/CISC474/gameapp/node_modules/mongodb/lib/mongodb/cursor.js:228:31 at /Users/Justin/Documents/git/CISC474/gameapp/node_modules/mongodb/lib/mongodb/cursor.js:806:30 at Cursor.close (/Users/Justin/Documents/git/CISC474/gameapp/node_modules/mongodb/lib/mongodb/cursor.js:1009:5) at getMore (/Users/Justin/Documents/git/CISC474/gamea…
type: AnsweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/45483406
has comment: http://stackoverflow.com/comment/45483566
type: Question
linked to: http://stackoverflow.com/q/500431
has answer: http://stackoverflow.com/a/28588375
tagged with: javascript
answer count: 1
has comment: http://stackoverflow.com/comment/45483402
has comment: http://stackoverflow.com/comment/45483456
accepted answer: http://stackoverflow.com/a/28588375
has title: calling function in Node.js
tagged with: node.js

http://stackoverflow.com/comment/45348856
comment on: http://stackoverflow.com/q/28515618
type: Comment
type: QuestionComment
score: 0
has text: Coz i ran your code in my local and it was working fine. The probable issue with your code is misplacement of jQuery file.

http://stackoverflow.com/a/28493173
has comment: http://stackoverflow.com/comment/45343948
has comment: http://stackoverflow.com/comment/45343958
has comment: http://stackoverflow.com/comment/45308636
has comment: http://stackoverflow.com/comment/45393418
has comment: http://stackoverflow.com/comment/45315667
has comment: http://stackoverflow.com/comment/45343990
has comment: http://stackoverflow.com/comment/45343973
has body: I have created a rough layout, check this and let me know what else you want in this. http://jsbin.com/goyepuhifo/1/edit
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45343942
answers question: http://stackoverflow.com/q/28492443
score: 0
has comment: http://stackoverflow.com/comment/45365284
has comment: http://stackoverflow.com/comment/45343978
type: Answer
accepted answer of: http://stackoverflow.com/q/28492443
has comment: http://stackoverflow.com/comment/45343906
has comment: http://stackoverflow.com/comment/45343935
has comment: http://stackoverflow.com/comment/45308800

http://stackoverflow.com/q/28485516
has answer: http://stackoverflow.com/a/28505288
tagged with: javascript
answer count: 2
tagged with: zingchart
favorite count: 0
possible better answer: http://stackoverflow.com/a/28505288
has title: zingcharts using time as x axis with multiple lines
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28502978
accepted answer: http://stackoverflow.com/a/28502978
downvote count: 0
tagged with: http://stackoverflow.com/tag/json
type: Question
upvote count: 2
tagged with: charts
has body: So I am trying to do a rather unique case of plotting it seems. I want to use time as my x-axis scale and I will have 2-5 lines being plotted, each with a different amount of time between datapoints. I am using zingcharts and they have some good documentation on general scale elements but I don't know if this is a case that is possible. Right now they plot on the same timestep and then the one that has less datapoints (greater time between points) ends up being shorter and not being displayed in a true manner. It works fine when I have only one chart and use that data's timestamp but it doesn't work for two. Is this something I need to handle on the backend or can this be done in Zingcharts on the frontend? This is my javascript of a single plot that works fine. Do I need to change this to allow for the above time scale with multiple plots? var myChart= { "type": "line", "title":{ "text":" value over time --- 38 data points" }, "legend": {}, "tooltip": {}, "crosshair-x":{}, "plot": { "valueBox": { "type": "max, min", "placement": "top", "visible" : false } }, "scaleX": { "label": { "text": "Time", }, "values" : [ 1418947599.0, 1418947599.0, 1418947599.0, 1418947599.0, 1418947599.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, 1418947600.0, ], "zooming" : true, }, "scaleY": { "label": { "text": "Value" }, "zooming" : true, }, "series": [ { "text" : "sim data - raw value", "values": [-0.31408204379961535, -0.3140820437996114, -0.3140820437996066, -0.3140820437996098, -0.3140820437996114, -0.31408204379960986, -0.314082043799613, -0.3140820437996122, -0.3140820437996098, -0…

http://stackoverflow.com/a/28485096
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28484448
score: 0
answers question: http://stackoverflow.com/q/28484448
has body: if you use json_encode on a class, the private properties of that class will never be visible. So if you change: private $username = ''; private $password = ''; to: public $username = ''; private $password = ''; the outcome will be: { username: "some-user-name" }

http://stackoverflow.com/a/28495848
upvote count: 1
downvote count: 1
type: Answer
has body: You can use querySelector() or querySelectorAll() to do this: querySelector Returns the first matching Element node within the node's subtree. If no matching node is found, null is returned. querySelectorAll Returns a NodeList containing all matching Element nodes within the node's subtree, or an empty NodeList if no matches are found. You might also find the following website useful; it contains examples of how you can do jQuery-like things without using jQuery: http://youmightnotneedjquery.com/
answers question: http://stackoverflow.com/q/28495757
score: 0

http://stackoverflow.com/a/28526149
answers question: http://stackoverflow.com/q/28525980
has comment: http://stackoverflow.com/comment/45370766
has comment: http://stackoverflow.com/comment/45370739
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45372980
has comment: http://stackoverflow.com/comment/45372351
has body: First, you need to define your array as array3 = ["seat 2","seat 5","seat 7"]; // notice [] for arrays, {} for objects Second, you can condense your code to for (i = 0; i &lt; array3.length; i++) { alert( array3[i] ); if(array3[i] == "seat 5" ) { alert("match 1"); document.getElementById("seat 1").checked = true; document.getElementById("seat 1").disabled = true; } else { alert ("match " + array3[i]); document.getElementById(array3[i]).checked = true; document.getElementById(array3[i]).disabled = true; } } Since, except seat 5, the names of the elements match the values from the array, there's no need to check the values explicitly and the if blocks can be done away with a single else block. Using a switch-case instead of if-else blocks array3 = ["seat 2","seat 5","seat 7"]; for (i = 0; i &lt; array3.length; i++) { switch (array3[i]) { case "seat 2": match = "seat 2"; break; case "seat 5": match = "seat 1"; break; case "seat 7": match = "seat 7" } alert( match ); document.getElementById(match).checked = true; document.getElementById(match).disabled = true; }
upvote count: 1
has comment: http://stackoverflow.com/comment/45372593
has comment: http://stackoverflow.com/comment/45370498
type: Answer

http://stackoverflow.com/comment/45276721
comment on: http://stackoverflow.com/a/28474540
type: Comment
score: 0
has text: What value have id attribute in inspector browser?
type: AnswerComment

http://stackoverflow.com/comment/45500808
comment on: http://stackoverflow.com/a/28593371
has text: Because you can't do that.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28497602
has comment: http://stackoverflow.com/comment/107144666
accepted answer of: http://stackoverflow.com/q/28497023
upvote count: 14
answers question: http://stackoverflow.com/q/28497023
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/76690581
has body: It's what you mean?? flow my examples: I have use google.maps.event.trigger(markers[2], 'click'); and it worked. I thing wrong from your event click of marker. My examples Javascript var tam = [16.3,108]; var toado = [[16.5,108.5,"https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQxFoh469eOsZQkuPOLpZn3R6yyIExkZCxOxf4ywfeY3v330EwP3Q"], [16.3,108,"https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQxFoh469eOsZQkuPOLpZn3R6yyIExkZCxOxf4ywfeY3v330EwP3Q"], [16,107,"https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQxFoh469eOsZQkuPOLpZn3R6yyIExkZCxOxf4ywfeY3v330EwP3Q"], [23,105,"https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQxFoh469eOsZQkuPOLpZn3R6yyIExkZCxOxf4ywfeY3v330EwP3Q"]]; var markers = []; function initialize() { var myOptions = { center: new google.maps.LatLng(tam[0], tam[1]), zoom: 10, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); for (var i = 0; i &lt; toado.length; i++) { var beach = toado[i]; urlimg = beach[2]; var image = new google.maps.MarkerImage( urlimg, null, null, null, new google.maps.Size(15, 15)); var myLatLng = new google.maps.LatLng(beach[0], beach[1]); markers[i] = new google.maps.Marker({ position: myLatLng, map: map, icon: image, draggable : true, animation : google.maps.Animation.DROP }); var ismove = true; (function(marker,i){ google.maps.event.addListener(marker, 'click', function(){ alert(toado[i][2]); //infowindow.open(map,this); }); }(markers[i],i)); } //setMarkers(map, beaches); } window.onload = initialize; //Html &lt;body&gt; &lt;input type="button" id="btn-click" value="Click"/&gt; &lt;div id="map_canvas" style="width:100%; height:100%"&gt;&lt;/div&gt; &lt;/body&gt; &lt;script&gt; $(document).ready(function(){ $("#btn-click").click(function(){ google.maps.event.trigger(markers[2], 'click'); }); }); &lt;/script&gt;
type: Answer
has comment: http://stackoverflow.com/comment/107146361
score: 13
downvote count: 1

http://stackoverflow.com/a/28570518
has comment: http://stackoverflow.com/comment/45450997
has body: Change to following line: document.getElementById("one").innerHTML = "Logout"; " characters has to be escaped. And link has to be like that link It's worth to use i.e. firefox plugins like JS console where you could see in what line error occurs.
has comment: http://stackoverflow.com/comment/45451051
has comment: http://stackoverflow.com/comment/45450996
score: 0
has comment: http://stackoverflow.com/comment/45451098
has comment: http://stackoverflow.com/comment/45451054
answers question: http://stackoverflow.com/q/28570392
type: Answer

http://stackoverflow.com/comment/45484203
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28558334
score: 0
has text: oh sorry forgot to attach the link http://jsfiddle.net/7ro02tpj/

http://stackoverflow.com/q/28546438
upvote count: 1
type: Question
tagged with: jquery-ui
has answer: http://stackoverflow.com/a/28547212
accepted answer: http://stackoverflow.com/a/28547212
tagged with: javascript
tagged with: jquery
has title: dynamically created jQueryUI spinner not working
answer count: 3
possible better answer: http://stackoverflow.com/a/28546622
has answer: http://stackoverflow.com/a/28546569
downvote count: 0
favorite count: 0
tagged with: jquery-ui-spinner
has answer: http://stackoverflow.com/a/28546622
type: AnsweredQuestion
has body: Fiddle Example I have multiple spinners on the page. Their minimums,maximums and steps depend on their own spinner's data-attributes. I have been using this code to call the spinner: function spin(){ $( ".spinner" ).each(function(){ var self = $(this), min = self.data('min'), max = self.data('max'), step = self.data('step'); $(this).spinner({ min: min, max: max, step: step, icons: {up:"tuparrow",down:"tdownarrow"} }) }); } $(document).ready(function(){ spin(); }) But I found that when spinners are dynamically created on click, the spin() function isn't working after being called following after. Can anyone know what is the problem? $('button').click(function(){ var area = $('.area').last(), newone = area.clone(); area.after(newone); spin(); }) HTML: Click
score: 1

http://stackoverflow.com/a/28573291
downvote count: 0
has comment: http://stackoverflow.com/comment/45456771
type: Answer
answers question: http://stackoverflow.com/q/28573022
score: 2
has body: In this case, @adeneo's approach is simpler. However, an alternative solution which allows you to emulate lookbehinds is reversing the string and using a lookahead: 'Jon, Joe4, Carrie, Steve17A 14, 13, 12, 37' .split('').reverse().join('') // Reverse the string .split(/\s+(?!,)\b/) // Use lookahead .reverse() // Undo reversion (1) .map(function(item) { return item .split('').reverse().join('') // Undo reversion (2) .split(/,\s+/); });
upvote count: 2

http://stackoverflow.com/q/28452882
tagged with: jquery
has answer: http://stackoverflow.com/a/28453042
type: Question
has body: Im new in laravel. im tring to create a multiple chekboxs,and click one button then checked all checkboxes im using chekall.blad.php code is here &lt;input type="submit" name="submit" value="submit"&gt; @foreach($students as $student) &lt;table border="1" width="220" &gt; &lt;tr&gt; &lt;td width="130"&gt; &lt;input tabindex="1" type="checkbox" name="student[]" id="{{$student}}" &gt; &lt;/td&gt; &lt;td&gt; {{$student-&gt;studname}} &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; @endforeach &lt;input type="submit" name="submit" value="submit"&gt; i dont know using jquery code.can you explain jquery code for checkall and i want to checked values are save into database table.
has answer: http://stackoverflow.com/a/28452967
score: 0
has title: how to use check all in laravel
tagged with: javascript
type: UnansweredQuestion
answer count: 2
has comment: http://stackoverflow.com/comment/45233207

http://stackoverflow.com/q/28465901
type: UnansweredQuestion
has body: I have a form with a field. The Format they need to enter is as follows. 10.222.92.160(asxvlc558-ipsn),10.222.92.161(asxvlc559-ipsn),10.222.92.162(asxvlc560-ipsn) I dont care too much about whats between the parens but I do care about the IP format where the Parens are and the comma delimitation. Can someone provide a snippet of code. Ive tried to use the RegExp to do it but cant get the match correct. Here is the form line &lt;textarea name="ro_access" onchange='validatehost(this.value)'&gt; 10.10.10.10(somehost01-ipsn),10.10.10.11(somehost02-ipsn)&lt;/textarea&gt;&lt;/td&gt; Here was my stab at the JS part. Not much of a JS guy so dont laugh to much. function validatehost( value ) { var ipRE = new RegExp('\d+\.\d+\.\d+\.\d+\(*\),'); var r = ipRE.test(value); if (r &gt;= 0) { alert("Hostnames are not in the Right Format. Use:ip(hostname),"); document.NFSNew.ro_access.focus(); return false; } }
tagged with: regex
has title: Check Syntax with parentheses in the variable
has answer: http://stackoverflow.com/a/28466378
upvote count: 2
score: 1
downvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28466388
has answer: http://stackoverflow.com/a/28466381
answer count: 3
favorite count: 0

http://stackoverflow.com/comment/45418383
type: QuestionComment
type: Comment
has text: Thanks @entre. It seems like your answer is to create a separate directive entirely. I'd like to try making this one work if I can though, unless there's a good reason why it won't.
score: 0
comment on: http://stackoverflow.com/q/28534491

http://stackoverflow.com/comment/45416931
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28551177
has text: Thanks! However, the filename is hardcoded in -- I am trying to access the same file that was uploaded in the original GET request. Is there a way to access the filename from the upload?

http://stackoverflow.com/q/28524673
downvote count: 1
linked to: http://stackoverflow.com/q/27928
has comment: http://stackoverflow.com/comment/45365383
has answer: http://stackoverflow.com/a/28524780
type: Question
has title: How to auto calculate and display the nearest distance of airport using googlemap?using jquery or javascript?
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/4057665
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45365421
score: 0
upvote count: 1
has body: I want to display nearest distance of airport using googlemap. i have lattitude and longitude of address. i got all nearest airport code but want to display nearest distance...

http://stackoverflow.com/a/28460667
score: 1
has comment: http://stackoverflow.com/comment/45407654
answers question: http://stackoverflow.com/q/28460090
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45297691
accepted answer of: http://stackoverflow.com/q/28460090
upvote count: 1
has body: Hmm, you're saying your data doesn't work well when shaped as [x, y] pairs but it seems to me that each point has 2 pieces of data: date (x) and that other integer (y). I remember that Highcharts needs to be specifically told whether your X axis is made up of categorical buckets (like nominal variables) or a continuous line (like dates or a number range, where many or most "ticks" on the line won't have a data point present for them). It sounds like your use case needs the latter. Have you looked into Highcharts' documentation to learn about the difference? Take a look at this example chart: http://www.highcharts.com/demo/spline-irregular-time/grid and in the source code, note the following designation for the X axis: xAxis: { type: 'datetime', }, Also note that when you scroll down to the data points defined for that chart (still in the source), you can see they had to specifically create a JS Date object for every single data point. Since your date intervals are irregular, you'll probably have to do the same thing: series: [{ name: 'Winter 2007-2008', // Define the data points. All series have a dummy year // of 1970/71 in order to be compared on the same x axis. Note // that in JavaScript, months start at 0 for January, 1 for February etc. data: [ [Date.UTC(1970, 9, 27), 0 ], [Date.UTC(1970, 10, 10), 0.6 ], [Date.UTC(1970, 10, 18), 0.7 ], [Date.UTC(1970, 11, 2), 0.8 ], How to set up a Gantt chart in Highcharts is a whole different matter. I don't have experience with this but I've seen elegant examples online, so hopefully this won't pose as much trouble. Good luck!
has comment: http://stackoverflow.com/comment/45274082
has comment: http://stackoverflow.com/comment/45312643

http://stackoverflow.com/q/28464767
tagged with: javascript
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: window.location.href not setting query parameters
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45255273
has body: I'm trying to set a new url, I've used: window.location.href = &lt;url&gt;; window.location.assign(&lt;url&gt;); if the url contains a section with query string parameters, Eg. info?value=1 in IE the url will not show these parameters. I tried the above two in Chrome and Chrome does show the query parameters. What's the hack to get it to work in IE?
has comment: http://stackoverflow.com/comment/45255308
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28464801
type: Question
tagged with: internet-explorer

http://stackoverflow.com/q/28589387
upvote count: 3
linked to: http://stackoverflow.com/q/9249680
type: Question
has comment: http://stackoverflow.com/comment/45487412
linked to: http://stackoverflow.com/q/10926880
downvote count: 0
accepted answer: http://stackoverflow.com/a/28589756
tagged with: javascript
tagged with: jquery
answer count: 2
has title: Hide iframes if not correctly loaded
has body: I have several iframes pointing to external websites on my page. In case those services are interrupted or changed, I would like to hide those iframes instead of displaying an error message on my page. Is there any way to find out in Javascript if the iframe has been loaded correctly? I added a class to hide the iframe and then remove it with jQuery when the iframe is ready, like this: $('#widget').ready(function () { $('#widget').removeClass('hidden'); }); It still removes the hidden class when I put an invalid URL in the iframe src, showing the error iframe. My questions are two: How can I make the function just run if the iframe has been loaded correctly? Instead of using $('#widget').ready, I would like to use $('iframe').ready to target all iframes at once; if I do so, how to refer to the specific iframe loaded, inside the function? Thanks!
favorite count: 0
has answer: http://stackoverflow.com/a/28589695
linked to: http://stackoverflow.com/q/1051782
tagged with: iframe
has answer: http://stackoverflow.com/a/28589756
possible better answer: http://stackoverflow.com/a/28589695
type: AnsweredQuestion
score: 3

http://stackoverflow.com/comment/45282279
comment on: http://stackoverflow.com/a/28457542
score: 0
type: AnswerComment
has text: Thanks for answering, but which code? There is more information on my post now, check it please. :)
type: Comment

http://stackoverflow.com/q/28459823
has comment: http://stackoverflow.com/comment/45245791
has title: Set header with PHP from within Javascript
type: Question
tagged with: javascript
tagged with: http-headers
has comment: http://stackoverflow.com/comment/45245891
score: 0
linked to: http://stackoverflow.com/q/13840429
has body: I'm trying to make a PHP 302 redirect, set the Vary header and set the X-Robots tag dependently on the screen width. The code snippet i have is &lt;script language="javascript"&gt; if ( $(window).width() &lt; 480 ) { &lt;?php { header('Vary: User-Agent'); header("Location:'$_SERVER['REQUEST_URI'].'/index_mobile.html", true, 302); header("X-Robots-Tag: noindex,nofollow"); } ?&gt; } &lt;/script&gt; I don't use a simple Javascript redirect, because i must set the Vary header and additionally the redirect must be explicitly 302. But it seems, this snippet doesn't work. Does somebody know, how i achieve the goals? Thank you!
has comment: http://stackoverflow.com/comment/45245808
duplicate of: http://stackoverflow.com/q/13840429
type: UnansweredQuestion
tagged with: http-redirect
tagged with: php
has comment: http://stackoverflow.com/comment/45245849
answer count: 0

http://stackoverflow.com/q/28523087
has answer: http://stackoverflow.com/a/28541742
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/45362854
accepted answer: http://stackoverflow.com/a/28541742
type: AnsweredQuestion
score: 1
tagged with: forms
type: Question
has body: I am trying to create a form with a range type input. Like &lt;input id="slider1" type="range" min="0" max="100" step="10" /&gt; Here the values are integer only like : 0,1,2,3,4,5........99,100. Is it possible to create the range values something like string or other type from database like: String1, String2, String3 Thanks.
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28523460
has title: HTML5: How to create a "range input type" with dynamic values?
has answer: http://stackoverflow.com/a/28523460
answer count: 2

http://stackoverflow.com/a/28541846
has comment: http://stackoverflow.com/comment/45397525
has comment: http://stackoverflow.com/comment/45398502
score: 0
has comment: http://stackoverflow.com/comment/45397794
upvote count: 1
has comment: http://stackoverflow.com/comment/45398565
type: AcceptedAnswer
downvote count: 1
has comment: http://stackoverflow.com/comment/45398358
accepted answer of: http://stackoverflow.com/q/28541790
has comment: http://stackoverflow.com/comment/45397496
answers question: http://stackoverflow.com/q/28541790
type: Answer
has comment: http://stackoverflow.com/comment/45397823
has comment: http://stackoverflow.com/comment/45398543
has body: Convert a number to a hexadecimal string with: var hexString = num.toString(16); and reverse the process with: var num = parseInt(hexString, 16); Documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt
has comment: http://stackoverflow.com/comment/45398277
has comment: http://stackoverflow.com/comment/45397372
has comment: http://stackoverflow.com/comment/45397851

pace.js
tag name: pace.js
tags question: http://stackoverflow.com/q/28530354
type: Tag

http://stackoverflow.com/comment/45280573
type: Comment
type: QuestionComment
score: 0
has text: Why would you need to do this?
comment on: http://stackoverflow.com/q/28477494

http://stackoverflow.com/comment/45430201
has text: you need to escape the hash sign, like mentioned here: http://stackoverflow.com/questions/10354340/jquery-having-pound-sign-in-the-selector
comment on: http://stackoverflow.com/q/28559319
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28589045
type: UnansweredQuestion
tagged with: selenium-webdriver
has body: I have little problem with making screenshot of whole page. Using webdriverio code such this (below, with firefox) makes me screenshot of whole page, but not with chrome. Author api says, that i need to use webdrivercss, but i dont know how. Anybody, pls help me. How i can change that code. var webdriverio = require('webdriverio'); var options = { desiredCapabilities: { browserName: 'chrome' } }; var size; webdriverio .remote(options) .init() .windowHandleMaximize(false) .url('http://webdriver.io/') .saveScreenshot('./chrome.png') .end(); For every help, i will be grateful
has comment: http://stackoverflow.com/comment/45485508
has answer: http://stackoverflow.com/a/29443596
tagged with: webdriver
type: Question
tagged with: javascript
score: 0
has title: Webdrivercss make a whole page screenshot
answer count: 1
has comment: http://stackoverflow.com/comment/45484996

http://stackoverflow.com/q/28569289
type: Question
tagged with: primefaces
tagged with: javascript
has answer: http://stackoverflow.com/a/28582719
answer count: 2
has comment: http://stackoverflow.com/comment/45487261
downvote count: 0
duplicate of: http://stackoverflow.com/q/30190214
has answer: http://stackoverflow.com/a/42835709
has body: I have this code: &lt;div id="visibleButtons"&gt; &lt;p:commandButton id="hint" action="#{tutorSession.hintRequest}" value="Hint Please" update="@parent" oncomplete="playNextHint(#{tutorSession.giveWarning});"&gt; &lt;/p:commandButton&gt; &lt;p:commandButton id="newType" action="#{tutorSession.newPathRequest}" value="Something Else" update="@parent" oncomplete="playNextHint(#{tutorSession.giveWarning});"&gt; &lt;/p:commandButton&gt; #{tutorSession.giveWarning}&lt;!-- I will remove this line once the buttons are working --&gt; &lt;/div&gt; and what is happening is that the javascript function playNextHint is executing with the value of giveWarning from the last call, rather than the current one. I checked that the server is returning the right value; it is. In fact, I added that little bit of text output at the bottom to verify that the right value is being returned, and it always displays the way I expect, but the javascript still uses the old value. Any thoughts on what might be happening? The javascript method, in case it is relevant: function playNextHint(giveWarning){ alert(giveWarning); } Thank you in advance. Edit: I found a work-around by using a hidden field with the value, and then getting the value of that field in the javascript, but that is messy and there has to be a better way, as I will be doing a lot of this sort of thing for this web app. Edit 2: Sorry, I left in some code for demonstration purposes that seems to have confused people. First, I do NOT want to display giveWarning. That is just there so I could see that it was getting the right value. I left it in so people could see where the right value does show up, as opposed to where it does not. Edit 3: What I want to do when the button is pressed is compute the new value of giveWarning on the server (that part works) and then send it to a javascript function to do logic based on it (the alert is a placeholder and for testing). The problem is that the value the javascript function gets always see…
favorite count: 0
linked to: http://stackoverflow.com/q/30190214
has comment: http://stackoverflow.com/comment/45487076
type: UnansweredQuestion
has title: PrimeFaces Attribute in oncomplete method not updating
tagged with: jsf
score: 1
has comment: http://stackoverflow.com/comment/45472257
upvote count: 1

http://stackoverflow.com/a/28572129
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28570503
has body: I've started a more in-depth project like this for fun, so I kinda know what's going on here. First of all, you're calling the score wrong. It's a javascript variable, so instead of calling it like an HTML element, call it as a javascript variable. Change this: document.getElementById("score").innerHTML = score + 5; To this: score = score + 5; Much simpler. However, you need to add a function to change #score to change as the score variable changes. Sorry, but my knowledge is too limited to help you with this one. Now, in order to only add points if a place has not been visited, you need to add a variable that states if a place has been visited, and add an if-statement for the score. Like this (for north): var score = 0; var beenNorth = false; function north(){ var message = 'You are now in the kitchen'; alert(message); if (beenNorth == false) { //If you have not been north, do this: score = score + 5; } beenNorth = true; //Yes, I have been north } Obviously, you'd have to add a variable for every room (N, S, E, and W). But a game like this with only four rooms is kinda boring. I'd recommend using a coordinate-based system, having a variable start out as: location = [0,0] And having if-statements to add or subtract to either location[0] or location[1], simulating a coordinate plane.

http://stackoverflow.com/q/28535013
tagged with: google-maps
answer count: 1
has title: Google Map USGSOverlay clickevent multi response on same level markers
tagged with: android
has answer: http://stackoverflow.com/a/28535755
type: AnsweredQuestion
type: Question
has body: I used Google Map V3 create 20 markers , click one marker and the marker will show it's infowindow (which the marker , the infowindow all create by USGSOverlay). Now ,I get a bugs, example: I clicked marker A,and show the infowindow B, here I will click infowindow B to goto another page,but now , the marker C (which is under infowindow B) also got the clickenvent ,and show it's infowindow D. why? I try to stopPropagation,but nouse! function makeInfoWindow(item){ var marker= new USGSOverlay(getLargeView(item),item.getLatLng(),{x:-56,y:-118},'infobox',item.id); mGmap.addOverlay('infobox',marker); marker.bind("click",function(event){ event.cancelBubble = true; if (event.stopPropagation) { event.stopPropagation(); } console.log("InfoWindow click "); }); return marker; } USGSOverlay.prototype.bind = function (eventname, callback) { this.clickListener=callback; google.maps.event.addDomListener(this.htmlObj_, eventname, this.clickListener); } I think the markers and infowindos at the same level , so they got the same clickevent, I spent a lot of time for this, any one help me ? //marker function makePointMarker(item){ var marker = new google.maps.Marker({ position: item.getLatLng(), map: mGmap._map, draggable: false, icon: getPointIcon(item) }); //infowindow if(item.infoWindow == null){ item.infoWindow=makeInfoWindow(item); item.infoWindow.hide(); } // register marker clickevent google.maps.event.addDomListener(marker, 'click', function() { //event.stopPropagation(); // event.cancelBubble = true; if(mSelectedItem!=null){ if(mSelectedItem.id==item.id){ if(mSelectedItem.infoWindow.isShow()){ mSelectedItem.infoWindow.hide(); console.log("hide"); }else{ mSelectedItem.infoWindow.show(); console.log("show"); } refreshMap(); window.gsMapNative.onMarkerClicked(mSelectedItem.infoWindow.isShow(),item.id,item.name,item.isMainPoi,item.poiType,item.mapType,item.inChina); return; }else{ mSelectedItem.infoWindow.hide(); mSelectedItem.infoWindow=null; mSelectedItem=null; } } console.log("…
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28535755
tagged with: google-maps-api-3
score: 0

http://stackoverflow.com/q/28534650
accepted answer: http://stackoverflow.com/a/28535572
answer count: 4
type: AnsweredQuestion
tagged with: validation
has answer: http://stackoverflow.com/a/28534776
possible better answer: http://stackoverflow.com/a/28534764
has comment: http://stackoverflow.com/comment/45383850
tagged with: asp.net
has answer: http://stackoverflow.com/a/28534764
type: Question
has answer: http://stackoverflow.com/a/28534825
has answer: http://stackoverflow.com/a/28535572
score: 0
has title: how to block specific charter inputs in ASP.NET
has body: i have the below asp.net code to get user input then using the below javascript i have make sure that it is not kept empty by the user. now what i want do is to block user input on few characters such as (|,@,#,$) using the same javascript. any suggestion on how can i do this? &lt;asp:TextBox ID="txtAccountName" runat="server" Width="100%" CssClass="input" Enabled="False" onblur="CheckTxtBox(this);"&gt;&lt;/asp:TextBox&gt; function CheckTxtBox(sender) { if (sender.value == "") { alert("Please enter Address 1"); return false; } }
tagged with: javascript
has comment: http://stackoverflow.com/comment/45384612

http://stackoverflow.com/comment/45540331
type: Comment
type: QuestionComment
has text: Thanks. I revised the title to 'Google Maps API v3.19 Broken in Internet Explorer' (was 'Google Maps API v3.19 Broken in IE11')
comment on: http://stackoverflow.com/q/28587238
score: 0

http://stackoverflow.com/a/28559660
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28559598
type: Answer
answers question: http://stackoverflow.com/q/28559598
has body: When you promisify an object with bluebird using promisifyAll - an Async suffix is added by default. So instead of calling get call getAsync: prompt.start(); // start is synchronous, no need to `then` it prompt.getAsync(["message"]).then(function(response) { // note the suffix added console.log("got message", response.message); // work with message here, can use promise aggregation/chaining and use like // any other promise method }); Quoting the documentation: The promisified method name will be the original method name suffixed with "Async". Any class properties of the object (which is the case for the main export of many modules) are also promisified, both static and instance methods. Class property is a property with a function value that has a non-empty .prototype object. Returns the input object. (Emphasis mine)
score: 2
downvote count: 0

http://stackoverflow.com/q/28525504
tagged with: backbone-model
tagged with: backbone.js-collections
has comment: http://stackoverflow.com/comment/45366898
type: Question
answer count: 1
tagged with: javascript
tagged with: sorting
has answer: http://stackoverflow.com/a/28525568
score: 0
has title: Sorting models in a backbone collection strange behaviour
tagged with: backbone.js
type: UnansweredQuestion
has body: In backbone application I have the ability to sort a collection of models in ascending or descending order based on a couple of attributes, one of which is cost. The api I am using weirdly returns the cost a string (not sure why I am investing this), but even wierder than this is that I can sort by cost absolutly fine until there is a cost greater than 100000.00 - and I cannot work out why. Here is the code that does the sorting, So I set the compartor in the collection, comparator: function (item1, item2) { var val1 = item1.get(this.sort_key); var val2 = item2.get(this.sort_key); /***added temporarly to sort save project from modal ****/ if(val2 == undefined){ val2 = val1; } /***end added temporarly to sort save project from modal ****/ if (typeof (val1) === "string" ) { val1 = val1.toLowerCase(); val2 = val2.toString().toLowerCase(); } var sortValue = val1 &gt; val2 ? 1 : -1; return sortValue * this.sort_order; } and then I run this code within the collection, this.sort_key = filters.order.by; this.sort_order = filters.order.type == "desc" ? -1 : 1; // console.log(this.sort_order); this.sort(); Lets say I have values of 10000.00, 20000.00, 30000.00, 40000.00 and 200000.00 If order ascending order I get the following returned, 10000.00 20000.00 200000.00 30000.00 40000.00 and if I sorting a descening order I get the following return 40000.00 30000.00 200000.00 20000.00 10000.00 Why would this be happening I cannot work it out.

microsoft-dynamics
tag name: microsoft-dynamics
tags question: http://stackoverflow.com/q/28440363
type: Tag
tags question: http://stackoverflow.com/q/28589252

http://stackoverflow.com/a/28442845
has body: One obvious variant is: var size = 5; var b1 = size &amp; 0xff; var b2 = (size&gt;&gt;&gt;8) &amp; 0xff; var b3 = (size&gt;&gt;&gt;16) &amp; 0xff; var b4 = (size&gt;&gt;&gt;24) &amp; 0xff; var sizeString = String.fromCharCode(b1, b2, b3, b4); very important note - depending on architecture order of b1-b4 could be different, it is called Endianness and probably you need b4, b3, b2, b1
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28442705
upvote count: 2

http://stackoverflow.com/comment/45299548
type: Comment
has text: @ginman Will do, but I added calls to `jest.dontMock()` for the actions and the stores. I'll post it anyways though.
type: QuestionComment
comment on: http://stackoverflow.com/q/28488667
score: 0

http://stackoverflow.com/comment/45257638
has text: Call `.show()` method before your `.filter()` call.
type: Comment
comment on: http://stackoverflow.com/a/28465808
score: 0
type: AnswerComment

http://stackoverflow.com/q/28561929
type: Question
has answer: http://stackoverflow.com/a/28562482
has comment: http://stackoverflow.com/comment/45435537
has body: i have been recently working on a mobile app, for which i have to code a calendar from scratch. i have to display the date in the scroll area which is in a parent div. i want the date to come in first, rather than hidden in the scroll area. please help me out how can i pull today's date in the visible part of the browser Sun 01 Sun 01 Mon 02 Tue 03 Sun 01 Wed 04 Thu 05 Fri 06 Sat 07
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Horizontal Calendar todays date highlight in pure javascript
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/28562482
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45435554
score: 1
upvote count: 1

http://stackoverflow.com/comment/45209651
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28440071
score: 1
has text: So what exactly is your question? Look into PHP get variables.

http://stackoverflow.com/q/28467486
tagged with: javascript
has answer: http://stackoverflow.com/a/28633454
answer count: 2
downvote count: 0
has body: I've been using the Selectize API and struggling on determining how to get the index/position of the currently selected item. I've looked at the API and found the getValue() to get the value of the selected item but I need the index. I also investigated the .selectize option itself but can't seem to find any attributes that store it?
tagged with: drop-down-menu
tagged with: jquery
favorite count: 0
has title: Get current index of select on selectize api dropdown
tagged with: selectize.js
type: UnansweredQuestion
score: 1
tagged with: select
upvote count: 1
has answer: http://stackoverflow.com/a/41024793
type: Question

http://stackoverflow.com/q/28439087
tagged with: javascript
linked to: http://stackoverflow.com/q/9461571
tagged with: jquery-validate
answer count: 1
downvote count: 0
has body: I have 3 validator methods to validate a form field. For each form field I have to validate, I needed to call these 3 validators all the time. Is it possible to write one validator method, that internally calls these 3 methods and returns the appropriate error? /* * Do not allow a name to include only underscores. */ jQuery.validator.addMethod('notallunderscores', function(value, element) { value = value.replace(/\_/g,''); return this.optional(element) || value.length &gt; 0; }, "Enter more than only underscore characters."); /* * Do not allow a name to include only hyphens. */ jQuery.validator.addMethod('notallhyphens', function(value, element) { value = value.replace(/\-/g,''); return this.optional(element) || value.length &gt; 0; }, "Enter more than only hyphens."); /* * Do not allow a name to include leading or trailing spaces. */ jQuery.validator.addMethod('notrailingorleadingspaces', function(value, element) { return this.optional(element) || ! value.match(/^ .*|.*\ $/g); }, "Please remove any leading or trailing spaces."); The validator I am looking for should be like this: /* * Call each of the above validator methods and return appropriate error. */ jQuery.validator.addMethod('validateformfield', function(value, element) { //Call the above 3 validator methods //Return the appropriate error returned by the above validators. }, "Return the error message from the failed validator.");
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28439644
score: 2
has answer: http://stackoverflow.com/a/28439644
upvote count: 2
type: Question
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/8829030
has title: Jquery - Calling multiple validators inside one big validator method

http://stackoverflow.com/q/28557676
has comment: http://stackoverflow.com/comment/45427326
score: 1
has answer: http://stackoverflow.com/a/74549577
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45427505
possible better answer: http://stackoverflow.com/a/28557748
upvote count: 1
has answer: http://stackoverflow.com/a/28557748
has title: How to convert chained property from string into a variable from javascript
type: Question
linked to: http://stackoverflow.com/q/45015
tagged with: javascript
has comment: http://stackoverflow.com/comment/45427297
has answer: http://stackoverflow.com/a/28557731
has body: I have this variable that is stored in a string var employee = { name: 'person', job: { post: 'developer', since: 2010, desk: { number: '1', } } }; How can i get the keychain value from a string e.g. var variable = "job.desk.number"; console.log(variable); //this should return 1 UPDATE 3 !! @T.J. Crowder's answer is actually the best answer. His function is quick and tidy. :) horry!
has answer: http://stackoverflow.com/a/28557750
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45427878
has comment: http://stackoverflow.com/comment/45427226
accepted answer: http://stackoverflow.com/a/28557731
answer count: 4
type: AnsweredQuestion

http://stackoverflow.com/comment/45319574
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28499794
has text: @raina77ow here is fiddle -> http://jsfiddle.net/kug0q35j/6/ but I can't get it to work...
score: 0

http://stackoverflow.com/comment/45378268
comment on: http://stackoverflow.com/a/28528900
type: Comment
has text: Body tags - if there are divs without body tag they will be pushed under the body tags
type: AnswerComment
score: 0

http://stackoverflow.com/q/28497411
favorite count: 0
has answer: http://stackoverflow.com/a/28497488
has comment: http://stackoverflow.com/comment/45316540
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45315944
has body: I am looking for a way to implement round facebook share button just like how its done here. I am able to implement standard facebook share with rectangular button.
has comment: http://stackoverflow.com/comment/45316965
has comment: http://stackoverflow.com/comment/48075516
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45315395
has comment: http://stackoverflow.com/comment/45317144
has title: how to get round/circular facebook share button
score: 2
downvote count: 0
linked to: http://stackoverflow.com/q/5699270
type: Question
upvote count: 2
tagged with: facebook-share
linked to: http://stackoverflow.com/q/20956229
answer count: 1
has comment: http://stackoverflow.com/comment/45314503
tagged with: javascript
tagged with: facebook-like

http://stackoverflow.com/q/28449937
tagged with: javascript
tagged with: jquery
score: 0
has body: I have a web application with a form and an number of inputs: Title1: Title2: Title3: Insert an Generate! I also have a JavaScript file which acts as a template: template.js function myFunction(p1, p2) { return p1 * p2; } function mySecondFunction(p3, p4) { return p3 - p4; } var myData = { *title1* : { Title: *title1*, Description: *title1Description* }, *title2* : { Title: *title2*, Description: *title2Description* }, } When a user clicks the button, how can i generate a copy of template.js insert the values the user has entered into the xxxxx parts of var myData, and prompt the user to download the newly generate file? I can use AngularJS if this makes it easier than jQuery?
answer count: 1
has comment: http://stackoverflow.com/comment/45239518
has comment: http://stackoverflow.com/comment/45270234
tagged with: angularjs
has answer: http://stackoverflow.com/a/28450870
has title: Inserting value into a JavaScript file template and generating a new file
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45242817
has comment: http://stackoverflow.com/comment/45232860
has comment: http://stackoverflow.com/comment/45228780
type: Question
accepted answer: http://stackoverflow.com/a/28450870
has comment: http://stackoverflow.com/comment/45228641

http://stackoverflow.com/comment/45279369
has text: It was also good before—entirely my fault for misreading. I just needed the edit to be able to change my vote. Sorry again.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28455898

http://stackoverflow.com/comment/45479454
type: Comment
score: 0
type: AnswerComment
has text: Hello, Thank you, this seems to be working but still the php is unfunctional, because it's supposed to update database data and it doesnt. It only shows me a result when I use a button and then try the ajax one manually with this But it doesnt get the message itself without reloading the page :(
comment on: http://stackoverflow.com/a/28585826

angular-strap
tag name: angular-strap
type: Tag
tags question: http://stackoverflow.com/q/28467793

http://stackoverflow.com/q/28483436
has title: Why is supertest returning an error when everything passes?
type: Question
type: AnsweredQuestion
tagged with: supertest
has answer: http://stackoverflow.com/a/28486933
accepted answer: http://stackoverflow.com/a/28486933
answer count: 1
tagged with: javascript
tagged with: mocha.js
score: 0
has body: My test looks like: it('should create a user with an email address and password', function(done) { return request.post('/v1/users').send(defaultUser).expect(200).expect(function(res) { console.log(res.body); res.body.should.have.property('id'); res.body.should.have.property('name'); res.body.should.have.property('email'); res.body.should.have.property('username'); return res.body.should.have.property('entities')["with"].lengthOf(1); }).end(done); }); res.body looks like { id: 17, name: 'Satoshi Nakamoto', email: 'snakamoto@mysite.com', username: 'snakamoto', api_key: '510e55d2c15b0617757bd463b3653ec8', entities: [ { id: 17, name: 'Satoshi Nakamoto Default Entity' } ] } So it has all of the appropriate fields. The error that I get is 1) User Interactions should create a user with an email address and password: Error: [object Object] at Test.assert (/Users/shamoon/Sites/mysite/mysite-api/node_modules/supertest/lib/test.js:218:48) at Server.assert (/Users/shamoon/Sites/mysite/mysite-api/node_modules/supertest/lib/test.js:132:12) at Server.g (events.js:180:16) at Server.emit (events.js:92:17) at net.js:1276:10 at process._tickCallback (node.js:419:13) What am I doing wrong?

http://stackoverflow.com/comment/45432609
has text: In `ES5` you can not do that, in `ES6` you can (http://goo.gl/Rwsi0e)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28560602
score: 1

http://stackoverflow.com/comment/45665104
comment on: http://stackoverflow.com/q/28487517
score: 0
type: Comment
type: QuestionComment
has text: @DanielLoNigro Right, they created the new repo ten months ago and haven't touched it yet. https://github.com/aspnet/signalr-client-js Don't get me wrong, I'd love to see this happen but I wouldn't count on it happening soon :)

http://stackoverflow.com/comment/45334014
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28507102
has text: you can write a wrapper function that invokes the passed function with the passed arguments, but inside a try/catch
score: 0

http://stackoverflow.com/q/28476604
favorite count: 0
has comment: http://stackoverflow.com/comment/61625598
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45286144
linked to: http://stackoverflow.com/q/25870970
has comment: http://stackoverflow.com/comment/45284405
has comment: http://stackoverflow.com/comment/45281171
score: 3
has comment: http://stackoverflow.com/comment/45284308
answer count: 0
upvote count: 3
tagged with: iframe
has body: I have this javascript fuction, I use it to print pdf document contained in an iframe: function printFrame1() { var frm = window.frames["IfPol_app"]; // or document.getElementById("IfPol_app").contentWindow frm.focus();// focus on contentWindow is needed on some ie versions frm.print(); } the iframe element is like this: &lt;iframe runat="server" id="IfPol_app" frameborder="0" width="100%" height="630px" /&gt; The browsers (chrome, firefox, IE8-) print window shows up with the pdf, IE9+ gives me this error on the focus() method call: 0x8000ffff - JavaScript runtime error: Invalid calling object I searched all related topics to contentWindow, contentDocument, iframe, pdf printing but i couldn't find a solution to this problem, can any one help please. thank you
type: Question
has comment: http://stackoverflow.com/comment/45286225
has comment: http://stackoverflow.com/comment/45284633
has comment: http://stackoverflow.com/comment/45280635
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45276876
has title: IE9+ gives Invalid calling object error when calling focus() on contentWindow of an iframe
tagged with: printing
tagged with: http://stackoverflow.com/tag/pdf
tagged with: asp.net

gmail
type: Tag
tags question: http://stackoverflow.com/q/28463482
tags question: http://stackoverflow.com/q/28562489
tags question: http://stackoverflow.com/q/28477428
tag name: gmail

http://stackoverflow.com/q/28561931
tagged with: javascript
favorite count: 0
tagged with: datetime
accepted answer: http://stackoverflow.com/a/28561991
type: AnsweredQuestion
upvote count: 0
has title: How to correctly interpret DateTime.UTCNow serialized as json, taking time zones into account?
tagged with: timezone
downvote count: 2
tagged with: utc
has answer: http://stackoverflow.com/a/28561991
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/45434669
score: -2
has body: We have server code that uses DateTime.UTCNow and is serialized as 2015-02-17T12:38:58.3220885Z What is the correct way to interpret these serialized dates client side, taking time zones into account? I am trying to track down a reported bug where the times appear to be incorrect and 'in the future' - at the client - I have seen no evidence of this however. The idea is for the server and client to simply be working with the same point in time.
has comment: http://stackoverflow.com/comment/45434671
answer count: 1

http://stackoverflow.com/comment/45305499
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28492456
has text: what error, it's a **BIG** word?
score: 0

http://stackoverflow.com/comment/45355236
has text: The linked question title is specific to Ajax calls, but at its core it is the same question, and the answers are applicable, since the problem comes from the A of Ajax (Asynchronous), and that is what you are experiencing too. I hope the answers there help you.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28519093

http://stackoverflow.com/q/28502576
answer count: 2
has title: AngularJs $watch throws Cannot read property 'replaceChild' of null
downvote count: 0
tagged with: javascript
score: 1
has body: I created a directive that looks like this: app.directive('superDir', function () { function link(scope, element, attrs) { scope.$watch('elements', function (value, old) { element.replaceWith(scope.elements.join("")) },true); } return { link: link }; }); however then the elements array is modified and the $watch is triggered I receive an exception : Cannot read property 'replaceChild' of null the html looks like this : &lt;body ng-app="myApp"&gt; &lt;div ng-controller="MainCtrl"&gt; &lt;super-dir&gt;&lt;/super-dir&gt; &lt;/div&gt; Can you tell me why it's not possible to replace a super-dir tag? Thanks
favorite count: 0
has comment: http://stackoverflow.com/comment/45324612
has answer: http://stackoverflow.com/a/28502645
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45324401
has comment: http://stackoverflow.com/comment/45345554
upvote count: 1
has comment: http://stackoverflow.com/comment/45324412
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/29404777
has comment: http://stackoverflow.com/comment/45324554
type: Question

http://stackoverflow.com/a/28449976
has comment: http://stackoverflow.com/comment/45242966
has comment: http://stackoverflow.com/comment/45233598
has comment: http://stackoverflow.com/comment/45242935
has body: You use db.fa from your router file, and pass the second parameter as a callback function. but the function signature don't have the cb param and doesnt use it. The main idea - you try to initiate an async operation and cannot know when it ends, so you send it a callback function to get triggered when all operations are done. Fixed code should be like that: //Module 1 //Module 1 has 2 functions, both are necessary to properly format function fnA(param1, cb1){ db.cypherQuery(query, function(err, result){ if(err){ cb1(err); &lt;-- return error to original call } var reformattedData = {}; //code that begins storing re-formatted data in reformattedData //the function that handles the rest of the formatting fnB(param1, param2, cb1); }); }); function fnB(param1, reformattedData, cb1){ db.cypherQuery(query, function(err, result){ if(err){ cb1(err); &lt;-- return error to original call } //the rest of the reformatting that uses bits from the second query cb1(false, dataObjectToSendBack); &lt;--- This will call the anonymouse function in your router call }); }); exports.fnA = fnA; Router file: var db = require('module1'); router.get('/url', function(req,res,next){ db.fnA(param1, function(err, result){ &lt;-- This anonymous function get triggered last if (err){ return next(err); } res.send(result); }); });
score: 1
has comment: http://stackoverflow.com/comment/45233527
answers question: http://stackoverflow.com/q/28449869
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45244015
accepted answer of: http://stackoverflow.com/q/28449869
type: Answer

http://stackoverflow.com/comment/45215396
comment on: http://stackoverflow.com/q/28442865
type: QuestionComment
type: Comment
score: 0
has text: I thought Angular provided it (the same way as for templateUrl)? Creating two routes is definitely an option, but I thought I could also do it this way.

handlebars.js
tags question: http://stackoverflow.com/q/28568174
tags question: http://stackoverflow.com/q/28572053
tags question: http://stackoverflow.com/q/28591004
tags question: http://stackoverflow.com/q/28482662
tags question: http://stackoverflow.com/q/28559197
tags question: http://stackoverflow.com/q/28516333
tags question: http://stackoverflow.com/q/28587604
tags question: http://stackoverflow.com/q/28549814
type: Tag
tags question: http://stackoverflow.com/q/28562982
tag name: handlebars.js
tags question: http://stackoverflow.com/q/28455217
tags question: http://stackoverflow.com/q/28470659
tags question: http://stackoverflow.com/q/28513392
tags question: http://stackoverflow.com/q/28534803
tags question: http://stackoverflow.com/q/28446242
tags question: http://stackoverflow.com/q/28492221

http://stackoverflow.com/comment/45321652
has text: it's possible but not that way, i just trying to say that you can't mix your code this way, read this topic http://stackoverflow.com/questions/6369313/difference-between-javascript-and-php First you have to understand difference between js and php and how it works and then you can start programing, And answering your question, you can do it many ways, you can e.g store dropdown list in js in some variables/templates or you can also make an ajax call to php and ask for dropdown list and then on success append the result where you want
type: QuestionComment
comment on: http://stackoverflow.com/q/28500390
score: 0
type: Comment

http://stackoverflow.com/a/28509345
has body: Why not just give them both the same class like submitForm &lt;input class="submitForm"** type="submit" id="saveScenarioButton" name="action" title="Save Scenario" value="Save" /&gt; &lt;input class="submitForm" type="submit" id="submitScenarioButton" name="action" title="Submit for approval" value="Submit" /&gt; then have a onClick for .submitForm like so: $('.submitForm').on('click', function () {...}); and inside the function get id by doing: var id = $(this).attr('id'); full code: $('.submitForm').on('click', function () { var id = $(this).attr('id'); ... the rest of your code ... });
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28509177
has comment: http://stackoverflow.com/comment/45338350
upvote count: 1

http://stackoverflow.com/q/28578119
score: 0
tagged with: java
answer count: 3
has answer: http://stackoverflow.com/a/28578228
tagged with: jsp
tagged with: javascript
type: UnansweredQuestion
has title: Load two return function with one click JSP and javascript
has answer: http://stackoverflow.com/a/28584220
type: Question
has answer: http://stackoverflow.com/a/28579306
has body: There is a jsp file calling 2 different js files. I had a button(assume ButtonA) in jsp which when clicked it load a function(Function1) which fill jsp form with values. There is another button in page (ButtonB) which when clicked it load another function where this function(Function2) calculate a figure based on result that Function1 populated in form. So the action was user click ButtonA first, field values loaded, then click ButtonB to get calculated figure. Now I dont want two button clicks here. I tried to put two functions in one button as example below &lt;td colspan=3&gt;&lt;center&gt;&lt;INPUT TYPE="Button" VALUE="Query Package Info" TARGET="bottom" onClick="generateReport('MK07FormPackageInfo'); computeMarkFormat(document.MK07Form.markSurf.value);"&gt;&lt;/td&gt; but it only correctly run first one but the second one with gives empty values. Please help.

http://stackoverflow.com/q/28488113
has comment: http://stackoverflow.com/comment/45310030
has title: How to change fields in Angular dynamic
has comment: http://stackoverflow.com/comment/45325174
tagged with: jquery
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45298052
answer count: 0
has comment: http://stackoverflow.com/comment/45331116
type: Question
has body: I have a really simple question I have been asking many times before in different ways without getting the help I needed. So Im familiar with javascript and HTML, but a real noob when it comes to Angular and steroids. I have provided code in all my other question, but this time I want to try to just provide some pictures to illustrate my problem, and then maybe you guys have a smarter solution that what I think is possible. So it's quite easy. The user starts in view 1 (the first picture) and based on his/her choice he/she will be forwarded to the next view (picture 2). If the user clicks on the list element Button 1, he/she will be forwarded to picture two with the check boxes Button 1.1, Button 1.2 and Button 1.3. However, if he/she clicks on Button 2 in view 1 (the first picture), he/she should be forwarded to the same view (picture 2) as when he/she clicks on Button 1, only this time the values of the checkboxes should be Button 2.1, Button 2.2 and Button 2.3. How is this possible?? I use scope, I would like to change it dynamic, but after 1000 tries I have given that up and I would just see a solution work. Please help UPDATED WITH CODE Ok so I added som code to this post, but please show be a working solution. The code example is almost the same as described above except some small differences. When you click on Button 1 in index1.html, the user should be forwarded to index2.html and the scope value should be button1. If the user clicks on button2, the scope value should be button2. However, the scope value stay static and does not change from the origin value which is "index 2". The reason why I did not provide the code in the first case was because I just want a solution that shows the first picture below and by clicking on one of the options the user will come to the next view (picture 2), and see the checkbox values based on which button he/she clicks. I do not want to create three html pages in order to show the different values for each button, I want to…
tagged with: javascript
tagged with: steroids
tagged with: angularjs-scope
score: 0

http://stackoverflow.com/q/28501455
has comment: http://stackoverflow.com/comment/52870685
tagged with: emscripten
tagged with: c#
score: 1
tagged with: marshalling
type: Question
has comment: http://stackoverflow.com/comment/52914664
has comment: http://stackoverflow.com/comment/52864713
upvote count: 1
tagged with: interop
tagged with: javascript
has title: Marshal C# and Emscripten - Callback
favorite count: 0
has body: I am trying to create a C# method and link it to an existing JavaScript method but I have some difficulties with Marshal and Emscripten usage. I tried to include my questions in the code as it will be easier to understand. Here is the javascript method // What are the types of those parameters ? JS_WebRequest_SetHandler: function (request, arg, onresponse) { var http = wr.requestInstances[request]; http.onload = function http_onload(e) { // ... var byteArray = new Uint8Array(http.response); var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); Runtime.dynCall('viiii', onresponse, [arg, http.status, buffer, byteArray.length]); // ... } Here is the C# content // Are the types right ? [DllImport("__Internal")] private static extern void JS_WebRequest_SetHandler(int request, IntPtr arg, IntPtr onresponse); public void SetHandler(string arg) // Example with a string { // How can I link the OnResponse method to the JS_WebRequest_SetHandler onresponse ? // What types should I use ? JS_WebRequest_SetHandler(request, arg, onresponse); } // Are those types right ? public void OnResponse(IntPtr arg, IntPtr status, IntPtr buffer, IntPtr length) { // How can I extract the data of each argument ? } Thanks a lot
answer count: 0
downvote count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/28473133
has comment: http://stackoverflow.com/comment/45270255
has answer: http://stackoverflow.com/a/28473251
has comment: http://stackoverflow.com/comment/45270300
accepted answer: http://stackoverflow.com/a/28473182
has title: select value with space jquery
has answer: http://stackoverflow.com/a/28473495
tagged with: javascript
has body: Select your favorite fruit: Apple Orange Pineapple Banana Click the button to change the selected fruit to banana. Try it This is from here setting value of select option on button click. When button is clicked the value will be banana when i change the value of banana with banana 1 it is not showing anymore.How to make it in a way that it will still accept the value even if there is a space
possible better answer: http://stackoverflow.com/a/28473397
type: Question
upvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45270243
answer count: 5
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45270351
score: -2
has answer: http://stackoverflow.com/a/28473308
downvote count: 2
tagged with: select
has answer: http://stackoverflow.com/a/28473182
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28473397

http://stackoverflow.com/a/28484045
type: AcceptedAnswer
has body: If you need it just at page load, then simply remove it from the event handler:* live.tiles.strikes_toggle($("input[name='set_strokes_shw']:checked").val() == '1'); If you need it on page load and in response to the event, make it a function you can call in both places: function tilesHandler() { live.tiles.strikes_toggle($("input[name='set_strokes_shw']:checked").val() == '1'); } tilesHandler(); $("#set_strokes_show input").on('click touchstart', tilesHandler); * This assumes the code is in a script tag after the relevant elements in the HTML, or that it's inside a ready handler. If not, move the script to the bottom of the HTML, just before the closing &lt;/body&gt; tag (preferred), or put it in a ready handler.
type: Answer
answers question: http://stackoverflow.com/q/28483969
accepted answer of: http://stackoverflow.com/q/28483969
score: 0

http://stackoverflow.com/q/28572004
tagged with: amazon-s3
tagged with: javascript
tagged with: html5-video
has title: Acquire Video File Metadata From S3
has answer: http://stackoverflow.com/a/28592225
score: 0
answer count: 1
type: UnansweredQuestion
has body: Setup: I'm working on a video upload tool. I use a 3rd party javascript library that loads content from a users various storage locations (Hard Drive, Dropbox, Facebook, etc ) The library pushes the videos to our S3 bucket and returns the url of the uploaded file. Goal: I would like to get the metadata (Height / Width / Duration / Etc) about the video without having to load the entire video binary. Context: I use a service that handles video transcoding, and eventually posts the transcoded metadata to one of our backend servers. The transcoding can take a few minutes. I need to get the temporary metadata of the uploaded file, but i don't want to load the full video.
tagged with: video
type: Question
linked to: http://stackoverflow.com/q/14629737
tagged with: video-streaming

http://stackoverflow.com/comment/45347836
comment on: http://stackoverflow.com/q/28515129
has text: can you upload it to edit jsfiddle so we can know the cause of lags
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/28440369
tagged with: base64
tagged with: image
upvote count: 43
answer count: 3
has body: My Node.js server has something that looks like the following: app.get("/api/id/:w", function(req, res) { var data = getIcon(req.params.w); }); Here, data is a string containing a Base64 representation of a PNG image. Is there any way I can send this to a client accessing the route encoded and displayed as an image (e.g. so the URL can be used in an img tag)?
downvote count: 0
has answer: http://stackoverflow.com/a/58943004
has comment: http://stackoverflow.com/comment/45210844
tagged with: javascript
tagged with: express
score: 43
favorite count: 0
has answer: http://stackoverflow.com/a/28440633
possible better answer: http://stackoverflow.com/a/53567757
has title: Rendering a Base64 PNG with Express
has answer: http://stackoverflow.com/a/53567757
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28440633
has comment: http://stackoverflow.com/comment/45210857
type: Question

http://stackoverflow.com/q/28536917
has body: I have tried to google this but I am not getting the answer I am looking for. I have two seperate modules (in seperate html pages - these perform totally unrelated tasks). I have created an authorization service and associated it with module 1 and I am using this $auth service inside my controller via DI. Now I want to use same service in module2. How can I do this? This is how service looks like : module1.service('$authService', function($http) { this.authorise = function(userid,accessKey) { // logic for performing auth }; });
upvote count: 1
type: Question
tagged with: javascript
answer count: 2
has title: How to use same service in two angular module
downvote count: 0
has comment: http://stackoverflow.com/comment/45387915
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/28536974
has answer: http://stackoverflow.com/a/28536979
accepted answer: http://stackoverflow.com/a/28536979
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28536974

http://stackoverflow.com/q/28584942
type: Question
has answer: http://stackoverflow.com/a/28586315
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: JavaScript/CSS Play Spritesheet once then change to gif?
score: 0
has comment: http://stackoverflow.com/comment/45477397
answer count: 1
accepted answer: http://stackoverflow.com/a/28586315
has comment: http://stackoverflow.com/comment/45478701
has body: So I have this game going on. I need to have it, when idle, play this gif and when a function() is called, I need it to loop through this spritesheet ONCE and then revert back to the gif. Here's my code, and the JavaScript I have NO IDEA how to do, but I tried anyway. CSS .dragon { width: 120px; height: 120px; background: url('http://www.thegaminghideout.com/school/dragonFire.png') left center; animation: play .8s steps(10) infinite; } @keyframes play { 100% {background-position: -1200px;} } JAVASCRIPT var weapon = []; var weapons = ['Claymore', 'Dagger', 'Magic Staff', 'Sword', 'Bow', 'Crossbow']; var armors = ['Helmet', 'Hood', 'Chestplate', 'Tunic', 'Robe', 'Legplates', 'Leggings', 'Undergarments', 'Boots', 'Armored Boots']; var materials = ['Leather', 'Iron', 'Steel', 'Mythril', 'Dragonbone']; var battleMusic = function() { if(mute.checked == false) { document.getElementsByTagName("AUDIO")[0].play(); } if(mute.checked === true) { } } var dragonHit = function() { var damage = dragonad / dp * 100; hp = hp - damage; Math.round(hp); alert("You were hit by the dragon! You currently have " + hp + " health!"); } var hitDragon = function() { var damage = ad / dragondp * 100; dragonhp = dragonhp - damage; Math.round(dragonhp); alert("You hit the dragon! The dragon now has " + dragonhp + " health!"); if(weapon.hasOwnProperty("Magic Staff")) { img.class = "dragon"; hitDragon(); } } HTML Your browser doesn't support the sound file for playback. The Dragon Battle will be silent! Mute Dragon Slayer - REBORN! You are a dragon-slayer veteran! You are retired, relaxed, and comfortable in your home, with no-one to boss you around... then you hear the town sirens. BEGIN! WHAT'S SUPPOSED TO HAPPEN The img starts with a blank class. By default, before the dragon fight, it will stay as the scenario. Once the dragonFight() function (included in the jcodepen with the full game) is called, it'll change the src of the image to the dragon.gif. If the player (array) has the weapon (propert…
type: AnsweredQuestion
tagged with: javascript

http://stackoverflow.com/q/28518676
favorite count: 0
has answer: http://stackoverflow.com/a/28527146
tagged with: transducer
accepted answer: http://stackoverflow.com/a/28527146
has title: Is it possible to implement scan as a transducer
type: Question
type: AnsweredQuestion
upvote count: 4
answer count: 1
downvote count: 0
tagged with: javascript
has body: I notice that scan is missing from the various transducer libraries that I looked at (e.g transducers-js). Is it impossible to implement or am I missing something?
score: 4
tagged with: rxjs

http://stackoverflow.com/comment/45452138
type: Comment
has text: @user3071089 hmmm im not sure! can you see the difference in the example i posted (karma) ?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28569726

http://stackoverflow.com/a/28521847
has body: Did you tried: if($request-&gt;isXmlHttpRequest()) { $id = (int)$request-&gt;request-&gt;get('row'); } Instead of: $id = $request-&gt;get('id'); ?
type: AcceptedAnswer
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45361472
has comment: http://stackoverflow.com/comment/45365864
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28521804
answers question: http://stackoverflow.com/q/28521804

http://stackoverflow.com/comment/45438661
score: 0
has text: @Jackson the version is IE9
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28563986

http://stackoverflow.com/q/28562515
tagged with: ajax
accepted answer: http://stackoverflow.com/a/28566073
has title: Django jquery with ajax. How to make jquery to listen id's of generated forms
type: AnsweredQuestion
tagged with: django
possible better answer: http://stackoverflow.com/a/28563346
type: Question
has answer: http://stackoverflow.com/a/28563346
tagged with: javascript
has body: I have created basic shopping basket where I can add products to my session. Ive added ajax in order to not reaload my website everytime i add something to my basket. The thnging is that I have generated forms with my for loop. Each of the form has hidden input with the id of product and quantity I want to add. I have problem with finding a solution, how to make jquery listen to ID's of the forms (which has the ID's of products).I know I can do everyting by: $(this).attr('id'); But when I try to press the button, everyting is just fine with the first one. But when I press the other one generated it doesnt do ajax, it is going the second section in my views.py where i check if request is not ajax. And It happens with all buttons that are > first one. I`m posting my codes bellow: jquery: $(document).ready(function () { //$('#custom_user_form').on('submit', function (event) { // event.preventDefault(); // add_product(); // //}); $('button[type=submit]').on('click', function (event) { event.preventDefault(); add_product(); }); //$('button[type=submit]').on('click', function(){ // var post_primary_key = $(this).attr('id').split('-')[2]; // console.log(post_primary_key) // delete_message(post_primary_key); //}); function add_product() { $.ajax({ url: window.location.pathname+'add_product/', type: 'POST', datatype: 'json', async: false, data: { product_id: $('#product_id').val(), quantity: $('#quantity').val(), csrfmiddlewaretoken: $('input[name="csrfmiddlewaretoken"]').val() }, success: function (json) { $('#quantity').val(0); $('#price span').remove(); $("#price").prepend(" Overall price of all your products in basket: " + json.price + "$$$ Recently added products: " + json.name + ""); console.log("success"); } }); }; }); my template with generating forms: {% if products %} {% for p in products %} {{ p.id }} {{p.name}} {{p.price}} $ {{p.stock}} units {% if user.is_authenticated %} {% csrf_token %} {{ add_product_form.as_p }} Add {% endif %} {% endfor %} {% endif %} and f…
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28566073
tagged with: jquery

http://stackoverflow.com/comment/45377283
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28530579
has text: The new window is obviously in the same domain, otherwise I couldn't insert new html inside it (which does work, btw. only scripts does not get executed). Actually it could be an "about:blank" page. I use window.open() function.

http://stackoverflow.com/a/28575061
accepted answer of: http://stackoverflow.com/q/28575014
upvote count: 2
answers question: http://stackoverflow.com/q/28575014
has body: Updated. Try to change (body -> document; click -> focus) from $(body).on('click',".startNew", function(){ $(".startNew").datepicker({ $(body).on('click',".endNew", function(){ $(".endNew").datepicker({ to $(document).on('focus',".startNew", function(){ $(this).datepicker({ $(document).on('focus',".endNew", function(){ $(this).datepicker({ Working FIDDLE HTML Start: &lt;input class='endNew'&gt;&lt;br/&gt;&lt;br/&gt; End: &lt;input class='startNew'&gt; JS $(document).on('focus',".startNew", function(){ $(this).datepicker({ dateFormat : "yy-mm-dd 00:00:00", numberOfMonths: 2, onSelect: function(selected) { $(".endNew").datepicker("option","minDate", selected) } }); }); $(document).on('focus',".endNew", function(){ $(this).datepicker({ dateFormat : "yy-mm-dd 00:00:00", numberOfMonths: 2, onSelect: function(selected) { $(".startNew").datepicker("option","maxDate", selected) } }); });
has comment: http://stackoverflow.com/comment/45484676
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/comment/45245901
comment on: http://stackoverflow.com/a/28459800
score: 0
type: Comment
has text: good point you've made. I did think this too when I was doing $(this) on the `closest` function but this didn't work. I've tried your method but this doesn't work either. Nothing happens on the page and I don't get an error. Any other suggestions?
type: AnswerComment

http://stackoverflow.com/comment/45474107
score: 0
type: Comment
has text: Ah sorry, you can add a new country next to canada e.g. `{"countries":{"canada":{"cities":["toronto"], "maps": ["canada"]},"scotland":{"cities":["glasgow"], "maps": ["scotland"]}}}`. It's easier to read if you use a json lint tool such as http://jsonlint.com/.
comment on: http://stackoverflow.com/a/28561206
type: AnswerComment

http://stackoverflow.com/a/28520286
score: 0
type: Answer
has body: function myFunction() { var data; setTimeout(function(){ $.ajax({ //My Ajax Junk success: function(resp) { data = resp.trim(); // Dont declare it inside // I want to be able to use this later on. } }): }, 6000); setTimeout(function(){ var shipping = 'f_name='+f_name+data; // Append data from previous call to shipping }, 12000); }
answers question: http://stackoverflow.com/q/28520227

http://stackoverflow.com/a/28572670
has comment: http://stackoverflow.com/comment/45460898
has comment: http://stackoverflow.com/comment/45497875
answers question: http://stackoverflow.com/q/28554682
has comment: http://stackoverflow.com/comment/45465191
has comment: http://stackoverflow.com/comment/45457246
has body: If you're using the latest develop branch from the PHPExcel github repo, there is actually an html to rich text helper class: The file 42richText.php in the Examples folder demonstrates its use: $html1=' My very first example of rich text generated from html markup This block contains an italicized word; while this block uses an underline. I want to eat healthy food pizza . '; $html2=' 100°C is a hot temperature 10°F is cold '; $html3='23 equals 8'; $html4='H2SO4 is the chemical formula for Sulphuric acid'; $wizard = new PHPExcel_Helper_HTML; $richText = $wizard->toRichTextObject($html1); $objPHPExcel->setActiveSheetIndex(0) ->setCellValue('A1', $richText); $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(48); $objPHPExcel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1); $objPHPExcel->getActiveSheet()->getStyle('A1') ->getAlignment() ->setWrapText(true); $richText = $wizard->toRichTextObject($html2); $objPHPExcel->setActiveSheetIndex(0) ->setCellValue('A2', $richText); $objPHPExcel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1); $objPHPExcel->getActiveSheet()->getStyle('A2') ->getAlignment() ->setWrapText(true); $objPHPExcel->setActiveSheetIndex(0) ->setCellValue('A3', $wizard->toRichTextObject($html3)); $objPHPExcel->setActiveSheetIndex(0) ->setCellValue('A4', $wizard->toRichTextObject($html4));
has comment: http://stackoverflow.com/comment/45494955
has comment: http://stackoverflow.com/comment/45459858
has comment: http://stackoverflow.com/comment/45465150
has comment: http://stackoverflow.com/comment/45498614
has comment: http://stackoverflow.com/comment/45500506
has comment: http://stackoverflow.com/comment/45509554
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45472206
has comment: http://stackoverflow.com/comment/45509487
has comment: http://stackoverflow.com/comment/45502451
accepted answer of: http://stackoverflow.com/q/28554682
has comment: http://stackoverflow.com/comment/45500636
score: 0
has comment: http://stackoverflow.com/comment/45495214
type: Answer
has comment: http://stackoverflow.com/comment/45500082
has comment: http://stackoverflow.com/comment/45498570
has comment: http://stackoverflow.com/comment/45502418
has comment: http://stackoverflow.com/comment/45500239
has comment: http://stackoverflow.com/comment/45465316

http://stackoverflow.com/comment/45391754
comment on: http://stackoverflow.com/a/28538050
type: AnswerComment
has text: Happy to delete this and add it as a comment, but I would have seen this as an answer? The answer to the question is "no". I'm not asking for clarification from the author - the question is "i want do it without JavaScript, can i do it with rails feature?" and the answer is "no, you must use javascript".
type: Comment
score: 0

http://stackoverflow.com/a/47134999
type: Answer
answers question: http://stackoverflow.com/q/28572380
has comment: http://stackoverflow.com/comment/84929341
has body: While this is not the best solution, it may work for some of your needs. If you want to run different code in node and browser using this worked for me: if (typeof window !== 'undefined') return } //run node only code now
score: -2
downvote count: 3
upvote count: 1

multiple-tables
tags question: http://stackoverflow.com/q/28500518
tag name: multiple-tables
type: Tag

http://stackoverflow.com/q/28587327
has answer: http://stackoverflow.com/a/28588369
tagged with: polymer
tagged with: javascript
has answer: http://stackoverflow.com/a/28603938
has body: Consider the following polymer element. I need to access upon an event that was triggered by within the same template instance. The querySelector() in the event handler obviously does not work.
type: AnsweredQuestion
type: Question
answer count: 2
has title: How to access any element within iterative templates
accepted answer: http://stackoverflow.com/a/28603938
linked to: http://stackoverflow.com/q/24588708
score: 0
possible better answer: http://stackoverflow.com/a/28588369

http://stackoverflow.com/comment/45454552
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28550024
type: AnswerComment
has text: Why are you throwing an error if there is no `chunk`?

http://stackoverflow.com/comment/45334049
type: Comment
has text: But you are dealing with data! The width and height of each slide is a function of how many slices you want and how many levels you want for each. The data is the number of levels you want and the description and colors for each.
score: 0
comment on: http://stackoverflow.com/a/28506742
type: AnswerComment

http://stackoverflow.com/comment/45465623
type: QuestionComment
comment on: http://stackoverflow.com/q/28578096
has text: This fiddle http://jsfiddle.net/jgesfjzz/1/ demonstrates how you can use $.Deferred to solve your problem.
score: 0
type: Comment

http://stackoverflow.com/comment/100930908
comment on: http://stackoverflow.com/q/28497863
type: Comment
type: QuestionComment
has text: I have the same issue, call new Date() in nw.js, will make the system clock more faster, about 10 minutes than standard time in one day. I can not figure out it until now.
score: 0

http://stackoverflow.com/q/28502601
has answer: http://stackoverflow.com/a/28502834
accepted answer: http://stackoverflow.com/a/28502834
has comment: http://stackoverflow.com/comment/45324763
has answer: http://stackoverflow.com/a/78417183
has answer: http://stackoverflow.com/a/28503883
has title: Get all parent paths from Path String - Javascript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/60607752
downvote count: 0
has answer: http://stackoverflow.com/a/28509828
score: 1
type: Question
answer count: 8
possible better answer: http://stackoverflow.com/a/28503130
has answer: http://stackoverflow.com/a/28503226
upvote count: 1
tagged with: arrays
has answer: http://stackoverflow.com/a/28503130
tagged with: javascript
tagged with: jquery
tagged with: string
favorite count: 0
has comment: http://stackoverflow.com/comment/45324715
has body: I need some advice concerning string manipulation. This is a possible string: "/branches/projects/MyTool/MyTool/someOtherFolderOrFile" What I need is an array with the following in it: ['/branches', '/branches/projects','/branches/projects/MyTool','/branches/projects/MyTool/MyTool'] So to clarify what this array should contain: All parent paths to the last file or folder. The last file or folder is excluded in the array. I know I can split the string at "/" and then could iterate over the array, concatenate strings and delete the last entry from the array. This method I would call recursively until there is no element in the array left. The concatenated string would then be saved at every iteration to a new array which would hold the desired result at the end...... However I asked me how to do it very clean and simple and I am sure someone of you can come up with a superb solution :) EDIT Here is my current solution I came up with just now: var string = "/branches/projects/MyTool/MyTool/anotherFolderOrFile"; var helperArr = string.split("/"); var endArray = []; getParentArray(); console.log(endArray); function getParentArray() { if(helperArr.length == 1) { return; } else { var helperString = ""; for(var i = 0;i&lt;helperArr.length;i++) { helperString = helperString+helperArr[i]; if(i!= helperArr.length -1) { helperString = helperString+"/"; } } endArray.push(helperString); helperArr.length = helperArr.length-1; getParentArray(); } }
has answer: http://stackoverflow.com/a/28503131

http://stackoverflow.com/comment/45394737
type: QuestionComment
comment on: http://stackoverflow.com/q/28539491
has text: You can tru, but your issue is somewhere else? Do you use CSRF tokens ? Please try to set $config['cookie_secure'] in config file to FALSE
score: 0
type: Comment

http://stackoverflow.com/a/28483057
type: Answer
has comment: http://stackoverflow.com/comment/45288974
score: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45288700
has body: You'll at least need JavaScript for that. First you need a function that can read the variables in the URL: function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0;i<vars.length;i++) { var pair = vars[i].split("="); if(pair[0] == variable){ return pair[1];} } return(false); } Now let's say you want to change the css of the element with id element1 if(getQueryVariable("theme") == "red") { document.getElementById("element1").className = "redClass"; } elseif(getQueryVariable("theme") == "yellow") { document.getElementById("element1").className = "yellowClass"; } Of course you need to create the css classes (in this example redClass and yelloClass) first, but that's pretty much how it could work out. edit: As requested by OP, here's a working demo. JsFiddle apparently doesn't like GET parameters, so just copy it to an html file an try for yourself. ?theme=red will make the text red. ?theme=yellow will make the text yellow. This is a test
answers question: http://stackoverflow.com/q/28482798
upvote count: 2

http://stackoverflow.com/q/28461780
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45249667
tagged with: jquery
has title: Change css background color in my function
type: Question
has answer: http://stackoverflow.com/a/28462062
has comment: http://stackoverflow.com/comment/45249553
tagged with: css
has comment: http://stackoverflow.com/comment/45249485
score: 0
has comment: http://stackoverflow.com/comment/45249670
has comment: http://stackoverflow.com/comment/45249686
answer count: 1
tagged with: classiejs
has body: I have this code to change my buttons inner HTML when they are clicked. I also want to change the CSS background color when button is clicked, but I couldn't get it to work. Show Menu var menuTop = document.getElementById('cbp-spmenu-s3'), showTop = document.getElementById('showTop'), body = document.body; showTop.onclick = function() { if (showTop.innerHTML == 'Show Menu') { showTop.innerHTML = 'Hide Menu'; } else { showTop.innerHTML = 'Show Menu'; }; classie.toggle(this, 'active1'); classie.toggle(menuTop, 'cbp-spmenu-open'); disableOther('showTop'); }; function disableOther(button) { if (button !== 'showTop') { classie.toggle(showTop, 'disabled'); } }

http://stackoverflow.com/comment/45410624
type: QuestionComment
has text: the script looks OK to me. how is the form being loaded? e.g. are you loading it dynamically, or is it in the same HTML document as the script? if the form is being loaded by script or by Ajax call, it's possible that it is being inserted into the DOM after your javascript has run.
score: 0
comment on: http://stackoverflow.com/q/28547554
type: Comment

http://stackoverflow.com/comment/45344830
comment on: http://stackoverflow.com/a/28512910
type: Comment
has text: Well, we're closer. I think your code has some scope issues (`this.store` within the `then()`) but I got closer with passing a variable `data` into the `then` function, and calling `data.get('definition')`. This loads the appropriate data into the store, but it doesn't return the whole thing as the model.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45301015
score: 0
comment on: http://stackoverflow.com/a/28478764
type: Comment
has text: Are you still having these issues? Sorry as had to sleep last night lol
type: AnswerComment

http://stackoverflow.com/q/28549101
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45415342
has answer: http://stackoverflow.com/a/28549127
has answer: http://stackoverflow.com/a/28549180
type: UnansweredQuestion
upvote count: 1
type: Question
has title: How to get form's id, only which submitted
has answer: http://stackoverflow.com/a/28549333
tagged with: forms
has body: I have 4 forms in my html, and required that form's id which submitted. But every time constantly first form's id comes in output. My HTML is: Family Number Submit Head Name Submit Phone Number Submit CNIC Submit and my js is function filterByFamNum(){ var name = $(this.form).attr('id'); console.log(name); } function filterByMemName(){ var name = $(this.form).attr('id'); console.log(name); } function filterByPhone(){ var name = $(this.form).attr('id'); console.log(name); } function filterByCNIC(){ var name = $(this.form).attr('id'); console.log(name); } Ouptut of every form submit is constantly filterHeadByFamNum
answer count: 3
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/28520316

http://stackoverflow.com/a/28510926
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/28510806
has comment: http://stackoverflow.com/comment/45346114
upvote count: 1
has comment: http://stackoverflow.com/comment/45378347
has body: Make sure in your index.html or whatever you are including the ng-animate scripts. In main.js you need to add the ng-animate module. main.js var app = angular.module("program", ['ngRoute','mobile-angular-ui.core','mobile-angular-ui.components', 'ngAnimate']);
has comment: http://stackoverflow.com/comment/45377857

http://stackoverflow.com/comment/45409872
comment on: http://stackoverflow.com/a/28548206
has text: hey just wondering would this work ok if the htm was in a partial view ?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45295089
has text: Eventually, I wanna write a single-page app (based on angular, if that makes any difference). The code would be transpiled into javascript and executed as so in the browser. So may I assume that any compile-time errors would be thrown on transpilation (called by https://www.npmjs.com/package/grunt-typescript)?
type: AnswerComment
comment on: http://stackoverflow.com/a/28486677
score: 0
type: Comment

http://stackoverflow.com/a/28488614
type: Answer
answers question: http://stackoverflow.com/q/28488546
has body: Function Definition Node.prototype.hasClass = function (className) { if (this.classList) { return this.classList.contains(className); } else { return (-1 &lt; this.className.indexOf(className)); } }; Node.prototype.addClass = function (className) { if (this.classList) { this.classList.add(className); } else if (!this.hasClass(className)) { var classes = this.className.split(" "); classes.push(className); this.className = classes.join(" "); } return this; }; Node.prototype.removeClass = function (className) { if (this.classList) { this.classList.remove(className); } else { var classes = this.className.split(" "); classes.splice(classes.indexOf(className), 1); this.className = classes.join(" "); } return this; }; Usage : myElement = document.getElementById("htmlbody"); Now you can call myElement.removeClass('myClass') or chain it: myElement.removeClass("oldClass").addClass("newClass"); This will remove a single class
has comment: http://stackoverflow.com/comment/45299105
has comment: http://stackoverflow.com/comment/45298892
score: 0
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/45287174
comment on: http://stackoverflow.com/q/28482489
has text: So I must use a variable for `window.location.pathname`?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45363894
has text: how can i also make the border wrap the white space? (the width of the border should automatically expand/condense depending on the text's width)
comment on: http://stackoverflow.com/a/28523743
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28575694
score: -1
has body: I would look into using a library like lightbox (http://lokeshdhakar.com/projects/lightbox2/) or jquery zoom (http://www.jacklmoore.com/zoom/)
upvote count: 0
answers question: http://stackoverflow.com/q/28575641
type: Answer
downvote count: 1

http://stackoverflow.com/q/28505859
possible better answer: http://stackoverflow.com/a/28505904
has comment: http://stackoverflow.com/comment/45330945
tagged with: javascript
has title: Determine whether callback is using all parameters
answer count: 3
has comment: http://stackoverflow.com/comment/45333226
upvote count: 1
has answer: http://stackoverflow.com/a/28505952
favorite count: 0
has comment: http://stackoverflow.com/comment/45331825
has comment: http://stackoverflow.com/comment/45330928
has answer: http://stackoverflow.com/a/28505904
accepted answer: http://stackoverflow.com/a/28506098
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/45333012
score: 1
has body: I'm wondering how I can determine whether a user of my plugin is using any or all of the parameters of my callback. For example I want the user to have optional error handling when using my callback. Here is the code: function myFunc(userInput, callback) { switch (userInput) case 'someInput': var = data; if (someError) {var err = someError;} callback(err, data); break; } Now if the user chooses they can look for an error in the callback like so: myFunc('someInput', function(err, data) { console.log(err); console.log(data); }); But if the user chooses to ignore any errors I still want the data to be sent like so: myFunc('someInput', function(data) { console.log(data); }); However, if there is an error and since I've declared any errors as the first parameter, the above example will log any error messages in the data and not the data itself. How can I know when the user doesn't include the err in their callback?
has comment: http://stackoverflow.com/comment/45331025
has answer: http://stackoverflow.com/a/28506098
type: Question

http://stackoverflow.com/a/28623812
accepted answer of: http://stackoverflow.com/q/28492990
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28492990
type: Answer
has comment: http://stackoverflow.com/comment/45559520
score: 2
upvote count: 2
has body: You have to use a plugin that makes the request from native side. This approach will allow you to bypass the web view limitations on making request outside your origin. You could start using this plugin: https://github.com/wymsee/cordova-HTTP.

http://stackoverflow.com/a/33683122
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/55139498
upvote count: 2
has body: I am not familiar with Skrollr but I have been looking into a similar situation with images flickering when they have been swapped. My understanding of the issue is that Firefox doesn't decode the images until they are viewed for the first time and the flicker you are seeing is the image trying to display before the decode is ready. Loading the image is separate to the decode so that is why preloading has no effect on this issue for Firefox. If you go to about:config in Firefox its possible to change the setting image.decode-immediately.enabled and this should fix the issue locally. Unfortunately I haven't found a better way to solve this issue. I found several bugzilla cases I believe are related to this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1149893 https://bugzilla.mozilla.org/show_bug.cgi?id=1158440
answers question: http://stackoverflow.com/q/28543320
type: Answer

http://stackoverflow.com/q/28504938
tagged with: swing
type: Question
tagged with: javascript
has body: I want d3 to work badly. I have this JFXPanel which displays a html page, which references d3.js. It is almost a duplicate of my other question but have not received much response - How to determine if i have implemented d3 correctly? Went to research on JavaFX, WampServer, D3.js (all due to recommendations) on top of much troubleshooting but still no avail. All I need is the HTML page to display some visual elements & im all set to proceed further. Can someone pls tell me why i cannot reference any d3 elements with the following, after every period? The website run on WampServer does not display as expected as well. jfxpanel in a swing project, eclipse, where jfxpanel runs html page. html page and d3.js are in the same folder. i can see the source of 'd3.js' when i 'inspect element' @ the html page. i will not see the source if i set the src to 'd3.v3.js' html elements (not within js) are working properly though. Code: D3 test
has title: how to implement elements to d3.js?
score: 0
has answer: http://stackoverflow.com/a/28505225
answer count: 1
tagged with: jquery
linked to: http://stackoverflow.com/q/28461938
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45329562
has comment: http://stackoverflow.com/comment/45329619
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28505225
tagged with: d3.js

http://stackoverflow.com/a/28437915
has comment: http://stackoverflow.com/comment/45208403
type: Answer
has comment: http://stackoverflow.com/comment/45208434
has comment: http://stackoverflow.com/comment/45205879
has comment: http://stackoverflow.com/comment/45205815
answers question: http://stackoverflow.com/q/28437488
downvote count: 2
upvote count: 7
has comment: http://stackoverflow.com/comment/45206557
score: 5
has body: var bills = [5, 10, 20, 50, 100]; var money = mod(89); function mod(num){ if (num % 5 === 0){ return num; }else{ return num + 5 - num % 5 } } function foo(num){ var index = bills.length - 1; var splits = []; while (money &gt;= bills[0]){ if (money &gt;= bills[index]){ money -= bills[index]; splits.push(bills[index]); }else{ index--; } } return splits; } console.log(foo(money)); edited jsfiddle

http://stackoverflow.com/a/28507164
answers question: http://stackoverflow.com/q/28506978
score: 0
type: Answer
has body: Parse each string. Build an associative array whose key is the first element in the string and the content an array, whose value is always appending the 3rd element in the string. To print, foreach over all items in the associative array, printing the $key to the imploded elements of the array.

http://stackoverflow.com/q/28559912
has title: Posting JavaScript Variable to MySQL using PHP
has answer: http://stackoverflow.com/a/28560381
has comment: http://stackoverflow.com/comment/45431561
tagged with: javascript
has answer: http://stackoverflow.com/a/28560031
tagged with: jquery
has comment: http://stackoverflow.com/comment/45431359
has comment: http://stackoverflow.com/comment/45431401
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to send a JavaScript variable to PHP but not exactly sure how to do it, a few things have said Ajax but I've never used it before and can't get my head around it. Does anyone know what the easiest way to do this would be? The column which I am attempting to populate in my DB is called 'cogs'. I have the following JavaScript code: &lt;script&gt; $(document).ready(function() { $('#duration-select').change(function() { var cogs = $('#cogsday').html(); cogs = cogs.replace(/\D/g,''); var x =$('#duration-select').val(); var y = cogs * x; $('#request').removeClass('hidden'); $('#duration-value').text('Total cost for this duration = ' + (y) + ' cogs'); if($(this).val() !== '') { } else { $('#duration-value').text(''); } }); $('#request').click(function() { var cogs = $('#cogsday').html(); cogs = cogs.replace(/\D/g,''); var x =$('#duration-select').val(); var y = cogs * x; $('#total').text(y); }); }); &lt;/script&gt; And the following HTML code: &lt;label id="total"&gt;&lt;/label&gt; Here is where I am trying to post the data, everything else is posting except for the $cost: &lt;form name="form" method="post"&gt; &lt;div class="modal-footer"&gt; &lt;?php if ($row3['availability'] === 'Available') { if (isset($_POST['request'])) { $to_id = $row3['customerid']; $from_id = $_SESSION['customerid']; $time_sent = date('Y-m-d H:i:s'); $subject = 'Request for ' . $row3['title']; $title = $row3['title']; $listingid = $listingid; $cost = $_POST['total']; //posting 0 $message = $customer_data['first_name'] . ' ' . $customer_data['last_name'] $request = mysql_query("INSERT INTO messages (to_id, from_id, listing_id, time_sent, subject, message, cogs, messagenumber, title, msgrand) VALUES ('$to_id', '$from_id', '$listingid', '$time_sent', '$subject', '$message', '$cost', '1', '$title', '$randomString')") or die(mysql_error()); } } ?&gt; &lt;input type="submit" class="btn btn-success" name="request" value="Yes" /&gt; &lt;input type="submit" class="btn btn-danger" data-dismiss="…
has answer: http://stackoverflow.com/a/28560109
favorite count: 0
upvote count: 2
accepted answer: http://stackoverflow.com/a/28560031
possible better answer: http://stackoverflow.com/a/28560109
tagged with: php
answer count: 4
type: AnsweredQuestion
score: 1
tagged with: mysql
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45431382
has answer: http://stackoverflow.com/a/28560313

http://stackoverflow.com/comment/45293831
type: AnswerComment
has text: i++ means: read the value of variable i, then increase variable i and then read the value of variable i
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28484344

http://stackoverflow.com/a/28450196
upvote count: 4
accepted answer of: http://stackoverflow.com/q/28449902
has comment: http://stackoverflow.com/comment/45406728
has comment: http://stackoverflow.com/comment/45236141
answers question: http://stackoverflow.com/q/28449902
score: 3
type: AcceptedAnswer
downvote count: 1
has comment: http://stackoverflow.com/comment/45391761
has comment: http://stackoverflow.com/comment/45267722
has body: One approach is to place that code in a separate file: assert-styles.js var chai = require('chai'); var chaiAsPromised = require('chai-as-promised'); chai.use(chaiAsPromised); var expect = chai.expect; var should = chai.should; module.exports = { expect: expect, should: should }; and then import it to your other test files: test1.js var assertStyles = require('./assert-styles'); var expect = assertStyles.expect; var should = assertStyles.should;
type: Answer
has comment: http://stackoverflow.com/comment/45247992

http://stackoverflow.com/a/28550167
type: Answer
has comment: http://stackoverflow.com/comment/45416006
accepted answer of: http://stackoverflow.com/q/28549907
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28549907
has comment: http://stackoverflow.com/comment/45415923
type: AcceptedAnswer
has body: text elements don't have a background style or attribute. To highlight words you have to create a rect element with the same size as the text (getBBox() for dimensions). Your code can be modified as follows. function draw(words) { var main_g = d3.select("#interests").append("svg") .attr("width", w) .attr("height", h) .append("g") .attr("transform", "translate(" + [w &gt;&gt; 1, h &gt;&gt; 1] + ")") main_g.selectAll("text") .data(words) .enter().append("text") .style("font-size", function(d) { return d.size + "px"; }) .style("font-family", "Impact") .style("fill", function(d, i) { return fill(i); }) .style("cursor", "pointer") .attr("text-anchor", "middle") .attr("transform", function(d) { return "translate(" + [d.x, d.y] + ")rotate(" + d.rotate + ")"; }) .text(function(d) { return d.text; }) .on("click", function(d) { var bbox = this.getBBox(); main_g.insert("rect",":first-child") .attr("x", bbox.x) .attr("y", bbox.y) .attr("width", bbox.width) .attr("height", bbox.height) .style("fill", "yellow"); if (d.inGraph == true){ d.inGraph = false; unloadInterest(d.text); } else { d.inGraph = true; loadInterest(d.text, "#ff0000"); } }); }
downvote count: 0

http://stackoverflow.com/comment/45446654
type: QuestionComment
has text: Try camel-casing the style attributes. Like `style.columnCount`. Edit: As El Guapo said earlier (sorry, didn't see his comment before adding mine)
comment on: http://stackoverflow.com/q/28568243
score: 0
type: Comment

http://stackoverflow.com/comment/45471742
type: AnswerComment
has text: That means callback wasn't passed.
type: Comment
comment on: http://stackoverflow.com/a/28572102
score: 1

http://stackoverflow.com/comment/45257404
score: 0
type: Comment
type: QuestionComment
has text: This looks quite silly, trying to create `getElementsByClassName` when jQuery is available…
comment on: http://stackoverflow.com/q/28465535

http://stackoverflow.com/comment/45512919
score: 0
type: AnswerComment
has text: Cheers for this, I think I need to have a look deeper into the use of $scope to fully understand what your doing first. I've gone for this .this object call, it looks something along the lines of what I was attempting though/
type: Comment
comment on: http://stackoverflow.com/a/28568524

http://stackoverflow.com/q/28565595
has comment: http://stackoverflow.com/comment/45441587
score: 0
has body: I'm using SimpleModal 1.4.4 (by Eric Martin) because it has an easy way of opening a modal from an iframe to the parent. I really like that, thanks to the developer! My question is: Now that I have it working the way I want to, I cannot close it with class="simplemodal-close". Here's the code: $(window.parent.document).find('#basic-modal-content').modal({ opacity: 30, closeHTML: "close", overlayClose: true, minWidth: picW, minHeight: picH, position: [30,xPosition], appendTo: $(window.parent.document).find('body'), }); Clicking on the overlay works perfectly but clicking on the 'close' link doesn't! What am I missing? I'm creating the modal div and an image placeholder dinamically each time an image on the iframe is clicked (basically, an image is clicked and the modal opens up with it). This is how: //Create Div and Image Placeholder var modalDiv = $(" ").appendTo($(window.parent.document).find('body')); modalDiv.attr("id", "basic-modal-content"); var imgPlace = $(" ").appendTo($(window.parent.document).find('#basic-modal-content')); imgPlace.attr("id", "image-place"); modalDiv.css("width", "100%"); imgPlace.css("width", "100%"); imgPlace.css("margin", "0 auto"); imgPlace.css("text-align", "center");
tagged with: javascript
type: UnansweredQuestion
tagged with: eric-martin-modal
has comment: http://stackoverflow.com/comment/45466422
has comment: http://stackoverflow.com/comment/45441824
tagged with: simplemodal
answer count: 0
has comment: http://stackoverflow.com/comment/45441850
has title: SimpleModal opened from iframe to parent body does not close with "simplemodal-close" class
type: Question

http://stackoverflow.com/a/28585571
score: 0
type: Answer
has body: I really tried to figure this out, and while it might be possible, it is an absolute nightmare. I ended up decided that it was easier to use internal routing and write it as it is suppose to, even if I love being a rebel, I really could not find a smooth way of getting the data from the backend all the way to html, javascript then over to Angular. I know this isn't a answer to my question, but I think it might be the best way.
answers question: http://stackoverflow.com/q/28579265

http://stackoverflow.com/q/28445131
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28445225
type: AnsweredQuestion
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28445227
has answer: http://stackoverflow.com/a/28445500
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: php
possible better answer: http://stackoverflow.com/a/28445227
has body: Is it possible to POST a form through jQuery and also handle the result? (without using json, ajax etc). Something like this: &lt;form id="loginform"&gt; //some input fields and a submit button. &lt;/form&gt; and then from jQuery: $("#loginform").submit(function (e) { $.post("somePHPscript") .done(function (response) { //Handle response }); }); .. or would that equal removing the form, and just binding an event to the submit-button, and take the inputs manually?
has answer: http://stackoverflow.com/a/28445225
answer count: 3
tagged with: forms
upvote count: 1
has title: POST form with jQuery and handle the result
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/28501482
has body: If you put the "like" text in a separate span it becomes a little easier... Here's an example: http://www.bootply.com/7YD8bspnRB HTML Like 1 JS $(document).on("click", ".like-btn", function(e) { e.preventDefault (); var btnCaption = $(this).find(".btn-caption") var badge = $(this).find(".like-badge") var count = parseInt(badge.text()); if ($(this).hasClass('active')) { btnCaption.text("Like"); badge.text(count - 1); $(this).removeClass('active'); } else { btnCaption.text("Liked"); badge.text(count + 1); $(this).addClass('active'); } });
upvote count: 1
answers question: http://stackoverflow.com/q/28501175
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/a/28556575
type: Answer
answers question: http://stackoverflow.com/q/28555901
has body: Too be short, there isn't. You could however, hook into the onload event of the script tag:
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45445708
accepted answer of: http://stackoverflow.com/q/28555901

http://stackoverflow.com/comment/117409104
type: AnswerComment
score: 0
has text: remove the $ sign from variables in the first method.
type: Comment
comment on: http://stackoverflow.com/a/28494112

http://stackoverflow.com/comment/77806788
type: Comment
has text: @JGreasley You can set it as an empty array: order: []
score: 7
type: AnswerComment
comment on: http://stackoverflow.com/a/44137826

http://stackoverflow.com/comment/45275681
has text: @Blauharley, thx. I can't inspect the Firebug error. It flashes, then the page refreshes. I'm looking into options, now...
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28474911
score: 0

http://stackoverflow.com/q/28463403
has answer: http://stackoverflow.com/a/28516708
has body: Asp.Net 4.5 Application has Textbox's with Minimum and Maximum values programmatically calculated on postback (server side), I call the js function from server code if it exceeds the limit. Works great in Chrome, FF. But in IE it freezes for approx. 2 minutes after user clicks [Ok] on the alert box. After about 2 minutes it allows the user to start making entries again. If I comment out the alert box then it works fine in IE. Any idea what would cause this only in IE? Server side call to JS If sender IsNot Nothing And TypeOf sender Is TextBox Then CType(sender, TextBox).Attributes.Add("onblur", "MinMaxBlurServer(this," &amp; min &amp; "," &amp; max &amp; ");") End If JavaScript Function function MinMaxBlurServer(obj, hfmin, hfmax) { var txt = obj; var val = txt.value; var m = document.getElementById("MainContent_minmaxpanel"); m.style.display = 'none'; if (isNumber(val) == "") { if (val != "") { //alert("Invalid enery. You must enter a numeric value!"); txt.value = ""; } } else { if (isNumber(hfmin)) { if (parseFloat(val) &lt; parseFloat(hfmin)) { //alert("Value cannot be less than " + hfmin + "."); txt.value = hfmin; } } if (isNumber(hfmax)) { if (parseFloat(val) &gt; parseFloat(hfmax)) { //alert("Value cannot be greater than " + hfmax + "."); txt.value = hfmax; } } } } function isNumber(n) { return !isNaN(parseFloat(n)) &amp;&amp; isFinite(n); }
type: AnsweredQuestion
has title: IE 11 freezes temporarily after Javascript Alert is accepted
has comment: http://stackoverflow.com/comment/45255417
type: Question
accepted answer: http://stackoverflow.com/a/28516708
tagged with: javascript
has comment: http://stackoverflow.com/comment/45253346
score: 0
answer count: 1
tagged with: asp.net

http://stackoverflow.com/q/28440321
has answer: http://stackoverflow.com/a/28441069
accepted answer: http://stackoverflow.com/a/28441069
type: Question
type: AnsweredQuestion
tagged with: phantomjs
has title: CasperJS is not working filling the google search field
has body: I'm using CasperJS (with the slimerjs engine) to fill a form. This is however not working. I tried it with a simple google.com script: var casper = require("casper").create({ verbose: true, logLevel: "debug" }); var fs = require("fs"); phantom.cookiesEnabled = true; casper.options.viewportSize = { width: 1024, height: 768 }; casper.start(); casper.userAgent("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"); casper.thenOpen("http://www.google.com", function(response) { casper.fill("form[id='gbqf']", { q: "test" }, true); }).run(); The form is not filled, nothing happens after the page is loaded.. The verbose log states: [info] [remote] attempting to fetch form element from selector: 'form[id='gbqf']' [info] [phantom] Done 2 steps in 1086ms (and then ends) What am I doing wrong? The form ID is 100% correct..
tagged with: javascript
has comment: http://stackoverflow.com/comment/45210184
upvote count: 1
tagged with: firefox
answer count: 1
tagged with: slimerjs
favorite count: 0
has comment: http://stackoverflow.com/comment/45210263
tagged with: casperjs
downvote count: 0
score: 1

http://stackoverflow.com/a/28587284
has comment: http://stackoverflow.com/comment/45481927
type: Answer
has comment: http://stackoverflow.com/comment/45481708
has comment: http://stackoverflow.com/comment/45481955
score: 0
answers question: http://stackoverflow.com/q/28587136
has body: You need to store the array in JSON format. See this fiddle: https://jsfiddle.net/3xfez/62/ The correct data value should be: [15, 17]. &lt;span id="demo" data-test="[15, 17]"&gt;&lt;/div&gt;

http://stackoverflow.com/a/28473495
answers question: http://stackoverflow.com/q/28473133
score: 0
type: Answer
has body: Use This:- var c=document.getElementById("mySelect"); c.value="banana 1"; alert(c.value);/* Only For Check*/

http://stackoverflow.com/comment/45302337
has text: That is exactly what I needed and I got this working great! Thanks a lot. I may be able to simplify it now as well, just wanted to make sure the concept would work before putting too much time into it.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28488383

http://stackoverflow.com/q/28476598
tagged with: server
type: UnansweredQuestion
has title: Server Login programme
has answer: http://stackoverflow.com/a/28476882
upvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45277543
type: Question
tagged with: http://stackoverflow.com/tag/html
score: -1
has comment: http://stackoverflow.com/comment/45277271
has answer: http://stackoverflow.com/a/28477027
has answer: http://stackoverflow.com/a/28476689
answer count: 3
tagged with: authentication
has body: so, I made my own little server. I tried to make it so, that you have to Login in order to access its files. I tried Javascript, but of course that is the worst thing to do (because you can see the passwords and usernames in the source code): &lt;form name="login"&gt; Användar: &lt;input type="text" name="user" value="gast"&gt; &lt;br&gt; Lösenord: &lt;input type="password" name="pw" value=""&gt; &lt;br&gt; &lt;input type="button" OnClick="log()" value="Login"&gt; &lt;/form&gt; and the log() method: function log() { if (document.login.user.value == "gast") if (document.login.pw.value == "0000") location.href="gast.html" } So, this is cleary not a good way to do it, if you actually want it to be somewhat secure... So does anybody have an idea how I could do this? With a databank perhaps? I'm pretty much a beginner with HTML and JS, so some help would be great :)
downvote count: 1

http://stackoverflow.com/q/28501793
type: Question
has comment: http://stackoverflow.com/comment/45324732
tagged with: grails
has comment: http://stackoverflow.com/comment/45331621
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/28501881
has body: I'm trying to do GET that retrieves data from a URL and then a POST to a RESTful api. The get call seems to work okay but the server sees nothing in the file parameter. I have verified that the GET call is return pdf stream data and that it is placing it in the FormData arg. Here is the complete call function upload(key, url){ var file; /* get data from url */ $.ajax({ url: url, type: 'GET', async: false, cache: false, dataType : 'text', contentType : 'application/pdf', success: function( data ) { file = data; }, error: function(xhr, status, error) { console.log("error logging: "+ error); } }); /* send data to api */ var data = new FormData(); data.append("key", key); data.append("file", file); //&lt;-- this has pdf stream data $.ajax({ url: ROOT_URL + "/api/account/upload", type: 'POST', cache: false, async: false, enctype: 'multipart/form-data', processData: false, contentType: false, data: data, success: function( data ) { console.log("Uploaded!"); }, error: function(xhr, status, error) { console.log("error logging: "+ error); }, dataType: "json" }); }; Here is the server side (grails + spring + jaxrs) @POST @Path('upload') @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces('application/json') String upload(@Context HttpServletRequest request){ GrailsWebRequest w = WebUtils.retrieveGrailsWebRequest() MultipartFile multipartFile = w.getRequest().getFile('file'); println("request:" + request) println("multipartFile:" + multipartFile) println("parameterMap:" + w.getRequest().getParameterMap() ) return ['okay':'uploaded'] as JSON } Which currently prints out: request:org.grails.jaxrs.web.RequestWrapper@448593df multipartFile:null parameterMap:[file:[], key:[c07fc0974ebb4f3a8fc21e3d002152d4]]
type: UnansweredQuestion
tagged with: web-services
tagged with: spring
has title: Using a GET to POST data to a restfull api

http://stackoverflow.com/q/28490087
tagged with: angularjs
has body: This issue is driving me crazy... I remove all $http calls, and all textboxs/textarea. I don't know what else to check. For some reason i think it has to do with nested pages in ui-Router. I only get this error(actually 14 times in a row) on nested pages. I also add the attribute about placeholder (ng-attr-placeholder) and i am still getting the error. Any suggestions would be great. Error: Invalid argument. at interpolateFnWatchAction (http://localhost:16266/Scripts/app/vendors/angularjs/angular.js:6834:15) at Scope.prototype.$digest (http://localhost:16266/Scripts/app/vendors/angularjs/angular.js:12251:23) at Scope.prototype.$apply (http://localhost:16266/Scripts/app/vendors/angularjs/angular.js:12516:13) at done (http://localhost:16266/Scripts/app/vendors/angularjs/angular.js:8204:34) at completeRequest (http://localhost:16266/Scripts/app/vendors/angularjs/angular.js:8412:7) at xhr.onreadystatechange (http://localhost:16266/Scripts/app/vendors/angularjs/angular.js:8351:11) State Config //-----------HOME-------------------------------- .state('home', { url: '/requests', templateUrl: mySettings.root + 'Scripts/App/js/views/home.html', controller: 'homeController', data: { pageTitle: 'Dashboard' } }) //---------Create New Order----------------------- .state('home.create', { url: '/create', templateUrl: mySettings.root + 'Scripts/App/js/views/create.html', resolve: { isReOrder: [ function() { return false; } ], requestData: [ function() { return null; } ], vendorsData: [ 'addressesService', function(addressesService) { return addressesService.query({ type: 'vendor' }).$promise; } ], unitOfMeasureData: [ 'loopUpOptionsService', function (loopUpOptionsService) { return loopUpOptionsService.query({ lookupid: 'UnitOfMeasure', active: true }).$promise; } ], addressesData: [ 'officeManagers', 'authService', function (officeManagers, authService) { return officeManagers.getAddressesByUsername({ id: authService.authentication.userName }).$promise; } ], locationsData: [ 'loca…
has comment: http://stackoverflow.com/comment/45301544
type: AnsweredQuestion
tagged with: angular-ui-router
score: 1
has comment: http://stackoverflow.com/comment/45302173
has comment: http://stackoverflow.com/comment/45302153
has comment: http://stackoverflow.com/comment/45302673
type: Question
has comment: http://stackoverflow.com/comment/45302791
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45301949
tagged with: javascript
upvote count: 1
has title: AngularJS IE11 Invalid Argument
has comment: http://stackoverflow.com/comment/45302538
has answer: http://stackoverflow.com/a/28504798
favorite count: 0
accepted answer: http://stackoverflow.com/a/28504798
has comment: http://stackoverflow.com/comment/45301893

http://stackoverflow.com/q/28437227
tagged with: popup
has answer: http://stackoverflow.com/a/28437355
upvote count: 3
type: Question
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28437369
answer count: 2
has title: JavaScript: Add event listener on parent popup window
favorite count: 0
type: UnansweredQuestion
has body: i'm currently trying to add an event listener on a popup window that is opened in a parent page. Let me give you a little bit more explanation: There is a button in an iframe. When this button is clicked an popup window is opened in the parent page that is calling/holding the iframe. Here is my code: parent.window.open(url, "MyParentWindowPopUp", "width=1000, height=800"); With this line of code i open the popup window in the parent page. When the windows is opened i have to create a listener on it so here is what i use when i add a listener for NON-parent window: if (window.addEventListener) { window.addEventListener('message', &lt;?php echo $_htmlId; ?&gt;_receive_message, false); } else if (window.attachEvent) { window.attachEvent('onmessage', &lt;?php echo $_htmlId; ?&gt;_receive_message); } How can i transform this code to work for the parent popup window? Thanks in advance!
score: 3

http://stackoverflow.com/comment/46280964
has text: Can you show the JavaScript part?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28472935
score: 0

http://stackoverflow.com/q/28527128
answer count: 1
tagged with: javascript
tagged with: extjs4
tagged with: rpc
has answer: http://stackoverflow.com/a/28943636
tagged with: ext-direct
favorite count: 0
has body: I use ExtDirect to communicate server. I need to send form data in json to remote functions. It seems that it ignore jsonSubmit config and send data as form post. How should I config my API on the server and client that all file-free request be send in json format.
tagged with: form-submit
type: UnansweredQuestion
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46140284
score: -1
has title: How to send form data in JSON format
linked to: http://stackoverflow.com/q/25535784
upvote count: 0

http://stackoverflow.com/q/28505453
has comment: http://stackoverflow.com/comment/45389894
type: Question
has comment: http://stackoverflow.com/comment/45335539
has comment: http://stackoverflow.com/comment/45387029
has answer: http://stackoverflow.com/a/28538934
answer count: 1
has title: plot lightning data in Google maps
tagged with: javascript
has comment: http://stackoverflow.com/comment/45373832
has comment: http://stackoverflow.com/comment/45390651
tagged with: ajax
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/45334836
favorite count: 0
has comment: http://stackoverflow.com/comment/45332192
accepted answer: http://stackoverflow.com/a/28538934
downvote count: 2
upvote count: 1
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45347830
has body: I've got a weather website, which misses lightning data. I found a data source from Blitzortung.org wich contains the Lat, Lon and time info of a lightning strike. How do I get this on Google Maps? I want the data to be realtime, just like on blitzortung.org. It should be displayed on the map, preferably as a red or yellow dot, changing color as it ages (probably a JavaScript or PHP function that can edit css to do this) and of course on the right place. I unfortunately had no experience with JSON and SQL, but don't call me lazy because I don't have the time to really learn this. I've got the map and the radar overlay which updates every 5 minutes: http://met.nl.eu.org/radar.html this is the data source: http://www.lightningmaps.org/live/ I can use this source, provided that I will not use it for profit and that I add link to Blitzortung.org So my main question is, how do I get Google maps to interpret the coords in the JSON file as places on the map, and draw a marker on the place, which changes color as it ages? server: Ubuntu with Apache, SQL databases, PHP5 and python for image processing Edit: this script might help a bit more: // // // var maps = { 0: { "west": -180.0, "east": 180.0, "north": 90.0, "south": -60.0, "projection": 1, "width": 925, "height": 925, "strike_type": 0, "detector_type": 0, region: 0 }, 10: { "west": -20.0, "east": 44.0, "north": 71.5, "south": 23.1, "projection": 1, "width": 925, "height": 925, "strike_type": 0, "detector_type": 2, region: 1 }, 11: { "west": 0.0, "east": 35.0, "north": 71.5, "south": 48.5, "projection": 1, "width": 925, "height": 925, "strike_type": 1, "detector_type": 1, region: 1 }, 12: { "west": -15.0, "east": 7.0, "north": 60.0, "south": 47.0, "projection": 0, "width": 925, "height": 925, "strike_type": 1, "detector_type": 1, region: 1 }, 13: { "west": -12.0, "east": 20.0, "north": 56.0, "south": 33.6, "projection": 0, "width": 925, "height": 925, "strike_type": 1, "detector_type": 1, region: 1 }, 14: { "west": 12.0…
has comment: http://stackoverflow.com/comment/45389794
score: -1

url
tags question: http://stackoverflow.com/q/28497157
tags question: http://stackoverflow.com/q/28555332
tags question: http://stackoverflow.com/q/28584111
tag name: url
tags question: http://stackoverflow.com/q/28580173
tags question: http://stackoverflow.com/q/28547713
tags question: http://stackoverflow.com/q/28480591
tags question: http://stackoverflow.com/q/28465606
tags question: http://stackoverflow.com/q/28553960
tags question: http://stackoverflow.com/q/28554352
tags question: http://stackoverflow.com/q/28556114
tags question: http://stackoverflow.com/q/28461691
tags question: http://stackoverflow.com/q/28567253
tags question: http://stackoverflow.com/q/28580235
tags question: http://stackoverflow.com/q/28483618
tags question: http://stackoverflow.com/q/28536984
tags question: http://stackoverflow.com/q/28440071
tags question: http://stackoverflow.com/q/28581419
tags question: http://stackoverflow.com/q/28461285
tags question: http://stackoverflow.com/q/28545236
tags question: http://stackoverflow.com/q/28549569
tags question: http://stackoverflow.com/q/28485522
tags question: http://stackoverflow.com/q/28579646
tags question: http://stackoverflow.com/q/28490863
tags question: http://stackoverflow.com/q/28438330
tags question: http://stackoverflow.com/q/28516333
type: Tag
tags question: http://stackoverflow.com/q/28569145

http://stackoverflow.com/comment/45236573
type: QuestionComment
score: 0
has text: what is your servertypeid? Can't you put it in your model too?
type: Comment
comment on: http://stackoverflow.com/q/28452504

http://stackoverflow.com/comment/111392441
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28523426
has text: this does not work for a "complex" scaleLabel containing multiple values, you need { something1: something1, something2: something2, callback: function(label) etc. etc.}
score: 0

http://stackoverflow.com/a/28553617
has body: This #panel1 row img is a wrong selector, change it to #panel1 .row img - note class name selector .row Change your click handler to do this $(this).toggleClass("circle"); .circle class shall look like: .circle { border-radius: 50%; border: 2px solid red; overflow: visible; }
accepted answer of: http://stackoverflow.com/q/28553543
answers question: http://stackoverflow.com/q/28553543
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/a/28463997
accepted answer of: http://stackoverflow.com/q/28463629
answers question: http://stackoverflow.com/q/28463629
upvote count: 1
type: AcceptedAnswer
downvote count: 0
score: 1
has body: Firstly you should configure your store with a field, see the example in the docs here http://docs.sencha.com/extjs/4.0.7/#!/api/Ext.data.ArrayStore Next your response needs to be an array of arrays each containing one of those strings, so [["abc"],["def"],...] A quick example of how to make one of these var string = "a,b,c"; var res = string.split(","); var x = []; for (var i = 0; i &lt; res.length; i++) { x[i] = [res[i]]; } alert(x[0][0]); You should be able to see how you can use this with your string split result. At the minute you are just returning a flat array of string values and the store reader doesn't know enough in order to parse it. That should be the minimum you need to start loading your store I think.
type: Answer

http://stackoverflow.com/comment/45435025
type: AnswerComment
score: 0
has text: I tried this and it returned "NaN". Modal is an element passed into the funtion so ti is always pointing at the correct element.
type: Comment
comment on: http://stackoverflow.com/a/28562147

http://stackoverflow.com/comment/45439354
type: AnswerComment
type: Comment
has text: @mason I never knew that, I've got a ton of `IHttpHandler` classes kicking about in an upgraded v4.0 app, maybe I'll convert them....
comment on: http://stackoverflow.com/a/28563935
score: 0

http://stackoverflow.com/a/28439587
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28439396
score: 4
has body: Maybe your script tags are out of order? Which includes the call for dropdown() is probably being executed before: Which defines the dropdown() method. Does the code in the require app get wrapped in a $(function() {})?
has comment: http://stackoverflow.com/comment/45209088
upvote count: 4

http://stackoverflow.com/a/33093578
score: 1
upvote count: 2
has body: The events are fired on the completion data object, which can be attached to like this. extraKeys: { "Ctrl-Space": function(cm) { hintFunction(cm); var completion = cm.state.completionActive.data; CodeMirror.on(completion, 'select', function(completion, element) { console.log('huh'); }) } }
downvote count: 1
answers question: http://stackoverflow.com/q/28567525
type: Answer

http://stackoverflow.com/comment/45454971
type: Comment
comment on: http://stackoverflow.com/a/28572441
has text: True, so probably best that they leave it so. I'll have to see what I can do on the parent page itself. Thanks!
score: 0
type: AnswerComment

http://stackoverflow.com/a/37698152
downvote count: 0
has comment: http://stackoverflow.com/comment/67865734
upvote count: 8
type: Answer
score: 8
has comment: http://stackoverflow.com/comment/67871070
answers question: http://stackoverflow.com/q/28551582
has body: I got this error because I had a circular import structure. One module importing another and the other way around.

http://stackoverflow.com/q/28511559
accepted answer: http://stackoverflow.com/a/28576645
favorite count: 0
type: AnsweredQuestion
upvote count: 2
score: 1
tagged with: knockout.js
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45460039
has answer: http://stackoverflow.com/a/28576645
has body: I want to apply animations when certain properties change with my knockout models (specifically a movement). I need these animations to be synchronous, if there is more than one going on things will get very confusing for the user. I would like to use a knockout custom binding to do this, as it should make my code easier to understand, but if I do that I can't provide a callback function to the jquery animation. I know that I can't have true synchronous behavior due to javascript limitations, but I can't figure out how to fake it. The behavior I want: http://jsfiddle.net/3fLvpxLc/2/ $("#e1").animate({left: 50}, "slow", function() { // more animations } The version with synchronization problems: http://jsfiddle.net/hrwsd1z3/1/ ko.bindingHandlers.position = { update: function(element, valueAccessor, allBindings, viewModel, bindingContext) { var value = valueAccessor(); var valueUnwrapped = ko.unwrap(value); $(element).animate({left: valueUnwrapped}, "slow"); } }
tagged with: javascript
tagged with: jquery-animate
has title: Sychronous animations in knockout binding
has comment: http://stackoverflow.com/comment/45369045
answer count: 1

http://stackoverflow.com/q/28463170
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28463251
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28463263
has answer: http://stackoverflow.com/a/28463515
type: Question
possible better answer: http://stackoverflow.com/a/28463251
has answer: http://stackoverflow.com/a/28463263
has body: I have a piece of code which picks up any hashchange in the URL. It works and notices whenever somebody types a hash in. However, I want to change the class name of a container. When I try that it changes all of the class names and I can see why. Is there anyway to specify an index for example $(".agenda-tabs li").this('class', 'active'); Here is the code: jQuery Example City 1 Speakers 2 Stage 3
has title: Change DOM element class name based on URL change

http://stackoverflow.com/comment/45307990
score: 0
comment on: http://stackoverflow.com/a/28456398
type: Comment
type: AnswerComment
has text: can you please tell me how to use this mentioned regex in javascript ?

http://stackoverflow.com/comment/45501541
type: QuestionComment
score: 0
has text: Duh, hope you all heard the big "slap in the face" sound :-) No wonder I had a bit of voodoo around that format string. Thanks!
comment on: http://stackoverflow.com/q/28588015
type: Comment

http://stackoverflow.com/q/28481830
has title: How to select ID of several children in an element?
score: 0
has answer: http://stackoverflow.com/a/28481892
accepted answer: http://stackoverflow.com/a/28481892
type: AnsweredQuestion
has body: I have an ul element where I drag and drop li's elements from another list. I want to get the id of the li I dropped and print these id's in a div after pressing a button. I tried this : $(".validate-btn").click(function(){ var Id = $("ul#sortable3").children().attr('id'); $('.text-id').text(Id); }); With this code I can just print the Id of the first li I have dropped. I need help to get the Id's of several li's. Thanks
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28506593
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/45335201
type: AcceptedAnswer
has body: You are in the right way. You can pass parameter to Angular $http like in the function below: $http({ url: "http://boost.meximas.com/mobile/login.php", method: "POST", data: { username: "", password: "" }, headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(data, status, headers, config) { // this callback will be called asynchronously // when the response is available }). error(function(data, status, headers, config) { // called asynchronously if an error occurs // or server returns response with an error status. });
has comment: http://stackoverflow.com/comment/45333857
has comment: http://stackoverflow.com/comment/45332540
answers question: http://stackoverflow.com/q/28506505
has comment: http://stackoverflow.com/comment/45332348
type: Answer
has comment: http://stackoverflow.com/comment/45332662
accepted answer of: http://stackoverflow.com/q/28506505
score: 2

http://stackoverflow.com/comment/45357357
has text: The search should stop when matching the first parent element of class "test" in this case which is within divs
comment on: http://stackoverflow.com/q/28519969
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45378106
has text: dont need the wrapper; just use `document.getElementsByTagName('img').onclick = changeImage;`
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28531487
type: Comment

http://stackoverflow.com/a/28444521
type: Answer
answers question: http://stackoverflow.com/q/28444486
has body: visibility and display are just text strings, so setting them to a variable, and then changing the variable, won't change the element. function toggle(kaka) { var temp=document.getElementById(kaka).visibility; temp=(temp=='visible')?'hidden':'visible'; document.getElementById(kaka).visibility=temp; }
score: 0

http://stackoverflow.com/comment/45393704
type: AnswerComment
has text: @Md.ArafatAlMahmud: It's just a standard HTTP request, just like loading an image or a CSS file...
comment on: http://stackoverflow.com/a/28539447
type: Comment
score: 1

http://stackoverflow.com/q/28592617
has body: I want to filter the following objects by category_id using the following array of category_id values: [19012000, 19012001, 19012002, 19012003, 19012004, 19012005, 19012006, 19012007, 19012008] Object {_account: "mjj9jp92z2fD1mLlpQYZI1gAd4q4LwTKmBNLz", _id: "rEEwENwnznCQvkm61wRziKlMRPqaYztnR4vn61", amount: 15, category: Array[2], category_id: "13005015"…} Object {_account: "AaaraZrLqLfzRYoAPlb6ujPELWVW4dTK4eJWj", _id: "944r40rPgPU2nXqzMYolS5nyo6Eo9OuqrlDkB", amount: 50, category: Array[3], category_id: "19012000"…} Object {_account: "AaaraZrLqLfzRYoAPlb6ujPELWVW4dTK4eJWj", _id: "rEEwENwnznCQvkm61wZ9uey62Pjy5YTqgYGDK", amount: 24, category: Array[2], category_id: "13005007"…} Object {_account: "mjj9jp92z2fD1mLlpQYZI1gAd4q4LwTKmBNLz", _id: "rEEwENwnznCQvkm61wRziKlMRPqaYztnR4vn61", amount: 45, category: Array[2], category_id: "13005009"…} Object {_account: "AaaraZrLqLfzRYoAPlb6ujPELWVW4dTK4eJWj", _id: "944r40rPgPU2nXqzMYolS5nyo6Eo9OuqrlDkB", amount: 105, category: Array[3], category_id: "13005009"…} When finished the object with category_id 19012000 should be the only one left. Object {_account: "AaaraZrLqLfzRYoAPlb6ujPELWVW4dTK4eJWj", _id: "944r40rPgPU2nXqzMYolS5nyo6Eo9OuqrlDkB", amount: 50, category: Array[3], category_id: "19012000"…} I've made a number of attempts with different versions of iteratee functions with filter, map and each and tried key value filters with keys, values, invert, pick and omit. After trying this, which I believe should work I reach out to you: var postDate = _.filter(_.first(goodDates), function(n){return category_id.indexOf(n.category_id) !== -1}) where goodDates is the list of objects and category_id is the array above.
accepted answer: http://stackoverflow.com/a/28593101
type: AnsweredQuestion
downvote count: 0
tagged with: underscore.js
score: 1
has title: Filter a number of javascript objects using an array of values for one key
possible better answer: http://stackoverflow.com/a/28593012
type: Question
tagged with: object
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/28593012
answer count: 2
tagged with: functional-programming
upvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28593101

http://stackoverflow.com/q/28489798
score: 0
answer count: 1
tagged with: meteor
linked to: http://stackoverflow.com/q/21096522
type: UnansweredQuestion
has body: I appreciate the meteor package for alpaca created here ahdinosaur/meteor-alpaca-bootstrap. It seems to differ subtly from a more standard installation of alpaca. Some of the examples from the Alpaca docs aren't working for me with this package. For instance, this simple example as part of a schema definition from the Alpaca docs results in a console error: // alpaca options "options": { "buttons": { "submit": { "click": function() { if (this.isValid(true)) { var value = this.getValue(); } } } } } This results in The compiled template: view-formButtonsContainer for view: VIEW_BOOTSTRAP_EDIT_LIST failed to execute: {"message":"renderedForm is not defined"} The compiled template: view-form for view: VIEW_BOOTSTRAP_EDIT_LIST failed to execute: {"message":"Alpaca caught an error with the default error handler: The compiled template: view-formButtonsContainer for view: VIEW_BOOTSTRAP_EDIT_LIST failed to execute: {\"message\":\"renderedForm is not defined\"}"} Or this variation also from the Alpaca doc also errors ({\"message\":\"renderedForm is not defined\"}"}): if (renderedForm.isValid(true)) { value = renderedForm.getValue(); alert(JSON.stringify(value, null, " ")); } I'm pretty sure if I weren't a JS neophyte, this would be trivial to fix, but for me it is a stumper. I'd love to see some examples in the README of some variations of working code using this meteor package so I can adapt it.
tagged with: twitter-bootstrap
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28490201
has title: Alpaca + Meteor: How to address form from within button handlers?

http://stackoverflow.com/q/28518486
has comment: http://stackoverflow.com/comment/45354138
has comment: http://stackoverflow.com/comment/45353990
tagged with: arrays
tagged with: javascript
has title: Javascript - Advanced JSON keypaths
answer count: 1
tagged with: nested
has comment: http://stackoverflow.com/comment/45354445
type: UnansweredQuestion
tagged with: dictionary
score: 0
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45354168
has body: I'm looking for a library which can parse my json deeply using a keypath, i.e. find values inside an array of dictionaries. Considering the following JSON Object: { "root" : { "infos" : { "sport" : [ {"name" : "tennis"}, {"name" : "basket"} ] } } }; I would be able to do something like var sport = json.valueForKeyPath('root.infos.sport.name') which should return["tennis", basket"]. I tried underscore-keypath.min.js but it can't do it. Does someone know a library which can do that ?
has answer: http://stackoverflow.com/a/28518523
type: Question

http://stackoverflow.com/a/28557993
upvote count: 2
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28557522
has body: If you know the last page number, you could use page PDF open parameter in your pdf file path like this: "data/test.pdf#page=50" When the pdf load, it will show page 50.

http://stackoverflow.com/a/28446252
accepted answer of: http://stackoverflow.com/q/28444546
score: 0
answers question: http://stackoverflow.com/q/28444546
type: Answer
has body: Accessing the DOM, to get data that needs to be sorted, is a bad practice IMO. Even worse when you had the results in raw JSON form in the first place (in the success callback of the ajax call). Your success function should do something like this success: function (json) { //first sort the results - or better store these results somewhere //and use that as a data store that is responsible for what is rendered in the DOM json.results.sort(function(a,b) { //using substring and parseFloat just like it was done in sortTable //assuming price field has prices as strings with currency symbol in the first place return parseFloat(a.substring(1)) - parseFloat(b.substring(1)) }); for (var i = 0; i < json.results.length; i++) { var section = json.results[i].section; var no = json.results[i].avalible; var price = json.results[i].amount; var button = " Click Here "; $("#tableid tbody").append(" " + section + " " + no + " " + price + " " + button + " "); $("#tableid").find(".redirect-button").click(function () { location.href = $(this).attr("data-url"); }); } }
type: AcceptedAnswer

http://stackoverflow.com/comment/45323953
comment on: http://stackoverflow.com/a/28502143
score: 0
type: Comment
has text: Check: https://jsfiddle.net/lharby/5p2xdnaf/6/ but also see the answer below regarding css.
type: AnswerComment

wijmo
type: Tag
tags question: http://stackoverflow.com/q/28557186
tag name: wijmo

http://stackoverflow.com/comment/45353351
score: 0
has text: Java : Javascript = Ham : Hamster
type: AnswerComment
comment on: http://stackoverflow.com/a/28517981
type: Comment

post
tags question: http://stackoverflow.com/q/28574024
tags question: http://stackoverflow.com/q/28507315
tags question: http://stackoverflow.com/q/28549951
tag name: post
tags question: http://stackoverflow.com/q/28588379
tags question: http://stackoverflow.com/q/28554796
tags question: http://stackoverflow.com/q/28535620
type: Tag
tags question: http://stackoverflow.com/q/28557245
tags question: http://stackoverflow.com/q/28516951
tags question: http://stackoverflow.com/q/28491233

http://stackoverflow.com/q/28464976
type: Question
has title: Simple javascript calculation
has body: Its been many years that I've had to do anything with javascript. Feel like I need to take a course just to relearn the basics. Trying to create a simple calculation with two input fields. Found the following solution on another post but it is not working for me. Box 1 Box 2 Result x = Eventually I will have default values for the two input field and allow the user to change the values and see how the result changes. PLanning to use on a SharePoint 2010 intranet site. I feel like whatever I am getting wrong is a very simple thing that I am overlooking. Thanks
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28465293
answer count: 1
tagged with: sharepoint-2010
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28465293
has comment: http://stackoverflow.com/comment/45255946
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45255656

http://stackoverflow.com/comment/45222299
type: AnswerComment
comment on: http://stackoverflow.com/a/28446546
score: 0
type: Comment
has text: That second way will work, but it's certainly the "hard way". Easier to just use a template function.

http://stackoverflow.com/q/28585538
answer count: 1
tagged with: asp.net
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45478805
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28585884
downvote count: 0
score: 1
tagged with: signalr
has comment: http://stackoverflow.com/comment/45478518
type: Question
tagged with: c#
tagged with: javascript
has title: Sending Complex Object From Angular to SignalR
has body: I am having trouble sending a complex object to my SignalR hub. My JavaScript object matches exactly to my C# object, so I would expect everything to work. However, I am unable to hit my UpdateEmployee method. I have other methods in my hub that work just fine with simple types. Here is what I currently have implemented - SignalR Hub public void UpdateEmployee(int userId, Employee employee) { // Update employee } Where Employee is defined as public class Employee: Persistable { [DataMember] public DateTime? DateOfBirth { get; set; } [DataMember] public string FirstName { get; set; } [DataMember] public string LastName { get; set; } } Which just simply inherits Persistable [DataContract] public class Persistable { [DataMember(Name = "id")] [JsonProperty(PropertyName = "id")] public int Id { get; set; } } I am trying to hit that method from my SignalR JavaScript client $.connection.myHub.server.updateEmployee(userId, employee); Where my employee object in JavaScript looks like { Id: 1, FirstName: "Test", LastName: "One", DateOfBirth: "01012001" } Is there anything I am doing wrong here?
upvote count: 1

http://stackoverflow.com/comment/45209528
has text: please make a small [Fiddle](http://jsfiddle.net) demo where we can see the issue
comment on: http://stackoverflow.com/q/28439929
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/comment/45373337
type: Comment
comment on: http://stackoverflow.com/a/28516166
has text: Thanks Ian, I'll check it out soon to see if this helps
type: AnswerComment
score: 0

http://stackoverflow.com/q/28478425
tagged with: fancybox-2
type: Question
has title: Fancybox works if I add a class manually but not with jQuery .addClass()
tagged with: addclass
has comment: http://stackoverflow.com/comment/45279427
tagged with: javascript
tagged with: jquery
score: -1
answer count: 2
has answer: http://stackoverflow.com/a/28478475
upvote count: 0
tagged with: fancybox
has comment: http://stackoverflow.com/comment/45280133
favorite count: 0
has body: I have the following JS code, which I add Fancybox classes to all hrefs on a page: $(function(){ //set target var var $targetTable = $('.photo-frame a'); //loop trough each table and insert the fancybox class on the href tag $targetTable.each(function() { $targetTable.addClass('fancybox'); }); }); This works because the fancybox class is added, but the fancybox is not triggered. But if I add this class manually in the browser-editor and click on the image fancybox is triggered. I have also tried the following, but without result: $('.photo-frame a').addClass('fancybox'); Does anyone have any idea where this may be due to?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45280244
has answer: http://stackoverflow.com/a/28490039
downvote count: 1
has comment: http://stackoverflow.com/comment/45280218

http://stackoverflow.com/q/28507049
downvote count: 0
has comment: http://stackoverflow.com/comment/45333688
score: 1
has title: Appending css to current menu
type: Question
answer count: 2
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45333280
has body: I am trying to add css marker to my menus to identify current page and current parent menu as follows: http://myweb.com/#about - This is a parent menu with children like http://myweb.com/about/history - This is a page with content http://myweb.com/about/vision - This is a page with content This is the markup About History Vision contact ..... I have the below javascript This marks the parent menu and all the children menus instead of the desired. that is; marking only the parent menu and the particular page. For example at http://myweb.com/about/history page I want only that and http://myweb.com/#about parent menu to be marked. Any help will be appreciated
has comment: http://stackoverflow.com/comment/45333874
tagged with: css
has answer: http://stackoverflow.com/a/28507532
accepted answer: http://stackoverflow.com/a/28507532
possible better answer: http://stackoverflow.com/a/28520264
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28520264

http://stackoverflow.com/q/28500217
has title: Update KendoUI Grid datasource with new items
accepted answer: http://stackoverflow.com/a/28514447
type: AnsweredQuestion
has body: I have: $.post('buying-grid/split/' + config.route.params.id, item).success(function(data){ var ds = new kendo.data.DataSource(); ds.data(data) $('#buyingGrid').data('kendoGrid').setDataSource(ds) $('#buyingGrid').data('kendoGrid').dataSource.sync(); }) But I am getting the error Uncaught TypeError: undefined is not a function The data variable is in the correct format of {"data":[{"id":99296,... Why is this not working?
has comment: http://stackoverflow.com/comment/45346597
type: Question
tagged with: kendo-datasource
tagged with: kendo-grid
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45346162
has answer: http://stackoverflow.com/a/28514447
tagged with: kendo-ui
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45330701

http://stackoverflow.com/a/28494449
downvote count: 0
has body: Another aproach (which not uses jQuery) is to use css class: .disable-anchor{ pointer-events: none; cursor: default; } and then just add this class to your anchor like: Level of Course P.S. check the availability of pointer-events before using it because this is the CSS3 feature.
answers question: http://stackoverflow.com/q/28493992
type: Answer
accepted answer of: http://stackoverflow.com/q/28493992
score: 4
upvote count: 4
type: AcceptedAnswer

http://stackoverflow.com/comment/45497875
type: Comment
comment on: http://stackoverflow.com/a/28572670
has text: `$richTextClient` not `$richTextClient->client` - the Rich Text object doesn't have a property of `client` - nor `$richTextClient['client']` - the Rich Text object isn't an array. The wizard takes a string value (not an array or object) and returns a Rich Text object that can then be set as a cell value.... in my example, `$richText = $wizard->toRichTextObject($html1);` takes a string argument (`$html1`) and converts it to a Rich Text object (`$richText`), then `$objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', $richText);` sets that __Rich Text object__ as the value to store in cell A1
type: AnswerComment
score: 0

http://stackoverflow.com/a/28538175
upvote count: 2
has comment: http://stackoverflow.com/comment/45390743
type: Answer
answers question: http://stackoverflow.com/q/28538065
has body: I use a div instead of the html itself,try this solution 1 $("#button").click(function () { // Animate the webpage's background, causing it to move $("#div1").animate({ left: "-=10000px", top: "-=5000px" }, 1250); });
has comment: http://stackoverflow.com/comment/45390643
score: 2
downvote count: 0

http://stackoverflow.com/comment/45400119
type: Comment
has text: @angezanetti No, I don't mean that. I don't know what you can try. It is a [guessing game](http://blog.stackoverflow.com/2012/02/lets-play-the-guessing-game/) at this point.
comment on: http://stackoverflow.com/a/28501974
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45410189
type: Comment
comment on: http://stackoverflow.com/a/28548178
score: 0
type: AnswerComment
has text: I don't/didn't know how to explain it in the OP, but I don't want to rely on grabbing info from enviornment dependant variables.

http://stackoverflow.com/a/28491733
has comment: http://stackoverflow.com/comment/45304288
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45304909
has comment: http://stackoverflow.com/comment/45304280
has comment: http://stackoverflow.com/comment/45304387
answers question: http://stackoverflow.com/q/28491592
has body: If you want to alert the name, make sure you use the name in the jQuery alert(person__name || 'none'); // Not: alert(person__email || 'none'); http://jsfiddle.net/376fLujs/3/ Also, make sure your script is included properly. Include the jQuery before your script: &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="local.js" type="text/javascript"&gt;&lt;/script&gt; add: console.log("working"); as the very first line of your script open the chrome console / Firebug and refresh your page. if you don't see "working" in the console, your javascript is not included properly. Edit: based on your comments again. If you have multiple forms, re-using the same ID, it will not work. Always keep IDs unique. Since your link is inside of the form like your input, you could do this: var person__email = $(this).parent().find("input[name='person.email']").val(); // DRX points out that escaping may be necessary: var person__name = $(this).parent().find("input[name='person\\.name']").val(); http://jsfiddle.net/376fLujs/4/
has comment: http://stackoverflow.com/comment/45304635
accepted answer of: http://stackoverflow.com/q/28491592
has comment: http://stackoverflow.com/comment/45304977
has comment: http://stackoverflow.com/comment/45304374
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45304687
has comment: http://stackoverflow.com/comment/45304599
has comment: http://stackoverflow.com/comment/45304590

http://stackoverflow.com/comment/45434863
comment on: http://stackoverflow.com/q/28562029
type: QuestionComment
has text: `$("#blackjack")` is a checkbox. Your CSS states : `input[type=checkbox]{ display: none}`, so checkboxes are hidden. Your javascript can never be triggered.
type: Comment
score: 1

http://stackoverflow.com/comment/45301182
comment on: http://stackoverflow.com/q/28489808
type: Comment
score: 0
has text: Thanks Ryan for your reply. I had actually tried that initially, as you suggested I really had only about 10 lines of code. I put the other stuff (if window.event...etc ) just to ensure that there wasn't anything funky going on. Turns out that it doesn't make any difference. As I said - if I put an alert box anywhere in the function, the ctrl key is successfully blocked. Without the alert - does NOT block
type: QuestionComment

http://stackoverflow.com/comment/45449177
comment on: http://stackoverflow.com/q/28569485
score: 0
type: Comment
type: QuestionComment
has text: When on what element or so does the `doClick()` function get triggered? Does `$` refer ro `jquery`?

http://stackoverflow.com/a/28525592
has body: You forgot jQuery selectors in the function. Try: function fixMenu() { $('.menu').css('position','absolute'); }
has comment: http://stackoverflow.com/comment/45367093
score: 0
has comment: http://stackoverflow.com/comment/45367151
type: Answer
answers question: http://stackoverflow.com/q/28525527

http://stackoverflow.com/comment/45511085
type: AnswerComment
comment on: http://stackoverflow.com/a/28601937
has text: I have executed it and its displaying only the "FormattedID". As per the requirement I don't want to display the ID. I want to count "number of stories" under particular release.(for example) if the release has 8 user stories, it should display 8 only.
type: Comment
score: 0

http://stackoverflow.com/comment/45229374
has text: we would like to know what are those things you have tried! :)
comment on: http://stackoverflow.com/q/28450557
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45249047
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28461119
has text: Kudos! Way better than my answer.

http://stackoverflow.com/comment/45299135
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28488675
type: Comment
has text: Yes, is more wide use hyphens. It makes the html more redeable. I see camel cased classes on legacy code. This is because i mentioned

http://stackoverflow.com/comment/45407077
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28546030
has text: I had GET before but changed it! Will do!
score: 0

http://stackoverflow.com/q/28564545
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45441150
has comment: http://stackoverflow.com/comment/45440255
has comment: http://stackoverflow.com/comment/45440896
has answer: http://stackoverflow.com/a/28569340
has body: Working onjquery stuff, i working on the following code and it works great, i want to add a fancybox to it, i mean rather than opening in same page, i want the contents to be loaded in the fancybox: Here is my code: $(document).on('click','#table td a', function(e) { var hcall = e.currentTarget.toString(); var cURL = hcall; ax(); $.ajax({ url: 'mypage.php?u='+encodeURIComponent(cURL), crossDomain : true, cache: false, beforeSend: function(xhr) {xhr.setRequestHeader("Access-Control-Allow-Origin","*");}, success: function(data){ cx(); $('#table').html(data); } }); e.preventDefault(); }); with fancybox i am trying like this: $(document).on('click','#table td a', function(e) { var hcall = e.currentTarget.toString(); var cURL = hcall; ax(); $.fancybox({ 'width':800, 'height':650, 'type':'iframe', 'autoScale':'true', openEffect: 'elastic', closeEffect: 'elastic', aftershow: function() { $.ajax({ url: 'mypage.php?u='+encodeURIComponent(cURL), crossDomain : true, cache: false, beforeSend: function(xhr) {xhr.setRequestHeader("Access-Control-Allow-Origin","*");}, success: function(data){ cx(); $('#table').html(data); } }); e.preventDefault(); } }); }); but it does seesm to work, it loads the fancybox and the new page also and the fancybox gives 404 error. a object is passed to the url. i am bit confused here
has title: load ajax contents inside the fancybox
has comment: http://stackoverflow.com/comment/45440533
tagged with: fancybox-2
type: Question
has comment: http://stackoverflow.com/comment/45440964
has comment: http://stackoverflow.com/comment/45441872
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/45440929
answer count: 1
tagged with: fancybox
has comment: http://stackoverflow.com/comment/45440641
has comment: http://stackoverflow.com/comment/45440073

http://stackoverflow.com/q/28593343
tagged with: meteor
has body: Im using pub/sub on my application, but when no user is logged in, the subscription defers to the waitOn method and loads my loadingTemplate loadingTemplate: 'loading', waitOn: function(){ return Meteor.subscribe('lists'); } I want the following spacebars to kick in, but the waitOn method is blocking it {{#unless currentUser}} log in to access your kaleo sign in above to access your kaleo {{/unless}}
has comment: http://stackoverflow.com/comment/45493384
accepted answer: http://stackoverflow.com/a/28594703
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45493658
has title: Remove loading template for non-logged in users in Meteor
type: Question
has answer: http://stackoverflow.com/a/28594703
score: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/28535209
has comment: http://stackoverflow.com/comment/45412203
upvote count: 1
type: Answer
downvote count: 0
has body: You can search for an existing tag as follows: var existing = store.find('tag', { name: addedTags[i] }); So, you can have logic along the lines of: AddTags: function(tags){ var store = this.store; var thisRecipe = this.get('model'); var thisRecipeTags = thisRecipe.get('tags'); var addedTags = tags.split(','); for (i = 0; i &lt; addedTags.length; i++) { var existing = store.find('tag', { name: addedTags[i] }); if(existing){ tag = existing } else { tag = store.createRecord('tag', { name: addedTags[i] }); } thisRecipeTags.addObject(tag); } } I can't test this at the moment so it might need some changes to account for promises, etc -- but that should get you more or less what you need.
answers question: http://stackoverflow.com/q/28534713
score: 1

http://stackoverflow.com/comment/45332159
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28503603
has text: Does the data file always contain 4 lines per table row?

cal-heatmap
tags question: http://stackoverflow.com/q/28534674
tag name: cal-heatmap
type: Tag

http://stackoverflow.com/comment/45274236
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28475429
has text: Sorry i'm finding it very hard to understand your question, also `no above image` and since you have no source code I have nothing to work with. Please edit your question so I can understand, thank you.
type: Comment

http://stackoverflow.com/q/28462630
has answer: http://stackoverflow.com/a/28462914
has title: How to make each div the same height, in order to keep the 3 div per row alignment working
tagged with: javascript
tagged with: alignment
tagged with: jquery
has comment: http://stackoverflow.com/comment/45251944
score: 0
has comment: http://stackoverflow.com/comment/45251503
tagged with: http://stackoverflow.com/tag/html
has body: My site contains a series of divs (represented by green boxes), and I only need 3 per row. But they're not all equal height, so it pushes the other divs out of alignment. See here: and here's my demo site showing the full issue if you scroll down: http://testsite24.netai.net/public/demo.html Here's an example of the code for one of the divs (green boxes): 59 Acre Paradise Kings County Offered at $95,000 Can you offer a solution to make all div heights the same height, so they stay in alignment? The solution must work for IE8+. Perhaps a script to identify the longest div in the row and make the other two the same height? Previously I used this script, but FlexWrap isn't supported by IE8/IE9 so I had to scrap it. Any ideas? Thank you!!
tagged with: height
has answer: http://stackoverflow.com/a/28462785
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45252003
has comment: http://stackoverflow.com/comment/45251191
answer count: 4
has answer: http://stackoverflow.com/a/28462926
has answer: http://stackoverflow.com/a/28462775
type: Question
linked to: http://stackoverflow.com/q/28119377

http://stackoverflow.com/a/28582630
type: Answer
answers question: http://stackoverflow.com/q/28582543
downvote count: 1
score: -1
upvote count: 0
has body: function deleteElement(list, index) { var newList = []; for (var ix in list) { var el = list[ix]; if (el.index == index) continue; if (el.index &gt; index) el.index--; newList.push(el); } return newList; } EDIT: Wrapped into general method

http://stackoverflow.com/a/28439368
answers question: http://stackoverflow.com/q/28439287
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28439287
upvote count: 2
has body: You can just use this regex: var re = /[^\x00-\x7f]/; then use it as: var invalid = re.test(name); // true if there is any character beyond ASCII (128) is present
has comment: http://stackoverflow.com/comment/45210005
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28549724
has body: You mean this, right? That bar isn't part of the web page, and a web page can only listen to keystrokes sent to the web page. So you can't (you shouldn't be able to, anyway) detect or stop those keystrokes. But you can open a window without an address bar. https://developer.mozilla.org/en-US/docs/Web/API/Window.open window.open('http://www.example.com/', '_blank', 'location=no'); Demo: http://jsbin.com/fisehihila/1/ In modern desktop browsers, they actually do show the location bar to prevent phishing, but it's not editable. Here it is grayed out in Firefox release channel on Windows 7. You can select it, but you can't type in it. The options to fiddle with these window features have limited support in mobile browsers though.
has comment: http://stackoverflow.com/comment/45412523
upvote count: 4
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28549569
score: 4
answers question: http://stackoverflow.com/q/28549569

http://stackoverflow.com/comment/45258255
comment on: http://stackoverflow.com/q/28466312
has text: Have you tried what happens if you disable JavaScript from your own browser?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28474907
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28471201
has comment: http://stackoverflow.com/comment/45311936
has body: To be honest, it can get a little confusing. Especially if you just read about it and don't actually try it out. I try to clarify it very quickly but if anything is unclear let me know :) First thing first: What is Isomorphic JavaScript? Simplified it means that you use the very same code on front-end and back-end which is usually possible thanks Node.js (or the new fork iojs). Now, until recently it was normal to deliver a more or less static html page to the client. Doesn't matter if the html is actually static on the server or the server creates it dynamically - the client just renders the HTML it gets. With the new frameworks like Angular or React the approach is differently: You basically create the HTML dynamically on the client side and ask the server just for data. This means your server is in general just an (json) API! However, some of the frameworks have an option to "pre-render" the html serverside which basically just means the initial request returns the proper html as we know it already and from there the clients takes over to manipulate the DOM again. Usually you do that because you want a "single-page" Application that has more than one page. Single-Page just means you don't need to reload. And the main reason you want that is because your webapp looks nicer on smartphones/tablets. The aim is to get a "native" feeling even though it's "just" a website. It has a few more advantages and obviously also quite a few disadvantages but if you're interested in them try to learn one of those frameworks and take it from there. Angular.js is currently the "standard" framework that most people use - so can't really go wrong there. I personally like React.js quite a bit but it's not as popular as Angular (yet?). Some people even combine the two of them but you really need to know what you do to make that work in a way that makes sense so just go with one ->they both provide everything you need. You can also have a look at Ember or Backbone but the concept is pre…
has comment: http://stackoverflow.com/comment/45312111
has comment: http://stackoverflow.com/comment/45312174
upvote count: 1
has comment: http://stackoverflow.com/comment/45312309
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28471201

http://stackoverflow.com/a/32949878
upvote count: 1
answers question: http://stackoverflow.com/q/28588318
downvote count: 0
score: 1
type: Answer
has body: I'm kanda late replay put simplest way is to use $scope.$parent.$close(result); $scope.$parent.$dismiss(reason); This works form your directive controller.

http://stackoverflow.com/comment/45362404
type: Comment
has text: I have a custom filter - not sure if you looked at the fiddle.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28522765

http://stackoverflow.com/q/28438309
type: AnsweredQuestion
type: Question
tagged with: ios
tagged with: javascript
has answer: http://stackoverflow.com/a/28810136
has title: Go to where word is highlighted
score: 0
answer count: 1
has body: I have my app registering a highlighted word when I search in a html file through a UIWebview. The issue I have is the program is just highlighting the selected words. Since I have several pages, how do I make it so the program will automatically go to where the words are highlighted instead of me scrolling around, searching for the highlighted word. Here is my code so far. Thank you function uiWebview_HighlightAllOccurencesOfStringForElement(element,keyword) { if (element) { if (element.nodeType == 3) { // Text node while (true) { //if (counter &lt; 1) { var value = element.nodeValue; // Search for keyword in text node var idx = value.toLowerCase().indexOf(keyword); if (idx &lt; 0) break; // not found, abort //(value.split); //we create a SPAN element for every parts of matched keywords var span = document.createElement("span"); var text = document.createTextNode(value.substr(idx,keyword.length)); span.appendChild(text); span.setAttribute("class","uiWebviewHighlight"); span.style.backgroundColor="yellow"; span.style.color="black"; uiWebview_SearchResultCount++; // update the counter text = document.createTextNode(value.substr(idx+keyword.length)); element.deleteData(idx, value.length - idx); var next = element.nextSibling; element.parentNode.insertBefore(span, next); element.parentNode.insertBefore(text, next); element = text; } } else if (element.nodeType == 1) { // Element node if (element.style.display != "none" &amp;&amp; element.nodeName.toLowerCase() != 'select') { for (var i=element.childNodes.length-1; i&gt;=0; i--) { uiWebview_HighlightAllOccurencesOfStringForElement(element.childNodes[i],keyword); } } } } }
tagged with: uiwebview
accepted answer: http://stackoverflow.com/a/28810136

http://stackoverflow.com/comment/45333728
comment on: http://stackoverflow.com/a/28507000
type: Comment
type: AnswerComment
has text: philip, I tested. I am not seeing anything in the alert nor in $_POST which should be shown
score: 0

http://stackoverflow.com/a/28561557
score: 0
type: Answer
has body: I need to repeat third value all the time. I try to give you an example. First value = Country Second value = City Third value = option And I want to do something like: If First value = Canada then Second value = Toronto If First value = Canada then Third value = Show canada map Second Value and third value don't depend of themselve, only of first value.
answers question: http://stackoverflow.com/q/28558216

http://stackoverflow.com/q/28565990
answer count: 2
has comment: http://stackoverflow.com/comment/45442482
upvote count: 1
has answer: http://stackoverflow.com/a/28566059
accepted answer: http://stackoverflow.com/a/28566059
has comment: http://stackoverflow.com/comment/45442328
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28566100
has comment: http://stackoverflow.com/comment/45940194
favorite count: 0
has answer: http://stackoverflow.com/a/28566100
has comment: http://stackoverflow.com/comment/45442379
has title: Dynamically adding one object to another in JavaScript
has comment: http://stackoverflow.com/comment/45442430
has comment: http://stackoverflow.com/comment/45442357
has comment: http://stackoverflow.com/comment/45442573
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45442326
downvote count: 0
has body: I have an object that needs to have another object added to it when a user selects a certain value. The object is a player object that holds basic info, I also have a weapon object that holds the information about a weapon. When a user makes a selection for a weapon to use, I would like to add the weapon object to the player object, if the user selects a different weapon, I'd like to remove the previous weapon object and add the new one. Is this possible? Would it be like pushing values into an array? HTML Sword Axe Hammer JS var Player = { name: "One", weapon: } var Sword = { type: "Bronze", speed: 1.25, min_damage: 15, max_damage: 20, str_required: 15, gems: "", hilt: "", blade: "", inscriptions: "", runes: "" } var Axe = { type: "Bronze", speed: 1.5, min_damage: 25, max_damage: 28, str_required: 25, gems: "", hilt: "", blade: "", inscriptions: "", runes: "" } var Hammer = { type: "Bronze", speed: 2.5, min_damage: 45, max_damage: 60, str_required: 55, gems: "", hilt: "", blade: "", inscriptions: "", runes: "" } $("select").on("change", function(){ var selected_weapon = $(this).val(); if(selected_weapon == "Sword"){ Player.weapon = Sword; $("#content").append(Player); } else if(selected_weapon == "Axe"){ Player.weapon = Axe; $("#content").append(Player); } else if(selected_weapon == "Hammer"){ Player.weapon = Hammer; $("#content").append(Player); } });
score: 1
has comment: http://stackoverflow.com/comment/45442405
has comment: http://stackoverflow.com/comment/45442622
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45442485

http://stackoverflow.com/a/28568559
has comment: http://stackoverflow.com/comment/45536331
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28564126
answers question: http://stackoverflow.com/q/28564126
has body: You need to return something: if (sku != " ") { sheet.appendRow(["'"+reference," "," "," ","'"+sku, "1", " ", " ", " ", "'"+loc_array[0],"'"+loc_array[1],"'" + loc_array[2],"'"+loc_array[3]]); return true; } else { return false; }; Note the use of return true; and return false;. Either true or false will be returned to your HTML code and passed to the success handler. You need to run a withSuccessHandler() and do the final processing in that separate "success" function. First get the data out of the spreadsheet. Then if that is successful, a different function will run that compares the values. &lt;script&gt; function onSuccess(argReturnValue) { Console.log('argReturnValue: ' + argReturnValue); if (argReturnValue === true) { //Code here } else { }; //Note that the argument: argValuesFromSpreadsheet is the return value from //the gs script function, "getValuesFromForm" var valueFromForm = document.getElementById("sku").value; //You'll need to modify this line to get a specific value var valueFromSpreadsheet = argValuesFromSpreadsheet[0]; Logger.log('valueFromSpreadsheet: ' + valueFromSpreadsheet); if (valueFromForm === valueFromSpreadsheet) { alert('alert text here: ' + document.getElementById("sku").value); } else { document.getElementById("sku").value = ' '; document.getElementById("sku").focus(); } } function formSubmit() { google.script.run .withSuccessHandler(onSuccess) .getValuesFromForm(document.forms[0]); }; &lt;/script&gt; Note: You will need to make some modifications to the code, depending on what data, and the format of the data being returned from the spreadsheet: var valueFromSpreadsheet = argValuesFromSpreadsheet[0]; That line needs to be modified.
upvote count: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/28555397
has comment: http://stackoverflow.com/comment/45424337
has body: It must be having a problem finding the xml file, I would double check the name and casing. Also permissions of folders could sometimes be an issue, but if they are in the same folder, I can't imagine that causeing you grief. Your code seems to work fine. This plunker is virtually a copy of the code you have, so we know the code works! Except I changed the name of the .xml to "test", which shouldn't change anything. xmlhttp.open("GET","test.xml",false);
type: Answer
accepted answer of: http://stackoverflow.com/q/28555173
score: 1
answers question: http://stackoverflow.com/q/28555173
downvote count: 0
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45437884

http://stackoverflow.com/a/28463515
has body: You can change your binding to this $(window).hashchange( function(){ var currenthash = location.hash; $(".agenda-tabs li").removeClass('active') $('.agenda-tabs').find('.ui-link').each(function(){ var innerDivId = $(this).attr('href'); if(innerDivId==currenthash) { $(".agenda-tabs li").addClass('active'); } });
answers question: http://stackoverflow.com/q/28463170
upvote count: 1
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/45468315
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28575591
score: 0
has text: i tried accessing directly thru browser and it works, unfortunately the javascript didnt work.

http://stackoverflow.com/a/28487534
upvote count: 1
answers question: http://stackoverflow.com/q/28487266
has body: Use a parameter to your function OnClientClick="descButton('&lt;%=desciptionPanel.ClientID%&gt;'); then script will be function descButton(id) { var desc = document.getElementById(id); desc.style.visibility = "visible"; desc.style.height = "800px"; }
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/comment/45221087
has text: `$scope.$apply()` looked promising. But didn't work. I'm really annoyed now. Been stuck with this for too long. I get the error `$apply() already in progress`.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28443912

http://stackoverflow.com/comment/45391246
has text: `stopped working` ? Any errors ?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28538596

http://stackoverflow.com/comment/45247914
score: 0
type: Comment
type: QuestionComment
has text: You've been given an answer below. Commenting back and forth here will result in being too chatty. You've been given tools to debug, and use `var_dump()` to see what's passing through or not.
comment on: http://stackoverflow.com/q/28460715

http://stackoverflow.com/comment/45264878
has text: using the code you provided, I still have the error.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28470042
score: 0

http://stackoverflow.com/q/28589267
tagged with: javascript
has comment: http://stackoverflow.com/comment/45490939
score: 0
has title: incrementing a counter in asp mvc view page for inserting a field using jquery
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/45493131
type: UnansweredQuestion
has body: I want to append a field based on the click event. I want to also increment the counter while doing this. I currently have this: @{ Layout = "~/Views/Shared/_Layout.cshtml"; ViewBag.Title = "Create"; var i = 0; } Beginform code omitted @Html.LabelFor(model => model.Images[0].ImageUrl, htmlAttributes: new { @class = "control-label col-md-2" }) @*@Html.HiddenFor(model => model.Images[0].ImageUrl, new { id = "updateimageurl" })*@ Select file... @*@Html.TextBoxFor(m => m.Images[0].ImageUrl, new { id = "fu-my-simple-upload", type = "file", name = "myfile" })*@ Start Upload This is my script code. Some of it is omitted to maintain the size of this question. $("#hl-start-upload").on('click', function () { $("#addhiddenimagefield").prepend('@Html.HiddenFor(model => model.Images[i].ImageUrl, new { id = "updateimageurl" })'); }); I want to increment the index counter "i" so that I can add more fields as the button is clicked. I've tried many ways but none have worked so far. Your help is greatly appreciated.
has answer: http://stackoverflow.com/a/28594838
type: Question
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/45486193

http://stackoverflow.com/comment/45269802
type: AnswerComment
has text: i dint get it..where i should include this?
type: Comment
comment on: http://stackoverflow.com/a/28471278
score: 0

http://stackoverflow.com/a/28563257
answers question: http://stackoverflow.com/q/28563042
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/45437101
has comment: http://stackoverflow.com/comment/45438049
downvote count: 0
has body: In ruby you can use map and pass a block. For instance: array.map { |element| element % 10 } or, if you prefer: mod_by_10 = Proc.new { |a| a%10 } array.map(&amp;mod_by_10) Note that there are two kinds of map: map does not have side effects and map!, which has side effects.

http://stackoverflow.com/q/28443814
accepted answer: http://stackoverflow.com/a/28443913
has comment: http://stackoverflow.com/comment/45217397
has comment: http://stackoverflow.com/comment/45217835
tagged with: javascript
tagged with: jquery
has body: I've got in my css file this: background:url("img/gold1.gif") repeat-x center; and now I want to change it into jQuery language but I 'dont know how :( I have this: $('#example').css( {"background": "url('img/gold1.gif')", "background-repeat": "repeat-x", "background-position": "center"; }); And it doesn't work. Any help, please?
favorite count: 0
has comment: http://stackoverflow.com/comment/45217271
has answer: http://stackoverflow.com/a/28443896
has answer: http://stackoverflow.com/a/28443913
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45217483
type: AnsweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/45217358
has title: css style to jquery - more than one property
downvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/28443896
has comment: http://stackoverflow.com/comment/45217372
has comment: http://stackoverflow.com/comment/45217388
has comment: http://stackoverflow.com/comment/45217214
score: 0
answer count: 2

http://stackoverflow.com/q/28500967
score: 4
has comment: http://stackoverflow.com/comment/45321267
type: Question
has comment: http://stackoverflow.com/comment/45321484
has comment: http://stackoverflow.com/comment/45321392
has comment: http://stackoverflow.com/comment/45321193
has comment: http://stackoverflow.com/comment/45321371
has comment: http://stackoverflow.com/comment/45321235
tagged with: javascript
has title: How to prevent cheating on JavaScript game?
has comment: http://stackoverflow.com/comment/45321247
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/45321379
has comment: http://stackoverflow.com/comment/45321324
has comment: http://stackoverflow.com/comment/45321128
has comment: http://stackoverflow.com/comment/45321448
answer count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/7171101
downvote count: 3
upvote count: 7
tagged with: php
has body: First, I know that there is no 100% sure solution, and this question have been ask more than once. These posts are my favorites first and second but they are too old without enough effective solutions. I'm creating a social game in JavaScript, HTML5 and CSS3 and I use canvas. For security reasons I wanted to know how to detect if a user is using his debugger tool. To prevent if a user is trying to change some value, speed etc.. but I can handle most of these stuff with PHP. My game is a real-time game. This is the non-exhaustive list of some anti-cheat ideas: Check values every time he earns points on server side to see if it's consistent. Crypt each value then decrypt it on server side. Have a different Hash for each value and make it random each time a user load the game. Minify and Encode my whole script file. Detect if a user is using a debugger and check if he is resizing his window during the game (but he could open his debugger before loading the game so..). Make the page submit a complete replay of the game and check for inconsistencies. for each request to the server, send the script and compare it with the original script in case user has modified it. Put the script minified inside my html page and for each request, send back the orignal script to replace the actual one. Put a timer on client side, send the time on server side when you want in order to check if values are consistent (to do it you could calculate if the score match a minimum time you have set, e.g: the time is at 47sec, the score is 1000 and for your game between 40sec &amp;&amp; 50sec the score can not be more than 1500 so in this case all is fine). Of course there is many more solutions to list. For each solution, he will have access to his debugger tool. There is no proper way to totally prevent the use of a debugger tool. So there is no way to prevent at 100% a user not to cheat. At least you can make an almost anti-cheat by grouping all of these solutions together. Even if you don't ha…
has comment: http://stackoverflow.com/comment/45321188
has comment: http://stackoverflow.com/comment/45321191
tagged with: anti-cheat
linked to: http://stackoverflow.com/q/5250403

http://stackoverflow.com/comment/45427827
score: 0
has text: Thank you for your answer DonJuwe, but the ng-show is not the only action bound to the ng-click and I find it very messy if there is a lot of code in the ng-click element, and I want to be able to call the show from everywhere in my site and show the right menu based on the parameter i'm giving the function
type: Comment
comment on: http://stackoverflow.com/a/28557755
type: AnswerComment

http://stackoverflow.com/comment/45220456
has text: Don't forget to declare your local variables with `var` !!!
score: 0
comment on: http://stackoverflow.com/q/28445553
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28477687
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/28477814
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28477999
has answer: http://stackoverflow.com/a/28477999
tagged with: checkbox
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28477814
has body: I have a table with following columns: checkbox, text, text, ... For every selected checkbox I need to get the 2nd text value and test if contains some value. My code so far $('input:checkbox').each(function () { var current = $(this); if (current.is(':checked')) { var txt = current.next('.inf-name').text(); if (txt.contains(inf) { ... } } }); razor code: State Lookup Type Plates Notices @Html.HiddenFor(p => p.OrgUnitID, new { @Value = orgUnitId }) @for(var ind = 0; ind < records.Count(); ++ind) { var r = records[ind]; var i = ind; @Html.HiddenFor(p => p.Comp[i].State, new { @Value = @r.State }) @Html.CheckBoxFor(p => p.Comp[i].Checked) @r.State @if (dict.ContainsKey(r.State)) { @dict[r.State].ToString() } else { } @Html.ActionLink(@r.Plates.ToString(CultureInfo.InvariantCulture), "Plates", new { controller = "Lookup", state = @r.State}) @Html.ActionLink(@r.Notices.ToString(CultureInfo.InvariantCulture), "Plates", new { controller = "Lookup" }, new { state = @r.State }) } where inf-name is the class on 2nd element. I can't get it done. Anyone know a solution?
score: 0
has title: jQuery - get next element inside checkbox each
has comment: http://stackoverflow.com/comment/45278036
type: Question

http://stackoverflow.com/comment/52015693
type: QuestionComment
type: Comment
has text: You might want to remove the final `|` or else anything that has a forward slash will be matched.
comment on: http://stackoverflow.com/q/28573169
score: 0

http://stackoverflow.com/a/28587664
score: 2
has comment: http://stackoverflow.com/comment/45483540
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28587352
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45482740
has comment: http://stackoverflow.com/comment/45485700
answers question: http://stackoverflow.com/q/28587352
type: Answer
has comment: http://stackoverflow.com/comment/45484025
has body: You should use ng-change. ng-change only fires when the input is changing the model - not the other way around. Your selectAll should change the model. I'm guessing that you are doing the "select all" differently. $scope.selectAll = function(){ for (var i = 0; i < $scope.sources.length; i++) { $scope.sources[i].selected = true; // this does not fire `ng-change` } $scope.updateArticleList(); } EDIT: Based on the OP's comment about submitting all the sources on every change, the following is a more complete conceptual example of how this could be achieved: {{source.title}} select all

http://stackoverflow.com/comment/45329097
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28504409
has text: Is there a reason is needs to be randomized in PHP? JavaScript can be used to create the random numbers AND to exchange the content - no page refresh, fewer calls to the server, less work for PHP.

http://stackoverflow.com/comment/45305941
has text: add a `return false;` at the end of validateForm()
score: 1
comment on: http://stackoverflow.com/q/28492495
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45249330
has text: dear my form id is form-basic so tell me i can pass the id at the place of form?
type: Comment
comment on: http://stackoverflow.com/a/28440026
score: 0
type: AnswerComment

zingchart
type: Tag
tag name: zingchart
tags question: http://stackoverflow.com/q/28485516
tags question: http://stackoverflow.com/q/28444407

http://stackoverflow.com/comment/45276974
has text: Hey, try `{{#each event in model}}`, you haven't specified `events` property in your controller (like `events: Ember.computed.alias('model'))`
score: 0
comment on: http://stackoverflow.com/a/28475164
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45285209
comment on: http://stackoverflow.com/q/28481405
score: 0
type: Comment
type: QuestionComment
has text: @kevin, I am unable to understand what you are saying. Did you mean that I should run index.js and then app.js.

http://stackoverflow.com/comment/122955478
type: Comment
has text: @Catalin You can drag and also click any button/link inside the child div. I made a fiddle with Kurt's answer: https://jsfiddle.net/5rvkum0p/2/
score: 3
type: AnswerComment
comment on: http://stackoverflow.com/a/66313884

http://stackoverflow.com/comment/45465252
has text: Did you observe that I am trying to print {{$scope.message}} value in html but it is not getting that. That is where I have a problem
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28578371
type: AnswerComment

http://stackoverflow.com/comment/45461769
comment on: http://stackoverflow.com/a/28576174
score: 0
type: AnswerComment
has text: Elements should be placed in the correct order before we get to this point - in a SQL order by clause - javascript is a poor choice for sorting easily database-ordered data. By all means sort testgroup to match using javascript. Since you asked why - I am returning el from the filter function because I forgot to change it from my array.map function I snarfed it from. Other than clarity and adding a few characters there's no real reason to change it. And yeah I guess I could stringify testgroup once.
type: Comment

http://stackoverflow.com/a/28477123
type: Answer
has body: Use chart.addSeries(); Here is a Fiddle
answers question: http://stackoverflow.com/q/28475796
score: 0

http://stackoverflow.com/comment/45400938
type: Comment
comment on: http://stackoverflow.com/a/28543562
has text: I am telling you this because someone else might just come and down-vote. Read more about .innerHtml [here](https://developer.mozilla.org/en-US/docs/Web/API/Element.innerHTML) . As it is mentioned, .innerHtml replaces and not adds. You'll have to use .appendChild()
score: 0
type: AnswerComment

http://stackoverflow.com/a/28550565
score: 2
answers question: http://stackoverflow.com/q/28550049
has comment: http://stackoverflow.com/comment/45415199
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45415510
type: Answer
accepted answer of: http://stackoverflow.com/q/28550049
has body: Use a capture group and add it to the replace value with $1 var p = new RegExp('^((\\S+ ){1})(\\S+)'); $("#sentence").html(function(k,v) {return v.replace(p, "$1was");}); Full example: This is some sentence that has the word is. Explanation: ^ Matches the beginning of the string. (\\S+ ){n} Repeats n times, but this would also repeat the capture. (Keeping only the last group captured.) ((\\S+ ){1}) Embed the repeat inside a capture group. $1 (\\S+ ){1} This is now the second capture group. $2 Only the last iteration is stored in $2 (\\S+) Capture the extra word to be replaced. $3 v.replace(p, "$1was"); $1 adds the first capture group and back into the string. The second capture group is left out.
upvote count: 2

http://stackoverflow.com/q/28518861
type: UnansweredQuestion
has body: I'm using Chartjs with Foundation I have three charts that I want to be displayed on three tabs. The chart only shows in the first tab. How can I get it to show in the second and third tabs? Can someone demonstrate a solution with a JSFiddle? HTML: View Day View Week View Month Chartjs js - this script just shows the #day-graph but it won't show if I place it in the 2nd or 3rd tab. var randomScalingFactor = function(){ return Math.round(Math.random()*100)}; var lineChartData = { labels : ["January","February","March","April","May","June","July"], datasets : [ { label: "Visitors", fillColor : "rgba(148,194,116, 0.5)", strokeColor : "rgba(220,220,220,1)", pointColor : "rgba(220,220,220,1)", pointStrokeColor : "#fff", pointHighlightFill : "#fff", pointHighlightStroke : "rgba(220,220,220,1)", data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()] } ] } window.onload = function(){ var ctx = document.getElementById("day-graph").getContext("2d"); window.myLine = new Chart(ctx).Line(lineChartData, { responsive: true }); }
type: Question
tagged with: chart.js
score: 0
has answer: http://stackoverflow.com/a/28519009
tagged with: zurb-foundation
answer count: 1
tagged with: javascript
has title: Chartjs not showing up in Foundation5 Tabs

http://stackoverflow.com/q/28486891
tagged with: node-webkit
tagged with: node.js
has comment: http://stackoverflow.com/comment/131485244
has answer: http://stackoverflow.com/a/68361304
upvote count: 136
has answer: http://stackoverflow.com/a/69931341
has answer: http://stackoverflow.com/a/28859693
has body: I try to use node-vlc with nw.js (v0.12.0-alpha2). When i launch my app without nw.js it works, but when i launch it with nw.js i got an error: Uncaught Error: Module did not self-register.", source: /home/alexis/Bureau/dev/jukebox/node_modules/vlc/node_modules/ffi/node_modules/bindings/bindings.js (84) I tried some commands with nw-gyp but it couldn't help me. I am on Ubuntu 14, 64-bit.
has comment: http://stackoverflow.com/comment/46759220
type: Question
has answer: http://stackoverflow.com/a/30401383
downvote count: 0
has answer: http://stackoverflow.com/a/74484361
tagged with: javascript
has answer: http://stackoverflow.com/a/31161152
has answer: http://stackoverflow.com/a/30233557
has answer: http://stackoverflow.com/a/46935984
has answer: http://stackoverflow.com/a/75671606
linked to: http://stackoverflow.com/q/34964310
has comment: http://stackoverflow.com/comment/135702668
linked to: http://stackoverflow.com/q/26205065
score: 136
has answer: http://stackoverflow.com/a/28695864
has comment: http://stackoverflow.com/comment/131491922
answer count: 15
favorite count: 0
has answer: http://stackoverflow.com/a/41283828
has answer: http://stackoverflow.com/a/29215381
has answer: http://stackoverflow.com/a/69011677
has answer: http://stackoverflow.com/a/49224357
tagged with: node-ffi
has answer: http://stackoverflow.com/a/28572926
has title: Uncaught Error: Module did not self-register
type: UnansweredQuestion

http://stackoverflow.com/comment/45441872
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28564545
has text: ok, the way i am implementing might be wrong, you please let me know how can i call that ajax inisde the fancybox, it should load fancybox and then this ajax contents inside that

http://stackoverflow.com/comment/45266847
comment on: http://stackoverflow.com/q/28470828
score: 0
type: Comment
type: QuestionComment
has text: Maybe I'm biased, proramming in Java for the last 17 years. I have an idea on how much optimization has been put into JVMs during that time. I don't know too much about JS through. Maybe I'm wrong. Just try it, and see what happens...

http://stackoverflow.com/q/28512508
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28512630
type: Question
has title: Prime the website using Express JS
accepted answer: http://stackoverflow.com/a/28512630
tagged with: javascript
tagged with: express
has comment: http://stackoverflow.com/comment/45343470
score: 0
answer count: 1
has body: I really hope to find some answers here as i tried everything by now. Background: Overtime we deploy code to web server, we need to do a cache warm up, i.e. access the site and make sure it loads. First load is always the slowest since IIS require to do some manipulations with a new code and cache it. Task: Create a page which will a checkbox and a button. Once button is pressed, array of links sent to server. Server visits each link and provides a feedback on time it took to load each page to the user. Solution: I am using node JS &amp; express JS on server side. So far i manage to POST array to the server with links, but since i have limited experience with node JS, i can not figure out server side code to work. Here is a code i got so far (it is bits and pieces, but it gives an idea of my progress). Any help will be greatly appreciated!!! var express = require("express"); var app = express(); var bodyParser = require('body-parser'); var parseUrlencoded = bodyParser.urlencoded({ extended: false}); var http = require("http"); function siteToPrime(url){ http.get(url, function (http_res) { // initialize the container for our data var data = ""; // this event fires many times, each time collecting another piece of the response http_res.on("data", function (chunk) { // append this chunk to our growing `data` var data += chunk; }); // this event fires *one* time, after all the `data` events/chunks have been gathered http_res.on("end", function () { // you can use res.send instead of console.log to output via express console.log(data); }); }); }; //Tells express where to look for static content app.use(express.static('public')); app.post('/', parseUrlencoded, function(request, response){ var newBlock = request.body; console.log(Object.keys(newBlock).length); var key = Object.keys(newBlock)[0]; console.log(newBlock[key]); siteToPrime("www.google.com"); response.status(201); }); app.listen(3000, function(){ console.log("Server listening on port 3000..."); });

http://stackoverflow.com/a/28469490
answers question: http://stackoverflow.com/q/28469060
downvote count: 0
score: 3
has body: function randomNum(low, high){ return Math.random() &gt; 0.5 ? high : Math.floor(Math.random() * (high - low)) + low; }
upvote count: 3
type: Answer

google-fusion-tables
type: Tag
tags question: http://stackoverflow.com/q/28457660
tags question: http://stackoverflow.com/q/28462344
tag name: google-fusion-tables

http://stackoverflow.com/comment/45321472
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28499403
has text: @TRGWII: you have used ondomready....how can I use it inside the script? can I use that code inside ready function?

http://stackoverflow.com/comment/45363505
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28523432
has text: you need show us the error message from the network panel.

http://stackoverflow.com/comment/45461736
comment on: http://stackoverflow.com/q/28575591
score: 0
type: Comment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/71132/discussion-between-rasclatt-and-dave).
type: QuestionComment

http://stackoverflow.com/comment/45306968
type: Comment
score: 4
comment on: http://stackoverflow.com/q/28493303
has text: Objects (which includes regular objects, arrays and functions) are passed by reference (or more accurately by pointer since they aren't a true reference). Strings are probably passed by reference too (for efficiency reasons), but since strings are immutable (you can't change a string), there's no difference in behavior if its a reference or a copy.
type: QuestionComment

http://stackoverflow.com/comment/45317227
type: QuestionComment
has text: Go to my anchor your html. Try it
comment on: http://stackoverflow.com/q/28498967
score: 0
type: Comment

http://stackoverflow.com/comment/45384687
has text: try the keypress event instead. It is continuous. Also, unbind the key event on the start of each animation then rebind it at the end so you dont crash the browser.
score: 0
comment on: http://stackoverflow.com/q/28534342
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28513981
answers question: http://stackoverflow.com/q/28513827
score: -1
downvote count: 1
has body: so, tried another one links.And method like this is works: $('#table-wrapper').append(' First Second Third Fourth Fifth '); Now I just need to put inside my vars.
type: Answer
upvote count: 0

http://stackoverflow.com/a/28560398
downvote count: 0
type: Answer
has body: Why use all that fancy jQuery when you can use css :P td{ border:1px solid black; display:block; } .TableMenu{ margin-top:-45px; } .shouldbeunderTableMenu{ margin-top:25px; } Working example:http://jsfiddle.net/h0pLe8cw/1/
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28560127

http://stackoverflow.com/q/28575924
accepted answer: http://stackoverflow.com/a/28576135
has answer: http://stackoverflow.com/a/28576055
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28576000
downvote count: 0
has comment: http://stackoverflow.com/comment/45461255
score: 1
tagged with: date
has answer: http://stackoverflow.com/a/28576064
type: Question
has title: How to get year in formate dd/mm/yyyy in javascript
has answer: http://stackoverflow.com/a/28576126
has comment: http://stackoverflow.com/comment/45461207
has answer: http://stackoverflow.com/a/28576100
has answer: http://stackoverflow.com/a/28576082
tagged with: javascript
upvote count: 1
answer count: 7
has body: for example var date = '18-02-2015'; How i can get the year? just the year. if i use getFullYear() -> it just process formate MM-DD-YYYY Sorry for my bad English
possible better answer: http://stackoverflow.com/a/28576064
favorite count: 0
has answer: http://stackoverflow.com/a/28576135

http://stackoverflow.com/q/28559718
accepted answer: http://stackoverflow.com/a/28559847
has answer: http://stackoverflow.com/a/28559907
favorite count: 0
has title: underscore filter, access index
score: 2
type: AnsweredQuestion
has body: I have the following javascript code log = _.filter(r.logs, (function(o, i) { if (i === 0) { r.createdAt = moment(o.updatedAt).format("lll"); } else { r.createdAt = ""; } if (i === 1) { r.authorisedAt = moment(o.updatedAt).format("lll"); r.authorisedBy = o.user; } else { r.authorisedAt = ""; r.authorisedBy = ""; } if (i === 2) { r.receivedAt = moment(o.updatedAt).format("lll"); r.receivedBy = o.user; } else { r.receivedAt = ""; r.receivedBy = ""; } if (i === 3) { r.creditedAt = moment(o.updatedAt).format("lll"); return r.creditedBy = o.user; } else { r.creditedAt = ""; return r.creditedBy = ""; } })); structure of r.logs { user: 54ba76d3a14c9766bc6e0c2f, updatedAt: Mon Feb 16 2015 16:38:46 GMT+0000 (GMT), status: 'new', comments: 'test return', _id: 54e21d16608eb7bc20d5451b } 0 { user: 54ba7c5b21f9fbb867222a95, updatedAt: Mon Feb 16 2015 16:40:14 GMT+0000 (GMT), status: 'authorised', comments: 'EP02-BR2 is a sample, therefore return not authorised', _id: 54e21d6e608eb7bc20d5451c } 1 { user: 54ba7c5b21f9fbb867222a95, updatedAt: Mon Feb 16 2015 16:41:11 GMT+0000 (GMT), status: 'received', comments: 'i only got one item for EP02-BL1', _id: 54e21da7608eb7bc20d5451d } 2 { user: 54ba7c5b21f9fbb867222a95, updatedAt: Mon Feb 16 2015 16:42:59 GMT+0000 (GMT), status: 'credited', comments: 'credit sent', _id: 54e21e13608eb7bc20d5451e } 3 This works, but wanted to know if it can be done simpler?
downvote count: 0
type: Question
tagged with: underscore.js
has comment: http://stackoverflow.com/comment/45431190
tagged with: javascript
has comment: http://stackoverflow.com/comment/45431117
upvote count: 2
answer count: 2
has comment: http://stackoverflow.com/comment/45431400
possible better answer: http://stackoverflow.com/a/28559907
has answer: http://stackoverflow.com/a/28559847

http://stackoverflow.com/q/28579265
has title: How to use javascript variable with ng-repeat filter
has comment: http://stackoverflow.com/comment/45475146
type: Question
has comment: http://stackoverflow.com/comment/45467253
tagged with: javascript
has comment: http://stackoverflow.com/comment/45468898
has answer: http://stackoverflow.com/a/28585571
tagged with: pug
has comment: http://stackoverflow.com/comment/45468850
answer count: 1
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45467915
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45467954
has comment: http://stackoverflow.com/comment/45467866
has body: Got a bit of a problem, and yes, I know that I did it the wrong way around to start with, but that will be fixed in the next version. So have finally managed to get a variable from express on the backend to the javascript (stored in users in the below example). And it works so far, the console.log will write the correct value. How do I now use that value as a filter, tried just set '_id': users, but that does not work, if I change it to the actual value. It all works fine (oh, and its in jade) script(type='text/javascript'). var users = !{JSON.stringify(canid)}; console.log("got the follwoing :" + users); ul.profilelist(ng-repeat="profile in profiles | filter: {'_id': users }") li img.sumpic(src="../{{profile.img}}")
has comment: http://stackoverflow.com/comment/45478240
has comment: http://stackoverflow.com/comment/45468063
has comment: http://stackoverflow.com/comment/45471270
score: 0
has comment: http://stackoverflow.com/comment/45475581

http://stackoverflow.com/comment/45405218
type: Comment
score: 0
type: AnswerComment
has text: Boy, it sure is great to have another pair of eyes on this :) that was it... Thanks so much for pointing it out...
comment on: http://stackoverflow.com/a/28545983

http://stackoverflow.com/comment/45251105
type: QuestionComment
has text: Maybe run it with Firebug Net dump or similar to watch the communication between your JS and server. Or test your PHP by a simple HTML form and POST data.
score: 0
comment on: http://stackoverflow.com/q/28462542
type: Comment

http://stackoverflow.com/comment/45394219
has text: I don't really get what it is you are trying to accomplish, you should be a bit more specific. "the setInterval stop working" -- what is not working, and what is it you are expecting. "but in chrome it's working" -- if you use other browser it works?
comment on: http://stackoverflow.com/q/28540128
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28540791
answers question: http://stackoverflow.com/q/28540371
upvote count: 1
downvote count: 0
score: 1
type: Answer
has body: Also, by passing ID directly function calculate (id) { var amount = $('#amount').val(); var year = $('#year').val(); var tip1 = 0; if (id == "1") { tip1 = (1 + 115 / 100); } else if (id == "2") { tip1 = (1 + 215 / 100); } var tip = Math.pow(tip1, year); var total = amount * tip; $('#tip').val( tip.toFixed(2) ); $('#total').val( total.toFixed(2) ); } Amount: Years: Tip: Total: Button1 Button2

http://stackoverflow.com/q/28541940
score: 0
accepted answer: http://stackoverflow.com/a/28542209
has comment: http://stackoverflow.com/comment/45397419
has comment: http://stackoverflow.com/comment/45399020
has body: I'm really new to Javascript. I've been playing around a bit, and had managed to get multiple div's on a page to flip individually, using tutorials and some other help. Now, I want to see if I can flip those same div's using a button or a hyperlink instead. I thought it would be as simple as moving the class that controls the flip to the button, but that doesn't seem to be the case. I've read that I need to adjust my Javascript to work from a passed id. Problem is, I don't know how to do this. I've tried passing the button id through to my Javascript function on click (like so: Click Me ), but that doesn't work. I'm probably way off base here. My fiddle is here. I've left the third div as I had it before, working, just to show you what I've started from. Any help would be much appreciated. HTML: some content above the flip card The CSS flip card: Ginger Cat 1 Male Front Click Me Ginger Cat 1 Male Back Click Me Tabby Cat 2 Female Front Click Me Tabby Cat 2 Female Back Click Me Siamese Cat 3 Male Front Siamese Cat 3 Male Back CSS: .large_box_main { width:100%; margin:0px 0px 10px; float:left; display:inline; } .sm_box { width:180px; /* The width of this element */ margin:10px 15px 20px; border: 1px solid #e3d9ec; border-radius: 10px; float:left; } .sm_box:hover { border: 1px solid #9975B9; } .sm_img_box { width:165px; margin:6px; float:left; display:inline; } .sm_info_box { width:165px; margin:8px; background-color:#e3d9ec; float:left; display:inline; text-align:center; line-height:7px; border-radius: 5px; } img.image { display:block; margin:0px auto; } .flipcard { position: relative; height: auto; min-height: 0px; /* Flip card styles: WebKit, FF, Opera */ -webkit-perspective: 800px; -moz-perspective: 800px; -o-perspective: 800px; -webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -o-transform-style: preserve-3d; -webkit-transition: min-height 1s ease-out 0s, -webkit-transform 1s ease-out 0.5s; -moz-transition: min-height 1s ease-out 0s, -moz-tra…
has title: Flipping multiple divs by clicking different buttons using CSS/Javascript
tagged with: css
has comment: http://stackoverflow.com/comment/45397373
type: AnsweredQuestion
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45397745
has answer: http://stackoverflow.com/a/28542209

http://stackoverflow.com/comment/45690109
type: Comment
type: QuestionComment
score: 0
has text: @Knerd, try it again. When something weird occurs, a good place to start is to eliminate known weird / hacky solutions as a potential culprit.
comment on: http://stackoverflow.com/q/28566814

http://stackoverflow.com/comment/45421584
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28554349
has text: Have you tried giving the links the class "navbar-link"? The code looks correct. Also make sure the link is correct. Try putting in "Google . com" or something for one of the links to test it.

http://stackoverflow.com/comment/45382242
has text: See my answer on using cookie functions. Chrome doesn't allow cookie access unless you are running local files from a web server.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28533616

http://stackoverflow.com/a/28702232
has body: Cordova was looking on the wrong folder because my onDeviceReady call were done on js/cordova.js, my custom file for Cordova things. There is a method on the library cordova.js that search the folder of cordova.js. The library uses the found folder to load the plugins. As my custom file had the same name, the library thought that the plugins folder was inside the js folder, when it was on root.
score: 0
has comment: http://stackoverflow.com/comment/57046230
type: Answer
answers question: http://stackoverflow.com/q/28480067

http://stackoverflow.com/comment/45303915
has text: As i expected, i think i've got an answer/explanation not a solution :( sorry
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28491329

http://stackoverflow.com/comment/45574401
comment on: http://stackoverflow.com/q/28522369
has text: @Ben I don't want to have to force users to have to use Browserify to use my script. A lot of users wouldn't be anywhere near the level of using node.
type: Comment
type: QuestionComment
score: 0

validation
tags question: http://stackoverflow.com/q/28585975
tags question: http://stackoverflow.com/q/28499419
tags question: http://stackoverflow.com/q/28438009
tags question: http://stackoverflow.com/q/28515427
tags question: http://stackoverflow.com/q/28470474
tags question: http://stackoverflow.com/q/28588898
tags question: http://stackoverflow.com/q/28592232
tags question: http://stackoverflow.com/q/28582090
tags question: http://stackoverflow.com/q/28495163
type: Tag
tag name: validation
tags question: http://stackoverflow.com/q/28570579
tags question: http://stackoverflow.com/q/28534650
tags question: http://stackoverflow.com/q/28558501
tags question: http://stackoverflow.com/q/28555363
tags question: http://stackoverflow.com/q/28587579
tags question: http://stackoverflow.com/q/28440850
tags question: http://stackoverflow.com/q/28568962
tags question: http://stackoverflow.com/q/28528617
tags question: http://stackoverflow.com/q/28484787
tags question: http://stackoverflow.com/q/28473977
tags question: http://stackoverflow.com/q/28565481
tags question: http://stackoverflow.com/q/28537400
tags question: http://stackoverflow.com/q/28540510
tags question: http://stackoverflow.com/q/28585541
tags question: http://stackoverflow.com/q/28459642
tags question: http://stackoverflow.com/q/28472830
tags question: http://stackoverflow.com/q/28538837
tags question: http://stackoverflow.com/q/28583223
tags question: http://stackoverflow.com/q/28450265
tags question: http://stackoverflow.com/q/28439287
tags question: http://stackoverflow.com/q/28554186
tags question: http://stackoverflow.com/q/28464626
tags question: http://stackoverflow.com/q/28551023
tags question: http://stackoverflow.com/q/28561758
tags question: http://stackoverflow.com/q/28558201
tags question: http://stackoverflow.com/q/28586684
tags question: http://stackoverflow.com/q/28492452

http://stackoverflow.com/comment/45467368
comment on: http://stackoverflow.com/q/28579480
has text: Yes it's function I typed here wrong, now it's correct, but my problem not there. :)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45446804
comment on: http://stackoverflow.com/q/28567351
has text: I'm voting to close this question as off-topic because it is better suited for the code review site.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45408934
comment on: http://stackoverflow.com/q/28547436
score: 0
has text: How are you accessing the content of htmlcss.txt? Is this using nodejs, or designed to work client side with AJAX?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28462169
answers question: http://stackoverflow.com/q/28461604
has body: The problem you are having is that whatever link is the "last to load" is displayed, they do not always load in the same order as they were clicked because not all links may be of the same file size (some take longer to load than others). So you need a way to keep track of which link was pressed last. Id suggest a simple global variable that records the last request. var lastURL; $(".load-me").on("click", function(){ var url = $(this).attr("href"); lastURL = url; (function(){ var thisURL = url; $.get(url, function(x){ if(thisURL==lastURL) $(".main-container").html(x); }); }()); // Anon function for scoping thisURL; }) This should load the last one pressed reguarless of the order they loaded, another issue I see is you may potentially be loading the same content over and over again, you should save the content in an array and check to see if its already loaded and if it is use the already loaded content instead of reloading the content again. var lastURL; var contents = []; $(".load-me").on("click", function(){ var url = $(this).attr("href"); lastURL = url; (function(){ var thisURL = url; for(var i=0;i&lt;content.length;i++){ if(content[i].url == thisURL){ $(".main-container").html(content[i].content); return; // kills the anon function } } $.get(url, function(x){ contents.push({ url: thisURL, content: x }); if(thisURL==lastURL) $(".main-container").html(x); }); }()); // Anon function for scoping thisURL; }) This will make the content load faster the 2nd, 3rd, 4th... time that the same page is loaded because its not doing another get request.
has comment: http://stackoverflow.com/comment/45252777
has comment: http://stackoverflow.com/comment/45252043
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45250942
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28461604

http://stackoverflow.com/comment/45258646
type: AnswerComment
has text: But the first (and second) element in the returned elements variable has a length property and numeric indices so why doesn't slice return that as well? If you console.log element before the return, you'll see both items in the array.
comment on: http://stackoverflow.com/a/28465579
type: Comment
score: 0

http://stackoverflow.com/comment/45428217
type: Comment
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/28558148
has text: Perhaps it would help identify the problem if you could share your code?

http://stackoverflow.com/comment/45464734
type: AnswerComment
has text: If it doesn't work I'll be happy to jump in a chat with you to solve it.
score: 0
comment on: http://stackoverflow.com/a/28563736
type: Comment

http://stackoverflow.com/a/28545779
downvote count: 0
has body: Try this: Have the server return the proper URL as a response to the log POST. Then change the link to: test.pdf An even better option is what @dave proposed: create a server-side page that handles redirecting, so you can just do something like: test.pdf By handling it on the server side, you have much more control over logging, which URL to redirect to, and so on.
has comment: http://stackoverflow.com/comment/45405003
type: Answer
has comment: http://stackoverflow.com/comment/45404906
upvote count: 2
has comment: http://stackoverflow.com/comment/45404646
has comment: http://stackoverflow.com/comment/45404919
answers question: http://stackoverflow.com/q/28545663
score: 2

http://stackoverflow.com/comment/45508932
score: 0
type: AnswerComment
has text: @Débora : sending the event inside the function called by the "$on", and keeping it outside for your purpose.
type: Comment
comment on: http://stackoverflow.com/a/28582864

http://stackoverflow.com/comment/45523739
has text: yep, it's a good idea. and it's relatively simple task - a few lines of code
type: AnswerComment
comment on: http://stackoverflow.com/a/28606840
type: Comment
score: 0

http://stackoverflow.com/a/28535074
has body: function GetNodeDetails(levelId, parentGroupID, ele) { //debugger; var x = $(ele).parent().next('td').html(); alert(x); } - Capital Accounts 3.17. Note: Question does not contains Td tag inside Table and Tr tag. So just a note here browser may remove tr tag or $(this).parent() may not return tr element and eventually your function would fail to get the value of td element you want to show in alert.
answers question: http://stackoverflow.com/q/28534789
type: Answer
score: 0

http://stackoverflow.com/comment/45492805
has text: Just combine two functions with the maximum number to get it
comment on: http://stackoverflow.com/a/28593036
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45477190
has text: You can use $$phase, like the article but not all the going to execute the apply, other option is evalAsync, but affect the performance (i think....), or the other way is change 1seconds to 1miliseconds, try the best for your case.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28459438

http://stackoverflow.com/q/28566996
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28567634
favorite count: 0
upvote count: 2
has body: I am creating an Schema to create events in the admin dashboard, and i have the following schema: { name: String, date: Date, price: String } Everything ok, i already create the CRUD, but now i need add a Description field in my schema. And this field is not exactly dynamic, I need it to have 4 pre-defined values: Value 1: Blue Value 2: Red Value 3: Yellow Value 4: Black And on my form I need to bind the user choose [radio button], to an description value. I have 4 pre-defined values, and i have 4 radio buttons in the form. Example: Radio1 [If the user choose this, the value of description field will be blue] Radio2 [If the user choose this, the value of description field will be red] Radio3 [If the user choose this, the value of description field will be yellow] Radio4 [If the user choose this, the value of description field will be the description black] A bigger example: If the user create an event with these values: In the name input field, value = 'Super big event' in the date input field, value = '20/03/2015' (in date format) in the price input field, value = '50 dollars', in the description radio buttons, he choose radio button with value 1, the output will be: { name: 'Super big event' date: '20/03/2015' (in date format) price: '50 dollars' description: 'Blue' } I really appreciate if someone give me a hand here, i didn't find anything with google that could help me.
answer count: 1
tagged with: node.js
tagged with: nosql
accepted answer: http://stackoverflow.com/a/28567634
has title: How create a field in mongodb schema with pre-defined values, and make the user choose the value with a radio button
tagged with: mongodb
score: 2
downvote count: 0
tagged with: mongoose
tagged with: javascript
type: Question

http://stackoverflow.com/a/28587567
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28587337
type: Answer
has comment: http://stackoverflow.com/comment/45483069
upvote count: 3
has comment: http://stackoverflow.com/comment/45483171
score: 3
has body: The moment command you are looking for is: moment("2014-12-20", "YYYY-MM-DD").fromNow(); // gives "2 months ago" Demo without reading div for date Demo with input div
accepted answer of: http://stackoverflow.com/q/28587337
has comment: http://stackoverflow.com/comment/45482600

http://stackoverflow.com/a/28483822
answers question: http://stackoverflow.com/q/28483462
has comment: http://stackoverflow.com/comment/45293171
type: Answer
has comment: http://stackoverflow.com/comment/45292633
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45290787
has comment: http://stackoverflow.com/comment/45292825
has comment: http://stackoverflow.com/comment/45293819
has comment: http://stackoverflow.com/comment/45292602
has comment: http://stackoverflow.com/comment/45292287
upvote count: 1
type: AcceptedAnswer
has body: There are several problems here: 1) You are looking for ^http but the URLs on your page don't contain that prefix. 2) You are calling attr() on the td rather than the iframe inside it. 3) Assorted typos. 4) Calling hide() during mouseleave is unnecessary and makes parts of your table disappear. var html = " My First Heading My first paragraph. "; var iframe = ' '; var contents = ""; $('td').on('mouseover', function(e) { contents = $(this).html(); console.log(contents); if (contents.match("^http")) { $(this).html(iframe); $(this).find('iframe').attr('src',contents).show(); }}).on('mouseleave', function(e) { // $(this).hide().removeAttr('src'); $(this).innerHTML = contents; }); Also note that many websites, such as google.com, use the X-Frame-Options HTTP header to prevent themselves from being shown in an iframe (for security reasons). This is why Google does not work on your page, but Wikipedia does.
accepted answer of: http://stackoverflow.com/q/28483462
has comment: http://stackoverflow.com/comment/45294326

http://stackoverflow.com/q/28571058
tagged with: javascript
tagged with: ajax
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28571099
favorite count: 0
upvote count: 3
type: UnansweredQuestion
has body: I want to run the AJAX request on the following code "Onload", not "onclick" I dont want to add the onload property in the body tag. I want it in a different tag, in a div for example. I change the row: and I did it but it doesnt work. Your result will display here
type: Question
score: 3
has comment: http://stackoverflow.com/comment/45452548
has comment: http://stackoverflow.com/comment/45452045
has answer: http://stackoverflow.com/a/28571085
has answer: http://stackoverflow.com/a/28571091
downvote count: 0
has title: javascript/ Ajax execute onload a div

http://stackoverflow.com/q/28486757
has comment: http://stackoverflow.com/comment/45295770
has answer: http://stackoverflow.com/a/28486847
has title: How to show the validation messages together
possible better answer: http://stackoverflow.com/a/28486982
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28486982
accepted answer: http://stackoverflow.com/a/28486847
has body: I need your assistant and help in modifying the below code to show the validation messages if not satisfied together not one by one. My code is: function validateForm() { var x = ""; var y = ""; if ( (RFC.C1.checked) &amp;&amp; (!RFC.Language_e.checked || !RFC.Language_e.checked )) { y += "Please Select the Language"; document.getElementById('error').innerHTML = y; return false; } else if (document.RFC.Reason.value=="") { x += "Please enter a Reason"; document.getElementById('error').innerHTML = x; return false; } else { return true; } } In addition, the validation message is shown one time and if the user didn't correct it and submit the page, the error will not be shown again. Can you please help in the two issues?
type: Question
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45295241
tagged with: javascript

http://stackoverflow.com/comment/45261264
comment on: http://stackoverflow.com/q/28467573
score: 0
type: QuestionComment
type: Comment
has text: My current thoughts are to use use JQuery to get the height of the element and the top position, use that to calculate the bottom pixel position of the row and if that is greater than the bottom of the container, consider it overflowing and split it out.

http://stackoverflow.com/q/28492340
has answer: http://stackoverflow.com/a/28495635
favorite count: 0
tagged with: kendo-ui
tagged with: angularjs
type: UnansweredQuestion
has body: I am starting to look at how I would get my grid edits back to a service via the datasource. Following the documentation, I have set a local test data source as follows.. function getDataSource() { var gridData = [ { col1: new CellData('1', 'data1-1'), col2: new CellData('2', 'data1-2') }, { col1: new CellData('3', 'data2-1'), col2: new CellData('4', 'data2-2') }, ]; var dataSrc = new kendo.data.DataSource({ batch: true, transport: { read: function (e) { e.success(gridData); }, update: function (e) { // batch is enabled var updateItems = e.data.models; // This is not called // on success e.success(); }, create: function (e) { e.success(e.data); }, destroy: function (e) { e.success(); } } }); return dataSrc; } I have a toolbar setup (with the "Save Changes"), and this is calling the SaveChanges configuration event, how ever, just cannot see what else I need to do to get the following to occur.. Have the data sources update called Mark the grid "on dirty" so that the red "edited" indicators on the edited cells disappear I am having the same problem with the Add New record (though I can't get the grids "addRow" even to fire here) I have the running example here Any help would be great appreciated!
score: 2
downvote count: 0
type: Question
tagged with: kendo-grid
linked to: http://stackoverflow.com/q/28515544
has title: Kendo Grid: how to make datasource trigger update and create events
tagged with: javascript
upvote count: 2
answer count: 1
tagged with: jquery

http://stackoverflow.com/comment/45368730
comment on: http://stackoverflow.com/q/28514091
score: 0
type: Comment
type: QuestionComment
has text: @Alexander Thanks. That JSBin helped me find the root cause of my problem

http://stackoverflow.com/comment/45442142
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28559594
score: 0
has text: I can't read any of your code in the comment. Please implement what you mean in your **jsfiddle** and I will take a look. And please be clear of what you want in the end. Maybe post a picture in your question or update somehow in your jsfiddle, or even try to explain in detail.

http://stackoverflow.com/comment/45353120
has text: http://jsfiddle.net/efsy19nu/ I'm getting back four trues.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28517594

http://stackoverflow.com/comment/45350524
comment on: http://stackoverflow.com/q/28516513
score: 0
type: Comment
type: QuestionComment
has text: Recursion isn't needed here. If the color you select is the same as the previous simply increment index by 1 and mod by colorPool's length to guarantee an unused previously (and random) new color..

http://stackoverflow.com/q/28511449
tagged with: function
upvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28511507
favorite count: 0
has title: jQuery -Function not getting called correctly
answer count: 3
has answer: http://stackoverflow.com/a/28511486
possible better answer: http://stackoverflow.com/a/28511494
downvote count: 1
has answer: http://stackoverflow.com/a/28511494
type: AnsweredQuestion
score: -1
has body: Okay this problem is pretty straight forward. I'm trying to call a this tele_in function that I have but I can't get it to run. I'm not sure what the heck I have to do. I dropped an alert in the area where I tried calling the function and it worked... What am I missing? Here is the code: The function I'm trying to call is right at the top there called "tele_in". The place I'm trying to call it has been commented out down towards the bottom. What am I doing wrong here? Var SpriteVis; jQuery(document).ready(function tele_in($) { // function to make sprite appear. $("#sprite").animate({bottom: '0px'}, 400, 'linear', function () { $("#sprite").css({ 'background-image': 'url(/images/Warp-Sprite.png)', 'height': '50px', 'width': '90px', 'left': '300px', 'bottom': '80px' }); setTimeout(function () { $("#sprite").css({ 'background-image': 'url(/images/test-sprite.png)', 'height': '120px', 'width': '96px' }); }, 80); }); SpriteVis = true; }); jQuery(function ($) { $(window).scroll(function () { if (SpriteVis == true) { //if Sprite is present on screen, run the animation sequence to make it disappear. $("#sprite").css({ 'background-image': 'url(/images/Warp-Sprite.png)', 'height': '50px', 'width': '90px', 'left': '300px', 'bottom': '80px' }); setTimeout(function () { $("#sprite").css({ 'background-image': 'url(/images/Teleport-Sprite.png)', 'height': '188px', 'width': '52px', 'left': '330px' }); $("#sprite").animate({bottom: '2000px'}, 400, 'linear', function () { }); }), 80; SpriteVis = false; } else { //I need to call the "tele_in" function here . } }); });
type: Question
accepted answer: http://stackoverflow.com/a/28511486

http://stackoverflow.com/comment/45363338
type: QuestionComment
has text: Can you give an example how constructor function returns an object?
comment on: http://stackoverflow.com/q/28523321
score: 0
type: Comment

http://stackoverflow.com/comment/45387967
has text: @StephenMuecke. I tested that as well.
score: 0
comment on: http://stackoverflow.com/q/28536472
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28521543
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45359842
has answer: http://stackoverflow.com/a/28521688
downvote count: 0
answer count: 1
score: 1
has body: I have created an ember.js template (about.hbs). I want to run some jQuery on the page but the jQuery only works if I reload the page. I don't really get where I am meant to put the jQuery code to make it run when the template is rendered. At them moment I have put it in the controller. App.AboutController = Ember.ObjectController.extend({ $(document).ready(function() { //my jquery code }); }); Could someone help me out?
favorite count: 0
type: UnansweredQuestion
tagged with: ember.js
has title: Ember.js load jquery on template render (no refresh)
upvote count: 1

http://stackoverflow.com/a/28486613
score: 2
has comment: http://stackoverflow.com/comment/45295313
has body: If you want to do it in pure angular that would look like so : Cancel
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45295525
accepted answer of: http://stackoverflow.com/q/28486065
type: Answer
answers question: http://stackoverflow.com/q/28486065
has comment: http://stackoverflow.com/comment/45295012
upvote count: 2

http://stackoverflow.com/a/28963118
downvote count: 1
type: AcceptedAnswer
type: Answer
upvote count: 16
accepted answer of: http://stackoverflow.com/q/28556648
has body: It is solved by converting current object to string and then used eval function,Worked solved thanks. var eventlist = JSON.stringify(eventresult.d);//Jsonresult var eventstring = new String(); eventstring = eventlist.toString().replace(/"/g, ""); eval(eventstring );
score: 15
answers question: http://stackoverflow.com/q/28556648

http://stackoverflow.com/comment/45441716
type: Comment
comment on: http://stackoverflow.com/a/28551105
has text: I notice, that if a user types something in that doesn't match something in the box, then selects an option from the box, it deletes the previously entered text. If that's a feature/validation, then you should keep that. If that's a bug, then you'd need to rearrange some of the logic.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45537986
has text: It's less that it's messy, as it is that I thought there was a neater way that I was messing up somehow. I saw on another stack overflow question (which I can no longer find or I'd link to it) someone say it could be done the way I originally tried, but now I'm guessing they are just mistaken. If the hidden element way is the best way to do it, then that's just how it is and I'll stop fretting over it. Thank you! Um... how do I accept a comment as an answer, though?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28582719
type: Comment

http://stackoverflow.com/comment/45343041
has text: When I just type the URL into the address bar with my credentials, here's what I get back: `{"Status":{"Code":"2","Message":"Authentication Succeeded","Success":"true"}}` What specifically in the headers am I looking for? There's a lot of data in there.......
type: QuestionComment
comment on: http://stackoverflow.com/q/28512136
score: 0
type: Comment

http://stackoverflow.com/q/28465352
type: Question
tagged with: angularjs-directive
tagged with: javascript
score: 4
tagged with: angular-ui-bootstrap
possible better answer: http://stackoverflow.com/a/32049361
has comment: http://stackoverflow.com/comment/45256579
answer count: 2
accepted answer: http://stackoverflow.com/a/28688853
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28688853
upvote count: 4
has answer: http://stackoverflow.com/a/32049361
type: AnsweredQuestion
downvote count: 0
has title: ng-bind-html with UI Bootstrap directives
has body: I don't think this is directly an issue but I don't know how to do this. I'm trying to dynamically load content that uses UI Bootstrap directives but when the content is loaded UI Bootsrap components don't work. Being more specific, tooltips don't work. Here is the important code: The javascript $scope.trustSnippet = function(snippet) { return $sce.trustAsHtml(snippet); }; The HTML I'm trying to inject is: Any clues? TY

http://stackoverflow.com/q/28475040
tagged with: javascript
has answer: http://stackoverflow.com/a/28475153
has title: How to set focus table row in Javascript
score: 0
has body: I have a dynamic table created in javascript. when page is loaded, I want to set the focus to first row of table and highlight the focused row to indicate as cursor. Now using arrow keys(Up and down) I want to navigate through each row of table. Thanks for the help.
has comment: http://stackoverflow.com/comment/45273581
answer count: 1
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45276970
type: Question

http://stackoverflow.com/a/28521703
has body: In MongoDB 2.6 you can use the $position modifier to specify the location in an array at which $push inserts values. http://docs.mongodb.org/manual/reference/operator/update/position/#up._S_position The current version of Meteor (1.0.3.1) doesn't support 2.6, but we will add support soon. Using $position on the client (more precisely, in minimongo) will require adding support for $position to minimongo. We'd welcome a pull request.
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28515403
downvote count: 0

http://stackoverflow.com/a/28514447
answers question: http://stackoverflow.com/q/28500217
score: 0
type: AcceptedAnswer
type: Answer
has body: When you call ds.data(data), data has to be an array of items. Your server backend is probably returning a response object that has the array in data.data, so you need to call: ds.data(data.data);
accepted answer of: http://stackoverflow.com/q/28500217

http://stackoverflow.com/a/28504617
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45407386
answers question: http://stackoverflow.com/q/28503653
has comment: http://stackoverflow.com/comment/45335218
type: Answer
has comment: http://stackoverflow.com/comment/45349665
upvote count: 1
has comment: http://stackoverflow.com/comment/45414051
accepted answer of: http://stackoverflow.com/q/28503653
score: 1
has comment: http://stackoverflow.com/comment/45415145
has body: The biggest problem is detecting browser support. If you need it to work x-browser you want to know which browsers support the download attribute. There's your biggest issue right there: in order to detect it, you fall back to a dynamic iframe which holds the data. IE has a data url limit and actually only supports it for images. In short, false positives occur and for those who support it, will trigger the download immediately. That said, I don't believe you can do it x-browser without detecting the useragent. function addDataUri(){ var csvData = convertJsonToCsv('&lt;%= JsonResults %&gt;'), dataUri = 'data:text/csv;charset=utf-8,' + escape(csvData), exportLink = $('.exportLink a'); if (exportLink.length) { // if browser is unsupported, fallback to flash if (isIe()) { getDownloadify(function () { setupDownloadify(csvData, exportLink); }); } else { exportLink.prop({ href: dataUri, target: '_blank', download: 'export_' + +(new Date()) + '.csv' }); } } } function convertJsonToCsv(json) { var objArray = json, array = JSON.parse(objArray), str = '', line, i = 0; for (; i &lt; array.length; i++) { line = ''; for (var index in array[i]) { line += array[i][index] + ','; } line.slice(0, line.length - 1); str += line + '\r\n'; } return str; } So in your example the convertJsonToCsv() should be different. As stated in the comments, something along the lines of: function convertJQueryToCsv(){ var arr = []; $.each($yourObj, function(){ arr.push($(this).text()); }); return arr.join(','); } If you're interested in how I set up the flash fallback, let me know.

http://stackoverflow.com/q/28546157
has comment: http://stackoverflow.com/comment/45405722
type: Question
has comment: http://stackoverflow.com/comment/45405400
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45406112
tagged with: jquery
has title: jquery: can find element, but unable to remove it
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45406356
has comment: http://stackoverflow.com/comment/45405478
has comment: http://stackoverflow.com/comment/45405507
answer count: 0
has body: I've got stuck here with jQuery remove method. Here's a piece of code ... clearTemplate : function(contentContainer) { var container = $('body').find('#' + contentContainer); if (container.length !== 0) { console.log(container.length); container.remove(); console.log(container.length); } } Script can easily find '#'+contentContainer in DOM but is unable to remove it. It has no problem with removing children elements of container object as well. Console.log returns (obviously) : 1 and 1 Container is also dynamically loaded into DOM. Here's a bigger piece ... var TemplateClass = { mainDiv : $('&lt;div&gt;').attr('id',contentContainer), setData : function(result, images, template, link) { this.result = result; this.images = images; this.template = template; this.link = link; }, readyTemplate : function() { var that = this; $.each(this.result, function () { data = that.result[0]; $(that.mainDiv).loadTemplate(that.template, data, { append: true }); }); return this.mainDiv; }, clearTemplate : function(contentContainer) { var container = $('body').find('#' + contentContainer); if (container.length !== 0) { console.log(container.length); container.remove(); console.log(container.length); } } } I'm able to live without removing this object, but it's just not right.

http://stackoverflow.com/comment/45344942
type: AnswerComment
type: Comment
score: 0
has text: thats correct, you can configure your $httpbackend to reply with whatever answer you want. http://prashantsahni.in/blog/2014/09/28/mocking-apis-integration-testing-with-protractor.html
comment on: http://stackoverflow.com/a/28506409

http://stackoverflow.com/a/28438343
downvote count: 0
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/52958566
answers question: http://stackoverflow.com/q/28438202
has comment: http://stackoverflow.com/comment/45206594
has body: The moment docs (see parsing) note browser support for parsing strings is inconsistent. This chart shows that only the UTC version of "YYYY-MM-DD" is supported in Firefox (v4+) currently. UTC: 2009-07-12 Local: 2009-7-12 So, you need to pad the month with a zero for the format to be valid.
score: 2

http://stackoverflow.com/comment/45534701
has text: http://postimg.org/image/mbvc6f5gd/ ########################Ops video won't open on http://jazzmatazz.free.fr/Cumulus/VideoPlayer/ I used this too http://www.wowza.com/resources/3.5.0/examples/LiveVideoStreaming/FlashRTMPPlayer/player.html and there connection failed
comment on: http://stackoverflow.com/a/28580724
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45490033
score: 0
has text: I am using chrome. I found a solution (guess I had to sleep on it), but I don't think I understand why it was happening in the first place.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28577403

http://stackoverflow.com/q/28565919
has title: jqplot draw vertical line in graph
has body: My program is drawing a graph with the following (comparable) source code from the jqplot page. The goal is to draw a vertical line at position x in the graph. I followed up the guide an examples on the jqplot page, but it didn't draw the line, just the graph. Is someone experienced with that? Or could tell me how the options/calls should be to get the line in the graph? Example-code: $(document).ready(function(){ var plot2 = $.jqplot ('chart2', [[3,7,9,1,4,6,8,2,5]], { // Give the plot a title. title: 'Plot With Options', // You can specify options for all axes on the plot at once with // the axesDefaults object. Here, we're using a canvas renderer // to draw the axis label which allows rotated text. axesDefaults: { labelRenderer: $.jqplot.CanvasAxisLabelRenderer }, // An axes object holds options for all axes. // Allowable axes are xaxis, x2axis, yaxis, y2axis, y3axis, ... // Up to 9 y axes are supported. axes: { // options for each axis are specified in seperate option objects. xaxis: { label: "X Axis", // Turn off "padding". This will allow data point to lie on the // edges of the grid. Default padding is 1.2 and will keep all // points inside the bounds of the grid. pad: 0 }, yaxis: { label: "Y Axis" } } }); });
downvote count: 0
has answer: http://stackoverflow.com/a/28599300
tagged with: jqplot
score: 1
type: AnsweredQuestion
tagged with: javascript
type: Question
upvote count: 1
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28599300

http://stackoverflow.com/a/34790465
has body: It's even more late reply, but someone may find it useful. I have enhanced Fernando Felix answer and made my own quite flexible directive which communicates with the controller, which I think might be solution for this question. Directive var modalUrl = function ($modal) { return { restrict: 'A', // A: attribute scope: { // isolate scope 'modalUrl': '@', // modal view url to render the modal content 'modalController': '@', // modal view controller (optional) 'value': "=" }, link: function(scope, element, attrs){ console.log('modalUrl link'); var modalInstance; var template = [ '&lt;div class="modal-body"&gt;', '&lt;button ng-click="$close()" type="button" class="close" aria-label="Close"&gt;', '&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;', '&lt;/button&gt;', '&lt;div ng-include="\'' + scope.modalUrl + '\'"&gt;&lt;/div&gt;', '&lt;/div&gt;' ].join(''); element.bind('click', function(){ // see modal reference from ui bootstrap at &lt;http://angular-ui.github.io&gt; modalInstance = $modal.open({ size: attrs.size, animation: true, template: template, resolve: { params: function () { console.log('value passed to modal:'); console.log(scope.value); return scope.value; } }, controller: scope.modalController }); modalInstance.result.then( function (returnValue) { // alert('value: '+returnValue); console.log('modal returnValue:'); console.log(returnValue); scope.value = returnValue; }, function () { console.log('Modal dismissed at: ' + new Date()); } ); }); } }; } modalUrl.$inject = ['$modal']; angular.module('app').directive('modalUrl', modalUrl); Controller var HelloCtrl = function ($scope, $modalInstance, modalVal) { // $modalInstance: same from from ui bootstrap console.log('Hello init!'); // modalVal is the init modal value passed via directive console.log(modalVal); // your code $scope.name = modalVal; $scope.ok = function() { $modalInstance.close(this.name); // returnValue }; $scope.cancel = function() { $modalInstance.dismiss('cancel'); }; } HelloCtrl.$inj…
downvote count: 0
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28588318

http://stackoverflow.com/a/28511113
type: Answer
has body: Not sure on what platform you are trying to crawl the website, but you can try using PhantomJS to run the JavaScript and render the site. If you are trying to crawl it with AJAX from another site, you can send a request to your own server that runs PhantomJS in the back-end and displays the rendered content as the output.
answers question: http://stackoverflow.com/q/28510938
score: 0

http://stackoverflow.com/comment/45469446
score: 0
comment on: http://stackoverflow.com/q/28580466
type: QuestionComment
type: Comment
has text: @StephenMuecke to set `contentType: "application/json; charset=utf-8"` make sense?, OP is able to post data on server

http://stackoverflow.com/q/28545663
has comment: http://stackoverflow.com/comment/45404574
tagged with: jquery
tagged with: ajax
has body: I have a list of PDF links that is dynamically generated from the database. I want to have a log to keep track of the users who download each one. It seems to not work because after the link is clicked, it doesn't have time to do the ajax before redirecting. Here is the javascript: function insertlog(linkName) { $.post( "insertlog.php", { linkName: linkName, user: "<?=$username?>" } ); } Here is the link: test.pdf
linked to: http://stackoverflow.com/q/2410773
has comment: http://stackoverflow.com/comment/45404480
answer count: 4
has answer: http://stackoverflow.com/a/28546368
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45404534
tagged with: javascript
has answer: http://stackoverflow.com/a/28545776
type: Question
has answer: http://stackoverflow.com/a/28545807
score: 0
has answer: http://stackoverflow.com/a/28545779
has title: AJAX call is not working because it proceeds to go to the link
has comment: http://stackoverflow.com/comment/45404581
has comment: http://stackoverflow.com/comment/45404472

http://stackoverflow.com/comment/45249391
score: 0
type: Comment
type: QuestionComment
has text: possible duplicate of [Div with external stylesheet?](http://stackoverflow.com/questions/16356939/div-with-external-stylesheet)
comment on: http://stackoverflow.com/q/28461284

http://stackoverflow.com/q/28478979
tagged with: http://stackoverflow.com/tag/html
tagged with: symfony
has comment: http://stackoverflow.com/comment/45300564
linked to: http://stackoverflow.com/q/6899097
tagged with: twig
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28492906
tagged with: javascript
has title: how to send variable from javascript to controller
type: Question
score: 0
has body: I'm working with symfony2 and I need to send data from javascript function to the controller. This works when there is no data to send in the url document.location.href="{{path("modifMalade")}}" But I don't know how to do to put parameter on it?
answer count: 1
tagged with: controller

http://stackoverflow.com/q/28554682
has title: PHPExcel to bold text in between HTML markups and
upvote count: 2
answer count: 1
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/27535251
has answer: http://stackoverflow.com/a/28572670
accepted answer: http://stackoverflow.com/a/28572670
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/13944956
tagged with: php
type: AnsweredQuestion
tagged with: phpexcel
score: 2
downvote count: 0
type: Question
has body: HI folks ive been trying to figure out a problem that's been haunting me for some time now and original started this thread thread PHPExcel - How to replace text using preg_replace. I was going about this all the wrong way and Mark gave me some tips on where to start. I gave up this project as I was very clueless of how to even start a script for this. What I am currently attempting is to bold text that are within HTML marker &lt;B&gt; and &lt;Strong&gt;. After spending some time studying Jquery and some javascript to help me with this. I am understanding that ill nee to write a script to find text with HTML markups &lt;b&gt;&lt;/b&gt; and &lt;strong&gt;&lt;/strong&gt;,and tell the javascript to bold that text using the following method: $objRichText = new PHPExcel_RichText(); $objRichText-&gt;createText('This text is '); $objBoldTextRun = $objRichText-&gt;createTextRun('bold'); $objBoldTextRun-&gt;getFont()-&gt;setBold(true); $objPHPExcel-&gt;getActiveSheet()-&gt;getCell('B1')-&gt;setValue($objRichText); I would imagine that with Jquery I would use something like the event .find but not quite sure what the best way to approach something like this. This is honestly way beyond my level of comprehension but willing to give it a shot with some help. Update updated code: &lt;?php /** Error reporting */ /** PHPExcel */ require_once '../js/PHPExcel/Classes/PHPExcel.php'; // Set active sheet index to the first sheet, so Excel opens this as the first sheet // Create new PHPExcel object $objPHPExcel = new PHPExcel(); $rows=2; $sheet=$objPHPExcel-&gt;getActiveSheet(); $wizard = new PHPExcel_Helper_HTML(); //Font Setting for the Support group title. $Support_team = array('font'=&gt; array('bold'=&gt; true,'color' =&gt; array('rgb' =&gt; '4D4D4D'),'size' =&gt; 22,'name' =&gt; 'Arial'),'alignment' =&gt; array('horizontal' =&gt; PHPExcel_Style_Alignment::HORIZONTAL_CENTER,'vertical' =&gt; PHPExcel_Style_Alignment::VERTICAL_CENTER),); //Font settings for the header cells only. $he…
tagged with: javascript

http://stackoverflow.com/q/28574150
has comment: http://stackoverflow.com/comment/45502375
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: client-side
has title: Can I have an id that is a variable and having trouble with calling client side function.... google-apps-script
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28598016
type: Question
tagged with: google-apps-script
has body: I have a rubric table in a google doc and I'm reading the cells and writing them into a sidebar. The cells in each row are written into an html section with a radio button, as shown in the pic below of the sidebar. link to pic ... https://drive.google.com/open?id=0B36uYLZ35wX0d1ozTGp5WFhZdFU&authuser=0 When a radio is selected, I want to change the color of the section's color from light gray to ... any color. So I planned on using a variable id for the section and radio button. Both id's will share the 'r' variable so knowing the id of the radio will allow me to know which section's color to change. Can the id have a variable like I've written here? It worked with Google's UI but I'm not sure with html? Also, I can't get the radio's onclick to call the function. I could use a second pair of eyes. THANKS. <? var rubric = getRubric(); ?> <? for (var r = 1; r < rubric.length; r++) { ?> <section id= <? "rubricSection" + r ?>; > <? for (var c = 1; c < rubric[r].length; c++) { ?> <input type="radio" class= "radioButton" id= <?"rbRubric" + r + c ?>; onClick= <? function(){changeColor(this.id)}; ?>; /> <?= rubric[r][c][1] ?> <? } ?> <? } ?>
answer count: 1
has comment: http://stackoverflow.com/comment/45463005
tagged with: javascript

unify
tag name: unify
type: Tag
tags question: http://stackoverflow.com/q/28506610

http://stackoverflow.com/q/28461757
answer count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45249388
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: I ran across some code that looks like this: &lt;a href="#" data-target=".. .. .. .class-name"&gt; I've never seen sets of dots used to target CSS classes. It is used to select that class, and feed data into it, but if I remove the dots, it can't find the class anymore to insert the data. Is this something the original developer built in? Or is this a standard CSS selector? How does these dots work?
tagged with: custom-data-attribute
upvote count: 2
has comment: http://stackoverflow.com/comment/45250437
tagged with: href
has comment: http://stackoverflow.com/comment/45249434
has comment: http://stackoverflow.com/comment/45249593
has comment: http://stackoverflow.com/comment/45249431
has title: Using ".." in custom data attribute selector
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45249621
score: 2
downvote count: 0

http://stackoverflow.com/a/28533593
answers question: http://stackoverflow.com/q/28533524
has comment: http://stackoverflow.com/comment/45381979
downvote count: 1
type: Answer
upvote count: 0
has body: // check the link : http://www.w3schools.com/jsref/prop_style_display.asp SuperSite Already a registered SuperSite user? Sign in with one of the following services. sign in with your SuperSite username and password add another authentication service from the list above change your SuperSite password If you haven't already registered with SuperSite Register Now Register to use SuperSite services with the following form: UserName: Password: Verify Password:
score: -1
has comment: http://stackoverflow.com/comment/45381994

http://stackoverflow.com/comment/45496778
comment on: http://stackoverflow.com/q/28437566
has text: I can't reproduce the error. Try updating angular to latest STABLE version, and update firefox too
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45438463
has text: Can you remove/comment the `setInterval(updateGradient,10);` in your gradient JS file?
score: 0
comment on: http://stackoverflow.com/a/28561230
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45251993
has text: Thank you! This definitely helped me out! :D
comment on: http://stackoverflow.com/a/28461497
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28899921
type: Answer
score: 5
answers question: http://stackoverflow.com/q/28533091
upvote count: 5
has body: Looking at the definitions from http://findproxyforurl.com/pac-functions/ , they have very different functionality. dnsDomainIs() uses exact domain names - such as .google.com, while shExpMatch() uses shell-like strings with wildcards such as *.google.com. They look very different now, but with shExpMatch, you can also match items in a folder structure like example.com/sub/folder/* or http://example.com/img/*.png. The first one only matches the hostname without protocol, port or subfolders, while the second one matches the whole URL. However, you may be able to use shExpMatch() like dnsDomainIs(), but I am not sure, if you may be vulnerable then by inadvertedly allowing a URL like google.com.example.com for google.com - dnsDomainIs() would return false here, shExpMatch() may return true (not tested, just a hunch)
downvote count: 0

momentjs
tags question: http://stackoverflow.com/q/28536083
tags question: http://stackoverflow.com/q/28588015
tags question: http://stackoverflow.com/q/28443725
tags question: http://stackoverflow.com/q/28497283
tags question: http://stackoverflow.com/q/28591472
tags question: http://stackoverflow.com/q/28531167
tags question: http://stackoverflow.com/q/28592215
tag name: momentjs
tags question: http://stackoverflow.com/q/28566748
tags question: http://stackoverflow.com/q/28587018
type: Tag
tags question: http://stackoverflow.com/q/28490717
tags question: http://stackoverflow.com/q/28473644
tags question: http://stackoverflow.com/q/28473488
tags question: http://stackoverflow.com/q/28438202

http://stackoverflow.com/q/28572191
possible better answer: http://stackoverflow.com/a/28572647
tagged with: iframe
type: Question
accepted answer: http://stackoverflow.com/a/28572441
has title: Refresh iframe when looking away (from within iframe itself)
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28572441
has answer: http://stackoverflow.com/a/28572647
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has body: I have a page that embeds an iframe with a Unity game in it, the game isn't loaded until the user actually clicks in the iframe. This to make sure the page loads quickly, and no games are running that aren't being played (there can be multiple games on one page). Now I was wondering, is it possible to make the iframe refresh when the user scrolls away? So the game stops running and the again waits for a click. Is it possible by only changing the page being shown by the iframe? (So not the page that has the iframe.) Note: I have limited control over the actual page embedding the iframe, that's why it would be nice if this could be done by the page being shown by the iframe. Edit: I found this for refreshing: self.location.reload();, now I only need to be able to detect if the iframe is in view from within the iframe.

http://stackoverflow.com/comment/45319091
comment on: http://stackoverflow.com/q/28499647
score: 0
type: Comment
type: QuestionComment
has text: I added the code i tried in the question

http://stackoverflow.com/q/28584635
has body: I have a container div: &lt;div id="fullpage" class="fullpage_bg"&gt; ...rest of the elements &lt;/div It has a background image for portrait and landscape: #fullpage {background-color: rgba(0,0,0,0.2); background-position: center center;} @media screen and (orientation:portrait) { .fullpage_bg{ background-image: url('images/bg_portrait.jpg'); } } @media screen and (orientation:landscape) { .fullpage_bg{ background-image: url('images/bg_landscape.jpg'); } } Is there a way to scale the image proportionally, either by using CSS or pure JS (no jQuery), for different screen sizes? For example: for landscape the image might take the entire height of the screen, but still have some margins on the sides (because the image must maintain proportions, but still fill the screen as much as possible). In portrait it might take the entire width, but have some margins on top and bottom. Thanks!
favorite count: 0
has title: Resizing background image proportionally
has comment: http://stackoverflow.com/comment/45476685
has answer: http://stackoverflow.com/a/28584709
accepted answer: http://stackoverflow.com/a/28584709
tagged with: http://stackoverflow.com/tag/html
tagged with: css
linked to: http://stackoverflow.com/q/11205553
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28584710
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45476668
answer count: 2
possible better answer: http://stackoverflow.com/a/28584710

http://stackoverflow.com/comment/45267338
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28471240
has text: that is bad.. really don't have any clue

ajax
tags question: http://stackoverflow.com/q/28475326
tags question: http://stackoverflow.com/q/28477394
tags question: http://stackoverflow.com/q/28560907
tags question: http://stackoverflow.com/q/28487086
tags question: http://stackoverflow.com/q/28585787
tags question: http://stackoverflow.com/q/28449723
tags question: http://stackoverflow.com/q/28569117
tags question: http://stackoverflow.com/q/28502393
tags question: http://stackoverflow.com/q/28519123
tags question: http://stackoverflow.com/q/28489000
tags question: http://stackoverflow.com/q/28449124
tags question: http://stackoverflow.com/q/28454611
tags question: http://stackoverflow.com/q/28480152
tags question: http://stackoverflow.com/q/28544444
tags question: http://stackoverflow.com/q/28541298
tags question: http://stackoverflow.com/q/28471647
tags question: http://stackoverflow.com/q/28495814
tags question: http://stackoverflow.com/q/28465072
tags question: http://stackoverflow.com/q/28565702
tags question: http://stackoverflow.com/q/28442781
tags question: http://stackoverflow.com/q/28437070
tags question: http://stackoverflow.com/q/28559463
tags question: http://stackoverflow.com/q/28488966
tags question: http://stackoverflow.com/q/28475382
tags question: http://stackoverflow.com/q/28521804
tags question: http://stackoverflow.com/q/28499291
tags question: http://stackoverflow.com/q/28574201
tags question: http://stackoverflow.com/q/28541866
tags question: http://stackoverflow.com/q/28562635
tags question: http://stackoverflow.com/q/28479361
tags question: http://stackoverflow.com/q/28557102
tags question: http://stackoverflow.com/q/28466340
tags question: http://stackoverflow.com/q/28462851
tags question: http://stackoverflow.com/q/28486498
tags question: http://stackoverflow.com/q/28487789
tags question: http://stackoverflow.com/q/28536472
tags question: http://stackoverflow.com/q/28528144
tags question: http://stackoverflow.com/q/28581229
tags question: http://stackoverflow.com/q/28543144
tags question: http://stackoverflow.com/q/28437788
tags question: http://stackoverflow.com/q/28573362
tags question: http://stackoverflow.com/q/28552049
tags question: http://stackoverflow.com/q/28500717
tags question: http://stackoverflow.com/q/28571058
tags question: http://stackoverflow.com/q/28529918
tags question: http://stackoverflow.com/q/28505447
tags question: http://stackoverflow.com/q/28552353
tags question: http://stackoverflow.com/q/28462542
tags question: http://stackoverflow.com/q/28527171
tags question: http://stackoverflow.com/q/28446536
type: Tag
tags question: http://stackoverflow.com/q/28458439
tags question: http://stackoverflow.com/q/28484448
tags question: http://stackoverflow.com/q/28438170
tags question: http://stackoverflow.com/q/28518066
tags question: http://stackoverflow.com/q/28516822
tags question: http://stackoverflow.com/q/28592339
tags question: http://stackoverflow.com/q/28512760
tags question: http://stackoverflow.com/q/28495266
tags question: http://stackoverflow.com/q/28449885
tags question: http://stackoverflow.com/q/28557874
tags question: http://stackoverflow.com/q/28546116
tags question: http://stackoverflow.com/q/28499857
tags question: http://stackoverflow.com/q/28487380
tags question: http://stackoverflow.com/q/28569909
tags question: http://stackoverflow.com/q/28475695
tags question: http://stackoverflow.com/q/28576441
tags question: http://stackoverflow.com/q/28546534
tags question: http://stackoverflow.com/q/28457484
tags question: http://stackoverflow.com/q/28461604
tags question: http://stackoverflow.com/q/28558444
tags question: http://stackoverflow.com/q/28503761
tags question: http://stackoverflow.com/q/28575896
tags question: http://stackoverflow.com/q/28570579
tags question: http://stackoverflow.com/q/28485468
tags question: http://stackoverflow.com/q/28562343
tags question: http://stackoverflow.com/q/28482201
tags question: http://stackoverflow.com/q/28549010
tags question: http://stackoverflow.com/q/28505453
tags question: http://stackoverflow.com/q/28508670

http://stackoverflow.com/q/28520623
tagged with: mousemove
tagged with: angularjs-e2e
has comment: http://stackoverflow.com/comment/45540233
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/36575019
has answer: http://stackoverflow.com/a/30350550
has body: I want to click on a specific location of my canvas element, so I wrote the following Protractor code: var canvas = element(by.id("canvas")); var clickCanvas = function(toRight, toBottom) { browser.actions() .mouseMove(canvas, -toRight, -toBottom) .click(); } toRight/toBottom are the numbers of pixels where the click should be made, relative the top left corner of my canvas. However, the click does not seem to be executed at the given coordinates. I got the snippet from a related question on the Software Quality Assurance &amp; Testing stack exchange. Can you confirm that this snippet works? Can you suggest alternatives?
type: Question
score: 12
tagged with: protractor
upvote count: 12
has comment: http://stackoverflow.com/comment/61382351
has answer: http://stackoverflow.com/a/28628070
downvote count: 0
has title: Clicking on given coordinates of element in protractor
tagged with: javascript
answer count: 3

http://stackoverflow.com/comment/45212856
score: 0
type: Comment
has text: If I run my $set in robomongo it works, it just doesn't work when node-mongo driver runs it.
comment on: http://stackoverflow.com/a/28439167
type: AnswerComment

http://stackoverflow.com/comment/45483267
score: 0
has text: It's only one row thick. These are the headers. The script that I am attempting to make finds the location of each column and assigns the location of each to a variable so that the order of the columns can change each time the script is run without affecting the output. I noticed in the script above that the position of each item in the array shares the same variable "i". Any idea on where I might start looking to learn how to assign each position to it's own variable?
type: Comment
comment on: http://stackoverflow.com/a/28577552
type: AnswerComment

http://stackoverflow.com/a/28495602
answers question: http://stackoverflow.com/q/28493770
has body: I think you need to replace this line: var currentWeekNumber = Math.ceil(dayOfYear/7); To be: var currentWeekNumber = Math.ceil((dayOfYear + 5)/7); To make a week start from Wednesday. In such case, the week of Day 2 (Tuesday) is Math.ceil((2+5)/7)=1, while Day 3 (Wednesday) is Math.ceil((3+5)/7)=2.
score: 0
type: Answer

http://stackoverflow.com/a/28530320
has comment: http://stackoverflow.com/comment/45389742
has comment: http://stackoverflow.com/comment/45375860
has comment: http://stackoverflow.com/comment/45406724
accepted answer of: http://stackoverflow.com/q/28530217
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28530217
has comment: http://stackoverflow.com/comment/45375684
upvote count: 3
has comment: http://stackoverflow.com/comment/45403434
has comment: http://stackoverflow.com/comment/45406823
has comment: http://stackoverflow.com/comment/45406527
downvote count: 0
type: Answer
has body: According to MDN documentation of HTMLCanvasElement.toDataURL, you can give a second parameter that controls the quality, a number between 0 and 1. So try: var dataURL = canvas.toDataURL("image/jpeg", 1.0); and see whether the quality is good enough for you, but since 1.0 equals "full" quality, I expect it will look exactly like what you see in the canvas itself. Note: if the second parameter is anything else than a Number between 0 and 1, the browser-specific default value will be used for quality. I don't know for sure what that value is for any browser, but according to this question both Chrome and Firefox use 0.92.
score: 3

http://stackoverflow.com/a/28459401
answers question: http://stackoverflow.com/q/28456543
downvote count: 0
has comment: http://stackoverflow.com/comment/45710456
type: Answer
has body: Each time you call port.on a new message listener is added. Only call it once. function checkURL(url, linkID) { data = [url, linkID]; self.port.emit("GetSize", data); console.log("Inside checkURL For linkID : " + linkID); } function DisplaySize(data) { console.log("Inside DisplaySize For linkID : " + data[1]); } self.port.on("receiveSize", DisplaySize);
upvote count: 1
has comment: http://stackoverflow.com/comment/45347587
score: 1

http://stackoverflow.com/q/28591515
has title: JS/JQ if/else user role check
has comment: http://stackoverflow.com/comment/45489617
tagged with: if-statement
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45489756
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28591639
accepted answer: http://stackoverflow.com/a/28591639
favorite count: 0
has comment: http://stackoverflow.com/comment/45489533
has body: I can't seem to get my code to check which user role I've selected from the drop down. I don't often use for this so I'm kind of running into some trouble with it I think. Let me know if I'm missing something? I left the console.log()'s in but they haven't returned anything. var userRole = ""; if ($('select[name=custom1]').find(':selected').val("") === "Healthcare Practitioner") { return userRole = "SR-Practitioner"; console.log(userRole); } else { return userRole = "SR-Educator"; console.log(userRole); };
has comment: http://stackoverflow.com/comment/45489491
has comment: http://stackoverflow.com/comment/45489531
type: AnsweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/45489567
upvote count: 1
type: Question

http://stackoverflow.com/comment/45787724
comment on: http://stackoverflow.com/a/28554000
has text: Hmmm...still struggling here. It seems that the code I run in my draw() routine doesn't take much time....but it has the side effect of producing a long time between animation frames. I can only assume this is because it draws on the canvas, and then the real work of rendering is done outside of my code, after it finishes....as if in a background thread/rendering-loop routine... :-(
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28567525
has title: How to subscribe to select events in CodeMirror with show-hint plugin?
possible better answer: http://stackoverflow.com/a/33093578
tagged with: codemirror
score: 2
type: AnsweredQuestion
upvote count: 2
type: Question
has body: I want to show some additional info while user navigate through the auto-complete suggestions. There is something about select event in the documentaion, but I am not able to find how to subscribe to it if it is possible. Can someone please suggest how to subscribe to that event? or any other method to detect which one is currently selected and detect when this changes? There are several questions about this, but I could not find any solution.
tagged with: autocomplete
has answer: http://stackoverflow.com/a/33093578
answer count: 2
has answer: http://stackoverflow.com/a/28888503
accepted answer: http://stackoverflow.com/a/28888503
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/a/28568242
has comment: http://stackoverflow.com/comment/45447423
type: Answer
has comment: http://stackoverflow.com/comment/61329361
upvote count: 10
has comment: http://stackoverflow.com/comment/61329544
has comment: http://stackoverflow.com/comment/45446899
score: 10
downvote count: 0
has body: Set the option bezierCurve to false. window.onload = function(){ var ctx = document.getElementById("canvas").getContext("2d"); window.myLine = new Chart(ctx).Line(lineChartData, { responsive: true, scaleFontColor: "#FF5972", bezierCurve: false }); }); It's right there in the Line Chart option list.. You can also have them be curved but "stiffer" by leaving the option set and then varying the bezierCurveTension property.
answers question: http://stackoverflow.com/q/28568204

http://stackoverflow.com/comment/45329367
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28505101
score: 0
has text: change the onload to no wrap in

http://stackoverflow.com/comment/45270869
comment on: http://stackoverflow.com/a/28473363
score: 0
type: AnswerComment
type: Comment
has text: Try putting the else part in the getsession.php and print 0 in that. Then run.

http://stackoverflow.com/comment/45305565
type: QuestionComment
has text: I too have the same kind of problem, hoping to get an answer.
score: 0
comment on: http://stackoverflow.com/q/28492422
type: Comment

http://stackoverflow.com/a/38000615
has comment: http://stackoverflow.com/comment/87657808
has comment: http://stackoverflow.com/comment/108608603
upvote count: 118
has body: If you use Google Chrome browser you can hack with an extension. You can find a Chrome extension that will modify CORS headers on the fly in your application. Obviously, this is Chrome only, but I like that it works with zero changes anywhere at all. You can use it for debugging your app on a local machine (if everything works in production). Notice: If URL becomes broken the extension name is Access-Control-Allow-Origin: *. I recommend you to disable this extension when you not working on your stuff, because, for example, youtube does not work with this extension.
downvote count: 3
has comment: http://stackoverflow.com/comment/104110963
answers question: http://stackoverflow.com/q/28547288
has comment: http://stackoverflow.com/comment/132072898
has comment: http://stackoverflow.com/comment/115850461
has comment: http://stackoverflow.com/comment/103235848
type: Answer
score: 115

http://stackoverflow.com/a/28488109
score: 0
answers question: http://stackoverflow.com/q/28487626
type: Answer
has body: Add an onClick() method Html: LOREM IPSUM and add this function in the tag: function changeColor(element){ element.style.color='red'; }

http://stackoverflow.com/q/28454050
upvote count: 2
tagged with: jspdf
has comment: http://stackoverflow.com/comment/45237137
answer count: 1
tagged with: javascript
tagged with: html2canvas
favorite count: 0
has comment: http://stackoverflow.com/comment/45236867
type: UnansweredQuestion
has body: I am working on codeigniter. I want to add save to pdf functionality to one of the div. I am using html2canvas to print it. My problem is I want to add a logo &amp; some other information at the header of the pdf, which is not visible on the webpage. I dont know how to do this. Below is my code. &lt;script type='text/javascript' src="&lt;?php echo site_url('assets/js/html2canvas.js'); ?&gt;"&gt;&lt;/script&gt; &lt;script type='text/javascript' src="&lt;?php echo site_url('assets/js/jspdf.debug.js'); ?&gt;"&gt;&lt;/script&gt; &lt;script type='text/javascript'&gt;//&lt;![CDATA[ function demoFromHTML() { var pdf = new jsPDF('p', 'pt', 'letter'); pdf.addHTML($('#content')[0], function () { pdf.save('test.pdf'); }); specialElementHandlers = { '#bypassme': function (element, renderer) { return true } }; margins = { top: 30, bottom: 30, left: 30, width: '100%' //color: '#000' }; pdf.addHTML()( source, // HTML string or DOM elem ref. margins.left, // x coord margins.top, { // y coord 'width': margins.width, // max width of content on PDF 'elementHandlers': specialElementHandlers }, function (dispose) { pdf.save('test.pdf'); }, margins); } &lt;/script&gt; &lt;div id="content"&gt; Save this to PDF &lt;/div&gt; Pls help.
tagged with: php
score: 2
downvote count: 0
has title: How to add header in pdf generated from HTML
tagged with: codeigniter
type: Question
has answer: http://stackoverflow.com/a/29079810

http://stackoverflow.com/comment/45480771
has text: Your code snippet was very nice, and it working perfectly in my application (after I fixed all of my stupid spelling mistakes :P), Thanks!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28576226
type: AnswerComment

http://stackoverflow.com/q/28518841
score: 0
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45354768
has comment: http://stackoverflow.com/comment/45354743
has comment: http://stackoverflow.com/comment/45354824
accepted answer: http://stackoverflow.com/a/28518881
has comment: http://stackoverflow.com/comment/45354778
has answer: http://stackoverflow.com/a/28518994
type: AnsweredQuestion
tagged with: loops
has title: Can somebody explain to me why we need a for loop in this function?
possible better answer: http://stackoverflow.com/a/28518994
type: Question
has body: I am relatively new to programming, and was reading the book, Eloquent Javascript today. I came across an example that was related to overall scope. However I was more interested in understanding all of the elements within the function that they provided. Here is the function: var landscape = function () { var result = ""; var flat = function (size) { for (var count = 0; count &lt; size; count++) result += "_"; }; var mountain = function (size) { result += "/"; for (var count = 0; count &lt; size; count++) result += "'" result += "\\" }; flat(3); mountain(4); flat(6); mountain(1); return result; }; console.log(landscape()); As I was trying to break down this function, I understood mostly everything except for the for loops. I am not sure why they are needed for this function, and was was wondering if somebody would be willing to digest this problem for me, and explain why we need for loops to make the function work properly.
has answer: http://stackoverflow.com/a/28518881

http://stackoverflow.com/a/28568742
has comment: http://stackoverflow.com/comment/45448114
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28568414
type: AcceptedAnswer
has body: Your text is not showing because you ad the text after .selectAll("text"), which results in an empty selection, hence nowhere to add your text. Furthermore, the text you are adding is in a new svg, and is not linked anyhow to your chart. I created a plunk to show how to put the text in the same svg: http://plnkr.co/edit/EHVB65sn7Oc67s7woKrj?p=preview Updated code: var w = 500; var h = 100; var barPadding = 5; var textWidth = 30; var dataset = [5, 10, 13, 19, 21, 25, 22, 18, 15, 13, 11, 12, 15, 20, 18, 17, 16, 18, 23, 25 ]; //Create SVG element Men 2010 var svg = d3.select("body") .append("svg") .attr("width", w) .attr("height", h); svg.selectAll("rect") .data(dataset) .enter() .append("rect") .attr("x", function(d, i) { return i * ((w - textWidth) / dataset.length); }) .attr("y", function(d) { return h - (d * 4); }) .attr("width", w / dataset.length - barPadding) .attr("height", function(d) { return d * 4; //Just the data value }) .attr("fill", function(d) { return "rgb(0, 0, " + (d * 10) + ")"; }); ///for the fixed text svg.append("g") .append("text") .text("2010") .attr("x", w - textWidth) .attr("y", h / 2) .attr("font-family", "sans-serif") .attr("font-size", "11px") .attr("fill", "black"); What I did is use the same svg to append the text (in a group). I also reduced the space available for the bar chart using a textWidth variable, allowing to view the text and position it properly.
accepted answer of: http://stackoverflow.com/q/28568414

http://stackoverflow.com/comment/45244765
score: 0
comment on: http://stackoverflow.com/q/28459237
has text: initialize your app using ngapp directive https://docs.angularjs.org/api/ng/directive/ngApp
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45230597
has text: @RobertLongson You are right that some sort of encoding is necessary (b64 being convenient). I was referring to the specific extra code in the `Base64` object from the referenced SO answer. Any base 64 encoder that treats its input strictly as an octet sequence (as opposed to a character stream) will do.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28451353
type: AnswerComment

http://stackoverflow.com/q/28478511
has title: FileReader onload does not work in safari
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/45281205
has comment: http://stackoverflow.com/comment/45282060
tagged with: javascript
tagged with: jquery
has body: I am working on a project where I need to show preview of image before croping.i am using jquery.Jcrop.js v0.9.12 plugin and it works great in all the browsers. but in Safari preview image does not display. I found that in lower version of Safari FileReader is not supported. i have safari 5.1.7. here is the code : var e = {}; e.pf = window.FileReader &amp;&amp; function (e, t, n) { var r = new FileReader; r.onload = function (n) { var r = new Image; r.onload = function (n) { if (!t.beforePick.call(e, r)) { e.setImage(r.src, t.afterPick) } }; r.onerror = function (n) { t.beforePick.call(e, null) }; r.src = n.target.result }; r.readAsDataURL(n) }; Do we have any other way to read file in lower version of Safari for window? Thanks
score: 3
favorite count: 0
has comment: http://stackoverflow.com/comment/45281845
has comment: http://stackoverflow.com/comment/45281781
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45281716
tagged with: safari
has comment: http://stackoverflow.com/comment/45281809
upvote count: 3

http://stackoverflow.com/a/28612468
downvote count: 0
type: Answer
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28593303
answers question: http://stackoverflow.com/q/28593303
score: 2
has body: Are you on iOS? This sounds like an audio session category issue to me. iOS apps define how their audio interacts with audio. From Apple's documentation: Each audio session category specifies a particular pattern of “yes” and “no” for each of the following behaviors, as detailed in Table B-1: Interrupts non-mixable apps audio: If yes, non-mixable apps will be interrupted when your app activates its audio session. Silenced by the Silent switch: If yes, your audio is silenced when the user moves the Silent switch to silent. (On iPhone, this switch is called the Ring/Silent switch.) Supports audio input: If yes, app audio input (recording), is allowed. Supports audio output: If yes, app audio output (playback), is allowed. Looks like the default category silences audio from other apps: AVAudioSessionCategorySoloAmbient—(Default) Playback only. Silences audio when the user switches the Ring/Silent switch to the “silent” position and when the screen locks. This category differs from the AVAudioSessionCategoryAmbient category only in that it interrupts other audio. The key here is in the last sentence: "it interrupts other audio". There are a number of other categories you can use depending on whether or not you want your audio silenced when the screen is locked, etc. AVAudioSessionCategoryAmbient does not silence audio. Give this a try in the objective-c portion of your app: NSError *setCategoryError = nil; BOOL success = [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryAmbient error: &amp;setCategoryError]; if (!success) { /* handle the error in setCategoryError */ }
type: AcceptedAnswer

http://stackoverflow.com/comment/45396483
type: QuestionComment
has text: Without going into detail, we are dealing with an app of medium size with a lot of debt, I do not want to refactor the entire thing in one go and need to be able to call the state 'Booking' too if possible.....if it's not possible then fine that's what I want to know....
score: 0
comment on: http://stackoverflow.com/q/28541309
type: Comment

http://stackoverflow.com/comment/45432257
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28548619
score: 0
has text: Please include in your question, how does `returnedItem` look like, and also, how do you serialize it for the client

http://stackoverflow.com/q/28592557
has answer: http://stackoverflow.com/a/28596879
tagged with: d3.js
upvote count: 3
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/45501213
has body: I'm trying to understand the code from http://bl.ocks.org/d3noob/e34791a32a54e015f57d I don't get the part where the code trying to scale the data below : // Scale the range of the data x.domain(d3.extent(data, function(d) { return d.date; })); y0.domain([0, d3.max(data, function(d) { return Math.max(d.close); })]); y1.domain([0, d3.max(data, function(d) { return Math.max(d.open); })]); Why would we have to use d3.max and also need Math.max within the return statement ? shouldn't d3.max(data, function(d) { return d.close ;} ) be enough to get maximum data ? why would we need another Math.max again ?
accepted answer: http://stackoverflow.com/a/28596879
has comment: http://stackoverflow.com/comment/45495841
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has title: What is the different between d3.max() vs. math.max() in d3.js?
has comment: http://stackoverflow.com/comment/45492370

http://stackoverflow.com/a/33632428
upvote count: 3
type: Answer
has comment: http://stackoverflow.com/comment/65982806
downvote count: 0
has body: I did not manage to find the circle inside the SVG so what I did was i went into the jvector core and found this line: this.shape.addClass('jvectormap-marker jvectormap-element'); and added my animation classes as so: this.shape.addClass('jvectormap-marker jvectormap-element animated flash');
score: 3
answers question: http://stackoverflow.com/q/28475549

http://stackoverflow.com/comment/45317829
comment on: http://stackoverflow.com/q/28499141
has text: Not sure "3" is a valid ID (starting with a number). Any errors in the console?
type: QuestionComment
score: 1
type: Comment

http://stackoverflow.com/q/28477484
tagged with: php
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/28477557
has title: php sessions doesn't work with form when submit button is clicked
type: AnsweredQuestion
tagged with: javascript
has answer: http://stackoverflow.com/a/28477539
tagged with: forms
type: Question
has body: I'm having an exam soon. I'm stuck with sessions. At most cases it does not work to me. No matter what I have tried. It worked for me once, but after refreshing a page I never saw it worked. My samples: qwer.php: <?php session_name('Private'); session_id('TEST'); if(isset($_POST["Submit"])){ session_start(); $_SESSION['counter']=5; $_SESSION["lolvalue"]=isset($_POST["imie"]); } ?> Login Link to protected file qwew.php <?php session_name('Private'); session_id('TEST'); session_start(); echo "here it is: ".$_SESSION["lolvalue"]." and ".$_SESSION["counter"]; session_destroy(); ?> The thing is that form and redirecting to another page should be done by clicking on submit. Please help me to figure out where I am wrong. Also I forgot to mension I'm using XAMPP, session.use_cookies and session.use_trans_sid are enabled
answer count: 3
has answer: http://stackoverflow.com/a/28477782
possible better answer: http://stackoverflow.com/a/28477539
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28477782
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/28556017
has body: exact solution to your answer is below please copy n paste then check. Whats your effective rate? Month 1 Total Sales, Including Amex * Total Fees, less any terminal or rental fees * Month 2 Total Sales, Including Amex * Total Fees, less any terminal or rental fees * Month 3 Total Sales, Including Amex * Total Fees, less any terminal or rental fees *
type: Answer
answers question: http://stackoverflow.com/q/28555363
score: 0

http://stackoverflow.com/comment/45416934
has text: I'm literally going to report this as a Firefox bug.
type: Comment
score: 2
comment on: http://stackoverflow.com/q/28551889
type: QuestionComment

http://stackoverflow.com/comment/45264065
type: QuestionComment
type: Comment
has text: it goes to hide before it is clicked and so click event is not fired because it is not clicked
score: 0
comment on: http://stackoverflow.com/q/28469484

http://stackoverflow.com/comment/45380152
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28532565
score: 0
has text: I dont see **function**

http://stackoverflow.com/a/28489090
type: Answer
has body: There is a 'prettify source' option in the Sources pane, click that and then add the breakpoint.
answers question: http://stackoverflow.com/q/28449430
score: 0

http://stackoverflow.com/q/28474309
has comment: http://stackoverflow.com/comment/45272572
has comment: http://stackoverflow.com/comment/45272516
has comment: http://stackoverflow.com/comment/45272347
has comment: http://stackoverflow.com/comment/45272481
tagged with: javascript
type: Question
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45272386
has title: how do i use angular js routes for node js application
has body: I'm having a issue with routing with angular js when i'm using node js. Controller PATH public_html/dev/inquiry/js/controllers/poolController.js app.controller('poolController', ['$scope', '$http', function($scope, $http) { "use strict"; $http({ method: 'GET', url: '/api/pool' }). success(function(data, status, headers, config) { $scope.pools = data; }); }]); server.js PATH public_html/dev/inquiry/server.js var app = require('express')(); var http = require('http').Server(app); var obj = ['id':5]; app.get('/api/pool', function(req, res) { res.json(obj); }); http.listen(3000, function(){ console.log('listening on *:3000'); }); And I'm running server js by consoling this node /home/abcdef/public_html/dev/inquiry/server.js So far i got a empty response. what i missed here ?
has comment: http://stackoverflow.com/comment/45274921
tagged with: angularjs
has answer: http://stackoverflow.com/a/28474550
tagged with: node.js
has comment: http://stackoverflow.com/comment/45272653
has answer: http://stackoverflow.com/a/28475460
type: UnansweredQuestion

http://stackoverflow.com/q/28441025
tagged with: javascript
tagged with: jquery
upvote count: 7
favorite count: 0
linked to: http://stackoverflow.com/q/6421769
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/90429662
tagged with: safari
downvote count: 0
score: 7
has answer: http://stackoverflow.com/a/29605198
has title: Ignore Safari's Initial Page Load popstate
has body: I'm using pushState and generating the page view on popstate events based on the history.state of the current page. If there is no history.state I (hope) to reload the document. window.onpopstate = function(event) { if( window.history.state !== null ){ // page was ajax created and history created by pushState // recreate with ajax } else{ // page was loaded from server normally document.location.reload() } } At issue is Safari fires a popstate event on the initial page load. Chrome and Firefox fire popstate on the back/forward browser button. I want to ignore the initial load popstate event on Safari (ideally without setTimeout and without browser detection). Additionally, the site is a mix of links - some that will trigger pushState and some that will load normally from the server - so if a user is ten pages into navigation history and clicking the back button, the history will have a mix of pushState pages and non-pushState pages.
type: Question
has comment: http://stackoverflow.com/comment/90429709
answer count: 1

http://stackoverflow.com/comment/45338823
comment on: http://stackoverflow.com/a/28489218
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/70882/discussion-between-nate-and-haopei).
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45446218
has text: Well I'm 99% sure that the data is empty since nothing is added to the page through $('.latest').append(data.d);
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28565702

http://stackoverflow.com/a/28470211
has body: For it to be completely dynamic would involve calculating the height of the container, and the total height of the rows one by one as they are placed. When the total height of the rows exceeds the height of the container, then we know how many rows fit in a single container, and can render as many containers as we need, each with the maximum number of rows it can handle. This can be done using a callback on the top-level (stateful) component, this callback is passed down to the component which handles rendering individual rows, and is called after the row component has mounted. The callback then does the required calculations, then updates the state of the app with new values indicating the maximum number of rows to render per container. Here is the rough outline of how this would work: var App = React.createClass({ getInitialState: function(){ return { rowsToPlace: 1, maxRowsPerContainer: 1, calculateRows: true } }, cb: function(){ // passed down to Row component, handles calculating container/row heights // updates state as required }, render: function(){ // use state to incrementally render rows in to a single container // until we know how many fit return( &lt;div ClassName="app"&gt; {containersToRender} &lt;/div&gt; ); } }); var Container = React.createClass({ render: function(){ return( &lt;div className="container"&gt; &lt;div ClassName="module"&gt; {this.props.rows.map(function(row,i){ return &lt;Row data={row} key={i} cb={this.props.cb} calcRows={this.props.calcRows}/&gt; }.bind(this))} &lt;/div&gt; &lt;/div&gt; ); } }); var Row = React.createClass({ render: function() { return ( &lt;div className="row"&gt;{this.props.data.rowNum}&lt;/div&gt; ); }, componentDidMount: function(){ if(this.props.calcRows) { this.props.cb(); } } }); It's not elegant, and abuses the use of state to a degree that makes me squirmish, but here is a very rough js fiddle prototype of the above in action: http://jsfiddle.net/qhuksapm/ Change the max-height of .container in the CSS to …
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45281833
accepted answer of: http://stackoverflow.com/q/28467573
type: Answer
answers question: http://stackoverflow.com/q/28467573
score: 1
upvote count: 1

http://stackoverflow.com/comment/46116670
has text: It's not agmardt.org.nz but it is an additional subdomain site for that group, that has not been released yet.
comment on: http://stackoverflow.com/q/28542720
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/45312685
type: QuestionComment
has text: Thanks jfriend00. I will have to find another way then
comment on: http://stackoverflow.com/q/28496485
score: 0
type: Comment

http://stackoverflow.com/q/28589940
answer count: 1
downvote count: 0
tagged with: javascript
has title: Change transform-origin on already transformed element
tagged with: css
favorite count: 0
has body: A couple of other questions have been asked that are similar to this, but none of them had sufficient answers. I have a transformed element with a current transform origin. I want to change the transform origin of the element and then transform it again. The problem is that when I change the transform origin, the original transform is calculated based on the new transform origin and then the new transform takes place. I would like to know if there is a way to make the currently transformed element stay in its exact place while I change the transform origin and then transform the element based on the new origin. Check out this fiddle if my description is confusing. http://jsfiddle.net/justinbchristensen/a6reyd3t/1/ var rotateDiv = $('#rotate-div'); var rotation = 0; $('#rotate-btn').on('click', function() { rotation += 90; rotateDiv.css('transform', 'rotate(' + rotation + 'deg)'); }); $('#origin-btn').on('click', function() { rotateDiv.css('transform-origin', 'top right'); }); 1) Press To Rotate 2) Press To Change Transform Origin
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/44773977
has comment: http://stackoverflow.com/comment/68722388
upvote count: 5
has comment: http://stackoverflow.com/comment/75775762
type: Question
has comment: http://stackoverflow.com/comment/69498638
score: 5

http://stackoverflow.com/comment/45365632
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28524794
type: QuestionComment
has text: HAve you had a look at this ? https://github.com/gdbate/jquery-tweetbox

http://stackoverflow.com/comment/45341467
comment on: http://stackoverflow.com/q/28511321
type: Comment
score: 3
type: QuestionComment
has text: Since it's a submit button, the form gets submitted, and that reloads the page.

http://stackoverflow.com/a/28476017
has comment: http://stackoverflow.com/comment/45277088
downvote count: 0
has body: use event.stopPropagation(); instead of event.preventDefault();. Because events happening on child bubbles up to the parents so all the events bound on parents also gets executed. So to stop the event to bubble up to the parent you need to have event.stopPropagation() on child click events.
score: 1
has comment: http://stackoverflow.com/comment/45277030
upvote count: 1
has comment: http://stackoverflow.com/comment/45276789
has comment: http://stackoverflow.com/comment/45277101
has comment: http://stackoverflow.com/comment/45277140
answers question: http://stackoverflow.com/q/28475972
type: Answer
has comment: http://stackoverflow.com/comment/45277218

http://stackoverflow.com/a/29039567
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/28578712
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28578712
has comment: http://stackoverflow.com/comment/46321490
has body: On your part it looks fine, it's Google's problem. However, you can use a pre-rendering service, such as prerender.io. (It's free up to 250 pages). As for the translations, you need to provide a location for each language, such as site.com/en &amp; site.com/cn for Google to understand it's a multilingual site. (take a look here, there are other URL structures that Google understands - scroll down to URL structures) It looks like you are using angular-translate, so here's an extensive article on how to make it work: http://fadeit.dk/post/angularjs-seo-for-angular-translate

http://stackoverflow.com/comment/45447518
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28568727
has text: I have many lines like this...it would be a solution for a couple of lines, but I want a solution in .jshintrc file

http://stackoverflow.com/comment/45327419
type: QuestionComment
comment on: http://stackoverflow.com/q/28504001
score: 0
has text: In your second page, it seems like there is a conflict using `$`, if you are using jQueryNoConflict you should change `$` to `jQuery` or Am I wrong !
type: Comment

http://stackoverflow.com/a/55736438
has comment: http://stackoverflow.com/comment/98150996
has body: .k-grid td white-space: nowrap; text-overflow: ellipsis; max-width:150px; }
answers question: http://stackoverflow.com/q/28438632
type: Answer
score: 0

http://stackoverflow.com/comment/45351201
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28516330
has text: yes, the problem is the same. Didn't think of linking my problem to static files. newbie mistake I guess. Thanks again @t.niese
score: 0

http://stackoverflow.com/q/28558375
has comment: http://stackoverflow.com/comment/45431180
score: 0
answer count: 2
tagged with: angular-ui
tagged with: angularjs-ng-repeat
has body: Hi I am new to angular and facing a strange issue with an angular template. My template has code : {{nav.name}} {{item.name}} but here data-ng-click="showScrollAndGo(item.link) is not working. Though I have defined it in global scope like this: app.run(function($rootScope, $location) { $rootScope.showScrollAndGo = function (path) { alert(path) $rootScope.showSpinner = false; $location.path(path); } }) Any Idea where I am doing wrong.
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45431342
has answer: http://stackoverflow.com/a/28560087
has answer: http://stackoverflow.com/a/28560595
has comment: http://stackoverflow.com/comment/45431363
has title: data-ng-click not working in template with data-ng-href
has comment: http://stackoverflow.com/comment/45430821
has comment: http://stackoverflow.com/comment/45429973
type: Question
tagged with: angularjs-directive
tagged with: javascript
has comment: http://stackoverflow.com/comment/45431568

http://stackoverflow.com/q/28496249
favorite count: 0
has comment: http://stackoverflow.com/comment/45312234
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: -1
has comment: http://stackoverflow.com/comment/45312264
possible better answer: http://stackoverflow.com/a/28496610
answer count: 3
has title: Changing img src on click with javascript
has answer: http://stackoverflow.com/a/28496610
downvote count: 1
has comment: http://stackoverflow.com/comment/45312226
has answer: http://stackoverflow.com/a/28496687
has answer: http://stackoverflow.com/a/28496821
has comment: http://stackoverflow.com/comment/45313231
accepted answer: http://stackoverflow.com/a/28496687
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/45312138
has body: I need to change image when I click on it every time. I added full path even it's not working. &lt;script type="text/javascript"&gt; var imageon= document.getElementById("myElement"); function changeImage(){ if (imageon.src=="play1.gif"){ imageon.src="shutdown.png"; } else if (imageon.src== "shutdown.png") { imageon.src="play1.gif"; } }; &lt;/script&gt; &lt;img src="shutdown.png" id="myElement" onclick="changeImage();" style="width:95px"&gt;&lt;/img&gt; Javascript: var pullImage=document.getElementById("change"); function changeImage(){ if (pullImage.src=="C:\Users\Srinivas\Downloads\Compressed\attachments_2\play1.gif") { pullImage.src="C:\Users\Srinivas\Downloads\Compressed\attachments_2\stop1.png"; }; if (pullImage.src=="C:\Users\Srinivas\Downloads\Compressed\attachments_2\stop1.png"){ pullImage.src="C:\Users\Srinivas\Downloads\Compressed\attachments_2\play1.gif"; } };
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28470652
has answer: http://stackoverflow.com/a/28470667
has comment: http://stackoverflow.com/comment/45265828
tagged with: regex
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28470667
upvote count: 2
score: 1
downvote count: 1
type: Question
has title: search for the same number in the beginning and the end of a string
tagged with: javascript
has comment: http://stackoverflow.com/comment/45265807
answer count: 1
has comment: http://stackoverflow.com/comment/45266880
has body: I'm trying to write regexp to find a string who start and ends with the same number like so : 2aldkc2 &lt;---- 4alou4 &lt;---- edit , i forget to motion what i have tried so far : ^(\d).^([^h].*$) but this doesn't work
has comment: http://stackoverflow.com/comment/45265873
favorite count: 0

http://stackoverflow.com/q/28498807
has body: Is there some way to display the index – and see if it is working? Thanks! I'm building it at startup: // create a compound index if (Meteor.isServer) { Meteor.startup(function() { MyPix.files._ensureIndex({'metadata.tags': 1, 'original.name': 1, 'uploadedAt': -1}) }) }
has answer: http://stackoverflow.com/a/28525418
answer count: 3
tagged with: meteor
has answer: http://stackoverflow.com/a/28499399
score: 0
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28499388
tagged with: mongodb
has title: How test if _ensureIndex is working?
tagged with: javascript

http://stackoverflow.com/a/28471192
has body: Changing the JQuery part to: var number = prompt("number?"); var num_int = parseInt(number); var smack = new Array(num_int); //populating array with numbers 1 through num_int for (i = 0; i < smack.length; i++) { smack[i] = i+1; } //test again still working? smack.forEach(function(n1) { //going through each array element, checking for fizz/buzz if (n1 % 3 === 0 && n1 % 5 === 0) { $('#hard').append(" fizz-buzz "); } else if (n1 % 3 === 0) { $('#hard').append(" fizz "); } else if (n1 % 5 === 0) { $('#hard').append(" buzz "); } else { $('#hard').append(" "+n1+" "); } }); //end of forEach would help. The changes here is inside the if conditions. You append your li to the ul each time and you will have your answers in the list. Hope this helped.
type: Answer
answers question: http://stackoverflow.com/q/28470646
score: 0

http://stackoverflow.com/a/28505398
has comment: http://stackoverflow.com/comment/45401536
has comment: http://stackoverflow.com/comment/45333936
has body: It's what jsonmurphy said above, but to expand a little, the resolves get passed into the controller as dependencies. So with how your controller is defined you could change the resolve to the following and it should work. resolve : { flight : function () { return { data : flightData.flight(id) }; } } Since flightData.flight(id) is returning a promise and you want the resolve to wait for it, try the following: resolve: { flight: function(){ return flightData.flight(id); } }
has comment: http://stackoverflow.com/comment/45333391
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28504011
has comment: http://stackoverflow.com/comment/45406096
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45484637
has comment: http://stackoverflow.com/comment/45401480
accepted answer of: http://stackoverflow.com/q/28504011

http://stackoverflow.com/comment/45235822
score: 1
type: AnswerComment
has text: Same substitution as the other line, instead of `$("#devGV tr:eq(" + i + ")")` just `gv.find("tr:eq(" + i + ")")`
type: Comment
comment on: http://stackoverflow.com/a/28453709

http://stackoverflow.com/comment/45426671
comment on: http://stackoverflow.com/a/28557309
type: AnswerComment
score: 0
type: Comment
has text: it breaks with error : Runtime Error JavaScript: Failed to set property "onkeyup" reference value is not defined or is NULL"

http://stackoverflow.com/a/28516863
answers question: http://stackoverflow.com/q/28516527
downvote count: 0
score: 1
upvote count: 1
type: Answer
has body: Turn it into a filter, like this. .filter('addTime', function(){ return function(current_date, add_minutes){ return (current_date.getTime() + 1000*60*add_minutes); } }); Then in html file: where add_minutes is a variable defined in your controller(as minutes). Now you can use this filter anywhere that you like, always aim for DRY. See http://plnkr.co/edit/4aY8NRSVLjqlrAqcA3YL?p=preview

http://stackoverflow.com/comment/45458716
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28558735
has text: I think that does work! However for that IF statement, I couldn't get a regular expression to work in there. I ended up doing this; do you think it's the best solution for testing a RegEx in there? (in this example I'd be finding all cells that end in a capital 'A'): ``var re = new RegExp('A$','gi'); for (var row = 0; row < values.length; row++) { for(var column = 0;column<values[row].length;column++){ if (re.exec(values[row][column])){ toDelete.push(row); } } }``
type: AnswerComment

http://stackoverflow.com/comment/45247323
has text: YES ! Oh my god I'm so lame ! I couldn't think of the word "hash"...
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28460493

http://stackoverflow.com/q/28565702
tagged with: javascript
has answer: http://stackoverflow.com/a/28565882
favorite count: 0
tagged with: ajax
answer count: 3
tagged with: asp.net
has title: Check if function returns any data in Ajax and WebMethod
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28567354
has comment: http://stackoverflow.com/comment/45442150
upvote count: 1
has answer: http://stackoverflow.com/a/28565780
score: 1
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/45446218
downvote count: 0
has body: I've developed the following system that returns endless scroll data on an aspx page. It works perfectly well. However I have a small problem checking whether the database has reached the end row and no data is returned. With the following code the javascript function keeps on calling the webmethod everytime the page scroll hits the bottom although there is no data to return. How can I check there is no data to avoid those meaningless function calls? $(document).ready(function () { var offset = 0; var fetch = 30; function Load() { $.ajax({ type: "POST", url: "UserControls/uc_functions.aspx/LoadLatest", data: "{offset :" + offset + ", fetch: " + fetch + "}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { if (data != "") { $('.latest').append(data.d); } else {alert("no data"); completed = true; } //I never get this alert even when there is no data returned from the database } }) }; $(window).scroll(function () { if ($(window).scrollTop() + $(window).height() &gt; $(document).height() - 10) { Load(offset, fetch); offset = offset + fetch; } }); }); [WebMethod] public static string LoadLatest(int offset, int fetch) { var LoadSql = db.Query("Exec dbo.SD_unionServices @0, @1", offset, fetch);"); foreach (var item in LoadSql) { Load_sb.Append(item.title + "&lt;br /&gt;"); } if(LoadSql.Count() &gt; 0) return Load_sb.ToString(); else return string.Empty; } UPDATE To check whether the data is empty or not I used data.d instead of data if (data.d != "") { $('.latest').append(data.d); } Instead of if (data != "") { $('.latest').append(data.d); }

http://stackoverflow.com/a/28542968
type: Answer
answers question: http://stackoverflow.com/q/28542326
has body: If you are not using jQuery, you can use pure JavaScript to achieve the desired result. Attach a change event to the select element, then use event.target.value to find out which option was selected. var select = document.getElementById('IdType'); var options = select.getElementsByTagName('option'); var label = document.getElementById('lbIDValue'); function selectChanged(e) { var value = e.target.value; var option; for (var i = 0; i &lt; options.length; i++) { if (options[i].value === value) { option = options[i]; } } label.innerText = option.innerText; } select.addEventListener('change', selectChanged, false); See jsFiddle - http://jsfiddle.net/60dsnhrt/ Also the html was invalid - it should have a closing select
score: 0

http://stackoverflow.com/a/39262263
type: Answer
has body: I added class="external nav", and that allowed my links to work in the navbar.
score: 0
answers question: http://stackoverflow.com/q/28554349

http://stackoverflow.com/q/28574032
tagged with: ruby-on-rails
score: 3
has answer: http://stackoverflow.com/a/49158488
tagged with: syntax-highlighting
type: Question
answer count: 2
has title: How to use highlight.js with Rails?
tagged with: javascript
has body: I am trying to use syntax highlighting with highlight.js in my rails application. The instructions for highlight.js are below (https://github.com/isagalaev/highlight.js): The bare minimum for using highlight.js on a web page is linking to the library along with one of the styles and calling initHighlightingOnLoad: I'm not certain where the above three should be placed. I've tried several possibilities. Presumably the first of the three, < link rel ... >, should be placed in the head of views/application/application.html.erb. And I think that the second of the three, < script src=... >, should be placed at the bottom of the file that contains the code that will be highlighted. I thought the third of the three, < script ... >, should go in the application.js file. In any case, I've tried this and several other possibilities, but I haven't been able to get the desired code highlighted in Ruby.
favorite count: 0
downvote count: 1
upvote count: 4
has answer: http://stackoverflow.com/a/28574046
type: UnansweredQuestion

http://stackoverflow.com/a/28479528
score: 0
type: Answer
has body: I think you should inform $.ajax(), that data is in JSON format, otherwise you will get string. Or parse string to JSON: dchart.series[0].setData(JSON.parse(msg[0].data));
answers question: http://stackoverflow.com/q/28475796

http://stackoverflow.com/comment/45490697
comment on: http://stackoverflow.com/a/28586918
has text: That's the issue actually, I needed to compare fields while doing some calculations. I'll try doing an aggregation, thanks!
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28467587
upvote count: 1
has body: You're passing the actions object as the second parameter instead of the third. This: var Posts = $resource('/api/posts', { categories: {method:'GET', isArray:true, url:'/api/posts/categories'} }); Should be like this: var Posts = $resource('/api/posts', {}, { categories: {method:'GET', isArray:true, url:'/api/posts/categories'} }); https://docs.angularjs.org/api/ngResource/service/$resource
downvote count: 0
answers question: http://stackoverflow.com/q/28467431
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45264793
has comment: http://stackoverflow.com/comment/45294113
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/28467431

http://stackoverflow.com/comment/45369533
type: QuestionComment
has text: @user3082412 just move checking inside _countUP_
score: 1
comment on: http://stackoverflow.com/q/28526805
type: Comment

http://stackoverflow.com/comment/45495741
type: AnswerComment
has text: thanks for the response. This now looks like it does the trick for me
type: Comment
comment on: http://stackoverflow.com/a/28548179
score: 0

http://stackoverflow.com/a/28576174
has body: I used stringify for comparison so the code doesn't change for a generic "something inside an object property" (ie the content of "groups" - or whatever) - performance could be better if you use direct compares. var array1 = [ {"name":"a","groups":["xxx","yyy"]}, {"name":"abc","groups":["xxx","yyy"]}, {"name":"abcd","groups":["zzz","xxx","yyy"]} ]; var testgroup = ["xxx", "yyy"]; var tg = JSON.stringify(testgroup); var filteredArray = array1.filter(function (el) { if (JSON.stringify(el.groups) == tg) return el; }); alert(JSON.stringify(filteredArray));
answers question: http://stackoverflow.com/q/28575949
score: 0
has comment: http://stackoverflow.com/comment/45461567
type: Answer
has comment: http://stackoverflow.com/comment/45461769
has comment: http://stackoverflow.com/comment/45462113
has comment: http://stackoverflow.com/comment/45461837
has comment: http://stackoverflow.com/comment/45461927
has comment: http://stackoverflow.com/comment/45462545

http://stackoverflow.com/a/28492127
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45305034
downvote count: 0
has comment: http://stackoverflow.com/comment/45309804
has comment: http://stackoverflow.com/comment/45341908
has comment: http://stackoverflow.com/comment/45305011
has comment: http://stackoverflow.com/comment/45308935
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28492114
has body: You can use .attr() like below to get all elements with data-href attribute and it that value as the value of the href attribute. $('a[data-href]').attr('href', function () { return $(this).attr('data-href') })
answers question: http://stackoverflow.com/q/28492114

http://stackoverflow.com/comment/45422062
has text: @Spokey logged the JSON.stringify()
score: 0
comment on: http://stackoverflow.com/q/28541866
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28582105
has comment: http://stackoverflow.com/comment/45472720
upvote count: 1
has body: You can add media queries in javascript too. You just need to change the 500px to whatever you want and add the code into the if you want to use. // media query event handler if (matchMedia) { var mq = window.matchMedia("(min-width: 500px)"); mq.addListener(WidthChange); WidthChange(mq); } // media query change function WidthChange(mq) { if (mq.matches) { // window width is at least 500px } else { // window width is less than 500px } } } Hope this helps, you can read more about it here.
has comment: http://stackoverflow.com/comment/45472495
has comment: http://stackoverflow.com/comment/45472668
downvote count: 0
has comment: http://stackoverflow.com/comment/45472525
score: 1
answers question: http://stackoverflow.com/q/28581630
type: Answer

http://stackoverflow.com/q/28592717
answer count: 1
tagged with: javascript
tagged with: asp.net
has answer: http://stackoverflow.com/a/28593908
has comment: http://stackoverflow.com/comment/45492310
tagged with: visual-studio-2013
type: UnansweredQuestion
type: Question
tagged with: c#
tagged with: webforms
has body: We have an old web project written with technology ASP.NET Web Forms. This website has a usual registration form, where user is required to fill in a phone number. I want to check on the run that this phone number is unique i.e. no other registered user has already used this phone number. Of course there is no need to send the whole form to the back-end, good example of this behavior could be how gmail checks if the email your are typing is free for registration. I tried to adapt an example from microsoft and use two standart ajax components: ScriptManager and UpdatePanel. My crazy implementation is: input-field "phonenumber" looses focus so this triggers "checkPhoneNumber" javascript function "checkPhoneNumber" clicks the button "ValidatePhoneNumber" Back-end writes "Valid/Invalid phone number" in a label Probably this is extremly bad and compicated practise, but somehow it works so far. The problem is that I want to make more changes on the webpage with help of javascript (add&remove some classes to visualize the error/success) in "onchange" event of the label that never runs. Is it because the change was made by server and not by user? Code in "registration.aspx": <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <asp:Label ID="ValidationLabel" runat="server" Text="" onchange="validationLabelOnChange"></asp:Label> <asp:Button ID="btnValidatePhoneNumber" runat="server" OnClick="btnValidatePhoneNumber_Click" Text="Button" /> </asp:UpdatePanel> Code in "registration.aspx.cs": protected void btnValidatePhoneNumber_Click(object sender, EventArgs e) { //Validation of phone number will be added here ValidationLabel.Text = "Refreshed at " + DateTime.Now.ToString(); } I appreciate if you can propose a better solution! I guess it could work even without UpdatePanel.
has title: "Gmail style" partial update of a web form
score: 0

http://stackoverflow.com/a/28494839
has comment: http://stackoverflow.com/comment/104934062
has comment: http://stackoverflow.com/comment/61050837
has body: Don't use the classes to access the date. there are ways to get the date and below is one where you can do it when you initialize the calendar , Using that you can get the date , month and year separately. $('#calendar').fullCalendar({ dayClick: function(date, jsEvent, view) { alert('Clicked on: ' + date.getDate()+"/"+date.getMonth()+"/"+date.getFullYear()); }, });
answers question: http://stackoverflow.com/q/28493618
type: Answer
has comment: http://stackoverflow.com/comment/104871675
accepted answer of: http://stackoverflow.com/q/28493618
has comment: http://stackoverflow.com/comment/104895213
has comment: http://stackoverflow.com/comment/61035803
has comment: http://stackoverflow.com/comment/97264324
has comment: http://stackoverflow.com/comment/97247904
score: 10
upvote count: 13
downvote count: 3
type: AcceptedAnswer

php
tags question: http://stackoverflow.com/q/28484448
tags question: http://stackoverflow.com/q/28444364
tags question: http://stackoverflow.com/q/28475494
tags question: http://stackoverflow.com/q/28554682
tags question: http://stackoverflow.com/q/28592339
tags question: http://stackoverflow.com/q/28591428
tags question: http://stackoverflow.com/q/28528526
tags question: http://stackoverflow.com/q/28555463
tags question: http://stackoverflow.com/q/28557874
tags question: http://stackoverflow.com/q/28478702
tags question: http://stackoverflow.com/q/28468747
tags question: http://stackoverflow.com/q/28499857
tags question: http://stackoverflow.com/q/28558217
tags question: http://stackoverflow.com/q/28554445
tags question: http://stackoverflow.com/q/28576441
tags question: http://stackoverflow.com/q/28548476
tags question: http://stackoverflow.com/q/28438822
tags question: http://stackoverflow.com/q/28546534
tags question: http://stackoverflow.com/q/28485298
tags question: http://stackoverflow.com/q/28457484
tags question: http://stackoverflow.com/q/28462345
tags question: http://stackoverflow.com/q/28587358
tags question: http://stackoverflow.com/q/28548682
tags question: http://stackoverflow.com/q/28504403
tags question: http://stackoverflow.com/q/28577907
tags question: http://stackoverflow.com/q/28562343
tags question: http://stackoverflow.com/q/28478201
tags question: http://stackoverflow.com/q/28494579
tags question: http://stackoverflow.com/q/28529724
tags question: http://stackoverflow.com/q/28459924
tags question: http://stackoverflow.com/q/28457410
tags question: http://stackoverflow.com/q/28527126
tags question: http://stackoverflow.com/q/28564060
tags question: http://stackoverflow.com/q/28450932
tags question: http://stackoverflow.com/q/28445571
tags question: http://stackoverflow.com/q/28480580
tags question: http://stackoverflow.com/q/28495544
tags question: http://stackoverflow.com/q/28564065
tags question: http://stackoverflow.com/q/28578776
tags question: http://stackoverflow.com/q/28591136
tags question: http://stackoverflow.com/q/28515255
tags question: http://stackoverflow.com/q/28466694
tags question: http://stackoverflow.com/q/28449124
tags question: http://stackoverflow.com/q/28567281
tags question: http://stackoverflow.com/q/28515956
tags question: http://stackoverflow.com/q/28444576
tags question: http://stackoverflow.com/q/28546474
tags question: http://stackoverflow.com/q/28496588
tags question: http://stackoverflow.com/q/28555363
tags question: http://stackoverflow.com/q/28451900
tags question: http://stackoverflow.com/q/28524433
tags question: http://stackoverflow.com/q/28458052
tags question: http://stackoverflow.com/q/28575591
tags question: http://stackoverflow.com/q/28437070
tags question: http://stackoverflow.com/q/28537172
tags question: http://stackoverflow.com/q/28577532
tags question: http://stackoverflow.com/q/28585823
tags question: http://stackoverflow.com/q/28490369
tags question: http://stackoverflow.com/q/28458803
tags question: http://stackoverflow.com/q/28528711
tags question: http://stackoverflow.com/q/28447335
tags question: http://stackoverflow.com/q/28570392
tags question: http://stackoverflow.com/q/28559908
tags question: http://stackoverflow.com/q/28516361
tags question: http://stackoverflow.com/q/28451065
tags question: http://stackoverflow.com/q/28492328
tags question: http://stackoverflow.com/q/28564611
tags question: http://stackoverflow.com/q/28580223
tags question: http://stackoverflow.com/q/28488734
tags question: http://stackoverflow.com/q/28588379
tags question: http://stackoverflow.com/q/28538998
tags question: http://stackoverflow.com/q/28513783
tags question: http://stackoverflow.com/q/28522799
tags question: http://stackoverflow.com/q/28439495
tags question: http://stackoverflow.com/q/28572520
tags question: http://stackoverflow.com/q/28540895
tags question: http://stackoverflow.com/q/28471262
tags question: http://stackoverflow.com/q/28487789
tags question: http://stackoverflow.com/q/28469990
tags question: http://stackoverflow.com/q/28562128

http://stackoverflow.com/q/28470732
has comment: http://stackoverflow.com/comment/45301185
type: UnansweredQuestion
upvote count: 1
type: Question
has title: Prevent d3 brush from firing a click event
score: 1
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: dom-events
favorite count: 0
has answer: http://stackoverflow.com/a/57134151
has comment: http://stackoverflow.com/comment/45270529
has body: D3 brush fires a strange click event on "brushend" even when the brush is not empty. I tried d3.event.stopPropagation() and d3.event.preventDefault() but it doesn't work. Any ideas? Here is a JSfiddle for demonstration . svg.append("rect") .attr("width", 200) .attr("height", 200) .style("stroke", "black") .style("fill", "none"); var brush_elem = d3.svg.brush() .x(d3.scale.linear().range([0, 200])) .on("brushend", function(){ d3.event.sourceEvent.stopPropagation(); }); svg.append("g").call(brush_elem) .selectAll("rect") .attr("height", 200);
has comment: http://stackoverflow.com/comment/45312670
tagged with: d3.js

http://stackoverflow.com/comment/84696351
type: AnswerComment
has text: Yes, or event better, use `map.setOptions()` if you need to change multiple options at once.
type: Comment
comment on: http://stackoverflow.com/a/28500306
score: 1

http://stackoverflow.com/q/28442910
has answer: http://stackoverflow.com/a/28443928
answer count: 1
tagged with: javascript
tagged with: dom-events
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Calendar Manipulation to only the cells with a Date
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion
score: 0
has body: I have a basic calendar that I got from here http://www.dynamicdrive.com/dynamicindex7/basiccalendar_dev.htm I want to modify the calendar by adding an svg image to only the cells that have a date in them. I commented the line in the JavaScript where i think needs manipulation. Its the 5th line from the bottom. I tried adding an Id to the 'td' on that line but that affected the cells that don't have dates in them as well. What needs to be done in order to isolate the cells that have a date in them? Any ideas? Appreciate any help. JavaScript var todaydate = new Date() var curmonth = todaydate.getMonth() + 1 //get current month (1-12) var prevmonth = todaydate.getMonth() - 1 //get current month (1-12) var curyear = todaydate.getFullYear() //get current year document.write(buildCal(curmonth, curyear, "main", "month", "daysofweek", "days", 1)); function buildCal(m, y, cM, cH, cDW, cD, brdr) { var mn = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; var dim = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; var oD = new Date(y, m - 1, 1); //DD replaced line to fix date bug when current day is 31st oD.od = oD.getDay() + 1; //DD replaced line to fix date bug when current day is 31st var todaydate = new Date() //DD added var scanfortoday = (y == todaydate.getFullYear() &amp;&amp; m == todaydate.getMonth() + 1) ? todaydate.getDate() : 0 //DD added dim[1] = (((oD.getFullYear() % 100 != 0) &amp;&amp; (oD.getFullYear() % 4 == 0)) || (oD.getFullYear() % 400 == 0)) ? 29 : 28; var t = '&lt;div class="' + cM + '"&gt;&lt;table class="' + cM + '" cols="7" cellpadding="0" border="' + brdr + '" cellspacing="0"&gt;&lt;tr align="center"&gt;'; t += '&lt;td colspan="7" align="center" class="' + cH + '"&gt;' + mn[m - 1] + ' - ' + y + '&lt;/td&gt;&lt;/tr&gt;&lt;tr align="center"&gt;'; for (s = 0; s &lt; 7; s++) t += '&lt;td class="' + cDW + '"&gt;' + "SMTWTFS".substr(s, 1) + '&lt;/td&gt;'; t += '&lt;/tr&gt;&lt;tr al…
type: Question

http://stackoverflow.com/comment/45382446
score: 0
has text: @giraffeslacks One thing I thought of was the fact that you are passing the callback by value and not by reference. When you were calling requireLogin, without parentheses, that is by reference; you are not calling the function, but allowing the Router to do that later. Calling requireLogin(), with parentheses, is by value; so you would be getting the return value of requireLogin. And at that time the **this** inside that function would be the Window context. So the question would be: how would you call requireLogin as a reference **and** pass values? I really don't know.
type: Comment
comment on: http://stackoverflow.com/a/28532397
type: AnswerComment

http://stackoverflow.com/comment/45277944
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28476156
has text: yes and i can have more than two categories
score: 0

checkbox
tags question: http://stackoverflow.com/q/28565049
tag name: checkbox
tags question: http://stackoverflow.com/q/28468323
tags question: http://stackoverflow.com/q/28546112
tags question: http://stackoverflow.com/q/28439607
tags question: http://stackoverflow.com/q/28558572
tags question: http://stackoverflow.com/q/28459392
tags question: http://stackoverflow.com/q/28520329
tags question: http://stackoverflow.com/q/28454605
tags question: http://stackoverflow.com/q/28562029
tags question: http://stackoverflow.com/q/28477687
tags question: http://stackoverflow.com/q/28561430
tags question: http://stackoverflow.com/q/28561406
tags question: http://stackoverflow.com/q/28577626
type: Tag
tags question: http://stackoverflow.com/q/28588794
tags question: http://stackoverflow.com/q/28485547

http://stackoverflow.com/comment/45390472
type: Comment
comment on: http://stackoverflow.com/q/28536472
score: 1
has text: Do you really have a controller named `QueryControllerController`? ALWAYS use the helpers to construct your url's `url: '@Url.Action("DecryptMessage", "QueryController")',`
type: QuestionComment

http://stackoverflow.com/a/28551621
accepted answer of: http://stackoverflow.com/q/28527883
score: 2
has comment: http://stackoverflow.com/comment/45443670
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45425942
type: Answer
has comment: http://stackoverflow.com/comment/45442555
has comment: http://stackoverflow.com/comment/45439591
answers question: http://stackoverflow.com/q/28527883
upvote count: 2
has comment: http://stackoverflow.com/comment/45501036
has body: This isn't the intended use and there is no support for it. goog.provide/require is a dependency management scheme. A file that declares a "goog.provide", can be required by declaring it with a goog.require. For production use, the dependencies would be preloaded or bundled. Unless you want to hack Closure, your only option is to host it with your sources.

http://stackoverflow.com/comment/45210922
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28440542
has text: your fiddle works perfectly for me... (edited to say, I stand corrected, it does break in win/safari)
score: 0

http://stackoverflow.com/a/28447802
score: 6
type: Answer
upvote count: 6
answers question: http://stackoverflow.com/q/28446168
accepted answer of: http://stackoverflow.com/q/28446168
has body: I think you need to escape your \n as \\n. Right now, it's getting parsed as a literal newline in the command, which is messing it up.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45457612
comment on: http://stackoverflow.com/q/28573965
score: 0
has text: the default syntax closes when I click on the popover. any syntax really, i've tried it all.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28474060
tagged with: javascript
has answer: http://stackoverflow.com/a/28476346
answer count: 1
downvote count: 0
favorite count: 0
has title: Require js caches the setup file which sets up the urlArgs bust
tagged with: requirejs
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/28476346
upvote count: 3
tagged with: caching
type: Question
has body: I have a knockout/require app and am struggling with the caching of one particular file. Sadly it is the file that busts the cache for all other javascript files. The setup may be slightly odd: Each view simply binds a knockout view model. It requires the require library and the main script for the particular area of the system: &lt;script data-main="scripts/user" src="~/Scripts/lib/require.js"&gt;&lt;/script&gt; The scripts/user.js file required above requires the common file (containing the require setup) and the main viewmodel script: require(['./Common'], function (common) { require(['userMain']); }) The scripts/user/userMain.js file binds the viewmodel and requires anything needed at the view level (such as custom binding handlers). define(function (require) { require(['ko', 'userViewModel'], function (ko, userViewModel) { var userVm = new userViewModel(false); userVm.initialise(); // bound to the wrapper to stop jquery dialog bindings being applied twice ko.applyBindings(userVm, document.getElementById('pageWrapper')); }); }); Then we have common.js: require.config({ baseUrl: './', paths: { 'userMain': './Scripts/user/Main', 'userAjax': './Scripts/user/userAjax', 'userBasicDetails': './Scripts/user/userBasicDetails', 'userExchangesModel': './Scripts/user/userExchangesModel', 'userModel': './Scripts/user/userModel', 'userReportAccessModel': './Scripts/user/userReportAccessModel', 'usersModel': './Scripts/user/usersModel', 'userViewModel': './scripts/user/userViewModel', ... etc , urlArgs: "bust=" + (new Date()).getTime() each script within the folder then requires anything it needs within its own model. The script structure is then setup as so: scripts\common.js scripts\user.js scripts\user\main.js scripts\user\userAjax scripts\user\etc... This setup allows me to reference scripts from other folders without specifying where the file is anywhere other than in common.js. The downside is that all js files have a reference in common but I can live with that. As an …

http://stackoverflow.com/q/28467941
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45263247
has body: I am using i frame based mechanism to submit my login from and it is working fine on each and every browser except Safari (5.1.7). Here is the HTML form I am using to submit the information <form:form action="${loginActionUrl}" method="post" commandName="loginForm" id="header-signin" target="loginFrame" name="header-signin"> </form:form> Here are the script I am using to submit form using JQuery document.getElementById('header-signin_j_password').onkeydown = function(event) { if (event.keyCode == 13) { triggerSigin(this.form.id); } } function triggerSigin(formID){ if(validateSigninForm(formID)){ $( "#"+formID).submit(); } } Everything is simple and without any complex logic, I have tested it on all available browser and it was working fine, but on the Safari, it is behaving in a very strange manner If I hit the enter button after entering the password, sign in process is working perfectly fine. If I fill each and every field and click on the login button, Safari is opening up a new tab and form is getting submitted to server with username and password field as null. If I close the extra window and again click on the sign in button, everything is working fine till I sign out and again try to sign in to the system. I am not sure why Safari is opening a new browser window and why the form data is being submitted as null, this behavior is only happening for the first time and subsequent click on signing button is working perfectly fine till I close the browser and open it again. Can any one help me to understand this issue Final output User Name Password Forgot password? I am not sure Why this is working in Safari when I am hitting enter button and why it is not working when clicking on the button. This issue is for the first click, once I close the other window and again click on the login button, everything is working fine in Safari also.
has comment: http://stackoverflow.com/comment/45384110
answer count: 3
has answer: http://stackoverflow.com/a/28543579
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has title: Strange behaviour on Safari when trying to submit form using iframe
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45262632
has answer: http://stackoverflow.com/a/28651593
upvote count: 6
tagged with: safari
has comment: http://stackoverflow.com/comment/45261422
tagged with: iframe
has comment: http://stackoverflow.com/comment/45384502
downvote count: 1
type: Question
score: 5
has answer: http://stackoverflow.com/a/28663661

http://stackoverflow.com/comment/55612116
type: AnswerComment
score: 13
comment on: http://stackoverflow.com/a/28859693
type: Comment
has text: Didn't work for me, but `rm -r node_modules` then `npm install` did the job

http://stackoverflow.com/comment/45249553
score: 0
type: Comment
type: QuestionComment
has text: Well, it looks like it should work. How about a demo of the problem? http://jsfiddle.com
comment on: http://stackoverflow.com/q/28461780

http://stackoverflow.com/comment/45344176
score: 0
has text: make sure that you have included the plugin script on your page
comment on: http://stackoverflow.com/q/28512909
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/50688226
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28517065
score: 2
has text: This worked for me! I'm making a telepresence robot and already have the remote controls listening on a UDP port for drive commands (that eventually sends it over Serial to the iRobot Create). So with this I was able to put W A S D keys on my web page and call the server side node.js function to send a UDP message to that command server! Thanks!

http://stackoverflow.com/q/28469454
type: Question
has comment: http://stackoverflow.com/comment/45296652
has answer: http://stackoverflow.com/a/28487316
tagged with: javascript
has title: Bootstrap 3 Adding text from a button click and display in new tab
score: 0
answer count: 1
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I am using Bootstrap 3 and trying to populate a form in one tab with the text that is generated when clicking a link in another tab. Using standard tab setup. When the user selects a schedule in one Tab there is a Book Now that correctly guides them to the Form.tab that I need them to fill out. The problem is that it is missing the string I need in the message field. So how do I get that done? I've tried jquery and had no luck so far. Would appreciate a helping hand on this one. EDIT Solved thanks to a friend! The solution was using in first running $(document).ready(function () to be able to manipulate the page, and $('#someComponentsText').val($(this).text()); }) to grab the text I needed and insert in into the component I required. I made a simple Bootply example showing the jquery required... view here http://www.bootply.com/DPoaz49nSb
tagged with: twitter-bootstrap

http://stackoverflow.com/comment/45304418
score: 1
comment on: http://stackoverflow.com/q/28491815
type: QuestionComment
has text: Why do you add the script tag dynamically?
type: Comment

exception
tags question: http://stackoverflow.com/q/28507102
tags question: http://stackoverflow.com/q/28530083
type: Tag
tag name: exception
tags question: http://stackoverflow.com/q/28556398

http://stackoverflow.com/q/28438951
answer count: 1
type: UnansweredQuestion
tagged with: generated
has title: Generate goo.gl short URL for current URL automaticlly
has body: I'm new to Google Developer Console and JavaScript too. I want to auto generate a short url for current page url. I have this working lines with onclick event attribute but I want it generated automaticlly after the page is loaded: HTML: google link display here create shorten link JS: function makeShort() { var pageURL=window.location.href; var request = gapi.client.urlshortener.url.insert({ 'resource': { 'longUrl': pageURL } }); request.execute(function(response) { if(response.id != null) { str ="Short URL: "+response.id+" "; document.getElementById("output").innerHTML = str; } else { alert("error: creating short url"); } }); } $(window).load(function load() { gapi.client.setApiKey('AAAAaaaa_XXXXXXxxxx'); //here my API KEY gapi.client.load('urlshortener', 'v1',function(){}); }); I suppose the function should look like this: shortThis(window.location.href); or shortThis('https://www.google.com');
has answer: http://stackoverflow.com/a/28439309
type: Question
tagged with: javascript
tagged with: goo.gl
score: 0
linked to: http://stackoverflow.com/q/12696704
tagged with: window.location

http://stackoverflow.com/q/28538455
type: UnansweredQuestion
tagged with: http-status-code-404
type: Question
has comment: http://stackoverflow.com/comment/45391079
has body: In angularjs is it possible to handle &amp; resolve 404 Views? I want to achieve conditional view rendering depending on my client, I have a view something like this: &lt;div ng-include="'assets/stackoverflow/breadcrumb.html'"&gt;&lt;/div&gt; so if suppose the above returns 404, it should try this: &lt;div ng-include="'assets/default/breadcrumb.html'"&gt;&lt;/div&gt; This approach may be wrong, but I just need a way to handle views 404, I have an interceptor which actually catches 404 requests but how do I resolve it and send it again? app.factory('RequestResponseInterceptor', ['$q', '$rootScope', '$location', function($q, $rootScope, $location) { var loadingCount = 0; return { responseError: function(response) { if (response.status === 404) { //Change URL and request again } return $q.reject(response); } }; } ]);
has title: Angularjs resolve 404 views
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28541884
linked to: http://stackoverflow.com/q/20836374
tagged with: ng-view
has comment: http://stackoverflow.com/comment/45391478
tagged with: angularjs

http://stackoverflow.com/a/56050715
type: Answer
score: 2
downvote count: 0
has body: Usually famous linting styles doesn't allow, for e.g. airbnb standard, so I would say it is not really a big deal and since it is not, I'd say it is better to stick to the warnings of the others. Why not using comma declarations? So you don't have to worry about issues when a ; is mistakenly used instead of ,, which would result in a variable becoming global instead of scoped. var t2 = 20; const foo = function(){ var t1 = 2; // assume that you by mistake did this t2 = 2; } foo(); console.log(t2); Note that a small mistake like that would result in the t2 having a different value when printed, the issue is JS doesn't care if it makes no since, it assumes that you knew what you are doing and it'll change the global variable from 20 to 2. WARNING global variables are evil don't use them, this is just an example also different let, const, and var, need to be grouped together, which isn't a big deal but again since JS is amazing at failing silently you have to be careful. the only benefit that I see so far for using chain declarations is that you would reduce the size of the JS file over the wire, and with the modern internet speed that is not a big plus.
upvote count: 2
answers question: http://stackoverflow.com/q/28585900

http://stackoverflow.com/a/28548543
type: Answer
has body: i hope i got your question right, but from the link you attached it seems that you have a problem with the first click on the menu button and that later on confuse the dimmer status. in your HTML you have the nav section &lt;section class="nav-animate"&gt; &lt;nav style="height:auto;" class="x-nav-wrap mobile cbp-spmenu cbp-spmenu-vertical cbp-spmenu-push"&gt; And your css sets .nav-animate to not be displayed, try removing that setting and instead set the inner nav tag to display:none;
score: 0
answers question: http://stackoverflow.com/q/28547971

http://stackoverflow.com/comment/45459762
has text: views are called using jade
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28574942

http://stackoverflow.com/comment/45371851
type: QuestionComment
comment on: http://stackoverflow.com/q/28528244
score: 0
has text: I Love Camel Case Typing. lol
type: Comment

http://stackoverflow.com/q/28512552
type: Question
tagged with: javascript
score: 0
has title: One of four bar charts showing up, legend missing D3
answer count: 1
has answer: http://stackoverflow.com/a/28513213
tagged with: d3.js
type: UnansweredQuestion
has body: UPDATED Problem a) Only one of my bar charts is showing after I switched a variable var csvData in my scripts.js to the real data from the dummy data. The previous data referenced states and demographics, which has now been switched to food and their prices. scripts.js (UPDATED, chart still not showing up) $(function() { $("#placeholder").remove(); var margin = {top: 60, right: 20, bottom: 30, left: 40}, width = 960 - margin.left - margin.right, height = 500 - margin.top - margin.bottom; // X is the horizontal axis var x0 = d3.scale.ordinal() // ordinal for non quantitative scales, like names, categories .rangeRoundBands([0, width], .1); // Width of each individual bar? var x1 = d3.scale.ordinal(); var y = d3.scale.linear() .range([height, 0]); // Bar chart colors var color = d3.scale.ordinal() .range(["#001F4C", "#003D99", "#005CE6", "#0066FF", "#3385FF", "#80B2FF", "#CCE0FF", "#E6F0FF", "#E6EBFA"]); var xAxis = d3.svg.axis() .scale(x0) .orient("bottom"); var yAxis = d3.svg.axis() .scale(y) .orient("left") // Where the Y axis goes, you'll want it on the left .ticks(8) .tickValues([0, 1, 2, 3, 4, 5, 6]); var svg = d3.select("body").append("svg") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom) .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); // Bar chart data var csvData = [ {"Store":"Co-op","Broccoli":2.69,"Cauliflower":3.69,"Celery":1.89,"Strawberries":4.49,"Oranges":1.69,"Tomatoes":3.49,"Lemons":0.99, "Lettuce":0.01, "Cucumber":2}, {"Store":"Safeway","Broccoli":2.97,"Cauliflower":3.98,"Celery":1.77,"Strawberries":5.96,"Oranges":0.97,"Tomatoes":2.97,"Lemons":0.77, "Lettuce":4.97, "Cucumber":1.97}, {"Store":"Sobeys","Broccoli":3.49,"Cauliflower":3.99,"Celery":1.29,"Strawberries":3.99,"Oranges":1.99,"Tomatoes":4.99,"Lemons":1.29, "Lettuce":3.49, "Cucumber":1.99}, {"Store":"Superstore","Broccoli":2.69,"Cauliflower":2.49,"Celery":1.09,"Strawberries":2.99,"Oranges":0.99,"Tomatoe…

http://stackoverflow.com/comment/45477238
type: QuestionComment
comment on: http://stackoverflow.com/q/28571217
type: Comment
has text: Ah, so you did. Still, I would have bolded that. Make it really obvious. Having an UpdatePanel is like going to work with Ebola. You don't just tell people you're sick. You give everyone a big warning. I would *get rid of* the UpdatePanel, and do everything with AJAX. What version of .NET are you on? And sticking with this question is fine for the moment.
score: 0

http://stackoverflow.com/comment/45379844
type: QuestionComment
comment on: http://stackoverflow.com/q/28532282
score: 0
has text: This is somewhat hackish, but you can convert the single quote `'` (or the HTML entity) of the string (i.e. using `str_replace()`) to a curly quote `’`, and then it won't interfere with your code. Without seeing your setup that's the best advice I can offer
type: Comment

http://stackoverflow.com/comment/45497586
type: Comment
comment on: http://stackoverflow.com/a/28591575
type: AnswerComment
score: 0
has text: That's not going to work, as I said, the best scenario is if you can flatten the array, that way the binding will work perfectly, consider doing that only for showing purposes.

http://stackoverflow.com/comment/72491399
type: AnswerComment
has text: This forces you to modify your application code just to do mocking. Not very optimal, especially for larger applications.
type: Comment
comment on: http://stackoverflow.com/a/28507790
score: 7

http://stackoverflow.com/comment/45932009
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28526196
has text: So, this URL explanation is not correct? -> https://weluse.de/blog/angularjs-seo-finally-a-piece-of-cake.html

http://stackoverflow.com/q/28557659
has comment: http://stackoverflow.com/comment/45429702
has comment: http://stackoverflow.com/comment/45427611
tagged with: javascript
score: 0
tagged with: cordova-plugins
has comment: http://stackoverflow.com/comment/45471245
tagged with: cordova
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45429215
answer count: 0
has title: Phonegap 3.6.3 connection
type: Question
has body: I am trying to run phonegap connection code. This is my script and i have installed network plugin. document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { checkConnection(); } function onBodyLoad() { alert('body load'); checkConnection(); } function checkConnection() { networkState = navigator.connection.type; alert('checkConnection'); var states = {}; states[Connection.UNKNOWN] = 'Unknown connection'; states[Connection.ETHERNET] = 'Ethernet connection'; states[Connection.WIFI] = 'WiFi connection'; states[Connection.CELL_2G] = 'Cell 2G connection'; states[Connection.CELL_3G] = 'Cell 3G connection'; states[Connection.CELL_4G] = 'Cell 4G connection'; states[Connection.CELL] = 'Cell generic connection'; states[Connection.NONE] = 'No network connection'; alert('Connection type: ' + states[networkState]); } But i am getting Uncaught TypeError: Cannot read property 'type' of undefined. Could any one please suggest where am i going wrong? Thanks

http://stackoverflow.com/comment/45452846
type: Comment
type: QuestionComment
has text: Show the code for functionTwo
score: 0
comment on: http://stackoverflow.com/q/28571434

http://stackoverflow.com/q/28495870
has body: Is there a more efficient way to loop through structure like following than doing for() for every level there is ? [{a:foo,b:[{a:bar},{a:bar}]},{a:bar,b:[]},...] I need to filter out all the items which property a contains certain data and if it has property b with some elements then loop through those also. I was thinking of using filter method, but can't seem to figure how to use it efficiently.
has answer: http://stackoverflow.com/a/28496170
accepted answer: http://stackoverflow.com/a/28496170
favorite count: 0
possible better answer: http://stackoverflow.com/a/28496503
has comment: http://stackoverflow.com/comment/45311520
type: AnsweredQuestion
upvote count: 0
tagged with: sapui5
has comment: http://stackoverflow.com/comment/45311956
type: Question
has title: Loop through multi dimensional object
score: -1
answer count: 2
has comment: http://stackoverflow.com/comment/45311560
has comment: http://stackoverflow.com/comment/45311744
has answer: http://stackoverflow.com/a/28496503
downvote count: 1
tagged with: javascript

http://stackoverflow.com/q/28566905
tagged with: iframe
tagged with: material-design
type: Question
accepted answer: http://stackoverflow.com/a/28567935
has title: Load an URL inside an iFrame in AngularJS app
score: 2
downvote count: 0
has body: I am loading a url in an angular application inside an iframe. Here is my code: HTML: {{selected.name}} {{selected.content}} App.Js: var routerApp =angular.module('DiginRt', ['ngMaterial']) routerApp.controller('AppCtrl', ['$scope', '$mdSidenav', 'muppetService', '$timeout','$log', function($scope, $mdSidenav, muppetService, $timeout, $log) { var allMuppets = []; $scope.selected = null; $scope.muppets = allMuppets; $scope.selectMuppet = selectMuppet; $scope.toggleSidenav = toggleSidenav; loadMuppets(); //******************* // Internal Methods //******************* function loadMuppets() { muppetService.loadAll() .then(function(muppets){ allMuppets = muppets; $scope.muppets = [].concat(muppets); $scope.selected = $scope.muppets[0]; }) } function toggleSidenav(name) { $mdSidenav(name).toggle(); } function selectMuppet(muppet) { $scope.selected = angular.isNumber(muppet) ? $scope.muppets[muppet] : muppet; $scope.toggleSidenav('left'); } }]) routerApp.service('muppetService', ['$q', function($q) { var muppets = [{ name: 'Product Report', iconurl: 'https://lh3.googleusercontent.com/-KGsfSssKoEU/AAAAAAAAAAI/AAAAAAAAAC4/j_0iL_6y3dE/s96-c-k-no/photo.jpg', imgurl: 'https://my.infocaptor.com/dash/mt.php?pa=inflation_50da569f84101', content: ' ' }, { name: 'Invoice Report', iconurl: 'https://yt3.ggpht.com/-cEjxni3_Jig/AAAAAAAAAAI/AAAAAAAAAAA/cMW2NEAUf-k/s88-c-k-no/photo.jpg', imgurl: 'https://my.infocaptor.com/dash/mt.php?pa=inflation_50da569f84101', content: '' } ]; // Promise-based API return { loadAll: function() { // Simulate async nature of real remote calls return $q.when(muppets); } }; }]); It rerurns an error saying Error: [$interpolate:interr] Can't interpolate: {{selected.imgurl}} Error: [$sce:insecurl] Blocked loading resource from url not allowed by $sceDelegate policy. Here is the Plunker
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45445596
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45445288
has answer: http://stackoverflow.com/a/28567935
type: AnsweredQuestion
upvote count: 2

http://stackoverflow.com/comment/45427686
type: Comment
comment on: http://stackoverflow.com/q/28557861
score: 0
type: QuestionComment
has text: And where is your download code ?

http://stackoverflow.com/comment/45305740
comment on: http://stackoverflow.com/q/28492042
score: 0
type: Comment
type: QuestionComment
has text: Also, the transparency works when drawing a straight line; it's only when drawing arcs, bezier curves, and quadratic curves that this problem comes up

http://stackoverflow.com/q/28521804
upvote count: 2
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28521847
score: 2
type: AnsweredQuestion
downvote count: 0
has body: little trouble working something out. I have a /view-alerts page which displays my data. For each row of data I provide a delete option &lt;input type="button" value="Delete" data-url="{{ path('NickAlertBundle_delete') }}" onclick="delete_alert( {{ alert[0].id }} )"/&gt; So when this button is clicked, a javascript function is called. function delete_alert(id){ var answer = confirm("Confirm delete"); if (answer){ $.ajax({ type: "POST", url: $(this).attr('data-url'), data: {row: id}, success: function(data) { if(data){ var splitdata = data.split(":"); if(splitdata[0]=="Deleted"){ var id = splitdata[1]; alert("Your alert has been deleted"); }else{ alert(data); } }else{ alert("Unknown Error!"); } }, error:function(){ alert("Please try again!"); } }); } So that calls my delete route, and should pass the id of the data row to be deleted. My route is currently like so NickAlertBundle_delete: pattern: /view-alerts defaults: { _controller: NickAlertBundle:Alert:delete } requirements: _method: POST I have the same url pattern as view-alerts because when they delete an alert from this page, I dont want them redirected to another page. So now I am trying to access the id in my controller so I can delete the alert. At the moment I am trying public function deleteAction(Request $request) { $id = $request-&gt;get('id'); $em = $this-&gt;getDoctrine()-&gt;getManager(); $alert = $em-&gt;getRepository('NickAlertBundle:AvailabilityAlert')-&gt;find($id); if (!$alert) { throw $this-&gt;createNotFoundException('Alert not found'); } $alert-&gt;setIsDeleted(true); $alert-&gt;setAlertStatus('Inactive'); $em-&gt;flush(); return new JsonResponse('Deleted'); } The error I am currently receiving is The identifier id is missing for a query of Nick\AlertBundle\Entity\AvailabilityAlert How can I get the id to my controller with the way I am doing things (through an ajax request?) Thanks
has title: Symfony2 - Get ID from route to controller
favorite count: 0
tagged with: ajax
type: Question
tagged with: symfony
accepted answer: http://stackoverflow.com/a/28521847

osx-mavericks
type: Tag
tags question: http://stackoverflow.com/q/28484075
tag name: osx-mavericks

http://stackoverflow.com/q/28455004
has comment: http://stackoverflow.com/comment/48845124
tagged with: websocket
downvote count: 0
tagged with: javascript
favorite count: 0
type: UnansweredQuestion
tagged with: android
linked to: http://stackoverflow.com/q/25739768
answer count: 0
upvote count: 3
type: Question
score: 3
has body: I am trying to connect my Ionic App to a Meteor App, using DDP (i tried using both Mondora's DDP.JS and Mondora's Asteroid solutions, but they both give me the same error) // Connect to a Meteor backend var options = { endpoint: "ws://my.meteor.app/websocket", SocketConstructor: WebSocket }; var ddp = new DDP(options); ddp.on("connected", function () { alert("Connected"); }); ddp.on("disconnected", function () { alert("Disconnected"); }); The thing is, when i run it on the chrome emulator (Ionic Serve) it works flawlessly, but when i run on the android phone (Ionic Run), it always gives me this error. WebSocket connection to 'ws://my.meteor.app/websocket' failed: Error during WebSocket handshake: Status line does not end with CRLF I have seen a question similar to this here on Stack, but i can't find the error on the DDP.JS file, it doesn't explicitly show me the Headers I think the error is a bit misleading. Every header should end with CRLF and not only the first one (the 'status line'), it seems. At least according to the test case. (PhistucK on Websocket communication between chrome(client) and hotspot(server) (Status line does not end with CRLF)). I have tried adding this '\r' thing on almost every variable on the DDP.JS file, with no success. Does anyone know what's happenning? Thanks in advance, Bruno
has title: Websocket Handshake error on Ionic app (Status line does not end with CRLF)
tagged with: ionic-framework
has comment: http://stackoverflow.com/comment/54825151

http://stackoverflow.com/comment/45461705
comment on: http://stackoverflow.com/a/28576065
score: 0
has text: @taesu http://stackoverflow.com/questions/500504/why-is-using-for-in-with-array-iteration-such-a-bad-idea for one
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28488189
has comment: http://stackoverflow.com/comment/45384051
has comment: http://stackoverflow.com/comment/45311729
has comment: http://stackoverflow.com/comment/45299907
answer count: 0
has title: node.js express.js app not working for large traffic (600/min)
has comment: http://stackoverflow.com/comment/45383936
tagged with: javascript
type: UnansweredQuestion
tagged with: amazon-web-services
tagged with: express
tagged with: large-data-volumes
has body: I am working on node.js express.js app which is used for user data collection (in get request) and sends back only 200 ok response. After getting data in request I am checking for existing entry in database dynamodb and redshift and for newer request I am storing data in dynamodb. In this process I required to to do some synchronous operations for that I am using async's waterfall method. Also used callback in few places. I have used pm2 module on server for clustering daemonizing and logging. I have used console.log() for logging steps. This application perfectly working on my local system and also on server with no traffic. All logs are working correctly also proper entires going in dynamodb But this same app is not working if I increase traffic to large numbers. Logs also not working after increasing traffic. I have no clue how to debug and find exact road block. I want help for debugging issue and for and tips while working on large traffic. P.S. :- I have tried increasing `http.globalAgent.maxSockets = large_number; CPU and Memory utilisation is not high (~40% CPU and 60% Memory) Local Environment node.js = 0.12.0 express.js = 4.x ubuntu 14.04.x Server Environment (AWS ec2) node.js = 0.12.0 express.js = 4.x Red Hat 6.6.x Load balancer = Amazon Elastic Load Balancer
type: Question
score: 0
has comment: http://stackoverflow.com/comment/45306001
tagged with: node.js
has comment: http://stackoverflow.com/comment/45304264
has comment: http://stackoverflow.com/comment/45309650

http://stackoverflow.com/a/29328227
has comment: http://stackoverflow.com/comment/72828476
answers question: http://stackoverflow.com/q/28515337
score: 0
has body: If it doesn't matter which image is loaded first you can do $('#yourclass').slick('slickGoTo', 2); it will jump to the next image which will be loaded fine.
type: Answer

http://stackoverflow.com/a/28539519
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28480578
has body: you don't have to destroy the Masonry just reinitialize it after the ajax action and reload items using: $container.masonry('reloadItems');

http://stackoverflow.com/comment/45206573
has text: so i just should replace: $.post('http://www.example.com/webservices/get-address.php',{ userid: "13" }, for: $.post('http://www.example.com/webservices/get-address.php',{ userid: localstorage.getItem('user-id'); }, and this would be the correct way of doing it?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28438262
type: AnswerComment

http://stackoverflow.com/comment/45302153
type: Comment
type: QuestionComment
has text: @Claies I removed the series of resolves and i still having the issue.
comment on: http://stackoverflow.com/q/28490087
score: 0

http://stackoverflow.com/comment/45328185
score: 0
comment on: http://stackoverflow.com/q/28504157
type: Comment
type: QuestionComment
has text: The items in the array could be variable. Could you help me with some example, please.

http://stackoverflow.com/q/28491242
has comment: http://stackoverflow.com/comment/45332705
tagged with: ajax
has comment: http://stackoverflow.com/comment/45303577
has answer: http://stackoverflow.com/a/28506878
has title: JQuery to populate select list based on another select list
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45327052
has body: I have 2 selects, one for states and one for cities, when the user selects the state the cities dropdown must be populated. It seems it is working fine, when selecting the state you can see how the select is populated and you can select a city, however, if I revise the source code for the html I can not see any code (RMB View source code) and the selected value is not send to process the form. My HTML State One State Two State Three My JQuery (Got from a tutorial and adapted) $(document).ready(function($) { var list_target_id = 'city'; var list_select_id = 'state'; var initial_target_html = ''; $('#'+list_select_id).change(function(e) { var selectvalue = $(this).val(); $('#'+list_target_id).html(' Loading... '); if (selectvalue == "") { $('#'+list_target_id).html(initial_target_html); } else { $.ajax({url: 'cities.php?idc='+selectvalue, success: function(output) { //alert(selectvalue); $('#'+list_target_id).html(output); }}); } }); }); The cities.php (here I read data from a DB, however, here is a simple example) <? //these are the city values echo ' Select... '; echo ' 1 '; echo ' 2 '; ?> Any ideas whats wrong? I can not get the values from cities. Any help... thank you!
has comment: http://stackoverflow.com/comment/45304052
accepted answer: http://stackoverflow.com/a/28506878
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45304629
answer count: 1
tagged with: jquery

http://stackoverflow.com/q/28494171
has comment: http://stackoverflow.com/comment/45308509
tagged with: javascript
tagged with: jquery
score: 0
has title: how to change a page by putting URL directly on this website
has answer: http://stackoverflow.com/a/28494386
answer count: 1
has body: how to change a page by putting URL directly on this website http://www.gojane.com/shop-by-category-shoes-heels.html go to that webpage. If I want to change the page 2, What values do I have to put URL directly? like what page=2 or something. I analyzed it for long time, but they used jquery. Kind of difficult to find out. Anyone know how to do it? Please help me out, I'm so serious.
has comment: http://stackoverflow.com/comment/45308583
has comment: http://stackoverflow.com/comment/45308630
has comment: http://stackoverflow.com/comment/45308466
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45308773
tagged with: php
has comment: http://stackoverflow.com/comment/45308644
has comment: http://stackoverflow.com/comment/45308751
has comment: http://stackoverflow.com/comment/45308472
type: Question

http://stackoverflow.com/q/28464160
favorite count: 0
has comment: http://stackoverflow.com/comment/45254160
has title: How can angular ui-bootstrap datepicker settings be declared in one place?
score: 1
has answer: http://stackoverflow.com/a/28465884
has body: I'm using angular-ui datepicker and currently have the settings declared in a controller, eg: $scope.date = new Date(); $scope.open = function($event) { $event.preventDefault(); $event.stopPropagation(); $scope.opened = true; }; In order to be DRY, I want to declare this in one place, so that the datepicker can be used anywhere, without having to declare the settings each time. I've tried putting them into a factory that would be injected into a controller, but with no success. I'm quite new to building factories/services. I found this SO question that mentions declaring the settings under the config method, like this: .config(['datepickerConfig', function(datepickerConfig) { datepickerConfig.showWeeks = false; }]); But this doesn't work for me for some reason. How can I declare the datepicker settings in once place to be used globally, or for injection?
tagged with: angularjs
linked to: http://stackoverflow.com/q/21785999
upvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28465884
has comment: http://stackoverflow.com/comment/45257447
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: angular-ui-bootstrap

http://stackoverflow.com/q/28518066
possible better answer: http://stackoverflow.com/a/28518170
has title: Jquery Ajax: Refreshing multiple divs with different id's
answer count: 2
has body: I want to refresh the countdown timer of multiple items on my page. Each timer has the class "refresh-item". It works well with just one item, but if I've multiple items (that means different countdown timers also), it seems to only pick the latest id. This is my JQuery code: function timeLeft() { var data = $(".refresh-item").attr("data-content"); var dataString = 'case=refresh_item&amp;' + data; $.ajax({ type: "GET", url: "ajax.php", dataType: "html", data: dataString, success: function(result) { $(".refresh-item").html(result); } }); } window.setInterval(function(){ timeLeft(); }, 1000); Each item also has the attribute "data-content" where the specific id of an item is saved. How is it possible to select the specific id of a specific item (to show the individual countdown timer then)?
downvote count: 0
tagged with: jquery
score: 1
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28518218
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/28518170
accepted answer: http://stackoverflow.com/a/28518218
type: Question
has comment: http://stackoverflow.com/comment/45353248
tagged with: javascript

http://stackoverflow.com/a/28582321
has comment: http://stackoverflow.com/comment/45472458
answers question: http://stackoverflow.com/q/28582122
type: Answer
has comment: http://stackoverflow.com/comment/45474576
has body: Try to move your Hope this will resolve your problem.
has comment: http://stackoverflow.com/comment/45474708
has comment: http://stackoverflow.com/comment/45473087
has comment: http://stackoverflow.com/comment/45474798
has comment: http://stackoverflow.com/comment/45473249
has comment: http://stackoverflow.com/comment/45473196
has comment: http://stackoverflow.com/comment/45473730
has comment: http://stackoverflow.com/comment/45473530
score: 0
has comment: http://stackoverflow.com/comment/45474427
has comment: http://stackoverflow.com/comment/45473110
has comment: http://stackoverflow.com/comment/45474391

http://stackoverflow.com/comment/45386060
has text: Thanks for the reply. Well, it was a snippet from the original code. I did put var dist outside that function as a global variable (and also within), both producing same results (i.e. not working as intended). The variable is only used in this function, so I don't mind getting it overwritten each time instead of creating a new one. So, any ideas what else could be the problem, or alternative ways of achieving what I want? Thanks!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28535300
type: AnswerComment

http://stackoverflow.com/comment/45265061
score: 0
type: AnswerComment
type: Comment
has text: The intent is not to hide the content upon clicking on it. The content should show/hide based on whether or not the input is focused, and still be clickable.
comment on: http://stackoverflow.com/a/28469525

http://stackoverflow.com/q/28531167
type: AnsweredQuestion
score: 3
upvote count: 3
accepted answer: http://stackoverflow.com/a/28531540
has title: Cannot read property 'tz' of undefined - Ember Moment Timezone
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: ember.js
has answer: http://stackoverflow.com/a/28531540
tagged with: momentjs
tagged with: timezone
has body: I have an ember app that I am trying to add moment with time zone into: { "name": "front-end", "dependencies": { "handlebars": "~1.3.0", "jquery": "^1.11.1", "ember": "1.8.1", "ember-data": "~1.0.0-beta.14.1", "ember-resolver": "~0.1.7", "loader.js": "stefanpenner/loader.js#1.0.1", "ember-cli-shims": "stefanpenner/ember-cli-shims#0.0.3", "ember-cli-test-loader": "rwjblue/ember-cli-test-loader#0.0.4", "ember-load-initializers": "stefanpenner/ember-load-initializers#0.0.2", "ember-qunit": "0.1.8", "ember-qunit-notifications": "0.0.4", "qunit": "~1.17.1", "bootstrap": "~3.3.2", "ember-simple-auth": "0.7.3", "jquery-autosize": "~1.18.12", "moment-timezone": "~0.3.0" } } I load the js file with this line in my Brocfile.js: app.import('bower_components/moment-timezone/builds/moment-timezone-with-data-2010-2020.min.js'); When I start the ember server I get the following error even before I call moment in any of my custom scripts: Uncaught TypeError: Cannot read property 'tz' of undefined Could anyone tell me the proper way to load moment-timezone? Thanks!

http://stackoverflow.com/a/28483601
score: 0
answers question: http://stackoverflow.com/q/28481826
type: Answer
has body: Expanding on phari's answer, it looks to be a CSS positioning problem. /* set up sub nav hover */ nav ul li a { padding:10px 25px 10px 25px; display:block; /*position:relative;*/ /*commenting out this line seemed to fix it*/ } You could also take a look at the jQueryUI which has a handy accordion function. jQueryUI Accordion
has comment: http://stackoverflow.com/comment/45399408

http://stackoverflow.com/comment/45274903
score: 0
comment on: http://stackoverflow.com/q/28454865
type: Comment
type: QuestionComment
has text: Does it show any error? Did you try like this `var gui = require('nw.gui'); gui.Window.get().showDevTools();`?

http://stackoverflow.com/comment/45487560
type: Comment
type: QuestionComment
has text: i would suggest you to start with the basics . Basics are the concepts that drive you
comment on: http://stackoverflow.com/q/28590261
score: 0

http://stackoverflow.com/a/28541226
answers question: http://stackoverflow.com/q/28540895
score: 0
type: Answer
has body: It's better you write some HTML and Java Script code which you are using. So, it's easy to correct mistake is you have made somewhere in code snippet.

http://stackoverflow.com/comment/45428837
comment on: http://stackoverflow.com/a/28557537
type: AnswerComment
has text: Not even in IE as you need compatibility mode and certainly not any other browser. IE doesn't even close to conforming to the W3C standards especially in compatibility mode. If the majority of the worlds browsers (including IE) can't use your application and a minority can if they break normal browser operations then I would humbly suggest that its not working. Get it working on all the others first (by using standards) then fix it for older IE after. Rather than building an app to use Compat Mode and forcing Quirks because even MS advise you not to do this for new applications.
score: 0
type: Comment

http://stackoverflow.com/q/28445847
has title: Titanium: How to get the objects or native object created from .js
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28451698
has body: I am doing dynamic layout in IOS developing: For example there are many tableviewCell templates described in js file, so I want to get the templateCell v from js. For example, I have a TemplateView.js, as following: var contentView = Titanium.UI.creatView({ backgroundImage:'../images/background.png', height:320, width:44 }); var button = Titanium.UI.createButton({ backgroundImage:'../images/send.png', height:33, width:33 }); contentView.add(button); Now how can I get the objects or the root object(contentView) created from eval TemplateView.js?
answer count: 1
downvote count: 0
tagged with: templates
favorite count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: titanium
score: 2

http://stackoverflow.com/a/28588219
has body: You have to play a bit with css transform and pseudo elements. Just a quick and dirty example: a { display:block; width:100px; background:blue; height: 30px; line-height:30px; color: #fff; text-align:center; margin-bottom:2px; position:relative; } a:after { position:absolute; content:""; background:darkRed; height: 20px; width: 42px; right: -36px; top:-2px; transform: skew(-45deg) rotate(45deg); } div { padding:100px; } one two three four
downvote count: 0
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28587384

http://stackoverflow.com/comment/45224177
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28447473
has text: @ArunPJohny beforeSend handler is perfectly fine. I put alert there, not only the alert got triggered, but the loader display block is triggered.

http://stackoverflow.com/q/28582863
has answer: http://stackoverflow.com/a/28630710
possible better answer: http://stackoverflow.com/a/28584976
has title: Showing Popup Windows with MVC, JavaScript
favorite count: 0
tagged with: asp.net-mvc-4
has answer: http://stackoverflow.com/a/28584976
accepted answer: http://stackoverflow.com/a/28630710
upvote count: 1
tagged with: model-view-controller
has body: I have a simple create form in MVC 4 and would like two submit functions: (1) Create and (2) Create &amp; Print. Create is a normal Create action and works perfectly. Create &amp; Print should save the object and then launch a popup browser window with data from the newly saved object. The original window needs to refresh to a blank Create form ready for another record. What is the best way to approach this? Below is an example that works in practice however I have the ID hardcoded in. Ideally, this ID will dynamically inherit from the object that was just saved and link there. Is JavaScript the best idea here or should (can) I launch the popup from the Controller? &lt;input type="submit" value="Create" /&gt; &lt;input type="submit" value="Create &amp; Print" onclick="window.open('Print/f1ad6330-2978-4ea9-9116-65f861412260' , 'PRINT' , 'height=200,width=200');" /&gt;
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45473393
tagged with: asp.net-mvc
type: Question
answer count: 2
tagged with: printing
downvote count: 0
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/45473482

http://stackoverflow.com/comment/45437115
has text: Many thanks, Raeen Hashemi. But I wanted to ask, you can customize every stackLabels? I tried, but I can not ... are all the same !!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28559594
type: Comment

http://stackoverflow.com/a/28574454
has body: To use an instance as prototype in order to inherit shows a lack of understanding what prototype is. Prototype shares members and a mutable instance member of Parent on the prototype of Child gets you very unexpected behavior. Setting Car.prototype to Object.create(Bus.prototype) has already covered by others, if you want to see the role of the constructor and the role of the prototype maybe the following answer can help: https://stackoverflow.com/a/16063711/1641941 To demonstrate what could go wrong let's introduce an instance specific mutable member called passengers we would like Bus to initialize this so we can't use Jeff's example as that only takes care of the prototype part. Let's use constructor functions but create an instance of Bus for Car.prototype. var Bus = function Bus(){ this.passengers=[]; } var Car = function Car(){}; Car.prototype = new Bus() var car1=new Car(); var car2=new Car(); car1.passengers.push('Jerry'); console.log(car2.passengers);//=['Jerry'] //Yes, Jerry is a passenger of every car you created //and are going to create This error could be resolved by shadowing instance properties by re using Parent constructor (Bus.call(this... as provided later) but Car.prototype still has a passengers member that has no business being there. If you want to protect agains people forgetting "new" you can do the following: function Car(){ if(this.constructor!==Car){ return new Car(); } //re use parent constructor Bus.call(this); } //Example of factory funcion Car.create=function(arg){ //depending on arg return a Car return new Car(); }; Car.prototype = Object.create(Bus.prototype); Car.prototype.constructor = Car; var car1 = Car();//works var car2 = new Car();//works var car3 = Car.create();//works
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28572553

http://stackoverflow.com/comment/45234477
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28453624
has text: if table b_id has auto increment attribute (ie, just increases a number one after other ex: 1,2,3)then mysql_insert_id(); is a sql function which returns the last inserted id
type: AnswerComment

http://stackoverflow.com/a/28583646
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/45484951
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45476358
accepted answer of: http://stackoverflow.com/q/28583466
answers question: http://stackoverflow.com/q/28583466
has comment: http://stackoverflow.com/comment/45484978
has body: In general I do not use global variables. They pollute the window scope and can make your code more confusing. For an example like the one you gave I would recommend using a factory or a service to persist the data. Then you can inject it clearly into whatever controller/direct/other-service that you want. While your co-worker is correct that there are many ways to do things I do not recommend polluting the global scope. app. module('myApp') .factory('myFactory', myFactory); function myFactory() { var globalVar = [23,43,21]; return { get: function() { return globalVar; } } } and then in your controller(or whatever) app. module('myApp') .controller('MyCtrl', MyCtrl); function MyCtrl(myService) { var localVar = myService.get(); }
type: Answer

http://stackoverflow.com/q/28492456
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45305499
type: Question
has body: This is an example of masked input plug in. The demo is looking good so i want to try it out the problem is i am getting error in line jQuery(function($) { $("#comp_id").mask("99-9999-999"); }); i Copied the maskedinput.js from the link and i also have a jquery-1.11.1.min.js What seems to be the problem here?
has comment: http://stackoverflow.com/comment/45305515
has comment: http://stackoverflow.com/comment/45306603
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45305527
has title: Masked input plugin returning `undefined is not a function`
answer count: 0
has comment: http://stackoverflow.com/comment/45305695
score: 0

http://stackoverflow.com/a/28456259
answers question: http://stackoverflow.com/q/28456194
score: 2
has body: $.getJSON is async that means it is called after the alert... so json is still empty. Try $.getJSON("test/test.json", function(data) { json = data; alert(json); });
downvote count: 0
upvote count: 2
type: Answer

http://stackoverflow.com/q/28528729
has body: I have an iframe element which I create dynamically. Where should I append this iframe if I am not sure if there is a body tag in the html or not ? I was thinking of appending this as child of html tags like div which I have to create dynamically too. But I need to append the div somewhere. Again I am not sure where to append the div.
has comment: http://stackoverflow.com/comment/45372701
tagged with: iframe
has comment: http://stackoverflow.com/comment/45372744
has answer: http://stackoverflow.com/a/28528864
has answer: http://stackoverflow.com/a/28528921
type: Question
has title: proper place to insert iframe in html
tagged with: javascript
tagged with: dom
score: 0
has answer: http://stackoverflow.com/a/28528900
answer count: 3
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45372961
has comment: http://stackoverflow.com/comment/45372923

http://stackoverflow.com/a/28459245
downvote count: 0
has comment: http://stackoverflow.com/comment/45250687
answers question: http://stackoverflow.com/q/28440262
type: Answer
upvote count: 6
has comment: http://stackoverflow.com/comment/45281552
has comment: http://stackoverflow.com/comment/45295065
score: 6
has comment: http://stackoverflow.com/comment/45251003
has body: I wrote a streaming Web Audio API system where I used web workers to do all the web socket management to communicate with node.js such that the browser thread simply renders audio ... works just fine on laptops, since mobiles are behind on their implementation of web sockets inside web workers you need no less than lollipop for it to run as coded ... I posted full source code here
has comment: http://stackoverflow.com/comment/45292581

http://stackoverflow.com/comment/45331225
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28506003
has text: Won't this simply delay every keyup event callback a second?
type: Comment

http://stackoverflow.com/a/28509428
type: Answer
has comment: http://stackoverflow.com/comment/45337988
upvote count: 2
score: 1
downvote count: 1
answers question: http://stackoverflow.com/q/28509103
has body: Try a bit of plain JavaScript: var audio=document.getElementById("my_audio_element"); audio.src="source.mp3"; audio.play(); This works for me. HTML5 Audio is still sort of shaky and isn't implemented the same across all major browsers. If you're trying to get it to play on mobile, that's even trickier. Your code looks fine to me, though. Hope this helps!

http://stackoverflow.com/comment/45225374
score: 0
has text: I don't know all i get is a blank alert box when i change options.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28448417

http://stackoverflow.com/q/28439287
favorite count: 0
possible better answer: http://stackoverflow.com/a/28439365
tagged with: regex
has comment: http://stackoverflow.com/comment/45225215
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45247163
upvote count: 1
type: Question
has title: Validate.JS - DISallow Non-ASCII Unicode Characters
has answer: http://stackoverflow.com/a/28439365
has comment: http://stackoverflow.com/comment/45208284
tagged with: javascript
answer count: 2
has body: I'm looking for a Regex, or easy function that returns TRUE/FALSE, that detects the presence of Non-ASCII Unicode Characters, to be used in my $("form").validate({ call. Basically, if the user enters any unicode characters, I want the validation to fail. I want to allow all standard, SQL-VARCHAR-acceptable, characters.
tagged with: validation
downvote count: 0
has answer: http://stackoverflow.com/a/28439368
accepted answer: http://stackoverflow.com/a/28439368
tagged with: jquery
tagged with: unicode

http://stackoverflow.com/comment/45437835
has text: This is not enough information to answer your question. Your code looks like c# but you are referring to angular. Please clarify
score: 0
comment on: http://stackoverflow.com/q/28563623
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45413826
has text: is back done after submit form hides but div is always there
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28549205
type: AnswerComment

http://stackoverflow.com/q/28503156
favorite count: 0
has answer: http://stackoverflow.com/a/28503380
has body: I have successfully created and added the key in mandrill and can send email from my javascript page hosted here: http://goo.gl/2YSwj7 but I'm having the issue that my mandrill key is publicly visible (in contact_me.js file) I have tried to use mandrill key option to enable key only from certain ip addresses but that does not work! ( I have entered github's ip's in key option restrictions but actually we are not sending it from there, but from users browser, right? ) If someone have some idea, how to workaround that, to send email from browser, and restrict it on that page only, I'd be very glad to hear it, thanks, oserk+
has title: How to hide my private key from mandrillapp in webpage
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
tagged with: mandrill
tagged with: javascript
tagged with: jquery
tagged with: ajax
accepted answer: http://stackoverflow.com/a/28503380
answer count: 1
downvote count: 0

inheritance
tags question: http://stackoverflow.com/q/28487909
tags question: http://stackoverflow.com/q/28558503
tags question: http://stackoverflow.com/q/28581028
tag name: inheritance
tags question: http://stackoverflow.com/q/28570531
tags question: http://stackoverflow.com/q/28527723
type: Tag
tags question: http://stackoverflow.com/q/28504487
tags question: http://stackoverflow.com/q/28471877
tags question: http://stackoverflow.com/q/28579480
tags question: http://stackoverflow.com/q/28588623

http://stackoverflow.com/q/28469685
has answer: http://stackoverflow.com/a/28469744
has body: I currently have a collection named Consumer_Complaints sitting in a mongoDB database called consumer_Complaints (sorry for making that confusing). I can access the Consumer_Complaints collection via the mongo shell, but I am unable to access it in my application. I am currently using express. Here is my code(Updated): var mongoose = require("mongoose"); //open connection to consumer_Complaints database mongoose.connect('mongodb://localhost/consumer_Complaints') //send error if connection fails mongoose.connection.on('error', console.error.bind(console, 'connection error:' )); var Schema = mongoose.Schema; var complaintSchema = new Schema({ complaint_ID: String, product: String, sub_Product: String, issue: String, sub_Issue: String, state: String, zip_Code: String, submitted_Via: String, date_Received: String, date_sent_to_Company: String, company: String, company_Response: String, timely_Response: String, consumer_Disputed: String, }); complaintSchema.set('collection', 'Consumer_Complaints'); var model = mongoose.model("Model", complaintSchema) model.find({}, function (err, results) { res.json(results); console.log(results);//Your Json result }); Previous Answer- Found Here This seems to be what I want, but the syntax used is different than what I see in the mongoose documents, and when I try to replicate this, I get the following error. "TypeError: Cannot call method 'find' of undefined" Any help clarifying the top answer in the linked post, or figuring out what I'm doing wrong would be greatly appreciated!
has title: Importing mongoDB collection to Express Model
type: UnansweredQuestion
type: Question
tagged with: mongodb
tagged with: mongoose
tagged with: javascript
linked to: http://stackoverflow.com/q/5794834
tagged with: express
has answer: http://stackoverflow.com/a/28469793
score: 0
answer count: 2

http://stackoverflow.com/comment/45301727
type: QuestionComment
has text: They aren't wrong. `-` operator has a higher priority than `>` so it's alright
comment on: http://stackoverflow.com/q/28490199
score: 0
type: Comment

http://stackoverflow.com/comment/45381998
has text: can you clarify on why `amount="{{amount}}"` doesn't work? does it pass the wrong value? does it pass nothing at all? does it throw an error?
comment on: http://stackoverflow.com/q/28533075
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28487468
upvote count: 1
type: AcceptedAnswer
has body: Since the change to the DIV is being made with Javascript in the page, you will have to actually load the page with the rendering engine (not just load the page source) and then look at the DIV element to see if the content has changed. You can do this easily with a content script. Create a content script that will run in the page that you wish to load (by setting the URL with the "matches" parameter in the manifest.json). The in-page content script can read the DIV periodically with something like this: window.setInterval(function() { var THRESHOLD = 100; var div = document.getElementById("theDiv"); var num = parseInt(div.innerText); if (num &gt; THRESHOLD) { alert('The number is: ' + num); } // If you need to reload the page itself to check the number // then just reload the page on a regular interval window.location.reload(); }, 10000); You can then load the page once from the background page in a non-selected tab: chrome.tabs.create({ selected: false, url: 'http://www.theurl.com' }) Alternatively, if the page allows framing, you could create an iframe in your background page and load the page invisibly within your background page: var frame = document.createElement("iframe"); frame.src = 'http://www.theurl.com'; document.body.appendChild(frame); But to do this in an iframe you will have to ensure that your content script has the "all_frames" value set to true in the manifest.json.
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/45298126
accepted answer of: http://stackoverflow.com/q/28466654
answers question: http://stackoverflow.com/q/28466654
score: 1
has comment: http://stackoverflow.com/comment/45296908

http://stackoverflow.com/comment/45380914
score: 0
type: Comment
type: QuestionComment
has text: Just tried window.innerHeight but same result :/
comment on: http://stackoverflow.com/q/28532893

http://stackoverflow.com/q/28591076
upvote count: 1
has title: Phaser with addEventListener
answer count: 1
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
downvote count: 0
score: 1
has body: I'm trying to capture a click event and change a game state but I constantly get "undefined" error. I use this code to add game states: var game = new Phaser.Game(800, 600, Phaser.AUTO, 'canvas'); game.state.add('Boot', Boot); game.state.add('Level_1', Level_1); game.state.start('Boot'); Here I run game intro and try to capture a click event var button; var Boot = function(game) {}; Boot.prototype = { preload: function() { this.load.image('logo','img/logo_allcomp_white.png'); this.load.image('welcome','img/welcome.png'); this.load.image('gradient','img/gradient.png'); }, create: function() { this.add.sprite(0,0,'gradient'); this.stage.backgroundColor = '#ffffff'; this.add.sprite(20,20,'logo'); var cutters = this.add.tileSprite(0, 0, this.game.width, this.game.height,'welcome'); cutters.autoScroll(-20,0); button = document.getElementById('startbtn'); button.addEventListener('click',this.updateButton); }, updateButton: function() { this.game.state.start('Level_1'); } }; I cannot get it to work. Is this even possible to interact with other DOM elements outside the canvas? Adding this button to canvas doesn't work for me. I must keep my control panel outside
favorite count: 0
has answer: http://stackoverflow.com/a/28738685
accepted answer: http://stackoverflow.com/a/28738685
type: Question
tagged with: phaser-framework
tagged with: javascript

http://stackoverflow.com/comment/45231237
type: Comment
has text: Not working. When I select any option no tab is selected & no content shows. Js not working.
comment on: http://stackoverflow.com/a/28451662
type: AnswerComment
score: 0

http://stackoverflow.com/q/28530623
has body: I have a file upload element that scans the file names upon change and does something to get a valid treeJSON variable. When the function detects a change the second time, the treeJSON variable will update, and I need to update the tree. I've tried various methods such as refresh(), destroy() etc., but I haven't been able to construct a new tree on the same page without reloading the page. Here is a snippet, I've included all the functions and it works. The important part is working with the treeJSON input.onchange = function (e) { // do something }; var treeJSON = someVar; $("#tree").jstree({ core: { check_callback: true, data: treeJSON, }, });
upvote count: 3
type: Question
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28543687
tagged with: javascript
tagged with: jquery
favorite count: 0
score: 3
has comment: http://stackoverflow.com/comment/128732159
linked to: http://stackoverflow.com/q/3682045
accepted answer: http://stackoverflow.com/a/28543687
has title: How to refresh a jsTree with new JSON data?
tagged with: jstree
type: AnsweredQuestion

http://stackoverflow.com/a/36280052
type: Answer
answers question: http://stackoverflow.com/q/28559881
score: 0
has body: to enable F12 navigation to JS function source defined in another .js file you need to add the following line to the top of the current .js file where you reference the external function: /// &lt;reference path="../Path/To/The/Referenced/file.js" /&gt; The ../ part is optional, just build the correct path yourself. After the above chunk is added Visual Studio successfully finds the definition of the external js function upon F12 hit on its reference. At least it works for me with VS2013 Premium.

http://stackoverflow.com/q/28452359
answer count: 1
tagged with: javascript
tagged with: jquery
has title: WYSIWYG Editor for Mathematical Equations using MathJax
favorite count: 0
has answer: http://stackoverflow.com/a/28462003
accepted answer: http://stackoverflow.com/a/28462003
has comment: http://stackoverflow.com/comment/73847813
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45242145
downvote count: 0
has body: I am trying to build WYSIWYG Editor to write Mathematical Formulas using MathJax. I am trying to select random content from the textarea and pasting it into a div for converting it into a Mathematical Equations. Wrap Selected Content with Dummy Editor ; $$\sum(a+b)(c+d)$$ Put Summation Sign So how can i convert the text displayed in div#pasteSelectedContent with Mathematical Equations Please help me to build this WYSIWYG Editor
type: Question
tagged with: mathjax
score: 3
tagged with: math
upvote count: 3
has comment: http://stackoverflow.com/comment/45249873

http://stackoverflow.com/comment/45233574
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28452967
has text: :) You have to change 'myInputIDStatusStartWith' with the first part of your inputs id. I mean replace 'myInputIDStatusStartWith' with the common part of what {{$student}} is returning.

http://stackoverflow.com/comment/45323246
type: Comment
type: QuestionComment
has text: Boom lharby! Nice. Integrated that code and it's really close. Only issue I'm having is that it seems like the image size code is firing before the centering code does its thing. So when I load the page, the correct image size loads, but it's not centered. When I mess with the window width the image centers itself and resizes perfectly though! I think I need to add a (window).load to the image size code so it waits to fire?
comment on: http://stackoverflow.com/q/28501510
score: 0

http://stackoverflow.com/comment/45474439
comment on: http://stackoverflow.com/q/28583084
score: 0
type: Comment
type: QuestionComment
has text: First of all the demo doesn't run. I also recommend to use Angular 1.3.x.

http://stackoverflow.com/q/28489648
has title: including a Google dynamic map
tagged with: php
upvote count: 0
has answer: http://stackoverflow.com/a/28490746
type: UnansweredQuestion
type: Question
has body: I need some help as I'm trying to call back a JavaScript function with PHP. I created 2 classes which work together perfectly. In the first one exploiting a Google API, I extract the latitude and longitude of a city chosen by a user on my form, and then I pass these values to the second class which exploits another API to show a weather forecast service for that city. I'd like to add a Google map too, to create this way a more complete service showing a dynamic map with the chosen city. I noticed with Firebug that the browser is not able to parse correctly the two mentioned properties of the object $map, as you can easily see by yourself. I really don't know how to call back the js function inside the tag , I need for my purpose. The simple echo I'm using here with PHP doesn't work here. Hope someone can help me. Here's my page and here's the piece of my code that is not working: /** * Check for the real existence of the city, using the * property $status of the instanced GeoLocalization class, here the object $map. * This class exploits a Google API. */ if ( isset($missing) && empty($missing) && strlen($citta) > 1 && $map->status == 'OK' ) { /** * Use some properties of the object $map to show my user * the chosen city and state in Italian. * Show even the latitude and the longitudine. * These values are those passed to the GeoWeather class. */ // show the location echo ' ' . ' ' . $map->formatted_address . ' ' . ' ' . 'Latitudine: ' . $map->latitude . ' ' . ' ' . 'Longitudine: ' . $map->longitude . ' ' . '; echo ' '; echo ' '; echo ' '; echo ' '; }
tagged with: javascript
score: -1
tagged with: google-maps-api-3
tagged with: google-maps
answer count: 1
downvote count: 1
favorite count: 0

http://stackoverflow.com/q/28439607
has body: All I'm trying to do is bind the change event of some checkboxes, by class - and then determine if the checkbox is being checked or unchecked for further processing (unrelated to my current problem). The "nope" alert pops, no matter what - and I have no idea why. I've read a couple related threads and the code that I've posted appears to be working for others. HTML: &lt;asp:CheckBox ID="cbNewMembers" runat="server" Checked="true" Text="New Members" CssClass="GreenControl CheckOption" /&gt; &lt;asp:CheckBox ID="cbLostMembers" runat="server" Checked="false" Text="Lost Members" CssClass="GreenControl CheckOption" /&gt; &lt;asp:CheckBox ID="cbIncludeOnline" runat="server" Checked="false" Text="Include Online Apps" CssClass="GreenControl CheckOption" /&gt; jQuery: $(document).ready(function (e) { $(".CheckOption").on("change", function () { if ($(this).is(":checked")) alert("yep"); else alert("nope"); }); }); Note that I've also tried: if (this.checked) and if ($(this).prop("checked") == "checked") and a few other combinations. But, like I said, the if statement always evaluates as false. Please help! UPDATE: I changed the event handler to this: $(".CheckOption input[type='checkbox']").on("change", function (e) { if ($(this).is(":checked")) alert("yep"); else alert("nope"); });
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45209269
tagged with: .net
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45209374
accepted answer: http://stackoverflow.com/a/28439844
has title: Class event handler not detecting whether or not checkbox is checked
has answer: http://stackoverflow.com/a/28439844
tagged with: checkbox

http://stackoverflow.com/q/28485398
answer count: 2
has answer: http://stackoverflow.com/a/28485451
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28485614
tagged with: css
has body: I'm using plain Javascript in a 3d art gallery. I have an image source array and am populating certain columns by pulling from this array. I need to get the index of the image on click so that I can use that to pull further information from said array...Titles, Descriptions. I could do this with jQuery but I am trying to learn plain Javascript. I already have event listeners on all the images. Here is the current code: var preview = document.getElementById('preview'); var subwrap = document.getElementById('subwrap'); var indexMatch; for (var i=0; i &lt;= imgList.length; i++){ document.images[i].addEventListener("click", srcSend, false); } function srcSend(){ var previewTitle = "Test Title"; var previewText = "Test Description"; var imgSrc = this.src; console.log('Image Source ='+''+imgSrc+''); if (imgSrc !== "file:///D:/Projects/mpaccione/img/navicon.png"){ preview.className = " "; subwrap.className = "hide"; preview.className = "show"; preview.innerHTML = '&lt;img src='+imgSrc+'&gt;&lt;p id="title"&gt;'+previewTitle+'&lt;/p&gt;&lt;p id="description"&gt;'+previewText+'&lt;/p&gt;'; }}
type: AnsweredQuestion
has title: Javascript get index on click
has answer: http://stackoverflow.com/a/28485614
type: Question
possible better answer: http://stackoverflow.com/a/28485451

http://stackoverflow.com/q/28533785
tagged with: string
has answer: http://stackoverflow.com/a/28533928
has comment: http://stackoverflow.com/comment/45382313
favorite count: 0
has comment: http://stackoverflow.com/comment/45382349
has comment: http://stackoverflow.com/comment/45382304
has body: var names = "John Keynes Carl Gauss Paul Feyerabend Antoine Lavoisier" Result in output should be : "John Keynes","Carl Gauss","Paul Feyerabend","Antoine Lavoisier"
possible better answer: http://stackoverflow.com/a/28533928
has title: replacing every alternate blank space of a string
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45382322
score: 1
has answer: http://stackoverflow.com/a/28533862
accepted answer: http://stackoverflow.com/a/28533862
upvote count: 2
answer count: 2
downvote count: 1
tagged with: javascript

http://stackoverflow.com/comment/45442553
score: 0
has text: this is the part I'm confused with, I'm just trying to test the same code from www.maisonbertine.com but I just couldn't get it to work on mine. I think the problem exists within: $lang = $('#lang_selection'); $lang.on('click', 'a', function(e){...} but I just couldn't find what's causing the problem.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28557102

http://stackoverflow.com/q/28576441
tagged with: ajax
has comment: http://stackoverflow.com/comment/45473390
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45462282
accepted answer: http://stackoverflow.com/a/28583487
has title: change db value AJAX PHP JS
favorite count: 0
type: Question
upvote count: 2
possible better answer: http://stackoverflow.com/a/28585251
answer count: 2
has answer: http://stackoverflow.com/a/28585251
tagged with: php
has body: I want for user to click a button to delete de div, and for it to no longer show on he webpage i want to change a value in my db so the webpage knows it was deleted and no longer appears in the 'newsfeed'. It does delete the div , but doesnt do anything to the DB. JS code: var xmlHttp = createXmlHttpRequestObject(); function createXmlHttpRequestObject() { var xmlHttp; //for IE if(window.ActiveXObject) { try{ xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");//THIS object is the heart of AJAX for users using IE } catch(e) { alert("Connection Error1"); xmlHttp = false; } } else { try { xmlHttp = new XMLHttpRequest(); //THIS object is the heart of AJAX } catch(e) { alert("Connection Error2"); xmlHttp = false; } } if(!xmlHttp) { alert("Connection Error"); } else { return xmlHttp; } } function deletePreview(id){ xmlHttp.open("GET","entOfferDeletePreview.php?id=" + id + "&t=" + Math.random(),true); xmlHttp.send(null); alert(id); } function removeDummy(id) { var elem = document.getElementById(id); elem.parentNode.removeChild(elem); } PHP <?php include('classes/dbConnection.php'); $link = new dbConnection; $id = $_GET['id']; $query = 'UPDATE entoffers SET preview = 1 WHERE id = "$id" '; $res = $link->query($query); if($res){ echo ' '; } ?>
has answer: http://stackoverflow.com/a/28583487
linked to: http://stackoverflow.com/q/60174
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45462766
tagged with: javascript
has comment: http://stackoverflow.com/comment/45483310

http://stackoverflow.com/q/28538778
has body: Hi I am using Ext Js version 4.1.8 and I want to add paging on my extjs grid. I have been using Ext.create('Ext.data.Store', { model: 'List', proxy:{ type: 'ajax', api:{ read:'getJson.php', }, extraParams:{ PRKEY : selectedProjId }, }, reader:{ type: 'json', root: 'data', } }); That is working fine, but if I change my json format in my php file and change the root type to someother string like 'users' I do not see any data Here is my json creation code in getJson.php //in a loop $aNode = array( "Name" =&gt; "My Name", "ID" =&gt; "123"); array_push($nodeArr, $aNode); //end of loop $json = new Services_JSON; echo $json-&gt;encode($nodeArr); and here is for the php code I want to run //in a loop $aNode = array( "Name" =&gt; "My Name", "ID" =&gt; "123"); array_push($nodeArr, $aNode); //end of loop $json = new Services_JSON; $jsonResult = array( 'success' =&gt; "true", 'users' =&gt; $nodeArr ); echo $json-&gt;encode($jsonResult ); and here is the new store code Ext.create('Ext.data.Store', { model: 'List', proxy:{ type: 'ajax', api:{ read:'getJson.php', }, extraParams:{ PRKEY :selectedProjId }, }, reader:{ type: 'json', root: 'users' } }); Please help so I can add totalProperty in reader of my store and perform paging.
has comment: http://stackoverflow.com/comment/45392334
upvote count: 1
type: Question
tagged with: javascript
tagged with: extjs
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28549962
favorite count: 0
has comment: http://stackoverflow.com/comment/45391733
has comment: http://stackoverflow.com/comment/45391840
has answer: http://stackoverflow.com/a/28554028
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45393614
has comment: http://stackoverflow.com/comment/45395691
has comment: http://stackoverflow.com/comment/45418988
tagged with: php
has title: Paging in Ext Grid
score: 1
tagged with: http://stackoverflow.com/tag/json
tagged with: pagination

http://stackoverflow.com/q/28460373
has comment: http://stackoverflow.com/comment/45247002
has comment: http://stackoverflow.com/comment/45246767
has comment: http://stackoverflow.com/comment/45246908
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45247310
answer count: 0
type: UnansweredQuestion
type: Question
has title: Javascript: setting an object's properties when the object is within a method?
has body: I have an function that contains an object. Some of the object's properties are defined dynamically, and the entire object is returned to the parent function. var myClass = { "my method": function(x) { var obj = { "one": { "stuff: "apples", "more stuff": "blah, }, "two": { "stuff": "stuff", "blah": "blah blah" }, "three": { "dynamic": x } }; return obj; } } You can access the properties of the method like this... myClass['my method']()['one']['stuff'] //apples But how can I set properties inside obj? for (var i = 0; i &lt; 5; i++) { myClass['my method']()['one']['stuff'] = i; //undefined myClass['my method']['three']['dynamic'] = i //undefined myClass['my method'](i)['three']['dynamic'] // 0, 1, 2, 3, 4 } If the obj object were not inside a function it would be easy but there's clearly some syntax I'm missing.

http://stackoverflow.com/q/28454543
has title: Drag and drop overlapping points
answer count: 1
downvote count: 1
favorite count: 0
has body: I have a graph plotted with a multitude of lines, a rather big figure overlapping the lines and ontop of that is a point that is capable of being drag and dropped all over the plot by the user. The problem I'm facing currently is that as soon as the user drags and drops the point straight ontop of a line or a point of the figure, the user is unable to drag and drop the point away. I have set up a fiddle with my current setup. JavaScript/jQuery code: $(function() { var startPoint = [[7.00, 0]]; var line10 = HHIsoPleth(7.00, 7.80, 10); var line120 = HHIsoPleth(7.00, 7.80, 120); var options = { series: { points: { editMode: "none", show: true, radius: 0, symbol: "circle", fill: true, hoverable: false, }, lines: { editMode: "none", editable: false, hoverable: false, clickable: false } }, yaxes: [ { position: "left", min: 0, max: 60, tickSize: 4, } ], xaxes: [ { position: "bottom", min: 7.00, max: 7.80, } ], grid: { backgroundColor: "transparent", editable: true, hoverable: true, clickable: false, }, legend: { position: "nw" }, }; var data = [ { data: line10, label: "PCO2", lines: { show: true, lineWidth: 1 }, points: { show: false }, editable: false, clickable: false, hoverable: false, color: "#FF0000" }, { data: line120, lines: { show: true, lineWidth: 1 }, points: { show: false }, editable: false, clickable: false, hoverable: false, color: "#FF0000" }, { data: startPoint, label: "Bloedzuur gehalte", lines: { show: true }, points: { show: true, radius: 3 }, editable: true, editMode: 'xy', color: '#00FF00' }, ]; var plot = $.plot($("#flot-placeholder"), data, options); // Drag and drop $("#flot-placeholder").bind("datadrop", function(event, pos, item) { var PCO2 = getPCO2(pos.x1.toFixed(2), pos.y1.toFixed(2)); var pH = getPH(pos.y1.toFixed(2), PCO2); var HCOmm = getHCO3(pH, PCO2); updatePoint(pH, HCOmm); }); // Generate red lines / isopleths function HHIsoPleth(minPH, maxPH, PCO2){ var isoPleth = []; for (var i = minPH; i < maxPH; i+=0.01){ HCOmm = (0.03 * PCO2 * Math.p…
has answer: http://stackoverflow.com/a/28457610
accepted answer: http://stackoverflow.com/a/28457610
type: AnsweredQuestion
score: 1
type: Question
tagged with: flot
tagged with: javascript
tagged with: jquery
upvote count: 2

http://stackoverflow.com/a/28472485
upvote count: 1
downvote count: 0
has body: Angular's $http has cache built in. Set cache as true in your $http request options: $http.get(url, {cache: true}).then(...);
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/28472395
answers question: http://stackoverflow.com/q/28472395
type: AcceptedAnswer

http://stackoverflow.com/q/28513901
has comment: http://stackoverflow.com/comment/45345970
type: Question
has comment: http://stackoverflow.com/comment/45346036
has comment: http://stackoverflow.com/comment/45345963
has comment: http://stackoverflow.com/comment/45345992
has comment: http://stackoverflow.com/comment/45345954
answer count: 1
has comment: http://stackoverflow.com/comment/45345950
tagged with: javascript
tagged with: parallax
score: 0
tagged with: onresize
has comment: http://stackoverflow.com/comment/45345975
has answer: http://stackoverflow.com/a/28514129
accepted answer: http://stackoverflow.com/a/28514129
type: AnsweredQuestion
has title: Move element on resize
has body: I have a black box &lt;div id="blackbox" style="margin-left:0px; background-color:black; width:20px; height:20px;"&gt; onresize, each 1px decrement from screen.width should increment 'blackbox'.margin-left by 2px. A parallax triggered by resize Need to translate this to javascript function move() { var screenwidth = screen.width var innerwidth = window.innerwidth var x = screenwidth - innerwidth document.getElementById("blackbox").style.marginLeft = (x * 2) + "px"; } window.onresize = move;

apache
tags question: http://stackoverflow.com/q/28570286
tag name: apache
tags question: http://stackoverflow.com/q/28537051
tags question: http://stackoverflow.com/q/28525639
tags question: http://stackoverflow.com/q/28589224
type: Tag

http://stackoverflow.com/comment/45485683
type: Comment
has text: @LarsKotthoff: face + palm... not sure how highlighting all occurrences of `clickTimer` didn't pick that up! Add a quick answer if you want +15 rep. It's deserved out of my stupidity!
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28588871

http://stackoverflow.com/q/28488808
has answer: http://stackoverflow.com/a/28497613
type: Question
has title: Chart.js: colouring tooltip labels
tagged with: charts
downvote count: 0
tagged with: javascript
answer count: 1
accepted answer: http://stackoverflow.com/a/28497613
favorite count: 0
type: AnsweredQuestion
score: 3
tagged with: chart.js
upvote count: 3
has body: I can't find it in the docs, does anyone know how I can make those grey squares in the tool tip the same color as the lines, and potentially label each one? (High, Low, Average)

http://stackoverflow.com/a/28550172
type: AcceptedAnswer
downvote count: 0
has body: You are unnecessarily using :selected and instead of split use join to join a array, Just do var values = new Array(), var items; $.each($("input[name='offer1cards[]']"), function() { values.push($(this).val()); }); items = values.join(','); alert(items);
answers question: http://stackoverflow.com/q/28550131
has comment: http://stackoverflow.com/comment/45413567
accepted answer of: http://stackoverflow.com/q/28550131
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/a/28485576
upvote count: 6
has comment: http://stackoverflow.com/comment/45294193
score: 6
has comment: http://stackoverflow.com/comment/45293923
has body: var count = (location.pathname.split('/').length - 1) - (location.pathname[location.pathname.length - 1] == '/' ? 1 : 0);
downvote count: 0
answers question: http://stackoverflow.com/q/28485522
type: Answer

http://stackoverflow.com/comment/45427611
has text: I see you call checkConnection twice. Is onDeviceReady really called? could you try to remove the checkConnection on `onBodyLoad()`?
score: 0
comment on: http://stackoverflow.com/q/28557659
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45230554
has text: Ok, I've been able to pinpoint what does not work. The problem is that `String.fromCharCode()` outputs two bytes for values that are between 128 and 256. Any idea how I would go about it?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28451350
type: Comment

http://stackoverflow.com/q/28441123
score: 1
tagged with: forms
has title: Prepend text to form on submission with javascript
type: Question
has comment: http://stackoverflow.com/comment/45212201
has body: I want to add "https://" to a form on submission, without it appearing the text submission box. So far I have a script: &lt;script&gt; function formSubmit(){ var x=document.getElementById(“formname”); for (var i=0;i&lt;x.length;i++){ if(x.elements.item(i).id == 'q' &amp;&amp; x.elements.item(i).value != "" ) x.elements.q.value='https://'+x.elements.item(i).value; document.getElementById("formname").submit(); } &lt;/script&gt; and the form: &lt;form name="formname" method="GET" action="http://google.com/search" onsubmit="return (this.q.value == '') ? false : true; &gt; &lt;input type="text" name="q" size="32" maxlength="256" value="" /&gt; &lt;input type="submit" name="btnG" value="Search" /&gt; but can't figure it out. anybody see what I'm doing wrong?
tagged with: javascript
upvote count: 2
answer count: 1
downvote count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28441432
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28441432

http://stackoverflow.com/a/28585507
answers question: http://stackoverflow.com/q/28584395
type: AcceptedAnswer
has body: Here is the solution: if Rails.env.development? Sprockets::Server.module_eval do alias_method :ok_response_orig, :ok_response def ok_response(asset, env) asset.instance_eval do #The next string to be appended @source += %{ \n;(function(){ console.log("Called from #{File.basename(@pathname)}"); })(); } @length = Rack::Utils.bytesize(@source) @digest = Digest::MD5.new.update(@source).hexdigest end if asset.instance_eval{@pathname.to_s}.include?(".js") #You might want to add .coffee here ok_response_orig(asset, env) end def etag_match?(*args) true end end end Enjoy. P.S. Use it only in development env.
type: Answer
has comment: http://stackoverflow.com/comment/45479869
has comment: http://stackoverflow.com/comment/45479478
accepted answer of: http://stackoverflow.com/q/28584395
score: 0

marker
tag name: marker
tags question: http://stackoverflow.com/q/28566226
type: Tag

http://stackoverflow.com/q/28592324
has comment: http://stackoverflow.com/comment/45491237
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45492320
tagged with: templates
has body: iam trying to get the code in a Element Template: rent.html {{ rent.id }} {{ rent.auto }} {{ rent.person }} {{ rent.title }} {{ rent.start }} {{ rent.end }} controller.js kfzModule.directive("kfzRent", function(){ return { restrict: 'E', templateUrl: '/kfz-buchung/rent.html' }; }); overview.html I dont know how to deal with the rest in overview.html. I finally want just an . Thanks!
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28593460
has comment: http://stackoverflow.com/comment/45491338
score: 0
has comment: http://stackoverflow.com/comment/45491604
tagged with: directive
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28593460
answer count: 1
has title: Angular Template directive for ng-repeat and ng-class
has comment: http://stackoverflow.com/comment/45491288

http://stackoverflow.com/a/28461280
downvote count: 0
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28461184
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28461184
has body: Change your last bit to - jQuery.each(json.news, function(idx, obj) { alert(idx + '__' + obj['title']); }); })($); You have to iterate news of json
type: AcceptedAnswer

iron-router
tags question: http://stackoverflow.com/q/28531904
tags question: http://stackoverflow.com/q/28569860
tags question: http://stackoverflow.com/q/28446242
tags question: http://stackoverflow.com/q/28569009
tag name: iron-router
tags question: http://stackoverflow.com/q/28471393
tags question: http://stackoverflow.com/q/28532572
tags question: http://stackoverflow.com/q/28472347
type: Tag
tags question: http://stackoverflow.com/q/28480596

http://stackoverflow.com/q/28463188
has body: This is what I have. I am using bootstrap. I want the labels to be the same size. I don't want to use a fixed width (pixels) because I'm going to be translating this into multiple languages. An other complication is that this content is added dynamically as HTML text using the jQuery .html() function. Most importantly, what event can I handle that would allow me to work on my new code when it actually has a size. If i can do that, I can equalize with jQuery. This seems a bit heavy handed. I would love a CSS solution. This just feels like the number one weakness with HTML. You cannot do simple these simple things without very heavy solutions. Width Height Depth Here is the JSFiddle that shows things correctly with bootstrap: http://jsfiddle.net/sbqve4gc/1/
score: 0
has comment: http://stackoverflow.com/comment/45252758
has comment: http://stackoverflow.com/comment/45252252
answer count: 2
upvote count: 1
downvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
possible better answer: http://stackoverflow.com/a/28463448
has comment: http://stackoverflow.com/comment/45252446
type: AnsweredQuestion
tagged with: twitter-bootstrap
accepted answer: http://stackoverflow.com/a/28463432
type: Question
has answer: http://stackoverflow.com/a/28463432
has answer: http://stackoverflow.com/a/28463448
has title: How can I make these labels the same size without using pixels?
has comment: http://stackoverflow.com/comment/45253365

http://stackoverflow.com/q/28567563
has answer: http://stackoverflow.com/a/28569212
has answer: http://stackoverflow.com/a/28567777
downvote count: 2
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45445482
has answer: http://stackoverflow.com/a/28567716
favorite count: 0
linked to: http://stackoverflow.com/q/507138
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/45445425
has answer: http://stackoverflow.com/a/28567770
has comment: http://stackoverflow.com/comment/45445422
has answer: http://stackoverflow.com/a/28568020
has comment: http://stackoverflow.com/comment/45445473
score: -1
has answer: http://stackoverflow.com/a/28567693
type: Question
has body: I have like link like this: My Button and css style: .tree li a:hover, .tree li a:hover+ul li a { background: #c8e4f8; color: #000; border: 1px solid #94a0b4; } And my question is how to change this .tree style to another one? And if i click again the style return to the beginning style?
has title: How to change css li style with javascript?
tagged with: javascript
answer count: 6

http://stackoverflow.com/a/28450879
downvote count: 1
has comment: http://stackoverflow.com/comment/84146150
has comment: http://stackoverflow.com/comment/45230481
has comment: http://stackoverflow.com/comment/45232700
has comment: http://stackoverflow.com/comment/63485136
accepted answer of: http://stackoverflow.com/q/28450471
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/96210747
answers question: http://stackoverflow.com/q/28450471
upvote count: 129
has comment: http://stackoverflow.com/comment/63480843
score: 128
has comment: http://stackoverflow.com/comment/133585101
has comment: http://stackoverflow.com/comment/84146699
has body: Use XMLSerializer to convert the DOM to a string var s = new XMLSerializer().serializeToString(document.getElementById("svg")) and then btoa can convert that to base64 var encodedData = window.btoa(s); Just prepend the data URL intro i.e. data:image/svg+xml;base64, and there you have it.
has comment: http://stackoverflow.com/comment/84146072
has comment: http://stackoverflow.com/comment/83572841
type: Answer
has comment: http://stackoverflow.com/comment/99568031
has comment: http://stackoverflow.com/comment/131622863

http://stackoverflow.com/q/28535421
accepted answer: http://stackoverflow.com/a/28535793
tagged with: firefox
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28535793
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28535548
tagged with: http://stackoverflow.com/tag/html
has body: I'm trying to limit the text in textarea using JavaScript. It works fine in Chrome but when displayed in Firefox with max limit I'm unable to use backspace key to remove elements. It simply freezes in Mozilla when with max limit. Here is the HTML code: dfgdfg Here is the JS code: function textboxMultilineMaxNumber(txt, maxLen) { if (txt.value.length > (maxLen - 1)) { return false; } } Here is a DEMO
has title: Backspace not working in Firefox for TextArea when reached its limit
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28535548
type: Question

http://stackoverflow.com/a/28557543
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28556762
answers question: http://stackoverflow.com/q/28556762
type: Answer
score: 1
upvote count: 1
has body: JS timestamp is in milliseconds, PHP's is in seconds. You have to multiply PHP's one by 1000 or divide JS' one by 1000.

http://stackoverflow.com/a/28438780
has body: Your issue is coming from here: $.ajax({ url:'{{url_for("autocomplete")}}' }) The url_for method requires the name of the function for the desired route rather than physical route. To fix this, you can either do: $.ajax({ url:'{{url_for("get_contacts")}}' }) or if your Javascript is in a JS file, then do the following: $.ajax({ url:'/autocomplete' })
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45250418
answers question: http://stackoverflow.com/q/28438630
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45208031
has comment: http://stackoverflow.com/comment/45243621

http://stackoverflow.com/q/28521942
has body: in my booking form I have an input (email) with concrete name and I want to get this value so I can send an email to this value. I can't much edit code of input since it's pretty complicated WP plugin. Input code: &lt;input required="required" type="text" name="single-line-text-label---6397382___required" value="" class="large textfield"&gt; Code to email send: $to2 = trim(strip_tags($_POST['single-line-text-label---6397382___required'])); wp_mail($to2,$subject,$message); or this one which shows error call to undefined function. $to2 = document.getElementsByClassName("textfield")[0].value; wp_mail($to2,$subject,$message); The problem is that I don't get any emails, so I suppose $to2 is not got right value, cause if I replace code to $to2 = 'my@email.com' it works fine. Thanks a lot for help.
has comment: http://stackoverflow.com/comment/45360993
has comment: http://stackoverflow.com/comment/45362031
type: UnansweredQuestion
tagged with: input
has comment: http://stackoverflow.com/comment/45362389
has title: Set value from input by its name
answer count: 0
has comment: http://stackoverflow.com/comment/45361052
has comment: http://stackoverflow.com/comment/45360790
tagged with: wordpress
type: Question
has comment: http://stackoverflow.com/comment/45361502
tagged with: javascript
has comment: http://stackoverflow.com/comment/45360813
score: 0
has comment: http://stackoverflow.com/comment/45360684

http://stackoverflow.com/comment/45386071
type: AnswerComment
score: 0
type: Comment
has text: @BitwiseCreative thanks for your answer in both jQuery and JavaScript, hopefully I learn jQuery soon. This code was clear and helpful, thanks. Just one last thing, do you know how I could hide the Next Question button after it reaches it's last question?
comment on: http://stackoverflow.com/a/28535387

http://stackoverflow.com/q/28583964
has answer: http://stackoverflow.com/a/28585148
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45475271
type: Question
has comment: http://stackoverflow.com/comment/45475492
has body: Here is my site. Image slider is working fine, but I want the last number to stay on the screen. Now it is in auto play. is there anyway to stop the animation on last number? using this js for slider.
tagged with: jquery-mostslider
answer count: 3
has answer: http://stackoverflow.com/a/29748538
has answer: http://stackoverflow.com/a/28584172
tagged with: slideshow
tagged with: javascript
tagged with: jquery
score: 0
has title: How to stop animation on last slide
tagged with: slider

http://stackoverflow.com/a/28575337
score: 0
has comment: http://stackoverflow.com/comment/45461048
has comment: http://stackoverflow.com/comment/45460680
type: Answer
has comment: http://stackoverflow.com/comment/45626035
has comment: http://stackoverflow.com/comment/45461806
has comment: http://stackoverflow.com/comment/45460142
answers question: http://stackoverflow.com/q/28575137
has body: ok first off you aren't posting data to conditional.php at all. Your form action is pointing at test.php: so Change: <?php require_once "conditional.php";?> to: <?php if($_SERVER['REQUEST_METHOD'] == 'POST'){ if($_POST['inputText'] != ''){?> <?php } else{ echo "when nothing is inputed. Empty" // this is the php } } ?>

http://stackoverflow.com/q/28587612
has comment: http://stackoverflow.com/comment/45482335
has comment: http://stackoverflow.com/comment/45482461
has comment: http://stackoverflow.com/comment/45483763
has body: I have these routines that split up the file path. The issue that I am having is with /home/one/github/load-balancer-service/app/js/app.coffee. It seems to exclude the app.coffee and just leaves /js/ for srcFile Not sure why. Any ideas? For files in sub directories underneath js/foo/file.coffee it's not a issue. srcPath = "app"; console.log(streamObject.history[0]); var projectDir = streamObject.history[0].split(srcPath)[0]; console.log(projectDir); var srcFile = streamObject.history[0].split(srcPath)[1]; console.log(srcFile); output: /home/one/github/load-balancer-service/app/js/app.coffee /home/one/github/load-balancer-service/ /js/
score: 0
tagged with: javascript
has title: Node.js- Splitting up File Path with string.split()... Top Level File Gets Excluded
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/45482285
answer count: 0
type: Question

http://stackoverflow.com/comment/45484669
type: AnswerComment
comment on: http://stackoverflow.com/a/28587689
type: Comment
has text: Sorry about the tags. Nice to hear you googled it. You could use it this way to: $('#element').click(function() { $("#returnedResult").load("retrieve.html", function(responseTxt, statusTxt, xhr){ console.log(responseTxt); }); });
score: 1

http://stackoverflow.com/q/28548487
has title: "Your browser does not support html" - Http get request
answer count: 0
has comment: http://stackoverflow.com/comment/45410020
tagged with: http
type: Question
tagged with: javascript
tagged with: get
score: 0
has comment: http://stackoverflow.com/comment/45410167
tagged with: construct-2
has comment: http://stackoverflow.com/comment/45410021
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45447354
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45447390
has body: I am trying to get some data from a webserver, at http://orbyte-games.pe.hu/hosting/theAmateur/training_01, and when I use python to get the content, it returns the correct data. However, when I try to access it from Javascript (Construct 2 namely) it gives an html webpage, ironically with the content "Your browser does not support html"! This is quite frustrating, because firstly I don't need to use html, and secondly because of the irony of the sentence, which might just be me not understanding the dynamics of it.

http://stackoverflow.com/q/28574285
score: 9
type: Question
downvote count: 0
has answer: http://stackoverflow.com/a/28574544
has comment: http://stackoverflow.com/comment/45458305
tagged with: javascript
linked to: http://stackoverflow.com/q/7911225
favorite count: 0
possible better answer: http://stackoverflow.com/a/28574508
has answer: http://stackoverflow.com/a/28574508
has answer: http://stackoverflow.com/a/28574356
tagged with: http://stackoverflow.com/tag/html
has title: Place video with 100% height & 100% width using css or javascript
tagged with: css
answer count: 4
has answer: http://stackoverflow.com/a/28574596
accepted answer: http://stackoverflow.com/a/28574544
has body: I want to place a html5 video (with the video tag of course) with 100% width and 100% height which will play in the background. Here is an example with an image and I want exactly the same with a video, I just didn't find out how to do that: #image { background-image: url("image.jpg"); background-repeat: no-repeat; background-size: 100% 100%; width: 100%; height: 100%; position: fixed; top: 0; left: 0; } JSFiddle: http://jsfiddle.net/u9ncpyfu/
type: AnsweredQuestion
upvote count: 9

http://stackoverflow.com/comment/45263982
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28455296
has text: @Rakesh_Kumar: Yes. I have looked into it. Still not helpful.
score: 0

http://stackoverflow.com/q/28457158
has comment: http://stackoverflow.com/comment/45240858
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28457198
answer count: 4
has answer: http://stackoverflow.com/a/28457417
favorite count: 0
has answer: http://stackoverflow.com/a/28457198
upvote count: 2
tagged with: css
has answer: http://stackoverflow.com/a/28457200
type: AnsweredQuestion
has body: I'm pretty new to all of this and still learning :s So in my css, i've done this... .example { display: none; } I have a button which when i click makes other divs invis as well as trying to make it so that .example will be visible. I am using an onClick function...this is where I set the other div invis... document.getElementById("thisdiv").style.display = "none"; I can't seem to figure out how to make the other div visible now?
score: 1
downvote count: 1
has title: I've made something hidden in css, i can't make it visible now when I click a button
type: Question
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28457200
has answer: http://stackoverflow.com/a/28457329

http://stackoverflow.com/comment/45236751
has text: Thank you for your answer. Inside the which is perfectly run. But i need to put inside the . Im try it which is not working
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28454024

http://stackoverflow.com/comment/45379151
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28532062
score: 0
has text: Something similar to [this ?](http://stackoverflow.com/a/21814409/383904)

http://stackoverflow.com/q/28517223
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45351657
has answer: http://stackoverflow.com/a/28517615
has comment: http://stackoverflow.com/comment/45377599
has body: I am trying to pass the value of a variable from javascript to C#. Here is the client side part: &lt;input type="text" value="1" id="h" name="n" runat="server" /&gt; &lt;script&gt; $("a").on("tap", function (event) { var a = event.target.id; $("#h").val(a); }); &lt;/script&gt; and the server side part: &lt;% string param = h.Value; Response.Write(param); %&gt; The input field has an initial value=1. A JQuery event changes the value attribute to, let's say, 5. When I try to access the value of input from server side (h.Value), the value is again, 1. What am I doing wrong? Thank you.
linked to: http://stackoverflow.com/q/958040
type: Question
tagged with: c#
linked to: http://stackoverflow.com/q/17301366
has comment: http://stackoverflow.com/comment/45490057
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45351886
score: 0
has comment: http://stackoverflow.com/comment/45352010
answer count: 1
has comment: http://stackoverflow.com/comment/45352922
has title: Issue passing variable from javascript to c#

http://stackoverflow.com/q/28555294
has body: I've been using an old jQuery plugin called Tipsy. I like the way the tooltips look and for the most part I like the plugin. Unfortunately it only shows tooltips relative to the element it is retrieving the tooltip from. I'd like to show the tooltip in the position of the mouse cursor instead. Is there any way to do this? I would personally like to use this tooltip plugin if at all possible. I have tried playing with the plugin for a little while, but the code is beyond my current knowledge of jQuery. I thought trying to capture the event when firing the 'show' function would let me get the coordinates where the event was fired but that didn't work. Any help would be greatly appreciated. I'll show the source JS file below: // tipsy, facebook style tooltips for jquery // version 1.0.0a // (c) 2008-2010 jason frame [jason@onehackoranother.com] // releated under the MIT license (function($) { function fixTitle($ele) { if ($ele.attr('title') || typeof($ele.attr('original-title')) != 'string') { $ele.attr('original-title', $ele.attr('title') || '').removeAttr('title'); } } function Tipsy(element, options) { this.$element = $(element); this.options = options; this.enabled = true; fixTitle(this.$element); } Tipsy.prototype = { show: function() { var title = this.getTitle(); if (title &amp;&amp; this.enabled) { var $tip = this.tip(); $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title); $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).appendTo(document.body); var pos = $.extend({}, this.$element.offset(), { width: this.$element[0].offsetWidth, height: this.$element[0].offsetHeight }); var actualWidth = $tip[0].offsetWidth, actualHeight = $tip[0].offsetHeight; var gravity = (typeof this.options.gravity == 'function') ? this.options.gravity.call(this.$element[0]) : this.options.gravity; var tp; switch (gravity.charAt(0)) { case 'n': tp = {top: pos.top + pos.…
answer count: 1
tagged with: hover
tagged with: popup
accepted answer: http://stackoverflow.com/a/28562398
type: AnsweredQuestion
tagged with: tooltip
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: jQuery: Attach Tooltip to Mouse Cursor Position Using Plugin Tipsy
type: Question
score: 3
has answer: http://stackoverflow.com/a/28562398
upvote count: 3

http://stackoverflow.com/comment/45218373
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28443912
has text: You could manually trigger apply on the scope after you update the value. That will probably fix it as well, but it is not as clean: '$scope.$apply()'
score: 0

http://stackoverflow.com/comment/45411067
has text: @ChrisPietschmann - The file does not load. The file is not included when I inspect the HTML. I have checked the spelling as well
comment on: http://stackoverflow.com/q/28548988
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28560636
tagged with: android
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: The navigation bar is fixed at the header and when the menu icon is clicked the entire container slides to right This is my main page When the menu icon is clicked But when the page is scrolled down and clicked on menu icon, the header disappear This is my css code .content { position:relative; width:100%; height:100%; } .header { position:fixed; width:100%; height:50px; float: none !important; clear: both !important; background-color:#19b8df; left:0; top:0; z-index: 999999; } .menu { float:left; margin:10px; width:40px; height:40px; } This is my html code My jquery
has title: Navigation bar disappears
score: 0
upvote count: 1
has answer: http://stackoverflow.com/a/28560901
downvote count: 1
type: Question
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/28561697
tagged with: jquery
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/45490901
comment on: http://stackoverflow.com/q/28577005
type: QuestionComment
has text: @floribon also, if you post your comment as an answer I will mark it as such.
score: 0
type: Comment

http://stackoverflow.com/comment/45489116
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28591273
has text: check your js console. you've got syntax errors.

http://stackoverflow.com/a/28447169
answers question: http://stackoverflow.com/q/28447099
type: Answer
has body: Try this code Html MICHEL HUSSY LUSY PARKAR AB DEVILIERS Jquery $(document).ready(function() { console.log('dom ready'); $('#student_list_ul li').click(function(){ alert('li clicked'); }); }); check this link
score: 0

http://stackoverflow.com/comment/45444030
type: QuestionComment
comment on: http://stackoverflow.com/q/28566559
score: 0
has text: Not sure if this is possible from javascript alone, but you can Chrome dev tools. Inspect the element you suspect there's an event listener attached to and find the 'Event Listeners' tab right next to the 'Styles' tab.
type: Comment

http://stackoverflow.com/q/28583620
score: 0
type: Question
has title: Write stdout to a div as program executes with Node-Webkit?
has answer: http://stackoverflow.com/a/28584733
tagged with: javascript
has body: In my Node-Webkit app, I use exec() to execute a child application. The application prints out some debug information to the shell. The problem is stdout only sends the text after the child application has exited. Is there a way to update a div element with the stdout info as the child application is running? var exec = require('child_process').exec; exec(executableFile, function (error, stdout, stderr) { if (stdout) { // this only updates after the app exits console.log('stdout: ' + stdout); $('#console-output').append('stdout: ' + stdout +'&lt;br/&gt;'); } if (error !== null) { console.log('exec error: ' + error); } });
tagged with: windows
answer count: 1
tagged with: shell
accepted answer: http://stackoverflow.com/a/28584733
tagged with: node-webkit
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/a/57065276
upvote count: 2
downvote count: 0
has body: I had this problem and it was because another script was deleting all of the tables and recreating them, but my table wasn't being recreated. I spent ages on this issue before I noticed that my table wasn't even visible on the page. Can you see your table before you initialize DataTables? Essentially, the other script was doing: let tables = $("table"); for (let i = 0; i &lt; tables.length; i++) { const table = tables[i]; if ($.fn.DataTable.isDataTable(table)) { $(table).DataTable().destroy(remove); $(table).empty(); } } And it should have been doing: let tables = $("table.some-class-only"); ... the rest ...
type: Answer
answers question: http://stackoverflow.com/q/28454203
score: 2

http://stackoverflow.com/q/28554750
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45422222
possible better answer: http://stackoverflow.com/a/28554816
has answer: http://stackoverflow.com/a/28554816
type: Question
score: -2
tagged with: javascript
tagged with: jquery
has title: jQuery file not linked properly
has comment: http://stackoverflow.com/comment/45422229
has answer: http://stackoverflow.com/a/28554791
has comment: http://stackoverflow.com/comment/45422208
answer count: 2
downvote count: 4
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/3395359
favorite count: 0
upvote count: 2
has body: Here is the HTML head: &lt;head&gt; &lt;link type='text/css' rel='stylesheet' href='style.css'&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" href='script.js'&gt;&lt;/script&gt; &lt;/head&gt; Here are the contents of the jQuery file: $(document).ready(function() { var $block_number = prompt('How many blocks?'); function writeBoard() { while ($.isNumeric($block_number) === false &amp;&amp; $block_number &lt; 150) { $block_number = prompt('How many blocks?'); } for (var i = 0; i &lt; $block_number; i++) { $('#board').prepend("&lt;div class='block'&gt;&lt;/div&gt;"); } }; writeBoard(); $(".block").on("mouseover", function () { $(this).css("background-color", "black"); }); $('#redo').on('click', function () { $('.block').css('background-color', 'white'); $block_number = prompt('How many blocks?'); writeBoard(); }); }); It doesn't seem to be working when the page is loaded locally as it was on jsfiddle for some reason. Any thoughts? Fiddle: http://jsfiddle.net/zfiscr/9dutj67b/
tagged with: css
accepted answer: http://stackoverflow.com/a/28554791

http://stackoverflow.com/a/28480384
upvote count: 1
answers question: http://stackoverflow.com/q/28478259
downvote count: 0
type: Answer
score: 1
has body: CSS class is the way to go, instead of changing the background simply add/remove a class. onrowclick="$(this).addClass('clicked')" onrowmousover="$(this).addClass('mouseover')" That way you can define a different style for each situation: .clicked { … } .mouseover { … } .clicked.mouseover { … }

http://stackoverflow.com/comment/45348737
type: QuestionComment
comment on: http://stackoverflow.com/q/28515405
score: 0
has text: please explain more, what do you want in output ?
type: Comment

http://stackoverflow.com/q/28461238
tagged with: pdf.js
has body: I've been following the following links to try to render a byte stream returned from an API to a PDF in browser using PDF.JS: http://codingcrazy87.blogspot.com/2014/05/view-pdf-files-directly-within-browser.html https://gist.github.com/fcingolani/3300351 Here is the JavaScript used to run render. Note: stream is a byte array returned from an API. var file = new Blob([stream], {type: 'application/pdf'}); var fileURL = URL.createObjectURL(file); $scope.renderPDF(fileURL, document.getElementById('pdf-holder')); Here is $scope.renderPDF: $scope.renderPDF = function(url, canvasContainer) { var scale= 1.5; //"zoom" factor for the PDF function renderPage(page) { var viewport = page.getViewport(scale); var canvas = document.createElement('canvas'); var ctx = canvas.getContext('2d'); var renderContext = { canvasContext: ctx, viewport: viewport }; canvas.height = viewport.height; canvas.width = viewport.width; canvasContainer.appendChild(canvas); page.render(renderContext); } function renderPages(pdfDoc) { for(var num = 1; num &lt;= pdfDoc.numPages; num++) pdfDoc.getPage(num).then(renderPage); } PDFJS.disableWorker = true; PDFJS.getDocument(url).then(renderPages); } Here is the HTML in my template page: &lt;script type="text/javascript" src="https://cdn.rawgit.com/mozilla/pdf.js/gh-pages/build/pdf.js"&gt;&lt;/script&gt; &lt;div id="pdf-holder"&gt; &lt;/div&gt; When the code runs PDFJS.getDocument(url).then(renderPages); I get a 404 Not Found error on worker.js, which makes sense because I'm following these examples and disabling worker so I shouldn't need it. Does anyone have any advice or an easy way around this that I can render a pdf in browser from a byte stream?
tagged with: http://stackoverflow.com/tag/pdf
upvote count: 3
has answer: http://stackoverflow.com/a/28464560
type: Question
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/45279375
has comment: http://stackoverflow.com/comment/45300152
accepted answer: http://stackoverflow.com/a/28464560
has comment: http://stackoverflow.com/comment/45283599
has title: Render PDF using PDF.JS and AngularJS from byte array
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/comment/87133317
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28558029
has text: Is there any option where I can move the image in a curve(kind of half circle) top to bottom ?
score: 0

http://stackoverflow.com/comment/45439184
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28560310
has text: because youre creating another element and delete the original one. when you want to move your car from a to b do you drive there or buy a new one and destroy the first one? :)

http://stackoverflow.com/q/28445401
has body: I want to create an array for active items and inactive items in my list. I currently have the below code. The below code works however I want the format to be the same as the existing array. var myData = [ {"text" : "item 1", "id":11111, "active" : 0 }, {"text" : "item 2", "id":22222, "active" : 1 }, {"text" : "item 3", "id":33333, "active" : 1 }, {"text" : "item 4", "id":44444, "active" : 0 } ]; console.log(myData[0].text); //returns item 1 var active = []; var inactive = []; for (var i = 0; i &lt; myData.length; i++) { if(myData[i].active) { active.push({ items: myData[i]; }); } else { inactive.push({ items: myData[i]; }); } } console.log(active[0].items.text); //returns item 2 console.log(inactive[0].items.text); //returns item 1 I can't seem to work out how to push the whole object into the array without naming it. I want to setup my array so that I can console.log active[0].text rather than having to go to the next level and go active[0].items.text Is there a way I can push the whole object without naming it?
has answer: http://stackoverflow.com/a/28445659
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28445493
has title: push existing array into multiple arrays js
tagged with: arrays
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28445659
possible better answer: http://stackoverflow.com/a/28445543
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28445543
has answer: http://stackoverflow.com/a/28445490
answer count: 4

http://stackoverflow.com/a/28568514
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28568293
has body: function showPic(e) { // e is the event, e.target is the current element "use strict"; e.preventDefault(); var source = e.target.getAttribute("href"); var placeholder = document.getElementById("placeholder"); placeholder.setAttribute("src", source); } window.onload = function() { "use strict"; var anchors = document.getElementsByTagName("a"); for(var i = 0, count = anchors.length; i &lt; count; i++) { anchors[i].onclick = showPic; // Or you could use anchors[i].addEventListener('click',showPic); } } Don't forget to remove what's in the HTML. JS Fiddle Demo On a side note Void mentioned using addEventListener instead of onclick. Both are acceptable, with a difference to keep in mind: This code: element.onclick = func1; element.onclick = func2; Will result in func2 being called on click, but not func1. That is because it overwrites any previous .onclick statement on that precise element. This code, however: element.addEventListener('click',func1); element.addEventListener('click',func2); Will result in both func1 and func2 being executed, because they add up.
answers question: http://stackoverflow.com/q/28568293
type: AcceptedAnswer
downvote count: 0
score: 1

http://stackoverflow.com/a/28585669
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28584545
answers question: http://stackoverflow.com/q/28584545
has body: Figured it out. Add sym.playAll(); To the 'complete' action to replay all symbols
score: 0

http://stackoverflow.com/a/28589727
type: AcceptedAnswer
upvote count: 6
accepted answer of: http://stackoverflow.com/q/28589540
type: Answer
has body: You could use window.performance.timing.loadEventEnd: &gt; performance.timing.loadEventEnd 1424280020354 window.performance.timing provides timestamps for the following page load lifecycle events, in order: navigationStart unloadEventStart unloadEventEnd redirectStart redirectEnd fetchStart domainLookupStart domainLookupEnd connectStart connectEnd secureConnectionStart requestStart responseStart responseEnd domLoading domInteractive domContentLoadedEventStart domContentLoadedEventEnd domComplete loadEventStart loadEventEnd Source: Navigation Timing API on MDN The Navigation Timing API is currently supported by most modern browsers. Exceptions: Safari &lt; 8 on OSX, Safari on iOS and Opera Mini. - caniuse.com.
score: 6
downvote count: 0
answers question: http://stackoverflow.com/q/28589540

http://stackoverflow.com/q/28484323
has body: Please read whole topic, before post answer. No answer found to this question in post: ++someVariable Vs. someVariable++ in Javascript var i = 1; i = i++ * 2; // i = 2, .. why not 4 ? interpreter does the multiply (1*2), but where is the increment ( i++ )? var i = 1; i = ++1 * 2; // i = 4 I'm understand, that the i++ does the increment after the statement, ++i does it before the statement, but in this example: i = i++ * 2 // (1*2), how the interpreter works?, where is the increment of i in this case? maybe i = (1*2)+1 )), or i = (1*2) and no more i exist, and nothing to increment?? HOW ? P.S. I think, it is a wrong question, but as Brooks Hanes said(in comment), this is a learning example.
has comment: http://stackoverflow.com/comment/45290702
duplicate of: http://stackoverflow.com/q/3469885
answer count: 2
upvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28486581
possible better answer: http://stackoverflow.com/a/28484344
score: -3
tagged with: increment
has answer: http://stackoverflow.com/a/28484344
has title: How works multiplication just after incrementation (i++ * 2) in Javascript?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45291098
has comment: http://stackoverflow.com/comment/45290604
tagged with: multiplication
downvote count: 3
has comment: http://stackoverflow.com/comment/45290634
type: Question
accepted answer: http://stackoverflow.com/a/28486581
has comment: http://stackoverflow.com/comment/45290669
linked to: http://stackoverflow.com/q/3469885
has comment: http://stackoverflow.com/comment/45293164
tagged with: javascript

http://stackoverflow.com/comment/45366167
has text: Strange the link for me is working. I think I explained why you think the decrement is not working. And how to fix it. Classes instead of ids and **live** instead of regular even listener
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28522672

http://stackoverflow.com/a/28520833
type: Answer
has body: No.You can do it like this: x var deleteItem = function(){ $(this).remove(); } or you can make click event with javascript.as set click event on each tag with javascript.The this inside click event function is the current element you clicked on. here is a link which can help you. http://www.w3docs.com/learn-javascript/javascript-events.html
has comment: http://stackoverflow.com/comment/45358644
has comment: http://stackoverflow.com/comment/45359029
has comment: http://stackoverflow.com/comment/45358574
has comment: http://stackoverflow.com/comment/45358533
answers question: http://stackoverflow.com/q/28520770
score: 0
has comment: http://stackoverflow.com/comment/45358907
has comment: http://stackoverflow.com/comment/45358711
has comment: http://stackoverflow.com/comment/45358678

http://stackoverflow.com/comment/45260254
score: 0
comment on: http://stackoverflow.com/q/28467271
type: QuestionComment
type: Comment
has text: what `Items.query()` returns ? can you paste `Items.query` function code

http://stackoverflow.com/comment/45366093
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28525098
type: QuestionComment
has text: Have you tried removing `top: -10px;`?

http://stackoverflow.com/comment/45433347
type: QuestionComment
comment on: http://stackoverflow.com/q/28556747
has text: Hey guys, never used code review so wasn't aware of this. I will repost, but thanks for your initial comment, very helpful.
score: 0
type: Comment

web-crawler
tags question: http://stackoverflow.com/q/28510938
tag name: web-crawler
tags question: http://stackoverflow.com/q/28537906
type: Tag

http://stackoverflow.com/comment/45488738
has text: `data="arrayResult[key]"` as explained in my answer.
comment on: http://stackoverflow.com/q/28590623
type: Comment
type: QuestionComment
score: 1

reactjs
tags question: http://stackoverflow.com/q/28442239
tags question: http://stackoverflow.com/q/28526372
tags question: http://stackoverflow.com/q/28578098
tags question: http://stackoverflow.com/q/28509789
tags question: http://stackoverflow.com/q/28467573
tags question: http://stackoverflow.com/q/28466762
tags question: http://stackoverflow.com/q/28517910
tags question: http://stackoverflow.com/q/28534344
tags question: http://stackoverflow.com/q/28507594
tags question: http://stackoverflow.com/q/28523805
tags question: http://stackoverflow.com/q/28532329
tags question: http://stackoverflow.com/q/28567549
tags question: http://stackoverflow.com/q/28463647
tags question: http://stackoverflow.com/q/28495850
type: Tag
tags question: http://stackoverflow.com/q/28524807
tags question: http://stackoverflow.com/q/28487380
tags question: http://stackoverflow.com/q/28541074
tags question: http://stackoverflow.com/q/28553904
tags question: http://stackoverflow.com/q/28479239
tags question: http://stackoverflow.com/q/28465374
tags question: http://stackoverflow.com/q/28488667
tags question: http://stackoverflow.com/q/28485543
tags question: http://stackoverflow.com/q/28569686
tags question: http://stackoverflow.com/q/28533824
tags question: http://stackoverflow.com/q/28439807
tags question: http://stackoverflow.com/q/28562993
tags question: http://stackoverflow.com/q/28514868
tag name: reactjs
tags question: http://stackoverflow.com/q/28534549
tags question: http://stackoverflow.com/q/28546473
tags question: http://stackoverflow.com/q/28498249
tags question: http://stackoverflow.com/q/28448641
tags question: http://stackoverflow.com/q/28459185
tags question: http://stackoverflow.com/q/28545736
tags question: http://stackoverflow.com/q/28527078
tags question: http://stackoverflow.com/q/28478945
tags question: http://stackoverflow.com/q/28588591
tags question: http://stackoverflow.com/q/28569503
tags question: http://stackoverflow.com/q/28577403
tags question: http://stackoverflow.com/q/28470902
tags question: http://stackoverflow.com/q/28473688
tags question: http://stackoverflow.com/q/28574143
tags question: http://stackoverflow.com/q/28503739
tags question: http://stackoverflow.com/q/28491734
tags question: http://stackoverflow.com/q/28497338
tags question: http://stackoverflow.com/q/28463807
tags question: http://stackoverflow.com/q/28577304
tags question: http://stackoverflow.com/q/28512089
tags question: http://stackoverflow.com/q/28517749
tags question: http://stackoverflow.com/q/28461696
tags question: http://stackoverflow.com/q/28487517
tags question: http://stackoverflow.com/q/28573329
tags question: http://stackoverflow.com/q/28462137
tags question: http://stackoverflow.com/q/28554004
tags question: http://stackoverflow.com/q/28587076
tags question: http://stackoverflow.com/q/28458207
tags question: http://stackoverflow.com/q/28438807
tags question: http://stackoverflow.com/q/28585051
tags question: http://stackoverflow.com/q/28525861
tags question: http://stackoverflow.com/q/28511207
tags question: http://stackoverflow.com/q/28509609

http://stackoverflow.com/comment/45484395
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28588719
has text: It's not working because there are the same id.

http://stackoverflow.com/comment/45474134
score: 0
type: QuestionComment
type: Comment
has text: @collapsar i am using firefox. If it was a setup or browser issue then it shouldnt be working at all even with the alert! but it works along with an alert! which seems very strange
comment on: http://stackoverflow.com/q/28582122

google-maps-api-3
tags question: http://stackoverflow.com/q/28526506
tags question: http://stackoverflow.com/q/28535013
tags question: http://stackoverflow.com/q/28534840
tags question: http://stackoverflow.com/q/28442571
tags question: http://stackoverflow.com/q/28493846
tags question: http://stackoverflow.com/q/28586618
tags question: http://stackoverflow.com/q/28489891
tags question: http://stackoverflow.com/q/28502932
tags question: http://stackoverflow.com/q/28477554
tags question: http://stackoverflow.com/q/28441920
tags question: http://stackoverflow.com/q/28499141
tags question: http://stackoverflow.com/q/28551056
tags question: http://stackoverflow.com/q/28480348
tags question: http://stackoverflow.com/q/28516905
tags question: http://stackoverflow.com/q/28573054
tags question: http://stackoverflow.com/q/28509452
tags question: http://stackoverflow.com/q/28566699
tags question: http://stackoverflow.com/q/28458223
tags question: http://stackoverflow.com/q/28484487
tags question: http://stackoverflow.com/q/28576388
tags question: http://stackoverflow.com/q/28556325
tags question: http://stackoverflow.com/q/28566052
tags question: http://stackoverflow.com/q/28582943
tag name: google-maps-api-3
tags question: http://stackoverflow.com/q/28581493
tags question: http://stackoverflow.com/q/28516746
tags question: http://stackoverflow.com/q/28584417
type: Tag
tags question: http://stackoverflow.com/q/28542133
tags question: http://stackoverflow.com/q/28497023
tags question: http://stackoverflow.com/q/28521852
tags question: http://stackoverflow.com/q/28513033
tags question: http://stackoverflow.com/q/28467447
tags question: http://stackoverflow.com/q/28505453
tags question: http://stackoverflow.com/q/28457660
tags question: http://stackoverflow.com/q/28531341
tags question: http://stackoverflow.com/q/28490425
tags question: http://stackoverflow.com/q/28530021
tags question: http://stackoverflow.com/q/28504389
tags question: http://stackoverflow.com/q/28470902
tags question: http://stackoverflow.com/q/28545365
tags question: http://stackoverflow.com/q/28483350
tags question: http://stackoverflow.com/q/28489648

http://stackoverflow.com/comment/45482359
type: Comment
type: QuestionComment
has text: yes, but doesn't work, because the pink square doesn't stay bellow the red one.
comment on: http://stackoverflow.com/q/28587586
score: 0

http://stackoverflow.com/q/28565041
has comment: http://stackoverflow.com/comment/45444455
score: 0
has comment: http://stackoverflow.com/comment/45442410
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: datepicker
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45444998
answer count: 0
has title: Mega Menu Tabs become unresponsive
type: Question
has body: I am trying to replicate the "tabs" section as explained in this tutorial:Google Material Design Everthing works fine except when I insert a date which uses a datepicker widget from this url DatePicker As soon as I select the date from Dropdown 2 all the tabs in Megamenu become unresponsive as shown in this jsfiddle link JSFIDDLE LINK HTML code for the tabs: Home Reminder Reports Insurance History Between Dates Insurance history of Account Insurance Amount between dates Bulletin Board Welcome Wasim(1117004017)
tagged with: javascript

http://stackoverflow.com/q/28512905
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/45344785
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45345268
has title: Bootstrap Date picker
accepted answer: http://stackoverflow.com/a/28537528
tagged with: javascript
has body: Hey this question might have been asked before, however I haven't been able to find a solution. I have two bootstrap date pickers. Based on the first date selection the second date should be restricted to the first date + 15. I would like the vice-versa to happen as well. When a user selects the second date first the first date should be restricted to the second date - 15. My code so far : var nowTemp = new Date(); var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0); var checkin = $('#inputDate1').datepicker({ onRender: function (date) { return date.valueOf() &gt; now.valueOf() ? 'disabled' : ''; } }).on('changeDate', function (ev) { //made changes to condition below var newDate = new Date(ev.date) checkout.setValue(newDate); checkin.hide(); $('#inputDate2')[0].focus(); }).data('datepicker'); var checkout = $('#inputDate2').datepicker({ onRender: function (date) { //made changes to below line var after = new Date(checkin.date); after.setDate(after.getDate() + 14); if(now.valueOf() &gt; after.valueOf()) { return (date.valueOf() &lt;= after.valueOf()) &amp;&amp; (date.valueOf()&gt;= checkin.date.valueOf()) ? '' : 'disabled'; } else if(after.valueOf() &gt; now.valueOf()) { return (date.valueOf() &lt;= now.valueOf()) &amp;&amp; (date.valueOf()&gt;= checkin.date.valueOf()) ? '' : 'disabled'; } } }).on('changeDate', function (ev) { checkout.hide(); }).data('datepicker'); Any help is appreciated.
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: datepicker
has answer: http://stackoverflow.com/a/28537528
type: AnsweredQuestion

geography
type: Tag
tag name: geography
tags question: http://stackoverflow.com/q/28506195
tags question: http://stackoverflow.com/q/28506718

http://stackoverflow.com/comment/45243051
type: QuestionComment
type: Comment
has text: Send something like this `{'data':{'var_1': 'value1', 'var_2' : 'value2'}}` .Then access it by `$_POST['data']['var_1'], $_POST['data']['var_2']`
comment on: http://stackoverflow.com/q/28458307
score: 0

http://stackoverflow.com/q/28477042
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45277244
type: Question
has answer: http://stackoverflow.com/a/28477243
has body: I am unable to show php variable in javascript; this is my code here: &lt;script type="text/javascript"&gt; $(document).ready(function (){ var n=&lt;?php echo json_encode($count)?&gt;; for(var i=0;i&lt;n;i++){ var div = document.createElement('div'); div.className = "d5"; div.id=i+1; document.getElementById('wrapper').appendChild(div); &lt;?php $query="select * from shop_product where shop_uniqueid='$unq'"; $result=mysql_query($query); while($row=mysql_fetch_array($result)) { $product=$row["in_product"]; ?&gt; var product=&lt;?php echo $product?&gt;; $('#'+div.id).html(product); &lt;?php } ?&gt; }//for loop ends });//ready ends &lt;/script&gt; here i am trying to pass var product in html() of which value is coming from php like: var product=&lt;?php echo $product?&gt;; but when doing so php value is not coming in Javascript's var product. when I pass $('#'+div.id).html("abcd"); abcd value is showing in divs. please help me.
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28477243
tagged with: http://stackoverflow.com/tag/html
has title: Unable to show php variable in javascript?
tagged with: php

http://stackoverflow.com/comment/45292394
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28484905
type: Comment
has text: would i write that if statement individually for each field ie: if($_POST['fieldname'] == "") return $error then another for the next, or would i write if($_POST['fieldname'] == "" && if($_POST['fieldname2'])

http://stackoverflow.com/q/28524790
type: Question
has comment: http://stackoverflow.com/comment/45366306
has comment: http://stackoverflow.com/comment/45372690
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28527227
score: 0
answer count: 2
has title: hottowel undefined is not a function
has comment: http://stackoverflow.com/comment/45366352
tagged with: gulp
tagged with: hottowel
has body: This is my first experience using Node.js I am following this tutorial: http://www.johnpapa.net/get-up-and-running-with-node-and-visual-studio/ I am using Cmder as my command prompt. I have all components installed and I can view the versions of: Node npm bower yeoman gulp grunt When I try to build the app using: gulp serve-dev --sync This is the output: F:\Projects\myapp λ gulp serve-dev --sync [04:18:21] Using gulpfile F:\Projects\myapp\gulpfile.js [04:18:21] Starting 'wiredep'... [04:18:21] Wiring the bower dependencies into the html [04:18:21] Starting 'clean-styles'... [04:18:21] Cleaning: ./.tmp/**/*.css,./build/styles/**/*.css [04:18:21] Starting 'clean-code'... [04:18:21] Cleaning: ./.tmp/**/*.js,./build/js/**/*.js,./build/**/*.html [04:18:21] Finished 'clean-styles' after 32 ms [04:18:21] Starting 'styles'... [04:18:21] Compiling Less --&gt; CSS [04:18:22] Finished 'clean-code' after 625 ms [04:18:22] Starting 'templatecache'... [04:18:22] Creating an AngularJS $templateCache F:\Projects\myapp\node_modules\gulp-less\index.js:68 }).done(undefined, cb); ^ TypeError: undefined is not a function at DestroyableTransform._transform (F:\Projects\myapp\node_modules\gulp-less\index.js:68:8) at DestroyableTransform.Transform._read (F:\Projects\myapp\node_modules\gulp-less\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:184:10) at DestroyableTransform.Transform._write (F:\Projects\myapp\node_modules\gulp-less\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:172:12) at doWrite (F:\Projects\myapp\node_modules\gulp-less\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:237:10) at writeOrBuffer (F:\Projects\myapp\node_modules\gulp-less\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:227:5) at DestroyableTransform.Writable.write (F:\Projects\myapp\node_modules\gulp-less\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:194:11) at write (F:\Pro…
has answer: http://stackoverflow.com/a/28591203
accepted answer: http://stackoverflow.com/a/28591203
tagged with: node.js
has answer: http://stackoverflow.com/a/28527227
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45380515
has comment: http://stackoverflow.com/comment/45377536

http://stackoverflow.com/comment/45467472
type: QuestionComment
has text: I have checked the link posted in question's comment above. The js code provided in that post is not detecting whether FB app is installed or not. It is simply redirecting to fb:// page or http://facebook.com.
comment on: http://stackoverflow.com/q/28577399
score: 0
type: Comment

http://stackoverflow.com/comment/49162922
has text: Leon, did that improvement ever ship in an update I can download to my Chromecast?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28554000
score: 1

http://stackoverflow.com/comment/45442709
type: Comment
has text: Right now it's not working on my browser. It may be a chaching issue or it could be the browser itself. Either way, at least it's working for others. Thanks for the help.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28566059

http://stackoverflow.com/q/28452299
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28452474
answer count: 4
has comment: http://stackoverflow.com/comment/45231973
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45232785
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28452451
upvote count: 1
downvote count: 1
accepted answer: http://stackoverflow.com/a/28452474
type: Question
has answer: http://stackoverflow.com/a/28452493
has title: JSON array elements as individual array
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/28452377
score: 0
has body: Say I have a JSON like the structure bellow [{ "name": "name1", "custitem_color": "3", "custitem_ribbon": "1", "baseprice": "10.00", "cost": "12.00" }, { "name": "name2", "custitem_color": "4", "custitem_ribbon": "2", "baseprice": "20.00", "cost": "15.00" }, { "name": "name3", "custitem_color": "6", "custitem_ribbon": "3", "baseprice": "30.00", "cost": "22.00" }, { "name": "name4", "custitem_color": "8", "custitem_ribbon": "4", "baseprice": "40.00", "cost": "18.00" }] I want to generate the output as bellow "name": ["name1","name2","name3"], "custitem_color":["3","4","6","8"] I searched over SO but didn't get a match of this type. I'm curious to know if is there any library or workaround to get all the key's value as a separate array like the above I've mentioned. Any suggestions or point to any resource would be greatly appreciated.
possible better answer: http://stackoverflow.com/a/28452377
linked to: http://stackoverflow.com/q/684672

http://stackoverflow.com/a/28527827
upvote count: 16
type: Answer
downvote count: 0
score: 16
answers question: http://stackoverflow.com/q/28527712
has body: You can use dot notation or bracket notation ... var obj = {}; obj = { "1": "aa", "2": "bb" }; obj.another = "valuehere"; obj["3"] = "cc";

http://stackoverflow.com/comment/45371141
comment on: http://stackoverflow.com/a/28527705
score: 0
type: AnswerComment
type: Comment
has text: There is nothing wrong with the answer. Sometimes the reason of downvote is not _technical_!

http://stackoverflow.com/comment/45333853
comment on: http://stackoverflow.com/a/28501739
score: 1
type: AnswerComment
has text: The solution works nicely. Using `page.switchToChildFrame(1)` (instead of `0`) I can finally get the `#imgCaptcha` and the correct width and height. However, the offset (`top` and `left`) are in relation to the frame itself (or something like that), so that when I use `page.clipRect` I end up getting a .png of some texts a little bit above the Captcha.
type: Comment

http://stackoverflow.com/comment/45417136
comment on: http://stackoverflow.com/q/28552014
score: 0
type: Comment
type: QuestionComment
has text: #1, use parametered prepare statements, #2, there is no telling what the problem is by this small code, filling in some data, this code works fine for me. Maybe you should try doing JSON posting instead?

http://stackoverflow.com/comment/64460355
type: AnswerComment
comment on: http://stackoverflow.com/a/28697396
type: Comment
has text: @MichaelM - I actually got code working on newer Android OS (so binary data in `multipart/form`). BUT then the app went live, and the devices used in production was much older. Long story short - eventually I also had to revert to base64 encoded post (and I tried *everything*...believe me). The main problem being that the Blob API available (if available at all) on older OSes just can't do what needs to happen
score: 0

http://stackoverflow.com/comment/45259106
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28466648
has text: i tried to do via php pass value to other page via jquery post , but it's longer way
score: 0

http://stackoverflow.com/comment/45253834
type: AnswerComment
score: 0
type: Comment
has text: So now I notice that my scripts aren't even showing up in the source code so they're not even making it past the enqueue part
comment on: http://stackoverflow.com/a/28463754

http://stackoverflow.com/q/28483136
tagged with: google-maps
tagged with: javascript
has comment: http://stackoverflow.com/comment/45289059
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28484288
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45288726
favorite count: 0
has body: I am having a problem where the google maps will start to slow down and crash after playing around with the draw area function (bottom of page). Wanted to know if I have missed something or I have something in there which is causing it to crash? var map; var weatherDisplayIsOn = false; var markers = []; var cArea; function initialize() { var myLatlng = new google.maps.LatLng(51.488651, -0.063232); var newYork = new google.maps.LatLng(40.719967, -74.009893); var paris = new google.maps.LatLng(48.857278, 2.352210); var london = new google.maps.LatLng(51.519670, -0.125631); var towerBridge = new google.maps.LatLng(51.506231, -0.075356); var mapOptions = { center: myLatlng, zoom: 8, disableDefaultUI: true, mapTypeId: google.maps.MapTypeId.SATELLITE }; map = new google.maps.Map(document.getElementById('map'), mapOptions); var Home = ' ' + ' ' + ' ' + ' Home ' + ' ' + ' Home, the buidling I had spent the last 13 years living ' + 'in with the locality of Primary Schools, Secondary and Localised ' + 'public transport ' + ' ' + ' ' + ' '; var infoHome = new google.maps.InfoWindow({ content: Home }); var marker = new google.maps.Marker({ position: myLatlng, map: map, animation: google.maps.Animation.DROP, title: 'Homeland' }); google.maps.event.addListener(marker, 'click', function() { infoHome.open(map, marker); }); var NewYork = ' ' + ' ' + ' ' + ' New York ' + ' ' + ' New York, often called New York City or the City of New York to distinguish ' + 'it from the State of New York, of which it is a part of the most populous city ' + 'in the United States and the center of the New York metropolitan area, the premier gateway for' + 'legal immigration to the United States and one of the most populous urban agglomerations in the world.' + ' ' + ' ' + ' ' + ' ' + ' '; var nyInfo = new google.maps.InfoWindow({ content: NewYork }); var marker1 = new google.maps.Marker({ position: newYork, map: map, animation: google.maps.Animation.DROP, title: 'New York' }); google.maps.event.addList…
has answer: http://stackoverflow.com/a/28484288
type: AnsweredQuestion
upvote count: 0
score: -1
type: Question
has comment: http://stackoverflow.com/comment/45288557
has title: Google Maps crashes after a while after a few clicks

http://stackoverflow.com/comment/126664507
type: Comment
comment on: http://stackoverflow.com/a/41951484
type: AnswerComment
score: 0
has text: Thank you! I use this approach to perform an action (view larger image) when clicked

http://stackoverflow.com/q/28564851
has answer: http://stackoverflow.com/a/78870788
has body: Hello i need create blending color tool, i try take color pixel from canvas with getImageData and mixed with my selected color and get average color, i can get it with easy: /* r1 = red channel from getImageData g1 = green channel from getImageData b1 = blue channel from getImageData r2 = red channel my selected color g2,b2 same */ var avR = Math.round(0.5*r1 + 0.5*r2); var avG = Math.round(0.5*g1 + 0.5*g2); var avB = Math.round(0.5*b1 + 0.5*b2); While i drawing i try mixed this colors, but blending effect not available.. Maybe somebody can help me? http://jsfiddle.net/b72ky2sc/6/ i need that tool can get image in left side:
downvote count: 0
tagged with: brush
favorite count: 0
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
has title: HTML5 canvas paint blending color tool
has answer: http://stackoverflow.com/a/28574510
type: Question
accepted answer: http://stackoverflow.com/a/28574510
tagged with: javascript
possible better answer: http://stackoverflow.com/a/78870788
answer count: 2
tagged with: canvas

http://stackoverflow.com/q/28570560
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45451189
has body: My problem: I have a PLC, a Raspberry Pi with a weather station and a Solar inverter in my home network. The Raspberry and the inverter have the possibility to deliever JSON data output. I like to access these data with a HTML webpage which is placed on the webserver of the PLC. But unfortunately I'm not able to access the JSON data within my network. Its possible to parse the data when I copy the data locally (on webserver or PC for testing purposes), so the JSON data is free of errors. But when I want to access the data directly with JavaScript, nothing happens... I tried JQuery, Ajax and also a lot of the tips regarding cross domain access. Any tips what I can try to access the data within my network? Maybe someone with a similar hardware setup can help. Thanks a lot in advance!
score: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45697431
answer count: 0
type: UnansweredQuestion
has title: Javascript json query in same subnet not working
has comment: http://stackoverflow.com/comment/45698046
has comment: http://stackoverflow.com/comment/45451071
type: Question
has comment: http://stackoverflow.com/comment/45697411

http://stackoverflow.com/q/28577116
upvote count: 0
answer count: 1
tagged with: jsp
has comment: http://stackoverflow.com/comment/45463819
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45463291
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45463503
has answer: http://stackoverflow.com/a/28577379
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45464054
has title: Pagination in jsp using jQuery is not working
accepted answer: http://stackoverflow.com/a/28577379
has comment: http://stackoverflow.com/comment/45463088
has comment: http://stackoverflow.com/comment/45463488
downvote count: 1
type: Question
tagged with: jquery-pagination
has body: jQuery(function($){ var items = $("table tr"); var numItems = items.length; var perPage = 2; items.slice(perPage).hide(); $(".pagination-page").pagination({ items: numItems, itemsOnPage: perPage, cssStyle: "light-theme", onPageClick: function(pageNumber) { var showFrom = perPage * (pageNumber - 1); var showTo = showFrom + perPage; items.hide(); .slice(showFrom, showTo).show(); } });
tagged with: javascript
score: -1

http://stackoverflow.com/comment/47990657
has text: What is in the routes module `var routes = require('./routes')` Is it a list of routes? I have used Express router but this example here on SO seems to be the only example of setting up server side rendering with React Router, so it would be good if it was a full code example
score: 9
type: AnswerComment
comment on: http://stackoverflow.com/a/28558545
type: Comment

http://stackoverflow.com/comment/45314269
type: AnswerComment
has text: @Stephen Muecke just like the above said, force refreshing & alert(or dialog), right?
score: 0
comment on: http://stackoverflow.com/a/28474884
type: Comment

http://stackoverflow.com/comment/45376695
comment on: http://stackoverflow.com/a/28530650
type: AnswerComment
has text: You have more then that ;)
score: 0
type: Comment

http://stackoverflow.com/comment/45436452
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28562630
has text: @PawełPsztyć So, I must remove allow-same-origin from ?
score: 0

http://stackoverflow.com/comment/45450571
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28569726
type: Comment
has text: sorry. i hit enter for new line but it posted my reply.. this is my line which fails compile - addon.webhook('room_message', \/^ask (.*)$, function *() { ^ SyntaxError: Unexpected token ILLEGAL

http://stackoverflow.com/comment/45208263
type: AnswerComment
score: 0
type: Comment
has text: @lijas Pretty much, yeah. This does the job.
comment on: http://stackoverflow.com/a/28438528

http://stackoverflow.com/comment/82635926
type: Comment
has text: When you input "b", then the bold gets messed up, is there a way to avoid replacing anything that is inside an HTML-tag?
comment on: http://stackoverflow.com/a/28558661
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45336924
type: Comment
has text: I hadn't but i have restarted now and it is working! Thanks for your help, its much appreciated.
type: AnswerComment
comment on: http://stackoverflow.com/a/28488821
score: 0

http://stackoverflow.com/q/28541998
has comment: http://stackoverflow.com/comment/45411306
has comment: http://stackoverflow.com/comment/45399498
answer count: 0
has comment: http://stackoverflow.com/comment/45398688
type: UnansweredQuestion
has title: How do I keep the value of the input text by using mask.js?
tagged with: mask
type: Question
has comment: http://stackoverflow.com/comment/45421892
has body: This is my fiddle. My problem is that if i write it wrong, for instance i write 9 characters (not 10 as it required) and if press the tab button from the keyboard, all of the 9 characters disappears and i have to write it again. What should I do ? how do i memorize the value ? This is the code: $(function() { $("#Contact_phone").mask("9999-999-999"); }); and the HTML : &lt;input placeholder="telefon" name="x1" id="Contact_phone" type="text"&gt; &lt;input placeholder="other*" name="x2" id="other" type="text"&gt;
tagged with: javascript
has comment: http://stackoverflow.com/comment/45398082
tagged with: jquery
score: 0

http://stackoverflow.com/a/28737747
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28446892
has body: for(var key in JSONObj.regex_attributes.matching_attributes){ for (var key2 in JSONObj.regex_attributes.matching_attributes[key]) { var val = JSONObj.regex_attributes.matching_attributes[key][key2] if (val == 'NULL') delete JSONObj.regex_attributes.matching_attributes[key][key2] } } for (var key in JSONObj.regex_attributes.matching_attributes){ var k=Object.keys(JSONObj.regex_attributes.matching_attributes[key]).length if (k==0){ delete JSONObj.regex_attributes.matching_attributes[key] } } for (var key in JSONObj.regex_attributes){ var k=Object.keys(JSONObj.regex_attributes[key]).length if (k==0){ delete JSONObj.regex_attributes[key] } } var count2=0 for (var key in JSONObj.regex_attributes.additional_processing[0]) { var val = JSONObj.regex_attributes.additional_processing[0][key]; if (val == 'NULL'){ delete JSONObj.regex_attributes.additional_processing[0][key] count2=count2+1 } } if(count2==6){ delete JSONObj.regex_attributes.additional_processing } var count3=0 for (var key in JSONObj.regex_attributes.account_details) { var val = JSONObj.regex_attributes.account_details[key]; if (val == 'NULL'){ delete JSONObj.regex_attributes.account_details[key] count3=count3+1 } } if (count3==5){ delete JSONObj.regex_attributes.account_details }

http://stackoverflow.com/a/28593028
has comment: http://stackoverflow.com/comment/45493962
has comment: http://stackoverflow.com/comment/45500015
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45494041
has body: Your display is powered by a fotorama.js script, which has an error in IE8 and IE9 and so fails to work. This script uses the Javascript console (at least once at line 1296). In IE8 and IE9, the Javascript console is created only if the Developer Tools are active. EDIT based on comments: One approach that may work is to create a dummy console if one does not exist natively, for example: &lt;script&gt; if (!window.console) { window.console = { log: function() {} }; } &lt;/script&gt; Now, if someone does a console.log(something), it will not cause an error.
answers question: http://stackoverflow.com/q/28590416
has comment: http://stackoverflow.com/comment/45500243
has comment: http://stackoverflow.com/comment/45497958
accepted answer of: http://stackoverflow.com/q/28590416
upvote count: 2
has comment: http://stackoverflow.com/comment/45529190
type: AcceptedAnswer

http://stackoverflow.com/q/28560801
tagged with: sorting
accepted answer: http://stackoverflow.com/a/28560896
has answer: http://stackoverflow.com/a/28560917
has title: Javascript - sorting array by multiple criteria
has answer: http://stackoverflow.com/a/28560903
downvote count: 0
has answer: http://stackoverflow.com/a/50580263
favorite count: 0
answer count: 5
possible better answer: http://stackoverflow.com/a/50580263
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/60068169
linked to: http://stackoverflow.com/q/74928718
score: 24
upvote count: 24
type: Question
has comment: http://stackoverflow.com/comment/45433030
has answer: http://stackoverflow.com/a/28560896
has body: I have an array of objects: var arr = [ {title:'50 - 50'}, {title:'100 - 100'}, {title:'50 - 65'}, {title:'100 - 125'} ]; I'm attempting to sort this array so that the items appear in the following order: var arr = [ {title:'50 - 50'}, {title:'50 - 65'}, {title:'100 - 100'}, {title:'100 - 125'} ]; Currently I'm using the following sorting function to attempt this: arr.sort(function(a, b){ var titleA = a.title; var titleB = b.title; var arrA = titleA.split(' - '); var arrB = titleB.split(' - '); var keyA = parseInt(arrA[0]), keyB = parseInt(arrB[0]); // Compare the 2 keys if(keyA &lt; keyB) return -1; if(keyA &gt; keyB) return 1; return 0; }); However, this returns the items in the following order: var arr = [ {title:'50 - 65'}, {title:'50 - 50'}, {title:'100 - 125'}, {title:'100 - 100'} ]; It looks like I need to sort by the first number in the title and then the second number. Any ideas?
has comment: http://stackoverflow.com/comment/45433059
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/a/28502984
has comment: http://stackoverflow.com/comment/45326043
has comment: http://stackoverflow.com/comment/45947299
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45325824
has comment: http://stackoverflow.com/comment/45325819
type: Answer
has body: CSS: html, body, #textarea { box-sizing: border-box; width: 100%; height: 100%; }
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28502942
has comment: http://stackoverflow.com/comment/45325954
answers question: http://stackoverflow.com/q/28502942

http://stackoverflow.com/q/28491223
has comment: http://stackoverflow.com/comment/45303697
has comment: http://stackoverflow.com/comment/45303539
downvote count: 1
has comment: http://stackoverflow.com/comment/45303638
type: AnsweredQuestion
has title: How to add currency at the end of the number with javascript
score: -1
accepted answer: http://stackoverflow.com/a/28491473
has comment: http://stackoverflow.com/comment/45303534
type: Question
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45303650
has answer: http://stackoverflow.com/a/28491473
has comment: http://stackoverflow.com/comment/45303571
has body: What i am doing here with the javascript below is converting numbers to currency format realtime that works properly. function myFunc(){ var numb=''; nStr = document.getElementById('dj_car').value; my = nStr.split('.'); var Len = my.length; for (var i=0; i&lt;Len;i++){numb = numb+my[i];} x = numb.split('.'); x1 = x[0]; x2 = x.length &gt; 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + '.' + '$2'); } formated = x1 + x2; document.getElementById('dj_car').value = formated; } My question is how can i put EUR as text at the end of the number? I need to convert number like '1.000 EUR' however as of now it appears like '1.000' Thanks in advance,
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45303652

http://stackoverflow.com/comment/45372223
comment on: http://stackoverflow.com/q/28525716
type: QuestionComment
has text: Normally I would not mix them
score: 0
type: Comment

youtube-javascript-api
type: Tag
tags question: http://stackoverflow.com/q/28504669
tag name: youtube-javascript-api
tags question: http://stackoverflow.com/q/28537020

http://stackoverflow.com/comment/45387084
comment on: http://stackoverflow.com/a/28536428
type: Comment
score: 2
type: AnswerComment
has text: Why would you re-retrieve `currentDiv` each time through the loop?

http://stackoverflow.com/comment/45236641
has text: I would change the title to the question as it is not related with fullPage.js. Try to create a full page video without fullPage.js and you'll find the same problem. Make things easier for people to answer. Not everybody is familiarized with fullPage.js, adding that info is unnecessary to solve the issue.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28452935

http://stackoverflow.com/q/28577006
has title: Keep focus() on DOM reload
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45463363
has comment: http://stackoverflow.com/comment/45463885
score: 0
has body: Forschung und Entwicklung I have the following Javascript code that executes when this link is clicked: $('#bigMenu').click(function () { element = document.getElementById("spanID"); menuElement = document.getElementById("bigMenu"); if (element.className == "glyphicon glyphicon-menu-right") { element.className = "glyphicon glyphicon-menu-down"; jQuery("#collapseMenu").show(); menuElement.setAttribute('aria-expanded', true); sessionStorage.setItem("expand", true); } else { element.className = "glyphicon glyphicon-menu-right"; jQuery("#collapseMenu").hide(); menuElement.setAttribute('aria-expanded', false); sessionStorage.setItem("expand", false); } curURL = document.URL; substring = "id=4"; if (curURL.match(substring)) { return false; } }); Regarding the curURL bit, I don't want the page to reload if I am already on it. Hence, I just return instead of loading the page (which would be redundant in this case). What I want to achieve is the following: When a user clicks on the F&E link, the page F&E opens (this work) and the focus remains on the F&E link (this does not work). I tried to achieve it in the following way (additions shown to the above code) jQuery("#collapseMenu").show(); $( document ).ready(function() { menuElement.focus() }); That didn't work, so obviously it was not the correct way of going about it. Could someone tell me what would be the correct way of keeping focus here?
tagged with: jquery
tagged with: focus
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/39391370
has comment: http://stackoverflow.com/comment/66111048
score: -18
answers question: http://stackoverflow.com/q/28511207
has body: This is a non-standard (but not so uncommon) React pattern that doesn't use JSX, instead putting everything inline. Also, it's Coffeescript. The 'React-way' to do this would be with the component's own state: (c = console.log.bind console) mock_items: [ { name: 'item_a' uid: shortid() } { name: 'item_b' uid: shortid() } { name: 'item_c' uid: shortid() } ] getInitialState: -&gt; lighted_item: null render: -&gt; div null, ul null, for item, idx in @mock_items uid = item.uid li key: uid onClick: do (idx, uid) =&gt; (e) =&gt; # justf to illustrate these are bound in closure by the do lambda, c idx c uid @setState lighted_item: uid style: cursor: 'pointer' background: do (uid) =&gt; c @state.lighted_item c 'and uid', uid if @state.lighted_item is uid then 'magenta' else 'chartreuse' # background: 'chartreuse' item.name This example works -- I tested it locally. You can check out this example code exactly at my github. Originally the env was only local for my own whiteboard r&amp;d purposes but I posted it to Github for this. It may get written over at some point but you can check out the commit from Sept 8, 2016 to see this. More generally, if you want to see how this CS/no-JSX pattern for React works, check out some recent work here. It's possible I will have time to fully implement a POC for this app idea, the stack for which includes NodeJS, Primus, Redis, &amp; React.
has comment: http://stackoverflow.com/comment/68843077
has comment: http://stackoverflow.com/comment/72444091
has comment: http://stackoverflow.com/comment/72719025
downvote count: 25
has comment: http://stackoverflow.com/comment/74797799
upvote count: 7
has comment: http://stackoverflow.com/comment/72452903
type: Answer
has comment: http://stackoverflow.com/comment/68876298

http://stackoverflow.com/q/28519063
has title: Object not a reference - Quickblox chat in phonegap
answer count: 1
tagged with: quickblox
tagged with: cordova
type: Question
has answer: http://stackoverflow.com/a/32334565
has body: I am having trouble getting quickblox chat working on phonegap (javascript).I have used the revealing module pattern to expose instead of 'require' and this is the broken piece of code: var chatParams = { onConnectFailed: onConnectFailed, onConnectSuccess: onConnectSuccess, onConnectClosed: onConnectClosed, onChatMessage: onChatMessage }; QB.createSession(params, function(err, result) { if (err==null) { chatUser = { id: result.user_id, pass: params.password }; connectChat(chatParams); } else { alert("Something went wrong, please try again later or contact us at contact@domain.co.uk if the problem persists."); } }); function connectChat(chatParams) { //This line here: var chatService = new QBChat(chatParams); console.log(chatService); // connect to QB chat service chatService.connect(chatUser); }; I am getting the error 'object not a reference' at the highlighted line. Please advise!
score: 0
accepted answer: http://stackoverflow.com/a/32334565
tagged with: javascript
type: AnsweredQuestion

http://stackoverflow.com/comment/45340231
comment on: http://stackoverflow.com/a/28510497
score: 4
has text: In Node.js the global object is `global`.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45251912
type: QuestionComment
type: Comment
has text: Are you matching a single token or extracting from some text?
comment on: http://stackoverflow.com/q/28462953
score: 0

http://stackoverflow.com/q/28544168
has comment: http://stackoverflow.com/comment/45401916
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
has title: How to pass id of dynamic drop downlist?
linked to: http://stackoverflow.com/q/28541298
favorite count: 0
answer count: 0
has body: I have dynamic table, in that table every row has a dynamic dropdown list. So every dynamic dropdown list have a unique id, I have to pass this id to the onChange function. Please tell me how to do this. Please see this question for more info. <select id=carpender"+obj[i].b_id +"onChange='update(this.id) The data in the table is dynamically generated. I have to pass an id like carpenter12, if the value of obj[i].b_id is 12. Working code I modified this code JavaScript:
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/45401818
score: 1
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/45332138
type: Comment
score: 1
has text: You'd be better off putting the text file data in a database, and pulling it from there.
comment on: http://stackoverflow.com/q/28503603
type: QuestionComment

http://stackoverflow.com/a/28456711
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28451722
answers question: http://stackoverflow.com/q/28451722
has comment: http://stackoverflow.com/comment/45241078
type: Answer
downvote count: 0
has body: An alternative to using XPathEvaluator and IE-specific XML functions (like selectSingleNode) is to use jQuery's selectors for XML, which XrmServiceToolkit uses. See the link below. https://xrmservicetoolkit.codeplex.com/
score: 1
has comment: http://stackoverflow.com/comment/45250263

http://stackoverflow.com/q/28473620
has comment: http://stackoverflow.com/comment/45270987
has answer: http://stackoverflow.com/a/28473730
type: UnansweredQuestion
has title: Is there any way to findout the truth value in an if condition in Javascript?
has comment: http://stackoverflow.com/comment/45270972
type: Question
has body: I have a scenario like this var a,b; if(a &gt; 0 || b &gt; 0){ var truthValue = // The value which was executed as true in the if condition either a or b } Now how do i identify which value is executed as true. I can write a separate if condition for both but in the process of minimizing the LOC i am trying this way. Any help is appreciated.
has comment: http://stackoverflow.com/comment/45271806
linked to: http://stackoverflow.com/q/27968511
has comment: http://stackoverflow.com/comment/45270973
answer count: 2
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28473966

http://stackoverflow.com/q/28490555
tagged with: javascript
tagged with: angularjs-scope
score: 0
has title: Angular module only works with inline javascript
has comment: http://stackoverflow.com/comment/45302645
answer count: 1
has comment: http://stackoverflow.com/comment/45302281
tagged with: angularjs
has body: I am learning Angular and adding a controller to my module only works when all the code is inline on the page. If I replace it with it fails with "Error: [$injector:unpr] http://errors.angularjs.org/1.3.11/$injector/unpr?p0=aProvider%20%3C-%20a%20%3C-%20personController var app = angular.module('app', []) .config([function(injectables){ console.log('configuring app'); }]).run([function(injectables){ console.log('running app'); }]).controller("personController", function($scope){ $scope.firstName = "John"; $scope.lastName = "Doe"; }); Name: Hello {{ yourName }}! The name is My first expression: {{ 5 + 5 }} First Name: Last Name: Full Name: {{firstName + " " + lastName}} {{ x.name + ', ' + x.country }} Click me! {{ count }}
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45332913
has answer: http://stackoverflow.com/a/28490992
has comment: http://stackoverflow.com/comment/45332661
accepted answer: http://stackoverflow.com/a/28490992
has comment: http://stackoverflow.com/comment/45332630
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45336533
has comment: http://stackoverflow.com/comment/45302607

http://stackoverflow.com/q/28520056
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/svg
type: Question
tagged with: javascript
tagged with: raphael
score: 0
has title: Snap.svg equivalent to RaphaelJS's setStart and setFinish?
answer count: 1
has body: In RaphaelJS, you can create a "set" of elements. When you transform this set, it transforms all elements in the set using a common origin (as opposed to each element having its own origin). An easy example of this: paper.setStart(); path = paper.path(string); path = paper.path(string); path = paper.path(string); set = paper.setFinish(); set.transform("T0,0R0S3,3,0,0"); I'm working on replacing RaphaelJS with Snap.SVG for a project. There is no equivalent to setStart() and setFinish(). Snap.svg does have Sets though according to the documentation. But it is not clear how to create a set and/or add elements to that set. What is the equivalent? How do I work with sets in Snap.svg?
has answer: http://stackoverflow.com/a/28522189

http://stackoverflow.com/q/28441472
tagged with: ajax
type: UnansweredQuestion
has body: I hope the title is not too convoluted to understand... Please have some patience while I explain as the restrictions of the platform I am working on make this convoluted. I am working on a functionality feature on a commercial eCommerce platform, ie BigCommerce. This causes many restrictions in terms of what and how things can be done. What I am trying to accomplish: I need to bring "color swatch connected to the appropriate product image color when user clicks a color in the colorswatch" functionality to a categories page of the site. This functionality already exists on the individual product pages, however there is no straight forward way to bring it to the categories page, hence this script. So essentially, when a user is on a product page, they see a line of little colored boxes (ie, red, green, blue, yellow, etc) which when clicked, will bring up the appropriate product color image into the main image DOM element (so if they click red, the red product appears in the main image DOM element, if they click green, the green product appears, and so on) The problem in implementing this: The rule sets of matching a certain color to a certain image are not available to developers for some terrible reasons. They are not even available thru the API with any language (ruby, python, PHP). On the product page, where the feature exists, the URLs are not present as they are automatically generated by backend PHP (I think) when a user clicks the boxes. (to be honest, I am not sure how the URLs to the images are generated but I can't find any reference to the URLs either directly or by dynamic rules. I've scoured through all the JS manually and through some searches and can't find any reference to this functionality). I've written a script to imitate a user click as this seems to be the only action that changes the image. I've also tried writing a script that reproduces the same behavior as clicking (ie, change class of one box from selectedValue to nothing, and set the click…
score: -3
has title: Using AJAX to get URLs of a DOM element on external page (same domain) which are generated by JS-enabled user clicks
downvote count: 3
has answer: http://stackoverflow.com/a/28442049
type: Question
tagged with: bigcommerce
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/45318336
type: Comment
has text: in input type text, it stops typing after you entered the 6th character right? I need the same to be applied to input type number..
comment on: http://stackoverflow.com/a/28499403
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45283822
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28480410
has text: will have to compare menu item href to the url or have server code set an active class. Javascript doesn't maintain state when load a new page
score: 0

http://stackoverflow.com/comment/45383819
has text: @MarcusTan no,... we are not using the default form submit... so that shouldn't matter...
type: Comment
comment on: http://stackoverflow.com/a/28534302
score: 0
type: AnswerComment

http://stackoverflow.com/a/31677998
downvote count: 0
answers question: http://stackoverflow.com/q/28559099
type: Answer
upvote count: 1
score: 1
has body: Dirty Forms 1.x watches the top document (when hosted within a frame) by default. You can disable this functionality by calling ignoreParentDocs() (which is incorrectly named, it should be ignoreTopDocument() to reflect what it actually does). $.DirtyForms.ignoreParentDocs(); Dirty Forms 2.x no longer watches the top document by default, but you can customize event binding to change which frames are watched and which target frame to redirect if the user decides to proceed. Also, $.DirtyForms.choiceContinue and $.DirtyForms.choiceCommit() can only be called from within a dialog module (after fire() is called) for them to have any effect, but it is unclear from your question if that is what you are doing.

http://stackoverflow.com/a/28503259
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28503216
score: 1
has body: You forgot to add a space between ID en textarea: Update link like so: $("#" + id + " input:visible:enabled:not([readonly]), #" + id + " textarea:visible:enabled:not([readonly]), #" + id + " select:visible:enabled:not([readonly])").first().focus();
downvote count: 0

http://stackoverflow.com/comment/45343062
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28512136
has text: these 3 might be useful: `Connection:Keep-Alive`, `Set-Cookie:JSESSIONID=8370b66678bf31885f594f79e6a288575d28977b3c88b6d4b41e5633670f4918.e38Lb3qTb3aKai0RbxeMahqPbhb0; path=/Search; secure` and `Set-Cookie:BNI_SECookie=000000000000000000000000330aa8c00000bb01; Path=/; Domain=url.com; HttpOnly`

http://stackoverflow.com/comment/45432705
has text: If in your other application the `dateText.update` method is not called, it could be that the bound field is not an observable, or the `update` function doesn't actually *read* the observable (which creates a dependency).
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28559970

http://stackoverflow.com/a/37822986
type: Answer
has body: solution: . check this https://github.com/tomchentw/react-google-maps and please React is very very fast give keys to components showing list/rows items of data to help react. //check my code below showMapMarkers({markers}){ ..use logic below } class WeatherList extends Component{ renderWeather(cityData, i){ const temps = cityData.list.map(weather => weather.main.temp); const pressures = cityData.list.map(weather => weather.main.pressure); const humidity = cityData.list.map(weather => weather.main.humidity); //distructuring // const lon = cityData.city.coord.lon; // const lat = cityData.city.coord.lat; const {lon, lat} = cityData.city.coord; return( <GoogleMap lon={lon} lat={lat} /> <Chart data={temps} color="orange" units="K"/> <Chart data={pressures} color="green" units="hPa"/> <Chart data={humidity} color="blue" units="%"/> ); } render(){ return ( City Temperature (K) Pressure (hPa) Humidity (%) {this.props.weather.map(this.renderWeather)} ); } }
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28470902
downvote count: 0

http://stackoverflow.com/comment/45474851
comment on: http://stackoverflow.com/a/28583019
score: 0
type: AnswerComment
has text: Thanks, I mistyped that
type: Comment

http://stackoverflow.com/comment/45377636
comment on: http://stackoverflow.com/q/28467630
score: 0
has text: Don't chnage the title to solved, select an answer. How do i do that?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28562534
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45622653
has comment: http://stackoverflow.com/comment/45622706
type: Answer
score: 6
has comment: http://stackoverflow.com/comment/45436499
has body: As suggested in a comment, since you ask for 60 times per second, it might mean you want to update an animation i.e. change the color, position, shape etc. of some DOM elements on the screen. For this it's recommended to use requestAnimationFrame instead of setInterval. So instead of setInterval(function () { doSomething(); }, 16) use function myFunction () { doSomething(); requestAnimationFrame(myFunction); } requestAnimationFrame(myFunction); This allows browser to perform certain optimizations. From MDN: You should call this method whenever you're ready to update your animation onscreen. This will request that your animation function be called before the browser performs the next repaint. The number of callbacks is usually 60 times per second, but will generally match the display refresh rate in most web browsers as per W3C recommendation. The callback rate may be reduced to a lower rate when running in background tabs. The name requestAnimationFrame might be a bit confusing, but you should read it as "please run my callback whenever the browser is ready to do a repaint of the screen", i.e. you let the browser decide the exact timing instead of imposing it yourself.
answers question: http://stackoverflow.com/q/28562342
has comment: http://stackoverflow.com/comment/45643750
upvote count: 7
downvote count: 1
accepted answer of: http://stackoverflow.com/q/28562342
has comment: http://stackoverflow.com/comment/45463385

http://stackoverflow.com/q/28557949
has body: I have successfully created js checkbox in uiwebview by using this code: - (void)viewDidLoad { [super viewDidLoad]; //---------------- UITapGesture on UIWebView----------------------- UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(detectTapGesture:)]; tapGesture.numberOfTapsRequired = 1; tapGesture.delegate = self; [self.webview addGestureRecognizer:tapGesture]; array = [[NSMutableArray alloc]initWithObjects:@"'Sudhaadagdudgdada'",@"'qwertyuiopo'",@"'asdfghjkl'", nil]; NSString *html = [NSString stringWithFormat:@"&lt;div id='check'&gt;&lt;/div&gt;&lt;script&gt; var j; var jsArray = new Array %@; str=''; for(j = 0; j&lt; 3; j++){ str += '&lt;label&gt;&lt;input type=\"radio\" style=\"padding:25px;border-radius:35px;\" id=\"one_'+j+'\" name = \"Sudha\" value = \"'+jsArray[j]+'\" onclick=\"showvalue(this.value);\" /&gt;'+jsArray[j]+'&lt;/input&gt;&lt;br/&gt;&lt;br/&gt;'; } document.getElementById(\"check\").innerHTML=str; &lt;/script&gt;",array]; NSLog(@"html..%@",html); [self.webview loadHTMLString:html baseURL:nil]; } Now I want to get checkbox onclick value in nsstring by UITapGeture on UIWebView. I am trying this code but alert showing proper value but returns nothing : #pragma mark Tap Gesture MEthod - (void) detectTapGesture:(UITapGestureRecognizer *)gestureRecognizer { NSString *result = [self.webview stringByEvaluatingJavaScriptFromString: @"function showvalue(data) {alert(data);return data;} showvalue(data) "]; //try 2 NSLog(@"result..%@",result); } Please help me to get checkbox value in NSString.Is there any another way to get text from uiwebview where I have touched or anything else. Thanks in advance.
type: Question
has comment: http://stackoverflow.com/comment/45428521
has title: get js checkbox label value in nsstring
tagged with: iphone
tagged with: ios
tagged with: javascript
has comment: http://stackoverflow.com/comment/45429795
tagged with: objective-c
tagged with: uiwebview
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/45428610
score: 0

http://stackoverflow.com/q/28463001
has title: Parse Cloud Code Sending Push Notification Twice
has answer: http://stackoverflow.com/a/28466562
type: AnsweredQuestion
has body: I am trying to send a push notification using cloud code to targeted channels. The Object is called Prayers. When someone saves Prayers, it is supposed to send a push notification to certain channels, if the new data in Prayers was not made anonymously. Prayers has a key of 'Anonymous' in it that is boolean. So, I have cloud code set up like this, in an effort that if the boolean value is false, it sends, it, but if it is true, it won't send the push. The issue now is that it is sometimes sending the Push through 2 times on a non-anonymous post. Parse.Cloud.afterSave("Prayers", function(request) { var firstName = request.object.get('FirstName'); var lastName = request.object.get('LastName'); var userId = request.object.get('UserId'); var anonymous = request.object.get('Anonymous'); var anonymousString = anonymous.toString var pushQuery = new Parse.Query(Parse.Installation); pushQuery.equalTo('channels', userId); if (anonymous == false) { Parse.Push.send({ where: pushQuery, // Set our Installation query data: { alert: firstName + " " + lastName + " " + "just added a prayer request." } }, { success: function() { // Push was successful }, error: function(error) { throw "Got an error " + error.code + " : " + error.message; } }); } });
type: Question
tagged with: ios
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28466562
tagged with: parse-cloud-code
tagged with: boolean
score: 0
answer count: 2
tagged with: parse-platform
possible better answer: http://stackoverflow.com/a/30091908
has answer: http://stackoverflow.com/a/30091908

http://stackoverflow.com/q/28439479
has comment: http://stackoverflow.com/comment/45209413
has comment: http://stackoverflow.com/comment/45210268
has answer: http://stackoverflow.com/a/28440089
has body: I'm pulling a json array using the following command: $.get('URL') .always(function(data) { console.log(data); The URL when accessed directly returns the following information: { "user": { "ipaddr": "192.168.37.10.", "system_date": "Feb 10 10:38:51 PST 2015" }, "clean_graph_allow": 0, "client": { "account_information": { 0: { "ID": 7611, "accountID": "abcd", "label": "Billing", "email": "bob@jones.com", "firstName": "Bob", "lastName": "Jones", "company": "Bob inc.", "address": "123 Fake Street", "city": "Nowhere", "province": "CA", "postalCode": 91111, "country": "US", "phone": 5555555555, "notes": null, "company_type": null }, 1: { "ID": 7611, "accountID": "abcd", "label": "Billing", "email": "bob@jones.com", "firstName": "Bob", "lastName": "Jones", "company": "Bob inc.", "address": "123 Fake Street", "city": "Nowhere", "province": "CA", "postalCode": 91111, "country": "US", "phone": 5555555555, "notes": null, "company_type": null }, 2: { "ID": 7611, "accountID": "abcd", "label": "Billing", "email": "bob@jones.com", "firstName": "Bob", "lastName": "Jones", "company": "Bob inc.", "address": "123 Fake Street", "city": "Nowhere", "province": "CA", "postalCode": 91111, "country": "US", "phone": 5555555555, "notes": null, "company_type": null }, "contact": { "ID": 7611, "accountID": "abcd", "label": "Billing", "email": "bob@jones.com", "firstName": "Bob", "lastName": "Jones", "company": "Bob inc.", "address": "123 Fake Street", "city": "Nowhere", "province": "CA", "postalCode": 91111, "country": "US", "phone": 5555555555, "notes": null, "company_type": null } }, "is_reseller": 300 }, "hidden_pages": [], "action": "dashboard_api_stats", "attacks_today": 4920, "blocks": 1816, "short_blocks": 101, "nullroutes": 314, "num_countries": 0, "attack_dnsc": 3, "attack_pstc": 6, "attack_gc": 28, "attack_core": 55, "attack_tcpc": 8, "attack_udpc": 0, "regional": { "": 100 } } The response I get back from the $.get or $.getJSON command that looks like this: Object { readyState: 4, g…
has comment: http://stackoverflow.com/comment/45208910
has title: jQuery get JSON access result
upvote count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45209283
has comment: http://stackoverflow.com/comment/45209156
has comment: http://stackoverflow.com/comment/45208802
tagged with: http://stackoverflow.com/tag/json
score: -1
has comment: http://stackoverflow.com/comment/45208728
type: Question
downvote count: 4
has comment: http://stackoverflow.com/comment/45209561
has comment: http://stackoverflow.com/comment/45209224
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/28454764
upvote count: 0
tagged with: jquery
has title: JavaScript not working properly on page
favorite count: 0
has comment: http://stackoverflow.com/comment/45236454
has body: I'm using this simple function to shake a form when the user email is not valid: function shakeForm() { var l = 10; for( var i = 0; i &lt; 10; i++ ) $("form").animate( { 'margin-left': "+=" + ( l = -l ) + 'px' }, 50); } You can see on this page that is works fine (just don't insert nothing and push the "Sign up for private beta" button"): http://www.saasmetrics.co/ The problem is: the very same function is not working properly on this second page (please check the end of the page): http://saasmetrics.co/monthly-recurring-revenue/ Any ideas? Thanks.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28454892
score: -4
type: Question
accepted answer: http://stackoverflow.com/a/28454892
has comment: http://stackoverflow.com/comment/45236380
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28455033
answer count: 2
downvote count: 4
has answer: http://stackoverflow.com/a/28455033
has comment: http://stackoverflow.com/comment/45236584

http://stackoverflow.com/a/28446163
has body: Put welcome.js into assets/javascripts Then in javascripts/application.js make sure you have this line //= require_tree . Please read this article http://railsapps.github.io/rails-javascript-include-external.html
has comment: http://stackoverflow.com/comment/45222243
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28446111

http://stackoverflow.com/a/28587960
has body: I think you should use sap.ui.core.mvc.xmlview("Splitter") instead of sap.ui.xmlview("Splitter");
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28561854

http://stackoverflow.com/comment/45232712
has text: Why are you wrapping it in a double array afterwards, though? Thats just curiosity. This should work.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28452758
score: 0

http://stackoverflow.com/comment/45368851
has text: @Passerby please can you illustrate with an example. I don't quite understand.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28526417
type: QuestionComment

http://stackoverflow.com/comment/45412617
has text: I tried exactly like this @test.com to validate whether onchange is triggering. It does not work.
score: 0
comment on: http://stackoverflow.com/q/28549573
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28554238
type: AnsweredQuestion
score: 3
tagged with: twitter-bootstrap-3
tagged with: alert
upvote count: 3
has answer: http://stackoverflow.com/a/28554276
type: Question
accepted answer: http://stackoverflow.com/a/28554276
has title: Trigger bootstrap modal if a condition statement is not met
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28554296
answer count: 2
has comment: http://stackoverflow.com/comment/45421500
downvote count: 0
tagged with: bootstrap-modal
possible better answer: http://stackoverflow.com/a/28554296
favorite count: 0
has body: Instead of using the default jquery alert popup, I'd like to trigger a Bootstrap Modal. All the tutorials I've read, the modal is triggered by the click(function(){});. I'd like to have if triggered if a condition in my "if statement" is not met. Here is the code I have var test1 = $('#test').val(); $('#go').click(function() { if (test1 === "") { alert("Please enter all values in the fields"); $('#myModal').modal('show'); } }); Test Go × Modal title One fine body… Close Save changes

http://stackoverflow.com/a/28563935
score: 3
has comment: http://stackoverflow.com/comment/45439248
downvote count: 0
answers question: http://stackoverflow.com/q/28563755
has comment: http://stackoverflow.com/comment/45439197
has comment: http://stackoverflow.com/comment/45439354
upvote count: 3
type: Answer
has body: WebMethod can't interact directly with the DOM. WebMethods are outside the scope of the normal page model. In fact, WebMethod is no longer supported by MS and you shouldn't use it. Instead, if you're on .NET 4.5 you can create a Web API and call into it with AJAX (jQuery has great helper functions for this, I see you tagged it). The Web API will return the string, and then you can use JavaScript to set the text of the textbox. Web API public class TestController : ApiController { public string GetHello(string name) { return String.Format("Hello, {0}!", name); } } Then the jQuery AJAX code: $.ajax({ url: '/api/test/GetHello?name=Nade', type: 'GET' }) .success(function(output){ $('#TextBox1').val(output); }); If you're not on .NET 4.5, upgrade! If upgrading isn't possible, then you could just set up a generic handler (.ashx) and write to the response.
has comment: http://stackoverflow.com/comment/45438915

http://stackoverflow.com/comment/45435528
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28562147
has text: Issue was I'd copied your code and forgot to remove the '' from the modal bit and mine is a declared variable. Stupidity. This is the solution I'll use because its a bit neater. Cheers

http://stackoverflow.com/q/28507602
has comment: http://stackoverflow.com/comment/45334258
has body: I am very new with coffeescript, I am working on a dev environment and I would like to ask from experiment user what they use for: Automatic Coffescript Compiler Automatic Coffescript watcher I came accross Cake, Grunt. I just one the best practice before for compiling and watching my coffescript code.
answer count: 1
score: 1
has comment: http://stackoverflow.com/comment/45336942
favorite count: 0
has comment: http://stackoverflow.com/comment/45334314
accepted answer: http://stackoverflow.com/a/28507657
type: AnsweredQuestion
tagged with: build
tagged with: watch
upvote count: 3
downvote count: 2
tagged with: coffeescript
has comment: http://stackoverflow.com/comment/45696600
has title: Coffeescript compiler and watcher
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28507657

http://stackoverflow.com/q/28561996
type: Question
tagged with: charts
tagged with: javascript
has answer: http://stackoverflow.com/a/43350268
has answer: http://stackoverflow.com/a/28562090
score: 0
answer count: 2
tagged with: jquery
favorite count: 0
has body: I can't change the legend color using charts.js. This is my code so far: label: "My First dataset", color: "#fff", fillColor: "rgba(220,220,220,0.2)", strokeColor: "rgba(220,220,220,1)", pointColor: "rgba(220,220,220,1)", pointStrokeColor: "#fff", pointHighlightFill: "#fff", pointHighlightStroke: "#FFF", scaleFontColor: "#fff", tooltipTitleFontColor: "#fff", tooltipFontColor: "#fff", scaleGridLineColor : "#fff", data: [65, 59, 80, 81, 56, 55, 40] The color is near #666 but I want #fff.
type: UnansweredQuestion
has title: Cant To CHange Chart.js Legend
tagged with: chart.js
upvote count: 1
downvote count: 1

http://stackoverflow.com/a/28832717
downvote count: 0
type: Answer
upvote count: 1
score: 1
has body: First of all, in MVC you will need a so called display model for the items that you want to display in the view. Let's say that the e-mail addresses belong to a User object and that they are of type 'String'. In that case, the model can be a List of User objects. Your view can then use this model like this: @model List&lt;User&gt; @using (Html.BeginForm("Index", "Home", FormMethod.Post)) { &lt;table&gt; @for (int i = 0; i &lt; Model.Count;i++ ) { &lt;tr&gt; &lt;td&gt;@Html.TextBox("users[" + @i + "].Email", Model[i].Email)&lt;/td&gt; &lt;/tr&gt; } &lt;/table&gt; } An excellent article about binding to a list of objects can be found here: http://www.binaryintellect.net/articles/b1e0b153-47f4-4b29-8583-958aa22d9284.aspx Good luck!
answers question: http://stackoverflow.com/q/28453022

http://stackoverflow.com/q/28542670
has answer: http://stackoverflow.com/a/28542858
answer count: 2
tagged with: jquery-autocomplete
tagged with: javascript
tagged with: jquery
has title: Case-insensitive autocomplete in Javascript
score: 0
has answer: http://stackoverflow.com/a/28542748
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45398844
has body: I have a javascript code that is used for autocomplete functionality. It highlights the text that is entered in a search box and matches it with the text in a database. This is case-sensitive, so it only highlights the text which is in the database table. I want the search to be case-insensitive. This is my existing code: &lt;script type="text/javascript"&gt; $(function() { var availableTags = [&lt;?php echo $tagsString; ?&gt;]; $( "#tags" ).autocomplete({ source: availableTags }); }); $.extend( $.ui.autocomplete.prototype, { _renderItem: function( ul, item ) { var term = this.element.val(), html = item.label.replace( term, "&lt;span class='f1'&gt;$&amp;&lt;/span&gt;" ); return $( "&lt;li&gt;&lt;/li&gt;" ) .data( "item.autocomplete", item ) .append( $("&lt;a&gt;&lt;/a&gt;").html(html) ) .appendTo( ul ); } }); &lt;/script&gt;
type: Question

http://stackoverflow.com/comment/45478353
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28574269
has text: Does `.map` do things concurrently?
type: AnswerComment

http://stackoverflow.com/comment/45333604
score: 0
type: AnswerComment
type: Comment
has text: (for ... in) was never a great construct in JS, as compared to how it's implemented in other languages. AND, it has "hasOwnProperty" bugs. Don't try to make sense of it, just use other loop-iteration methods (ie, ".forEach()" or "Object.keys(arr).forEach".)
comment on: http://stackoverflow.com/a/28506974

http://stackoverflow.com/comment/45440514
comment on: http://stackoverflow.com/a/28564459
type: Comment
score: 1
has text: Yea, your are right. However, correct me if I'm wrong, but I think `['$scope', '$routeParams'` is needed when uglifying. Just to clearify. If I'm wrong please correct me, so I can edit the post.
type: AnswerComment

http://stackoverflow.com/comment/45491349
type: QuestionComment
has text: well a simple `console.log(cat.ownedBy)` will bring some light
comment on: http://stackoverflow.com/q/28592241
score: 2
type: Comment

http://stackoverflow.com/comment/98151590
has text: Have you tried using a column attribute and placing the max-width? attribute: {style: "max-width:200px"}. I was actually using this earlier today to color certain columns. Sorry on my phone.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28438632
score: 0

http://stackoverflow.com/q/28572380
has answer: http://stackoverflow.com/a/43436223
answer count: 10
favorite count: 0
has answer: http://stackoverflow.com/a/55563098
has answer: http://stackoverflow.com/a/34689642
has answer: http://stackoverflow.com/a/29851256
accepted answer: http://stackoverflow.com/a/29851256
has comment: http://stackoverflow.com/comment/46174478
has body: I have some things for development - e.g mocks which I would like to not bloat my distributed build file with. In RequireJS you can pass a config in a plugin file and conditonally require things in based on that. For webpack there doesn't seem to be a way of doing this. Firstly to create a runtime config for an environment I have used resolve.alias to repoint a require depending on the environment, e.g: // All settings. var all = { fish: 'salmon' }; // `envsettings` is an alias resolved at build time. module.exports = Object.assign(all, require('envsettings')); Then when creating the webpack config I can dynamically assign which file envsettings points to (i.e. webpackConfig.resolve.alias.envsettings = './' + env). However I would like to do something like: if (settings.mock) { // Short-circuit ajax calls. // Require in all the mock modules. } But obviously I don't want to build in those mock files if the environment isn't mock. I could possibly manually repoint all those requires to a stub file using resolve.alias again - but is there a way that feels less hacky? Any ideas how I can do that? Thanks.
upvote count: 109
has answer: http://stackoverflow.com/a/47134999
has answer: http://stackoverflow.com/a/55800763
type: AnsweredQuestion
tagged with: build
tagged with: conditional-statements
downvote count: 0
has answer: http://stackoverflow.com/a/44994470
has answer: http://stackoverflow.com/a/48304491
type: Question
has answer: http://stackoverflow.com/a/72110230
possible better answer: http://stackoverflow.com/a/44994470
has title: Conditional build based on environment using Webpack
has answer: http://stackoverflow.com/a/43814847
tagged with: webpack
tagged with: javascript
score: 109
tagged with: require

http://stackoverflow.com/a/28451081
answers question: http://stackoverflow.com/q/28445743
has comment: http://stackoverflow.com/comment/45249088
score: 0
has body: change your this code nav.find('a[href="#'+$(this).attr('id')+'"]').addClass('active'); to this function activateNav() { var hashValue = window.location.hash.substr(1); $('body').find('a[href="#'+ hashValue +'"]').addClass('active'); } $( document ).ready(function() { activateNav(); $('a').on('click', function() { activateNav(); }); });
type: Answer

http://stackoverflow.com/comment/45329315
type: QuestionComment
has text: I know how to use CSS very well. I don't know how to select a PHP element.
score: 0
comment on: http://stackoverflow.com/q/28504643
type: Comment

http://stackoverflow.com/q/28510846
has body: I am very new to javascript and I'm just doing little problems that I can find on the web. My question to you guys is their an array method or something that returns the last element in the array. No matter if new elements gets added to the array or not? I know if we had an array like var array = [1,2,3,4]; You would specify the last one by saying array[3], but if you added a 5 at the end of the array do I have to go back in the code and change the array[3] to array[4]? Or is there a way to code it from the beginning to know when new elements get added? Thanks.
score: 1
has title: Returning the last element in a array always
upvote count: 1
tagged with: methods
has answer: http://stackoverflow.com/a/76380463
type: Question
has answer: http://stackoverflow.com/a/28510916
has answer: http://stackoverflow.com/a/28510851
tagged with: arrays
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28510851
answer count: 3
downvote count: 0
accepted answer: http://stackoverflow.com/a/28510916
favorite count: 0
type: AnsweredQuestion

http://stackoverflow.com/comment/45461255
type: Comment
type: QuestionComment
score: 0
has text: The date comes from user who choose manual date . But i just need the year.
comment on: http://stackoverflow.com/q/28575924

http://stackoverflow.com/q/28548802
answer count: 3
has body: I have a google form. Every time it is submitted, the answers go into a google spreadsheet. I am trying to write an app script that triggers every time the form is submitted, and adds an "edit" link in the column to the right of the data from the form. The link itself is easy to generate, google has a method called getEditResponseURL(). (https://developers.google.com/apps-script/reference/forms/form-response) But everytime I run it, I am getting the error "TypeError: Cannot call method "getResponses" of null." Here is my code: function addeditlink(e) { // Get the active sheet var sheet = SpreadsheetApp.getActiveSheet(); // Get the active row var row = sheet.getActiveCell().getRowIndex(); //get the form var form = FormApp.getActiveForm(); //get latest form response var responses = form.getResponses(); var lastResponse = responses[responses.length - 1]; //get edit URL var editurl = lastResponse.getEditResponseUrl(); //build link var editlink = "Edit"; //place edit link in column R (index 18) if (sheet.getRange(row, 18).getValue() == "") { sheet.getRange(row, 18).setValue(editlink); } } Any help? Thanks!
has answer: http://stackoverflow.com/a/28550751
downvote count: 0
tagged with: google-forms
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28550307
score: 2
upvote count: 2
has title: getting responseID of latest form submission in google apps
has answer: http://stackoverflow.com/a/28550325
type: Question
tagged with: javascript
tagged with: google-apps-script

http://stackoverflow.com/comment/45208814
type: QuestionComment
has text: [related question](http://stackoverflow.com/questions/5045053/set-cookie-wih-js-read-with-php-problem)
score: 0
comment on: http://stackoverflow.com/q/28439495
type: Comment

http://stackoverflow.com/a/28566967
has comment: http://stackoverflow.com/comment/45444123
has body: When setting up middleware, the order in which you call app.use() is key. In your server.js, you're setting up your application routes before you set up body parser. Meaning, when the request comes in, is is not parsed before hitting your application logic. You need to move the app.use(bodyParser) parts to the top of your code. var express = require('express'), bodyParser = require('body-parser'); var app = express(); var router = express.Router(); var es = require('express-sequelize'); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true }));
answers question: http://stackoverflow.com/q/28566487
score: 0
type: Answer

http://stackoverflow.com/a/28458324
score: 3
has body: you just have to give the transition to the header.. so the element still has the style also you do not hover any more. right now the transition is set to the hover so it only transitions on hover ;) see code snippet header { background: #000; padding: 50px; -webkit-transition: padding-bottom 0.5s cubic-bezier(0.175, 0.885, 0.320, 1.275); } header:hover { padding-bottom: 90px; } &lt;header&gt; &lt;/header&gt;
accepted answer of: http://stackoverflow.com/q/28458157
answers question: http://stackoverflow.com/q/28458157
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 3

http://stackoverflow.com/q/28474754
tagged with: javascript
has comment: http://stackoverflow.com/comment/45273128
tagged with: dom
has answer: http://stackoverflow.com/a/28718978
has answer: http://stackoverflow.com/a/28474815
has body: I've seen similar posts to this but I just can't get this piece of code right. var obj2 = JSON.parse('{"venue_data": {"venue_id":"25", "description":"Space Cafe", "venue_type": [ {"type_description":"Cafe"}, {"type_description":"Free Wifi"}, {"type_description":"Hangout"} ] } } '); //next line doesn't work :( alert(obj2.venue_data[0].venue_id); //either do the next two :( alert(obj2.venue_data[0].venue_type[0]); } alert(obj2.venue_data[0].venue_type[1]); I've tries different things but now I'm just guessing. ps...without the array in the data it works fine. Any help welcome. Thanks, Ned
tagged with: arrays
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28475155
answer count: 4
has title: Referencing JSON object using Javascript
type: UnansweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28474862

http://stackoverflow.com/a/28579094
type: Answer
answers question: http://stackoverflow.com/q/28579044
score: 0
has body: Use new Date(); var x = new Date(); You can also fetch each value using .getDay() , .getMonth(), .getYear(), .getHours(), .getMinutes(), .getSeconds() Like x.getHours(); // Will give you hours.

http://stackoverflow.com/comment/45263402
type: AnswerComment
type: Comment
has text: Thank You very much Guilherme for your response, I'll check and let you know.
comment on: http://stackoverflow.com/a/28463580
score: 0

http://stackoverflow.com/comment/45395479
type: Comment
comment on: http://stackoverflow.com/a/28478349
type: AnswerComment
has text: It is not working. Actullay I am using for in loop var arry=['1515001161','1515001161','1515001107','1515001106' ] for (exp_id in arry) { grid.rows[i].cells[8].getElementsByTagName("INPUT")[0].checked = true; } Here when I click on first id 1515001161 then It will automatically check all other checkboxes with same id 1515001161.
score: 0

http://stackoverflow.com/q/28534866
has comment: http://stackoverflow.com/comment/45384426
answer count: 0
upvote count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45384204
has title: Duplicate DIV using drawImage()
has comment: http://stackoverflow.com/comment/45384347
has comment: http://stackoverflow.com/comment/45384351
linked to: http://stackoverflow.com/q/16068047
type: Question
score: 3
has comment: http://stackoverflow.com/comment/45384447
tagged with: javascript
has comment: http://stackoverflow.com/comment/45385031
has comment: http://stackoverflow.com/comment/45386127
tagged with: canvas
linked to: http://stackoverflow.com/q/27230293
downvote count: 0
tagged with: jquery
linked to: http://stackoverflow.com/q/32386863
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45384288
has comment: http://stackoverflow.com/comment/51347356
has body: I'm loading a html into a DIV. The users are allowed to do some changes here. My question is how do I use drawImage() to duplicate it into another DIV? I tried the below but it gives a blank canvas? HTML: Does not support HTML5 canvas. JS: $("#winNumbers").load("hourly/winningNums.html"); var img = $("#winNumbers"); $("#myCanvas").getContext("2d").drawImage(img, 0, 0, 100, 50);

http://stackoverflow.com/comment/45412385
has text: Are the requirements running the service from the web through Javascript?
comment on: http://stackoverflow.com/q/28542627
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45356858
has text: Look at my revised question I put a comment in the HTML. It is the nearest one from id "test2" and I need to grab it.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28519969

http://stackoverflow.com/comment/45336562
comment on: http://stackoverflow.com/q/28508423
score: 0
type: Comment
type: QuestionComment
has text: It would be best if you post just a small portion that you're struggling to understand and convert; I believe people will be more likely to help if they see something other than what appears to be a massive code dump.

onsen-ui
tags question: http://stackoverflow.com/q/28513993
tags question: http://stackoverflow.com/q/28564323
tags question: http://stackoverflow.com/q/28561034
tag name: onsen-ui
type: Tag

http://stackoverflow.com/a/28477151
accepted answer of: http://stackoverflow.com/q/28476841
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45277385
score: 0
type: Answer
has body: This gives you the exact url the user is on: document.location.href
answers question: http://stackoverflow.com/q/28476841

http://stackoverflow.com/comment/45351492
score: 0
type: Comment
has text: how do i implement this in my function?
type: AnswerComment
comment on: http://stackoverflow.com/a/28517147

http://stackoverflow.com/q/28525920
tagged with: jquery
has comment: http://stackoverflow.com/comment/45367568
accepted answer: http://stackoverflow.com/a/33868972
tagged with: android
type: AnsweredQuestion
score: 0
possible better answer: http://stackoverflow.com/a/28526011
has comment: http://stackoverflow.com/comment/45367591
has answer: http://stackoverflow.com/a/28526011
has comment: http://stackoverflow.com/comment/45369350
has answer: http://stackoverflow.com/a/33868972
type: Question
has title: Can't call global javascript functions from android phone
answer count: 2
has body: I have a global file functions.js with global javascript functions which are called from other javascripts. Why is not this working on my android phone? Functions are defined like this in functions.js function function_name(){ alert("test"); } And called like in the other javascript files. function_name(); Is there another way to deal with global javascript functions to get it working on android?
tagged with: javascript

http://stackoverflow.com/q/28470542
tagged with: javascript
has comment: http://stackoverflow.com/comment/114104610
answer count: 1
linked to: http://stackoverflow.com/q/34487077
favorite count: 0
tagged with: google-places-api
upvote count: 2
has title: How to get postal code with using Google Places API?
has answer: http://stackoverflow.com/a/28476248
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
has body: I use Google Places API to implement autocomplete. I noticed that Google Places API doesn't return zip codes for some addresses: URL: https://maps.googleapis.com/maps/api/place/autocomplete/json?input=3&types=address&language=en&key=MY_KEY One of predictions: description = "3rd Avenue, NY, United States"; id = b9ea1b2047021e7b8f4d1e2d2033b4baafcc8d21; "matched_substrings" = ( { length = 1; offset = 0; } ); "place_id" = Eh0zcmQgQXZlbnVlLCBOWSwgVW5pdGVkIFN0YXRlcw; reference = "CjQhAAAAZddDjaWNLgFtHPG-JqwGI9W4kfxDj0DwYLQ9WtzJ8BdKJ-q7qu0YcrGHfdYCs_6-EhB6ZULyxVK-yFVOMmjt17XIGhT76Ln6Cy1sukn0DMKMLiqMADMmbg"; terms = ( { offset = 0; value = "3rd Avenue"; }, { offset = 12; value = NY; }, { offset = 16; value = "United States"; } ); types = ( route, geocode ); Moreover, it even doesn't return postal code, when I call details of this place. URL: https://maps.googleapis.com/maps/api/place/details/json?reference=CjQhAAAAtTsm_rHPRkKVkTBCXhFiRX7hjWshEAchbcqQslgpJaZEaDWyzqGzWsMmaZItCGO7EhCzWXberoKVpm0eIMJd8Uk2GhQxEpgyR_XiYLsvU3tc43ZsrK_M2Q&language=en&key=MY_KEY Result: "html_attributions" = ( ); result = { "address_components" = ( { "long_name" = "3rd Ave"; "short_name" = "3rd Ave"; types = ( route ); }, { "long_name" = Manhattan; "short_name" = Manhattan; types = ( "sublocality_level_1", sublocality, political ); }, { "long_name" = "New York"; "short_name" = NY; types = ( locality, political ); }, { "long_name" = "New York County"; "short_name" = "New York County"; types = ( "administrative_area_level_2", political ); }, { "long_name" = "New York"; "short_name" = NY; types = ( "administrative_area_level_1", political ); }, { "long_name" = "United States"; "short_name" = US; types = ( country, political ); } ); "adr_address" = "3rd Ave, New York, NY, USA"; "formatted_address" = "3rd Ave, New York, NY, USA"; geometry = { location = { lat = "40.769058"; lng = "-73.9611034"; }; }; icon = "http://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png"; id = b9ea1b2047021e7b8f4d1e2d2…
downvote count: 1
type: Question
tagged with: google-maps
accepted answer: http://stackoverflow.com/a/28476248

http://stackoverflow.com/a/28571094
has comment: http://stackoverflow.com/comment/76694457
upvote count: 2
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28570599
has body: When debugging, instead of using the repl module, you can drop into a repl on breakpoint by running your script as: node debug myscript.js This will, on breakpoint, enter into a debugger prompt where you can type repl and then you can inspect the current scope and do some basic debugging operations. Node's docs provide a detailed information on what's possible, so I suggest you take a look at them and have fun! Update: If you are not so much interested in the repl itself but in a good way to inspect your code at a given breakpoint, there is always node-inspector - an excellent debugger for Node.js that works with any WebKit-based browser and provides a wide variety of code inspection (not a repl, though, but you can still inspect variables at a given breakpoint or modify them at runtime, for example).

http://stackoverflow.com/q/28471711
type: Question
tagged with: android
favorite count: 0
has body: I my code for sms intent does not give any responses..nor message dialogbox appears..iam stuck in this for days..please help Here is the code: var intent = Ti.Android.createIntent({ action : Ti.Android.ACTION_VIEWs, type : "vnd.android-dir/mms-sms" }); intent.putExtra("address", "111111111"); intent.putExtra("sms_body", "Body of Message"); try { Ti.Android.currentActivity.startActivity(intent); } catch (ActivityNotFoundException) { Ti.UI.createNotification({ message : "Error" }).show(); } should i add anything in the intent filters?plz need some advice.. i do noticed that intents were not working in this titanium sdk version 3.4.1..is there any fix?
upvote count: 1
tagged with: titanium-mobile
has comment: http://stackoverflow.com/comment/45309996
answer count: 0
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
score: 1
has title: sms intent not working titanium

http://stackoverflow.com/comment/59901115
has text: getBoundingClientRect() only works on a single element. getElementsByName(iframeName) returns an array of elements. getElementsByName(iframeName)[0].getBoundingClientRect() should work.
comment on: http://stackoverflow.com/a/28468605
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28473628
has comment: http://stackoverflow.com/comment/84246554
has comment: http://stackoverflow.com/comment/48844004
score: 65
type: AcceptedAnswer
has body: Copy var src = { name: 'Apple', price: 5}; var dst= angular.copy(src); deep copy Extend: var mergedObject = angular.extend(dst, src1, src2, ...) shallow copy Merge: var mergedObject = angular.merge(dst, src); since angular 1.4+ deep (recursively) copy If you want to not overwrite with null, you can use this. Object.assign(): let movie2 = Object.assign({}, movie1, { episode: 8 }); fot Angular 2+ (ECMAScript 6) Sources: https://docs.angularjs.org/api/ng/function http://davidcai.github.io/blog/posts/copy-vs-extend-vs-merge/
type: Answer
accepted answer of: http://stackoverflow.com/q/28473574
answers question: http://stackoverflow.com/q/28473574
upvote count: 65
has comment: http://stackoverflow.com/comment/48843150
downvote count: 0

http://stackoverflow.com/a/28686342
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28493603
score: 0
has comment: http://stackoverflow.com/comment/75882433
has body: If you are using 1.3.6 or later version then you can do as below onLoadSuccess:function(){ ....... ........ //At last of your code $('#'+elementId).datagrid('sort', { sortName: 'columnid', sortOrder: 'desc' }); }
type: Answer
answers question: http://stackoverflow.com/q/28493603

http://stackoverflow.com/comment/45372858
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28528704
has text: Thank you for your help. The problem is here that className has all classes from the markup. console.log gives me "thumbnail img-2 show-thumb". Can I strip everything beside img-x? And then filtering the x?

http://stackoverflow.com/comment/45275404
has text: Paste the code of what you have tried so far
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28476075
type: Comment

http://stackoverflow.com/q/28487629
type: AnsweredQuestion
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45302542
has answer: http://stackoverflow.com/a/28490850
has body: I'm working with a responsive site and I want the homepage to not require any scrolling. Right now, it has a header (239px tall) and a footer (94px tall) and then Owl Carousel sliding through images in the middle of the page. The CSS on the Owl Carousel is at 100% width, which shows the whole image. But the way the slider is setup, if I change the container height to be window.innerHeight, it crops the image in the slider (still 100% width). How can I have the Owl Carousel be a relative height that changes the width to the exact % width so that Header + Owl Carousel + Footer all fit the users browser window without having to scroll? EDIT: This is the basic structure of the Owl Carousel. And has the <'header'> of 239px tall and <'footer'> of 94px tall. The images scale to fit the width of the .sy-box, and max-height:none; Here is a great, very similar example to what I'm working with. Header, footer, Owl Carousel in the middle. How would you take this page and make it fit the screen (without cropping images, simply having them scale so they fit on the page)? http://www.isidrophotographer.com
has comment: http://stackoverflow.com/comment/45298471
has comment: http://stackoverflow.com/comment/45297184
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/28511570
accepted answer: http://stackoverflow.com/a/28511570
has comment: http://stackoverflow.com/comment/45297309
has answer: http://stackoverflow.com/a/28487772
tagged with: javascript
tagged with: jquery
has title: Change width so height fits in window screen?
possible better answer: http://stackoverflow.com/a/28487772
has comment: http://stackoverflow.com/comment/45302767
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/45297232
has answer: http://stackoverflow.com/a/28488290
has comment: http://stackoverflow.com/comment/45298755
has comment: http://stackoverflow.com/comment/45299129

http://stackoverflow.com/comment/45380981
type: AnswerComment
score: 0
type: Comment
has text: Code that interacts with the DOM should go in the view, components are a type of view.
comment on: http://stackoverflow.com/a/28521688

http://stackoverflow.com/a/28465934
downvote count: 0
type: Answer
has body: element.style contains the styles for inline styles, not ones from CSS stylesheets. You will need to use jQuery("element").css or getComputedStyle to get the value JQuery css method var dispVal = jQuery(".faq-answer").css("display"); console.log(dispVal); .faq-answer { display:none; } getComputedStyle var ele = document.querySelector(".faq-answer"); var style = window.getComputedStyle(ele); console.log(style.display); .faq-answer { display:none; } You could also more simply use .is(":visible") which will return a boolean value, true if visible, false if not. var isVisible = $(".faq-answer").is(":visible"); ; console.log(isVisible); .faq-answer { display:none; }
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28465755
accepted answer of: http://stackoverflow.com/q/28465755
type: AcceptedAnswer

http://stackoverflow.com/q/28437488
has comment: http://stackoverflow.com/comment/45205005
has answer: http://stackoverflow.com/a/58320231
upvote count: 1
accepted answer: http://stackoverflow.com/a/28438275
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45205625
score: 1
has body: So I've been trying to create a program in Javascript/jQuery that splits an amount of money into the smallest amount of dollar bills. So far the program only works with one bill, and I'm not too sure how to implement the rest and need a push in the right direction here. var bills = [5, 10, 20, 50, 100]; while(money &gt; 0){ // Keep deviding for(var i=0; i &lt; bills.length; i++){ if(money &lt; bills[i]) return "You need a $" + bills[i] + " bill to pay for your item."; } } If I run this with money = 89; it will return 100 because that's the closest bill that can pay for $89, but I want it to return 50 + 20 + 20 so it will work with money = *anything*. EDIT: After comments I've now come so far: while(money &gt; 0){ // Keep deviding for(var i=bills.length-1; i &gt;= 0; i--){ if(money &gt; bills[i] || i == 0){ stringToReturn += " + $" + bills[i]; money -= bills[i]; break; } } }
type: Question
has comment: http://stackoverflow.com/comment/45205573
tagged with: algorithm
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28438275
has title: Javascript Coin changing / Change making algorithm
answer count: 3
possible better answer: http://stackoverflow.com/a/28437915
has comment: http://stackoverflow.com/comment/45205125
has answer: http://stackoverflow.com/a/28437915
favorite count: 0

http://stackoverflow.com/q/28497274
answer count: 3
tagged with: html5-canvas
favorite count: 0
has title: fabricjs How can i keep fixed size on group elements while others scaling?
upvote count: 2
score: 2
has body: Hello I use fabricjs to play with the html canvas. I create the canvas and i add group of objects on it. On a group of objects, I need to keep fixed width &amp; height for some objects while I scale the object. I use the 'object:scaling' event to get the active object when it changes size, I read each object of the group and I assign element[i].set({'radius':5}) on the group objects that I want to be unchanged. But the result is that , all the group object to resize. I show you the snippet of the object:scaling event : canvas.on('object:scaling',function(e){ var activeObject1 = e.target; var elements = e.target._objects; var count_elements = elements.length; for(var i = 0; i &lt; count_elements; i++) { var type = elements[i].typeCircle; if(type == "parts"){ //elements[i].set({"radius":8,"fill":"#abcde2","stroke":"#367827"}); //elements[i].set('radius',8); /*elements[i].setWidth(16); elements[i].setHeight(16); elements[i].currentWidth = 16; elements[i].currentHeight = 16; elements[i].scaleX = 1; elements[i].scaleY = 1; console.log(elements[i]); canvas.renderAll();*/ } } }); What should I write into the for loop to keep fixed size on some objects? everything that I used above, they don't work except for the "fill":"#abcde2","stroke":"#367827" If anyone has faced something similar on fabricjs, please let me know .
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/30217055
accepted answer: http://stackoverflow.com/a/30217055
possible better answer: http://stackoverflow.com/a/47734584
tagged with: fabricjs
type: Question
has answer: http://stackoverflow.com/a/47734584
tagged with: frameworks
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/65072013

http://stackoverflow.com/a/28545168
answers question: http://stackoverflow.com/q/28544715
score: 0
type: Answer
has body: The given full example inside doesn't give a clear understanding which is though as the parent and which is child. There are 2 easy ways of doing the effect you desire: Add margin-top to the child so it moves down the same as the height decreases Parent element needs to be position: relative while the child needs to be position: absolute for the bottom to work here Sidenote #1: Make code more readable by changing dom element style with its style property. And by doing this you won't need to set bottom style on each animation frame. //From elm.setAttribute("style", "height:" + val + "px;bottom:0px;"); // To elm.style.height = val + 'px'; elm.style.bottom = '0px'; Sidenote #2: read about using Window.requestAnimationFrame() for animating within javascipt. Sidenote #3: try to do animation within css using a combination of transform and transition and listen to the end of animation withing javascript.
has comment: http://stackoverflow.com/comment/45404481
has comment: http://stackoverflow.com/comment/45428092

http://stackoverflow.com/a/28464427
accepted answer of: http://stackoverflow.com/q/28463907
has comment: http://stackoverflow.com/comment/45255509
has comment: http://stackoverflow.com/comment/45255414
has comment: http://stackoverflow.com/comment/45255348
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45255709
has comment: http://stackoverflow.com/comment/45254976
answers question: http://stackoverflow.com/q/28463907
type: Answer
has body: On the page you provided, you initialize fancybox on line 469: &lt;script type="text/javascript"&gt; $(document).ready(function() { $(".fancybox").fancybox(); }); &lt;/script&gt; so you could just replace the line $(".fancybox").fancybox(); with the script from the Fiddle and it should work. Basically, you wouldn't add the code to intialize a plugin to the plugin files itself, but either add it as inline script in your HTML (as you already did) or add it in a separate script-file that you include in your page which can be better for maintainability. Note that your page is not valid HTML - you have two additional head and body tags that you should remove - the second head tag is in line 446: &lt;div id="CustomPageBody"&gt;&lt;head&gt; and closes in line 452. The second body tag is line 454 and closes in line 464 below the script that initializes fancybox.

http://stackoverflow.com/comment/45482887
comment on: http://stackoverflow.com/q/28582528
type: Comment
type: QuestionComment
has text: lets see if the insert its really happening, remove the allows/deny methods
score: 0

http://stackoverflow.com/comment/45437109
type: Comment
type: QuestionComment
has text: Push simply creates a unique id and returns a reference to it. It is a pure client-side operation, so no server-side validations (e.g. Firebase's security rules) are triggered.
comment on: http://stackoverflow.com/q/28561758
score: 0

http://stackoverflow.com/q/28504282
linked to: http://stackoverflow.com/q/23766086
score: 3
has body: I am loading an arbitrary page into an element. However, I want to call a method only AFTER I'm sure that page has loaded. Is there a way to detect such an event? &lt;body&gt; &lt;div id="testFrame" style="width: 640px; height: 480px; border: solid; border-width: thick;"&gt;&lt;/div&gt; &lt;input id="reload" type="button" value="Refresh"/&gt; &lt;script&gt; $(document).ready(function(){ $('#reload').click(function(e){ e.preventDefault(); $("#testFrame").html('&lt;object id="idObject" width="640" height="480"data="http://www.microsoft.com"&gt;'); }); $( "#idObject" ).isLoaded(function() { // Not a real function alert("frame loaded"); // Show a message when the page is loaded }); }); &lt;/script&gt; &lt;/body&gt;
linked to: http://stackoverflow.com/q/7756353
tagged with: javascript
upvote count: 3
answer count: 3
has answer: http://stackoverflow.com/a/28507250
has answer: http://stackoverflow.com/a/28510464
tagged with: jquery
has comment: http://stackoverflow.com/comment/45327797
favorite count: 0
linked to: http://stackoverflow.com/q/16660559
type: UnansweredQuestion
has title: How to fire an event when a page is loaded into an element
has answer: http://stackoverflow.com/a/28505524
has comment: http://stackoverflow.com/comment/45368782
downvote count: 0
type: Question

http://stackoverflow.com/comment/45368588
score: 0
comment on: http://stackoverflow.com/q/28518119
type: Comment
type: QuestionComment
has text: @Tigrokonvel: See the example in the answer by Ingo Bürk

http://stackoverflow.com/comment/45481687
type: AnswerComment
has text: It doesn't work because there is no element with `data-action=clear` attribute in HTML.
type: Comment
comment on: http://stackoverflow.com/a/28585693
score: 0

http://stackoverflow.com/a/28493407
accepted answer of: http://stackoverflow.com/q/28492939
answers question: http://stackoverflow.com/q/28492939
upvote count: 1
type: AcceptedAnswer
has body: You included jQuery with your tags, and so I assume you'd be okay using a jQuery plugin. jQuery-dateFormat is simple to use. var date = new Date(); var fDate = $.format.date(date, 'E MMM dd yyyy hh:mm:ss a'); $('#date').text(fDate);
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/28537613
type: Question
has body: I want to pass a parameter to my Store proxy to retrieve the right data from the server. I need to pass the parameter without the name prefix and just the value. Instead of this kind of url : myAppUrl/collections/units?collectionId=54 which can be done like this: myStore.getProxy().extraParams.collectionId = 54; I want to have a call like this: myAppUrl/collections/54/units My web service is adapted for both calls I just need the correct client code to pass the parameter. Please help and advise.
downvote count: 0
tagged with: javascript
tagged with: extjs
tagged with: proxy
answer count: 3
tagged with: sencha-architect
has answer: http://stackoverflow.com/a/46447175
has answer: http://stackoverflow.com/a/28537715
favorite count: 0
has answer: http://stackoverflow.com/a/28538257
has title: Ext Js proxy pass parameter
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/87772128
tagged with: store
upvote count: 1
score: 1

universal-analytics
tag name: universal-analytics
tags question: http://stackoverflow.com/q/28481589
type: Tag

http://stackoverflow.com/comment/45341694
type: QuestionComment
type: Comment
score: 1
has text: "So in JavaScript, object literals {} are hash tables under the hood." - this is not entirely accurate. Implementations vary, but the engine I work on (Chakra) exhibits a degree of polymorphism internally where an object can be both an array and exhibit hashtable behaviour simultaneously under certain circumstances.
comment on: http://stackoverflow.com/q/28511328

http://stackoverflow.com/q/28538998
has body: page1.php In this the select option is selected options are send to the page.php forget the values which are selected in this page1.php I am trying to hide and show the input box when the mouse click or focus on the selected id i.e..select option html tags Children 1 2 3 4 5 page2.php After the page2.php loads through the ajax than the javascript code which is focusing on this id tg_value_select this id : cic_value_select show be hide and input id : cic_name should show... Children 1 2 3 4 5 After the page2.php loads, than the user select the select option i.e..tg_value_select the second select option cic_value_select has to hide and input box has to show... The focusing on the select option is no working please help.. Thanks.
tagged with: javascript
has answer: http://stackoverflow.com/a/28539412
tagged with: jquery
type: UnansweredQuestion
has title: Hide and Show based on focus of the select option
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: php
answer count: 1
score: 0
tagged with: hide

http://stackoverflow.com/q/28577347
has comment: http://stackoverflow.com/comment/45495427
score: 1
upvote count: 1
type: Question
tagged with: javascript
tagged with: resize
has answer: http://stackoverflow.com/a/31137181
answer count: 1
downvote count: 0
tagged with: controls
favorite count: 0
has body: I have a function createControls(){ return new THREE.TrackballControls( camera,domElement );} which is created with THREE.TrackballControls=function(object, domElement){.....} controls = createControls(camera, renderer.domElement); restoreView(controls, vars); addDefaultKeyEventListener(); and after resizing the webgl container the controls dont work correct..to be precise there is an event where when the user clicks on the screen a yellow ball moves to the exact place on a plain at the 3d space. After the resize event the ball moves at a spot which has a offset of that place i suppose related with the resized scale. When i try to redefine controls variable it crashes.. How can i update the controls having new camera and renderer.domElement input variables?
accepted answer: http://stackoverflow.com/a/31137181
tagged with: three.js
has title: How to update createControls's function input variables at javascript?
type: AnsweredQuestion

http://stackoverflow.com/q/28493197
linked to: http://stackoverflow.com/q/4683331
has body: There's a site at work that I want to fill out with my name, email and phone number with either one click, or as soon as I navigate there.* The site, in its most rudimentary form is this: &lt;html&gt; &lt;body&gt; &lt;table&gt; &lt;TR&gt; &lt;TD width="71"&gt;&lt;BR&gt;&lt;BR&gt;Text1:&amp;nbsp;&lt;/TD&gt;&lt;TD colspan="5" width="608 &lt;BR&gt;** Text2&lt;BR&gt; &lt;input name="Comment" size="100" maxlength="200" value="na"&gt; &lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; I've tried approaches based on these two questions on this site: How to fill in form field, and submit, using javascript? Using Javascript to Open a New Page and Populate Form Values There But I just can't get anything to work. Here's the bookmarklet I have created: javascript (function()%7Bdocument.getElementById("Comment").value%3D"Test111"%7D)() but this gives an error of type "Uncaught TypeError: Cannot Set Property 'Value' of null" I also created this bookmarklet: javascript:(function()%7Bdocument.getElementByTagName("Comment")[0].value%3D"moo"%7D)() which gives me an error of type "Uncaught TypeError: undefined is not a function" I'm lost in the woods; I have experience coding but mostly data parsing and analysis in python or FORTRAN (eep). HTML and the various related scripting languages are really interesting to me, but I just don't understand them well enough to tackle this problem. *If there's a way for me to submit a form of this type without actually navigating to the site, that would be great as well.
has comment: http://stackoverflow.com/comment/45306787
tagged with: http://stackoverflow.com/tag/html
tagged with: autofill
has comment: http://stackoverflow.com/comment/45348523
score: 2
downvote count: 0
linked to: http://stackoverflow.com/q/16664205
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28594615
linked to: http://stackoverflow.com/q/3717361
has title: Autofill Form Using Bookmarklets
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/45342041
tagged with: bookmarklet
has comment: http://stackoverflow.com/comment/45313636
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/a/28580835
answers question: http://stackoverflow.com/q/28580752
has body: use regular expressions. \d is any digit, + is 1 or more. var str = 'http://example.com?uid=1234'; var regexp = /\d+/; str = str.match(regexp); console.log(parseInt(str));
score: 0
type: Answer

http://stackoverflow.com/comment/45456885
type: QuestionComment
has text: In short, I need the "+" operator to work as an "append" and not a "mathematical operator".
score: 0
comment on: http://stackoverflow.com/q/28573663
type: Comment

http://stackoverflow.com/comment/45292294
has text: I've been using Mustache to throw in values I grab from a database. I'll add that into my tags.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28485160
score: 2

http://stackoverflow.com/a/28463703
type: Answer
accepted answer of: http://stackoverflow.com/q/28463357
has body: With jQuery Cookie plugin: if($.cookie("accepted")){ $("#terms").hide(); } $('#accept').click(function() { $.cookie("accepted", true, { expires: 9999 }); $(this).parent().fadeOut(); }); JSFiddle: http://jsfiddle.net/Tymek/jv6L8ncL/ (see External Resources)
has comment: http://stackoverflow.com/comment/45306699
score: 0
answers question: http://stackoverflow.com/q/28463357
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45377544

http://stackoverflow.com/comment/45240038
type: Comment
comment on: http://stackoverflow.com/a/28454936
has text: I'll try. but how can I explain that even without this problematic member, I still cannot access these vars via the browser console?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45341285
has text: You got in before my edit of the solution, work-around @NathanTuggy
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28511191
score: 0

http://stackoverflow.com/a/28496403
answers question: http://stackoverflow.com/q/28496290
score: 1
upvote count: 1
has body: If you look in the web console of your browser, you'll probably see an error saying that redirectCHUB is not defined. Since the function call fails (throws an exception), the return false is never executed, and the default action isn't prevented. To call a function from an attribute event handler, it has to be a global function. (This is one of many reasons not to use them, see below for an alternative.) If the function is a global, that attribute works: function redirectCHUB() { var p = document.createElement('p'); p.innerHTML = "redirectCHUB ran"; document.body.appendChild(p); } click me To use a non-global function (which is preferred), use advanced event handling hookup. To do that, you'll need a way to identify the anchor you want to add the handler to. That can be any CSS selector; ids are handy but of course limited (they have to be unique on the page) and a bit inflexible. Using modern event handling still requires allowing for older versions of IE that use Microsoft's attachEvent instead of addEventListener; this answer has a fully-implemented cross-browser means of doing it. Here's an example using that hookEvent function: // The hookEvent function; you obviously just stick this off in a // library file or some such... var hookEvent = (function() { var div; // The function we use on standard-compliant browsers function standardHookEvent(element, eventName, handler) { element.addEventListener(eventName, handler, false); return element; } // The function we use on browsers with the previous Microsoft-specific mechanism function oldIEHookEvent(element, eventName, handler) { element.attachEvent("on" + eventName, function(e) { e = e || window.event; e.preventDefault = oldIEPreventDefault; e.stopPropagation = oldIEStopPropagation; handler.call(element, e); }); return element; } // Polyfill for preventDefault on old IE function oldIEPreventDefault() { this.returnValue = false; } // Polyfill for stopPropagation on old IE function oldIEStopPropagation() { this.canc…
downvote count: 0
type: Answer

http://stackoverflow.com/comment/45277932
type: Comment
has text: The catch proceeds "successfully" and returns a promise which is resolved (fulfilled). So chained `then`'s **will** be executed. To avoid that, throw the error again within the `catch` function. To put it another way, you could say that rejections are caught just once along the chain (unless the catch handler itself rethrows). By the way, this is on the boundary of what some say promises should be used for. Normally, rejections indicate some extraordinary situation. Here, you're using them for some plain old duplicate checking.
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28469810

http://stackoverflow.com/comment/45440188
has text: This tells you everything you need to know https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
score: 1
comment on: http://stackoverflow.com/q/28564921
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28438201
has comment: http://stackoverflow.com/comment/45206887
score: 0
answers question: http://stackoverflow.com/q/28438053
type: Answer
has comment: http://stackoverflow.com/comment/45207257
has comment: http://stackoverflow.com/comment/45207476
has body: Using HTTP header You have to set the Cache-Control HTTP/1.1 header at the server side. This is the recommended approach. Using a nonce in the request However you can also use a hacky solution, if you can't change the server settings. Use a nonce in the request: $('.new_feed').load('headline.asp?' + nonce); Because it will look like a different request to the browser, it will ignore the cached value. The simplest solution for a nonce is using the current time: var date = new Date(); var nonce = date.getMilliseconds();
has comment: http://stackoverflow.com/comment/45207531
has comment: http://stackoverflow.com/comment/45207371

http://stackoverflow.com/q/28521858
tagged with: casperjs
answer count: 0
has comment: http://stackoverflow.com/comment/45381540
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45372728
has comment: http://stackoverflow.com/comment/45371979
has body: Having problem using subprocess with Casperjs, try a couple of option already but getting nowhere. Using a mac, python 2.x import os import subprocess CASPER ='/usr/local/Cellar/casperjs/1.1-beta3/bin/casperjs' SCRIPT = '/Users/doddarliu/Desktop/simple.js' params = CASPER + ' ' + SCRIPT stdout_as_string = subprocess.check_output(params, shell=True) print stdout_as_string Error Traceback (most recent call last): File "/Users/doddarliu/Desktop/untitled.py", line 11, in &lt;module&gt; stdout_as_string = subprocess.check_output(params, shell=True) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 573, in check_output raise CalledProcessError(retcode, cmd, output=output) CalledProcessError: Command '/usr/local/Cellar/casperjs/1.1-beta3/bin/casperjs /Users/doddarliu/Desktop/simple.js' returned non-zero exit status 1
type: UnansweredQuestion
has title: Trying to run casperjs with subprocess in python
tagged with: python

http://stackoverflow.com/comment/45302473
type: Comment
has text: @Oriol Thank you for your comment, I'm well aware of it, but I think the latter is clearer.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28490253

http://stackoverflow.com/a/28560973
answers question: http://stackoverflow.com/q/28560157
type: Answer
upvote count: 4
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28560157
score: 4
has comment: http://stackoverflow.com/comment/45433238
downvote count: 0
has body: Your approach is on the right track. It's just that you're using the document.getElementsByName slightly wrong. From the docs(emphasis is mine): The getElementsByName() method returns a collection of all elements in the document with the specified name (the value of the name attribute), as a NodeList object. So in your code where you do: document.getElementsByName("atrib[]") //This returns a NodeList object In other words, this would be an array of elements that have the name attribute with value 'attrib[]' and therefore you can't just access the value attribute of that array, which is why you when you do this: var inputAtrib = document.getElementsByName("atrib[]").value; //You get undefined console.log(document.getElementsByName("atrib[]")); //This would return a node list and you can see all the matched input elements are returned So you would want to do something like: var test = document.getElementsByName("atrib[]"); console.log(test[0].value); //Outputs "atrib name 1" You could also use document.querySelectorAll("input[name='atrib[]']"). I have incorporated both these approaches and made a Fiddle out of it. Feel free to play around with it. Hope it gets you started in the right direction.
has comment: http://stackoverflow.com/comment/70080689

http://stackoverflow.com/q/28453662
has comment: http://stackoverflow.com/comment/45234302
tagged with: javascript
has comment: http://stackoverflow.com/comment/45234505
has comment: http://stackoverflow.com/comment/45235081
has comment: http://stackoverflow.com/comment/45668032
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45234530
has comment: http://stackoverflow.com/comment/45234944
tagged with: jsrender
has comment: http://stackoverflow.com/comment/45246565
upvote count: 2
type: UnansweredQuestion
has title: Single quotes in JSRender Syntax error
score: 2
answer count: 0
tagged with: http://stackoverflow.com/tag/json
has body: I have use JSrender for crating template. I have apostrophe in JSON object value. So js render showed as syntax error. Any Possible solution for this. My JSON are as follows. var data={"name":"k'obrain","state":"D.E"} i used js render like this $("#tdCell").html("") When i remove apostrophe from "name" its working fine. Can anyone help to resolve this. Thanks in advance
type: Question
has comment: http://stackoverflow.com/comment/45234421

http://stackoverflow.com/a/28500664
upvote count: 1
has comment: http://stackoverflow.com/comment/45320854
type: Answer
has body: whre is the "sltSecondary" ID ?? the second item has the same id i think you mean One-Time Recurring One-Time Recurring
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28500461

http://stackoverflow.com/q/28541745
tagged with: reload
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
upvote count: 1
has answer: http://stackoverflow.com/a/28552760
tagged with: asp.net
favorite count: 0
has body: I am trying to fix some issues in an old asp.net application which uses ASP GridView. There are several events bound to the grid. Say sort, row click etc. I want to execute some js function after load/reload completes, (like after sort using header click etc.). I tried JQuery's ready function, which fires only on page load. Placed a script block next to the grid Placed a RegisterStartupScript in grid_sort (where DataBind happens) none of them fires on grid reload after sort.
tagged with: gridview
type: UnansweredQuestion
has title: Reload event of ASP gridview
score: 1

http://stackoverflow.com/a/28543628
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28543527
answers question: http://stackoverflow.com/q/28543527
has comment: http://stackoverflow.com/comment/45409981
upvote count: 3
has body: did you try this? Edit to your comment: $('div.pop-up').click(function(){ $('.text').removeClass('show'); $(this).find('.text').toggleClass('show'); }); You have to say which div to click by class, otherwise, partent div's are clicked as will...
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/45402257

http://stackoverflow.com/comment/45448238
has text: Although it kinda works, it is not getting the desired results.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28534308
score: 0

http://stackoverflow.com/comment/45403191
comment on: http://stackoverflow.com/q/28544883
score: 0
type: QuestionComment
type: Comment
has text: @Pointy I realized I had the wrong url. Please check the edited url above. Thanks!

http://stackoverflow.com/a/28574644
has body: DOM events, when using React are synthetic ... they are all handled at the document level and then synthesized across all handlers. So, for DOM events, a handler hasn't been attached to each element for each event. However, that still means there is overhead that can't be avoided as your components would need to be notified that an event has occurred. For communicating to the SheetComponent from a CellComponent, you could simply add your own event as a property: onCellActivated for example. If you have more than a couple, you could, instead of having lots of events needing to be wired up, you could have a generic event with an argument set to the type of event: onCellEvent({ eventType: 'activation', cell: this }) That pattern starts to look more like an Action Creator/Action following the Flux pattern (without the Dispatcher and Store of course). Instead of relying on your own events, you could use a Flux/Action/Dispatcher pattern potentially to relay key events to a centralized location (like the SheetComponent) and from there handle the interaction. With the action dispatched, you would include the key information about the cell where the interaction took place. But, you might want to test the performance of a more traditional event model first as this might add extra complexity with little actual benefit. You might also want to take some inspiration from Facebook's Fixed Data Table component, written for React. It's designed to handle thousands of rows of data efficiently.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28574143
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45474451
has comment: http://stackoverflow.com/comment/45473323
accepted answer of: http://stackoverflow.com/q/28574143
has comment: http://stackoverflow.com/comment/45476787
type: Answer
has comment: http://stackoverflow.com/comment/45473384
upvote count: 1
has comment: http://stackoverflow.com/comment/45467018

http://stackoverflow.com/comment/45299802
type: Comment
has text: OK i change it but now i obtain four array empty! I add partialArray.pop() after recursive call
comment on: http://stackoverflow.com/a/28482705
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45210262
type: Comment
comment on: http://stackoverflow.com/a/28440338
score: 0
type: AnswerComment
has text: yes, edited although returning the jquery object can be more useful.

asp.net
tags question: http://stackoverflow.com/q/28534637
tags question: http://stackoverflow.com/q/28561107
tags question: http://stackoverflow.com/q/28446292
tags question: http://stackoverflow.com/q/28483539
tags question: http://stackoverflow.com/q/28592407
tags question: http://stackoverflow.com/q/28463622
tags question: http://stackoverflow.com/q/28487266
tags question: http://stackoverflow.com/q/28557227
tags question: http://stackoverflow.com/q/28585538
tags question: http://stackoverflow.com/q/28563755
tags question: http://stackoverflow.com/q/28558148
tags question: http://stackoverflow.com/q/28552272
tags question: http://stackoverflow.com/q/28453483
tags question: http://stackoverflow.com/q/28475230
tags question: http://stackoverflow.com/q/28473977
tags question: http://stackoverflow.com/q/28565777
tags question: http://stackoverflow.com/q/28574036
tags question: http://stackoverflow.com/q/28531123
tags question: http://stackoverflow.com/q/28476604
tags question: http://stackoverflow.com/q/28567826
tags question: http://stackoverflow.com/q/28437453
tags question: http://stackoverflow.com/q/28453022
tags question: http://stackoverflow.com/q/28535851
tags question: http://stackoverflow.com/q/28486082
tags question: http://stackoverflow.com/q/28448143
tags question: http://stackoverflow.com/q/28492943
tags question: http://stackoverflow.com/q/28523735
tags question: http://stackoverflow.com/q/28559744
tags question: http://stackoverflow.com/q/28579118
tags question: http://stackoverflow.com/q/28482992
tags question: http://stackoverflow.com/q/28537892
tags question: http://stackoverflow.com/q/28468208
tags question: http://stackoverflow.com/q/28537278
tags question: http://stackoverflow.com/q/28494497
tags question: http://stackoverflow.com/q/28571217
tags question: http://stackoverflow.com/q/28496829
tags question: http://stackoverflow.com/q/28538920
tags question: http://stackoverflow.com/q/28541389
tags question: http://stackoverflow.com/q/28579749
tags question: http://stackoverflow.com/q/28487517
tags question: http://stackoverflow.com/q/28568113
tags question: http://stackoverflow.com/q/28475326
tags question: http://stackoverflow.com/q/28474387
tags question: http://stackoverflow.com/q/28480217
tags question: http://stackoverflow.com/q/28589938
tags question: http://stackoverflow.com/q/28439628
tags question: http://stackoverflow.com/q/28452741
tags question: http://stackoverflow.com/q/28536366
tags question: http://stackoverflow.com/q/28520756
tags question: http://stackoverflow.com/q/28516497
tags question: http://stackoverflow.com/q/28530151
tags question: http://stackoverflow.com/q/28566196
tags question: http://stackoverflow.com/q/28501725
tags question: http://stackoverflow.com/q/28503750
tags question: http://stackoverflow.com/q/28513198
tags question: http://stackoverflow.com/q/28555308
type: Tag
tags question: http://stackoverflow.com/q/28493964
tags question: http://stackoverflow.com/q/28476791
tags question: http://stackoverflow.com/q/28551444
tags question: http://stackoverflow.com/q/28523197
tags question: http://stackoverflow.com/q/28445999
tags question: http://stackoverflow.com/q/28541745
tags question: http://stackoverflow.com/q/28578096
tags question: http://stackoverflow.com/q/28468757
tags question: http://stackoverflow.com/q/28470098
tags question: http://stackoverflow.com/q/28481117
tags question: http://stackoverflow.com/q/28565702
tags question: http://stackoverflow.com/q/28459712
tags question: http://stackoverflow.com/q/28505522
tags question: http://stackoverflow.com/q/28465248
tags question: http://stackoverflow.com/q/28478218
tags question: http://stackoverflow.com/q/28592717
tags question: http://stackoverflow.com/q/28465305
tags question: http://stackoverflow.com/q/28590770
tags question: http://stackoverflow.com/q/28566056
tags question: http://stackoverflow.com/q/28540199
tags question: http://stackoverflow.com/q/28469307
tag name: asp.net
tags question: http://stackoverflow.com/q/28463403

http://stackoverflow.com/q/28539610
tagged with: css
linked to: http://stackoverflow.com/q/11589816
type: AnsweredQuestion
downvote count: 0
type: Question
score: 5
has answer: http://stackoverflow.com/a/28558029
accepted answer: http://stackoverflow.com/a/28558029
tagged with: javascript
has title: Bootstrap carousel animate top to bottom instead of left to right
has comment: http://stackoverflow.com/comment/45393346
answer count: 1
tagged with: jquery
favorite count: 0
has body: Is there any option in bootstrap carousel to animate it to top to bottom and bottom to top, instead of right to left and left to right. jsFiddle Example headline. Sign up today Another example headline. Learn more One more for good measure. Browse gallery
upvote count: 5
tagged with: twitter-bootstrap
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28527007
accepted answer: http://stackoverflow.com/a/28527184
tagged with: jquery
has body: I have following html: Domů O nás Výzkum a vývoj Aplikace aktivního gumového prášku Odprašky Guma Zemědělství Potravinářství Projekční činnost Realizace realizace podstránka Kontakty What I am trying to achieve, is wrap each .menuItem and all next .submenuItem with .menuSet. Unhappily, the following js wraps the whole snippet instead of the set defined above. Domů O nás Výzkum a vývoj Aplikace aktivního gumového prášku Odprašky Guma Zemědělství Potravinářství Projekční činnost Realizace realizace podstránka Kontakty For make my intention more understandable, below I post the desired result: $(".menuItem").nextUntil(".menuItem").andSelf().wrapAll(" "); Domů O nás Výzkum a vývoj Aplikace aktivního gumového prášku Odprašky Guma Zemědělství Potravinářství Projekční činnost Realizace realizace podstránka Kontakty
has title: How to wrap all next elements until?
tagged with: wrapall
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/28527184
type: Question
tagged with: javascript
answer count: 1

http://stackoverflow.com/comment/45235404
score: 0
type: QuestionComment
type: Comment
has text: Exactly, that means the price is a number, and when using jQuery's `data` the type is automagically set, in this case to `Number`, which doesn't have a `substring` method. Replace it with `$(a).data('price').toString().substring(1)`
comment on: http://stackoverflow.com/q/28444546

http://stackoverflow.com/a/28536893
type: Answer
score: 2
upvote count: 2
has body: Getting the GMT time out of a JavaScript Date object is simple enough - Date.prototype.toUTCString() The toUTCString() method converts a date to a string, using the UTC time zone. For example: var test = new Date('Thu Jan 01 1970 01:02:01 GMT+0200').toUTCString(); console.log(test); Note that this correctly outputs Wed, 31 Dec 1969 23:02:01 GMT, which although it not what you are looking for, is converting the provided Date to GMT. To get what you want out of your input, a regular expression is useful. Caveats: assumes duration will never be more than 23 hours, 59 minutes, and 59 seconds. If it is this will break. var test = 'Thu Jan 01 1970 01:02:01 GMT+0200'; var durationMatcher = /\d\d:\d\d:\d\d/; console.log(test.match(durationMatcher)); If you can, consider working in some values that works for you with one number - number of milliseconds for example.
answers question: http://stackoverflow.com/q/28536779
accepted answer of: http://stackoverflow.com/q/28536779
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45441747
has text: I'm trying to add the code to the original question and I keep getting error messages. Frustrating.
type: Comment
comment on: http://stackoverflow.com/a/28565628
score: 0
type: AnswerComment

http://stackoverflow.com/a/28594308
score: 9
downvote count: 0
has comment: http://stackoverflow.com/comment/45501671
has body: So far, this has been working great. I noticed that the status is 0 when it can't contact anything. This is inside my http interceptor responseError: function (rejection) { if (rejection.status == 0) { // put whatever behavior you would like to happen } // ....... return $q.reject(rejection); }
upvote count: 9
type: Answer
answers question: http://stackoverflow.com/q/28587753
has comment: http://stackoverflow.com/comment/45496113
has comment: http://stackoverflow.com/comment/75410676

http://stackoverflow.com/comment/45472066
has text: Sorry, my mistake. I wasn't concentrating. I have edited the answer.
type: AnswerComment
comment on: http://stackoverflow.com/a/28566073
score: 0
type: Comment

http://stackoverflow.com/q/28480673
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has title: jQuery trigger click (element.click()) on dynamically created button
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28480775
has comment: http://stackoverflow.com/comment/45283647
type: Question
has comment: http://stackoverflow.com/comment/45283767
has body: I know that with on('click') for dynamically created elements, I must first use a parent element that existed in the DOM For example parent.on('click', child, function(){}); However now my task is to trigger a click to a dynamically created button. I tried $('#button_' + id).click() and $('#button_' + id, '#parentContainer').click() but they didn't work.
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28480949
score: 0

http://stackoverflow.com/comment/45280326
has text: Why do people down vote questions like this? I'm up voting it.. WHY.. because SOF is for learning.. and he explained what the script is meant to do, had his own suspicions and also stated he is new to this... WHY down vote someone for trying to learn and being able to explain and show code on their first post....
type: QuestionComment
comment on: http://stackoverflow.com/q/28478470
type: Comment
score: 2

http://stackoverflow.com/comment/45477339
has text: I would suggest you to store the zip temporarily on server and get a link to it for download after ajax call.
comment on: http://stackoverflow.com/q/28584823
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45290145
comment on: http://stackoverflow.com/a/28483778
has text: But will the string retrieved from the value of the input type=number ever have a 0 on the front to be unintentionally interpreted as base 8?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45304859
comment on: http://stackoverflow.com/q/28492031
has text: Where's the jQuery/JavaScript that you tried?
score: 0
type: Comment
type: QuestionComment

toggle
tags question: http://stackoverflow.com/q/28525527
type: Tag
tags question: http://stackoverflow.com/q/28546112
tag name: toggle
tags question: http://stackoverflow.com/q/28457191

strongloop
tags question: http://stackoverflow.com/q/28534766
tag name: strongloop
type: Tag

http://stackoverflow.com/comment/45403298
type: Comment
comment on: http://stackoverflow.com/q/28544883
type: QuestionComment
has text: @Mikey I thought it did, but if you try it in (for example) the menu bar it doesn't.
score: 0

http://stackoverflow.com/q/28541996
has title: Remove array of objects from array of objects with Jquery or JavaScript
has answer: http://stackoverflow.com/a/28542036
favorite count: 0
has comment: http://stackoverflow.com/comment/45397433
tagged with: angularjs
type: Question
has body: Might be duplicate, but I couldn't find it. So I have two arrays of objects: var a = [{id: '1', name: 'bob'}, {id: '2', name: 'bill'}] $scope.b = [{id: '4', name: 'jack'}, {id: '2', name: 'bill'}, {id: '1', name: 'bob'}, {id: '3', name: 'john'}] I want to remove all the a elements from b. I have tried: $scope.b = $scope.b.filter(function(item){ return a.indexOf(item) === -1; }); unfortunately, for some reason, the index is always -1, so nothing gets deleted. with some console.log-s console.log(item); console.log(a); console.log(a.indexOf(item)); , this is how the data looks like: Resource {id: 4, name: "jack"} [Resource, Resource, Resource, Resource, $promise: Promise, $resolved: true] -1
upvote count: 1
accepted answer: http://stackoverflow.com/a/28542036
answer count: 1
has comment: http://stackoverflow.com/comment/45397540
has comment: http://stackoverflow.com/comment/45397495
type: AnsweredQuestion
tagged with: arrays
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery

http://stackoverflow.com/a/28575103
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/28563997
answers question: http://stackoverflow.com/q/28563997
type: AcceptedAnswer
downvote count: 0
has body: First of all, the word "exclude" used in the question isn't quite accurate. These are files that are generated by the build system - they're not files existing in the source to be excluded in the first place. If you don't want the build to generate source maps, set useSourceMaps: false in your build profile. As for the *.uncompressed.js files, the build generates these automatically for any module or layer that it minifies. If you really don't want them in the build output, you'll need to remove them afterwards with a command like frank suggested in the comments. The reason both of these files are included ordinarily is to assist in debugging of built applications. Neither of these files will be downloaded by a browser during normal use; they will only be requested by developer tools.

http://stackoverflow.com/q/28492476
type: Question
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
downvote count: 0
has title: how to pass an object to a function and return the outcome back to the original function
has body: So I am parsing a csv file which has an address object. I then want to take that address and send it to another function I have which goes to a website and gets the lat/lng for the address. I then want that function to return the lat/lng and add it as a child object of the location object in the array. What I have so far is the CSV being parsed and pulling out the address object. and I have the function that is able to send the address and get the lat/lng....but I dont know how to elegantly link them together. I figured I could just make just 1 giant function but I want to make it cleaner. my incident array looks like this: reportType: 'OFFENSE 2.0', reportNumber: '15021912', offense: '3301', description: 'Driving on Right Side of Roadway.', dateTime: '02/06/2015', location: { block: '02:03 Greentree Rd &amp; Mansfield Ave', zone: 'Outside City' }, person: { age: 'OSC', sex: 'N/A' } } Code for CSV parse is here. function makeURL() { var date = new Date(); var today = date.getDay(); var day = daysOfTheWeek[today]; link = 'http://apps.pittsburghpa.gov/police/arrest_blotter/arrest_blotter_' + day + '.csv' return link } var url = makeURL(); function getURL() { http.get(url, function(res) { if(res.statusCode === 200) { res.pipe(parser); } else { console.error('The address is unavailable. (%d)', res.statusCode); } }) } var parser = parse(function(err, data) { for(i = 1; i &lt; data.length; i++) { var info = data[i] if(info[7] === 'OSC') { info[7] = 'Outside City Limits' } if(info[9] === '') { info[9] = 'N/A' } if(info[8] === '') { info[8] = 'N/A' } var incident = { reportType: info[0], reportNumber: info[1], offense: info[2], description: info[3], dateTime: info[4], location: { block: info[5] + " " + info[6], zone: info[7], }, person: { age: info[8], sex: info[9] } } var passLoc = info[5]; passLoc = passLoc.replace('block ','') passLoc = passLoc.replace(/ /g,"+") console.log(incident); // console.log(passLoc); } }); Code for getting the Lat/lng is here: function getLoc() …
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28492775
accepted answer: http://stackoverflow.com/a/28492775
score: 1

http://stackoverflow.com/q/28503391
type: Question
possible better answer: http://stackoverflow.com/a/57860343
answer count: 2
tagged with: cesiumjs
has answer: http://stackoverflow.com/a/57860343
downvote count: 0
tagged with: javascript
has body: I am trying to show an icon as a billboard and scale it by distance. I can manage fine, but as soon as I load the billboard through CZML instead of directly in JS, I cannot get the billboard the resize. In my JS file I have: var czmlDataSource = new Cesium.CzmlDataSource(); czmlDataSource.loadUrl('airports.czml'); viewer.dataSources.add(czmlDataSource); My CZML file shows: [ { "id":"document", "version":"1.0" }, { "id":"test", "billboard":{ "image":"airport.png", "verticalOrigin":"BOTTOM", "show":true }, "position":{ "cartographicDegrees":[ 0.055278, 51.505278, 0 ] } } ] Before I used this: entity.billboard.scaleByDistance = new Cesium.ConstantProperty(new Cesium.NearFarScalar(1.5e3, 0.3, 3.5e5, 0.0)); Obviously this now doesn't work. But I cannot find a way how to maybe get the ID of the billboard and use the scaleByDistance.
accepted answer: http://stackoverflow.com/a/28509150
favorite count: 0
has title: Cesium - Using scaleByDistance for a billboard created through CZML
score: 6
upvote count: 6
type: AnsweredQuestion
tagged with: czml
has answer: http://stackoverflow.com/a/28509150

http://stackoverflow.com/comment/45269155
type: Comment
type: QuestionComment
has text: Is the url changing in the address bar?
comment on: http://stackoverflow.com/q/28471393
score: 0

http://stackoverflow.com/comment/45482948
score: 0
type: Comment
type: AnswerComment
has text: I am Sorry to mention but this also replace also style color code like #000 . ie. Hello world http://jsfiddle.net/nsfn320q/3/
comment on: http://stackoverflow.com/a/28586428

http://stackoverflow.com/comment/45310084
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28495031
has text: @omega also you can use Jquery mobile buttoms
score: 0

http://stackoverflow.com/comment/45297067
comment on: http://stackoverflow.com/a/28487661
has text: about:blank works too, although that puts me in a gray area with same-origin policy.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28560087
has body: {{item.name}} $rootScope.showScrollAndGo = function ($event, path) { $event.preventDefault(); alert(path) $rootScope.showSpinner = false; $location.path(path); } You must prevent the default action of the event as you are on an anchor element and it will trigger the browser to change the view.
has comment: http://stackoverflow.com/comment/45436456
answers question: http://stackoverflow.com/q/28558375
score: 0
type: Answer

http://stackoverflow.com/comment/45486659
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28589969
type: QuestionComment
has text: Can you show the HTML that the razor code is actually generating?

http://stackoverflow.com/comment/45272139
type: QuestionComment
comment on: http://stackoverflow.com/q/28474256
type: Comment
score: 0
has text: If you could find out why, and in what context this is required, we might be able to help . . .

http://stackoverflow.com/comment/45218831
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28444576
has text: You're actually already doing it with `console.log(result)` as `console.log()` is a function. (I.e. to another function, but you can't return to the function that called the post to begin with)

http://stackoverflow.com/a/28532632
score: 1
has body: There are a couple of things that will make this work View example First use 1 variable to determine fail or success, in my case I used 'success' which is true when it is a success and a false when it is an error vm.openAlert = function(m) { console.log(m); vm.message = m; vm.notification = m; vm.success = (m === 'success'); } Second in your directive change the ng-class location and ng-class string return { restrict: 'E', template: ' ' + ' {{main.message}} ' + ' ' + ' ' }; And you're done!
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45380146
type: Answer
answers question: http://stackoverflow.com/q/28532142

http://stackoverflow.com/q/28477648
tagged with: reusability
type: Question
upvote count: 1
has answer: http://stackoverflow.com/a/31052632
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: c3
has title: How do you make reusable/template charts in c3js
favorite count: 0
has comment: http://stackoverflow.com/comment/47096142
has body: I'm trying to use C3.js(c3js.org) to make charts, but I want to specify everything but the data(and any other minor deviations unique to that chart) once then reuse that for all charts of that variation(a specific configuration of a chart). All the documentation and all examples I've found for C3.js only deal with how you make a single chart. Applying that to multiple charts means a lot of repeated code and doesn't ensure consistency when making changes. The only thing related to this that I've found is a concept on making reusable charts in D3.js(d3js.org), the underlying library used by C3.js, and an implementation inspired by that concept. That doesn't really help me because I want the higher-level abstraction that C3.js provides but these may give you an idea what I'm looking for. I have found no info on this but one idea is to make a chart type that is based on an existing type but that also include the extra configuration(for example make a new chart type called 'horizontalbar' based on the existing 'bar' chart type). Here is a chart I've made, bindto and columns are the unique parts of this chart, the rest should be part of a template, but I don't know how. var chart = c3.generate({ bindto: '#chart', data: { columns: [ ['data1', 125.2], ['data2', 282.7], ['data3', 3211.1], ['data4', 212.2], ['data5', 131.1], ['data6', 329.7] ], type: 'pie', order: null }, pie: { label: { format: function (value, ratio, id) { return d3.format('.1f')(ratio*100)+'%'; //percent with one decimal } } }, tooltip: { format: { value: function (value, ratio, id, index) { return value+'mkr ('+d3.format('.1f')(ratio*100)+'%)'; //example: 155.2mkr (3.3%) } } }, legend: { item: { onclick: function () {} //disable clicking to hide/show parts of the chart } } }); &lt;link href="https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.9/c3.min.css" rel="stylesheet" /&gt; &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.3/d3.min.js"&gt;&lt;/script&gt; &lt;script src="https://cdnjs.cloudflare…
type: UnansweredQuestion
tagged with: charts
score: 1

http://stackoverflow.com/q/28587384
has title: Construct a "3D" bulding using HTML, CSS and JS
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28588190
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45483208
tagged with: css
has comment: http://stackoverflow.com/comment/45483629
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45502061
has body: This question is to broad, I know, but anyway... How can I achieve the same result as the image below using HTML, CSS and JS (maybe images)? The number of "levels" are unpredictable and every "level" of the building must be clickable, an &lt;a href="#"&gt;&lt;/a&gt;, or something like this. Is that possible?
has comment: http://stackoverflow.com/comment/45483419
upvote count: 1
has answer: http://stackoverflow.com/a/28587747
downvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/28588219
accepted answer: http://stackoverflow.com/a/28588190
has answer: http://stackoverflow.com/a/28588219
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/45482190

http://stackoverflow.com/comment/45209156
type: QuestionComment
has text: Can you post an example of the JSON you are sending, and are you sending it with the correct content type i.e. application/json ?
comment on: http://stackoverflow.com/q/28439479
score: 0
type: Comment

http://stackoverflow.com/comment/45249996
score: 0
has text: O horror, it doesn't return *any result at all* for arrays with zero or three elements!
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28459585

http://stackoverflow.com/comment/45473129
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28581419
has text: I'd rather suggest using [redirector addon](https://addons.mozilla.org/en-us/firefox/addon/redirector/) instead of custom script.. It supports some basic level of regex with back-reference..
score: 0

http://stackoverflow.com/comment/45331288
has text: I found at least a bug report for this here: https://connect.microsoft.com/IE/Feedback/Details/1046712
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28489808

http://stackoverflow.com/comment/45371801
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28528213
has text: fair enough, the thing is, the function has a parameter which depends on an ng-repeat, i will edit the question, sorry for that.
type: AnswerComment

http://stackoverflow.com/q/28545369
has answer: http://stackoverflow.com/a/28545400
has body: By pressing a button item ID passed to the function PIG element x and change its border when pressed when no border - by 2px, when pressing once again - border disappears. Works only the first condition. Help please. function PIG(x) { if (!(document.getElementById(x).style.border = "none")) { document.getElementById(x).style.border = "2px solid green"; } else if(!(document.getElementById(x).style.border = "2px solid green")){ document.getElementById(x).style.border = "none"; } }
score: -1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28546282
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28545755
has title: Function only works for the first condition
answer count: 3
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45404036
favorite count: 0

http://stackoverflow.com/q/28454823
answer count: 1
has body: I have this code: public void foo (){ String script = "var aLocation = {};" + "var aOffer = {};" + "var aAdData = " + "{ " + "location: aLocation, " + "offer: aOffer " + " };" + "var aClientEnv = " + " { " + " sessionid: \"\", " + " cookie: \"\", " + " rtserver-id: 1, " + " lon: 34.847, " + " lat: 32.123, " + " venue: \"\", " + " venue_context: \"\", " + " source: \"\"," + // One of the following (string) values: ADS_PIN_INFO, // ADS_0SPEED_INFO, ADS_LINE_SEARCH_INFO, // ADS_ARROW_NEARBY_INFO, ADS_CATEGORY_AUTOCOMPLETE_INFO, // ADS_HISTORY_LIST_INFO // (this field is also called "channel") " locale: \"\"" + // ISO639-1 language code (2-5 characters), supported formats: " };" + "W.setOffer(aAdData, aClientEnv);"; javascriptExecutor.executeScript(script); } I have two q: when I debug and copy script value I see a member rtserver - id instead of rtserver-id how can it be? the code throws an exception because of this. Even if i remove this rtserver-id member (and there is not exception thrown) I evaluate aLocation in this browser console and get "variable not defined". How can this be?
has title: `rtserver-id` turns to `rtserver - id` in java string
tagged with: selenium-webdriver
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45236509
tagged with: java
tagged with: selenium
tagged with: webdriver
has comment: http://stackoverflow.com/comment/45240056
type: Question
has answer: http://stackoverflow.com/a/28454936
accepted answer: http://stackoverflow.com/a/28454936
tagged with: javascript
score: 0

http://stackoverflow.com/q/28558570
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28560895
score: 0
type: Question
tagged with: javascript
has body: Hi i´m trying to create multiple textareas with wysihtml5 0.3.0. First generate HTML an then initialize the editors, I must customize blur for each textarea. bold | italic switch to html view bold | italic switch to html view bold | italic switch to html view Always in the blur event get the last textarea and undefined value: blur3 undefined,blur3 undefined,blur3 undefined Could someone help me out, thanks in advance.
answer count: 1
has answer: http://stackoverflow.com/a/28560895
has title: Create wysihtml5 dynamically
tagged with: wysihtml5

http://stackoverflow.com/a/28471636
answers question: http://stackoverflow.com/q/28471582
score: 1
accepted answer of: http://stackoverflow.com/q/28471582
has comment: http://stackoverflow.com/comment/45267767
has comment: http://stackoverflow.com/comment/45267658
has body: As you are using jQuery, you can use .hide() and .show() functions of jQuery. modify your function as below &lt;script&gt; function showhide(id){ $('#'+id).show(); $('#'+id).siblings('.hide').hide(); } &lt;/script&gt; API Document for siblings
has comment: http://stackoverflow.com/comment/45267823
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45267623
has comment: http://stackoverflow.com/comment/45267701
type: Answer
upvote count: 1

http://stackoverflow.com/a/28540402
downvote count: 0
has comment: http://stackoverflow.com/comment/45432533
answers question: http://stackoverflow.com/q/28540283
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28540283
has body: There are a couple of ways out : 1) Using clipboardData. This should work for IE also $(document).ready(function() { $("#sURL").bind('paste', function(e) { alert(e.clipboardData.getData('Text')); }); }); 2) You can use a timer and paste it in a div with ID paste $("#sURL").live('input paste',function(e){ $('&lt;textarea&gt;&lt;/textarea&gt;').attr('id', 'paste').appendTo('#editMode'); $("#paste").focus(); setTimeout($(this).paste, 250); }); Try this out and let me know :)
type: AcceptedAnswer

http://stackoverflow.com/comment/45444677
comment on: http://stackoverflow.com/a/28535198
type: Comment
score: 0
has text: are you able to reduce the width of the vertical scrollbar
type: AnswerComment

http://stackoverflow.com/comment/45358310
score: 0
comment on: http://stackoverflow.com/q/28520539
type: Comment
type: QuestionComment
has text: How do you access login page? Should be `Login`

http://stackoverflow.com/a/28561697
has comment: http://stackoverflow.com/comment/45435588
score: 0
type: Answer
has body: &lt;a href="#menu"&gt; Above line means you are linking to an element within same page with a name attribute value as "menu" example : &lt;a href="search.html"&gt; Above line means you are linking to another page itself, hence you are getting blank page because you might not have a search.html page or using a blank search.html page.
answers question: http://stackoverflow.com/q/28560636

http://stackoverflow.com/q/28592339
tagged with: php
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45491516
upvote count: 1
has answer: http://stackoverflow.com/a/28592392
has body: I'm trying to update a REST search result with ajax to not reload a new page. right now search result is shown within: <?php include 'hotels/hotelList.php';?> On click on button I want to reload this div element so it includes a new php file. Button: LOAD jQuery I'm not able to replace the div element "searchable" - with replaceWith - Am I doing this right ?
has answer: http://stackoverflow.com/a/28592575
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28592575
answer count: 3
accepted answer: http://stackoverflow.com/a/28592392
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
has title: jQuery.ajax replace PHP code
has answer: http://stackoverflow.com/a/28592478
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45448749
has text: @jw56578 I would prefer it to be a select box because provData could be insanely large and I don't want to clutter the page.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28568651
score: 0

http://stackoverflow.com/comment/45312013
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28496178
has text: possible duplicate of [Adding input elements dynamically to form](http://stackoverflow.com/questions/14853779/adding-input-elements-dynamically-to-form)

http://stackoverflow.com/a/28517393
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28509024
has body: This is a parser error, there are three ways to make this work, creating a var with the number and calling .toString on that, writing the number with an extra a dot or writing the number in parentheses. If you try 6.toString(2) on a JavaScript console you will get this error: SyntaxError: Unexpected token ILLEGAL But this 6..toString(2) works. This is because the JavaScript parser expects a number followed by a dot to be a float literal. When you write 6. the parser expects the next character to be a number not t, when you write 6.. the first dot is parsed as part of the number (creating the number 6.0) and the second dot is parsed as a method call on the created number. In ClojureScript the compiler knows about this "feature" of JavaScript so you can pass the 6 literal to toString: cljs.user&gt; (.toString 6 2) "110" cljs.user&gt; (.toString 6. 2) "110" The ClojureScript compiler generates the correct code in both cases. In the first case it generates (6).toString(2) and in the second case it generates 6.0.toString(2). (js/toString 6) is calling the toString defined on the window global object. No matter what you pass the result is always the same. You can check that calling by window.toString() in a JavaScript console. (.toString target args) is calling the toString defined in the target object passing args as parameters of the method.
has comment: http://stackoverflow.com/comment/45358780
score: 3
answers question: http://stackoverflow.com/q/28509024
has comment: http://stackoverflow.com/comment/45359790
upvote count: 3
has comment: http://stackoverflow.com/comment/45374554
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/45374017

http://stackoverflow.com/comment/45233370
has text: You are a lasy boy hum... Try to google it.
type: Comment
comment on: http://stackoverflow.com/q/28453107
score: 0
type: QuestionComment

http://stackoverflow.com/comment/66096831
has text: yes, I can see. I've already been through a lot of the documentation, and haven't seen any mention or example of anything except a SVG being used for icons. Which is why I was wondering where *specifically* you've found that in the docs. Your link is to the generic documentation.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28447868
score: 0

http://stackoverflow.com/q/28566559
type: UnansweredQuestion
has title: How to find where a custom event listener has been added?
has comment: http://stackoverflow.com/comment/45443473
upvote count: 2
tagged with: dom
has comment: http://stackoverflow.com/comment/45446074
type: Question
has answer: http://stackoverflow.com/a/28578160
tagged with: javascript
has body: There is a 3rd party piece of code running in a "friendly" iframe on a page. The code may or may not have added a listener for one of it's own custom events to any element on the outer page, or in one of the iframes somewhere on the page (either on their window, document or dom elements). I know the name of the custom event, but how can I tell where the listener has been added?
score: 2
answer count: 1
downvote count: 0
tagged with: events
tagged with: dom-events
favorite count: 0
has comment: http://stackoverflow.com/comment/45443745
has comment: http://stackoverflow.com/comment/45444030
has comment: http://stackoverflow.com/comment/45444748

http://stackoverflow.com/q/28576493
has answer: http://stackoverflow.com/a/28576567
type: AnsweredQuestion
tagged with: argument-passing
type: Question
has body: I want to pass multiple values to a function in uploadify. The way you call a function is like this $("#id").uploadify("upload", fileId); here fileId is id of only one file to be uploaded. I have a scenario where i itertate over a table to get file ids to upload then i want to pass those ids to this function call. How can i do that. and here is currently what i am doing, which obviously isn't working. var imagesToUpload = []; $.each(data.validationResult, function (index, obj) { var imageToUpload = GetFileToUpload(obj.ImageName); if(imageToUpload){ imagesToUpload[imageToUpload] = imageToUpload; } }); $("#id").uploadify("upload", imagesToUpload);// this is not working
tagged with: function
answer count: 1
has title: Pass multiple args to function
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28576567
tagged with: jquery
score: 0

http://stackoverflow.com/q/28566417
has body: Having a small issue - when I am trying to update the view results via AJAX in Ruby on Rails (js.erb) ie. when I update/render the form via AJAX, selectpicker turns into just simple input, hence it just disappears from the view. Could someone suggest what I need to do to fix that? = form.input_field :id, :include_blank =&gt; "Some text...", collection: @some_ids, class: 'selectpicker', "data-style" =&gt; "btn", "data-width" =&gt; "100%", :selected =&gt; object.id, :id =&gt; "some_id"
tagged with: ruby-on-rails
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28566524
tagged with: javascript
tagged with: bootstrap-select
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28566524
has title: Bootstrap select turns from dropdown into input field on AJAX - js.erb
tagged with: ajax
score: 0
answer count: 1

http://stackoverflow.com/comment/45370205
comment on: http://stackoverflow.com/a/28526277
score: 0
type: Comment
has text: @Sai Krishna Deep I have editted the answer, works now for your case as well. For some reason fiddle is not working for me atm.
type: AnswerComment

http://stackoverflow.com/a/28520588
has body: What you call a "hole" is not exactly a hole: var a = [,,,,,,,,,,]; a.length; // 10 var n, k; n=0; for (k in a){if (a.hasOwnProperty(k)){++n;}else{break;}}; n; // 10 : a has 10 own properties, all SET to undefined Now delete all properties, and recount while (n--) delete a[n]; for (k in a){if (a.hasOwnProperty(k)){++n;}else{break;}}; n; // 0 a.length; // 10 : a is identical to Array(10), empty array of length 10 To get an array with holes you can either delete properties by hand, or start with Array(N) and fill some indices with values, or use push/splice but not methods that return an array. For instance: Array(2).concat([void(0)]).concat(Array(3)).concat([3]).concat(Array(2)).concat([4]); reproduces exactly your original array (it has length 10 and 10 own properties), althought the first summand (Array(2)) has none. EDIT : The above was tested in ExtendScript and is not true in recent browsers (see comments). Tested afterwards in Firefox and [,,,,,,] indeed has no own property...
upvote count: 0
has comment: http://stackoverflow.com/comment/45359036
has comment: http://stackoverflow.com/comment/45358215
type: Answer
has comment: http://stackoverflow.com/comment/45359120
downvote count: 2
answers question: http://stackoverflow.com/q/28517886
score: -2
has comment: http://stackoverflow.com/comment/45359207
has comment: http://stackoverflow.com/comment/45358247

http://stackoverflow.com/comment/45446728
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28506003
has text: Thanks void! I wasn't able to get it working when using $('#name') but when I made it $('input') it works. And as I don't think I'll have a need to have any other types of input other than text that would be using the delay, this should work great!
score: 0

http://stackoverflow.com/q/28473076
score: 1
has comment: http://stackoverflow.com/comment/56447096
has body: In my ExtJs application I have created two alert message using Ext.Msg object along with the one normal java script alert. Below is code. Ext.onReady(function(){ Ext.Msg.alert("Alert One"); Ext.Msg.alert("Alert Two"); alert("Alert Three"); }); After running this code I found browser first displaying the normal alert message then the 2nd Ext JS alert message. It is not populating the 1st Ext JS alert message So my questions are Why it is populating the normal java script alert first? Why it is not populating the 1st Ext JS alert message? Am I doing something wrong? If not then why this is happening? Please help me.
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28473437
has answer: http://stackoverflow.com/a/28473434
accepted answer: http://stackoverflow.com/a/28473434
has title: Why only one alert message is displaying when I am using Ext.Msg object?
answer count: 2
upvote count: 1
favorite count: 0
tagged with: extjs
linked to: http://stackoverflow.com/q/21703828
possible better answer: http://stackoverflow.com/a/28473437
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/a/28599458
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28588623
accepted answer of: http://stackoverflow.com/q/28588623
type: AcceptedAnswer
has body: Eventually I made the following, //get the injector. var injector = angular.injector(['app']); //get the service. var $controller = injector.get('$controller'); var BaseCtrl = $controller('BaseCtrl'); angular.module('app') .controller('ChildCtrl', ChildCtrl); function ChildCtrl() { var vm = this; BaseCtrl.call(this); } ChildCtrl.prototype = Object.create(BaseCtrl); As you can see I have injected the $controller service got the BaseCtrl with it. I know this is ugly as hell and I will glad to hear better suggestions;
type: Answer

http://stackoverflow.com/comment/45286591
type: Comment
comment on: http://stackoverflow.com/a/28482160
type: AnswerComment
has text: @Jamiec _exactly!_. A simple work around is `player[stat] = (player[stat] + 1) || 1`
score: 0

http://stackoverflow.com/comment/45412471
type: Comment
comment on: http://stackoverflow.com/a/28538882
score: 0
has text: @BenjaminGruenbaum `var rejection = Promise.reject(...); rejection.reason(); instance.processEvent.returns(rejection);`
type: AnswerComment

http://stackoverflow.com/q/28494758
upvote count: 8
type: Question
has body: I've heard that javascript Numbers are IEEE 754 floating points, which explains why &gt; 0.3 - 0.2 0.09999999999999998 but I don't understand &gt; 0.1 0.1 I thought 0.1 couldn't be accurately stored as a base 2 floating point, but it prints right back out, like it's been 0.1 all along. What gives? Is the interpreter doing some rounding before it prints? It's not helping me that there are at least 2 versions of IEEE 754: 1984 edition and 2008. It sounds like the latter added full support for decimal arithmetic. Doesn't seem like we have that.
has answer: http://stackoverflow.com/a/28494854
has comment: http://stackoverflow.com/comment/45326561
linked to: http://stackoverflow.com/q/1458633
answer count: 1
tagged with: ieee-754
score: 8
accepted answer: http://stackoverflow.com/a/28494854
tagged with: floating-point
has title: How does javascript print 0.1 with such accuracy?
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/45440291
has text: Many downvotes I think because you suggest something, but you don't even try it... And there are probably LOTS of similar questions already in SO
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28564921

http://stackoverflow.com/comment/45334123
comment on: http://stackoverflow.com/a/28507511
has text: No, but I will give it a go - is there any specific reason that you know of that the above fails to work? Just out of curiosity?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45349169
comment on: http://stackoverflow.com/q/28515956
score: 1
type: Comment
has text: Yes, but **be careful!** If you have PHP support, your user may enter PHP code in the textarea and save it as a PHP file. When he then navigates to that file in his browser, your server will execute his code. That's a huge security risk. You should store these files in a separate directory and make sure they are never executed on the server.
type: QuestionComment

http://stackoverflow.com/comment/45264715
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28469873
has text: When you attempt to call `set` is the output of `console.log(status.set)` what you expect? Do you have the code in which you attempt to call this method?
score: 0

http://stackoverflow.com/a/28450762
has body: You can use clicked elements context along with jquery .next() to target the next element in each iteration: $(".container &gt; .item").each(function(){ var context = $(this); context.text("this is " + $(this).attr('class') + ' next one is ' + $(this).next().attr('class')); }); Working Demo
answers question: http://stackoverflow.com/q/28450707
type: Answer
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/comment/45429279
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28558542
has text: I modified the answer to show the whole code. Does it help?
type: AnswerComment

http://stackoverflow.com/comment/45377630
score: 0
type: AnswerComment
type: Comment
has text: Yes, I was trying second url too. I chenged template to templateUrl and firebug doesn't show any errors. In html sorces I can see my code but pop up is empty ...
comment on: http://stackoverflow.com/a/28530622

http://stackoverflow.com/a/28516641
answers question: http://stackoverflow.com/q/28516527
score: 1
has body: Just set the Date 15 Minutes (in Milliseconds) in the furture: var minInFuture = 1000*60*15; var d = new Date(); var newDate = new Date(d.getTime()+minInFuture); $scope.mytime = newDate; The model mytime is passed to angularjs's date compontent.
upvote count: 2
type: AcceptedAnswer
downvote count: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/28516527

http://stackoverflow.com/q/28561133
has answer: http://stackoverflow.com/a/28561146
downvote count: 2
has body: I have a text field in my form and a submit button. As soon as submit button is clicked, I would like to fill this text field value with random number by using Math.rand() but it did not work, please help: Here is my form: &lt;form id='testForm' method="post" action="process.php"&gt; &lt;input type="text" id= "randnum" name="randnum" value=""&gt; &lt;input type ="submit" value="Submit"&gt; &lt;/form&gt; Here is my javascript $('#testForm').submit(function(e) { document.getElementById('randnum').value = Math.random(); }); When form is submitted, The $_POST['randnum'] variable is still nothing? Please help...
has answer: http://stackoverflow.com/a/28561152
has answer: http://stackoverflow.com/a/28561357
type: Question
upvote count: 0
score: -2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45433475
has comment: http://stackoverflow.com/comment/45433402
answer count: 3
has title: fill random() into text field when submit is pressed
favorite count: 0
type: UnansweredQuestion

ruby-on-rails-4
type: Tag
tags question: http://stackoverflow.com/q/28551240
tags question: http://stackoverflow.com/q/28560257
tags question: http://stackoverflow.com/q/28530526
tags question: http://stackoverflow.com/q/28506305
tags question: http://stackoverflow.com/q/28579686
tags question: http://stackoverflow.com/q/28440861
tags question: http://stackoverflow.com/q/28538244
tags question: http://stackoverflow.com/q/28465982
tags question: http://stackoverflow.com/q/28445120
tags question: http://stackoverflow.com/q/28475315
tags question: http://stackoverflow.com/q/28574865
tags question: http://stackoverflow.com/q/28582025
tag name: ruby-on-rails-4
tags question: http://stackoverflow.com/q/28478521

http://stackoverflow.com/q/28584165
downvote count: 0
score: 1
type: Question
has comment: http://stackoverflow.com/comment/45477723
has body: Following the main answer here, I've tried to do the same, with the exception that my controller is isolated. I get this: Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to: ReferenceError: myController is not defined I only get this when the resolve: parameter is present. How can I work around this one ? Route config: .state("my.jobs", { url: "/my/:jobId", templateUrl: "Views/my/index.htm", controller: "myController", resolve: myController.resolve // the root of all evil here }) controller: (function (ng, app) { "use strict"; var ctrl = app.controller( "myController", ['$scope', 'job', function ($scope, job) { $scope.job = job; }]); ctrl.resolve = { job: function ($q, $stateParams, batchService) { var deferred = $q.defer(); jobService.loadJob($stateParams.jobId, true) .then(deferred.resolve, deferred.reject); }, delay: function ($q, $defer) { var delay = $q.defer(); $defer(delay.resolve, 1000); return delay.promise; } }; })(angular, myApp); I don't want to make the controller a global function, I like it isolated as it is.
tagged with: javascript
has comment: http://stackoverflow.com/comment/45476297
has comment: http://stackoverflow.com/comment/45477550
upvote count: 1
answer count: 1
favorite count: 0
linked to: http://stackoverflow.com/q/11972026
has comment: http://stackoverflow.com/comment/45476345
has title: Inject controller in $routeProvider resolve method
tagged with: angularjs
has answer: http://stackoverflow.com/a/28585887
accepted answer: http://stackoverflow.com/a/28585887
type: AnsweredQuestion

http://stackoverflow.com/comment/45289307
comment on: http://stackoverflow.com/q/28482992
score: 0
has text: how are you defining `appguid ` ? you should pass this variable to each function
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28567467
accepted answer of: http://stackoverflow.com/q/28567374
score: -2
answers question: http://stackoverflow.com/q/28567374
has comment: http://stackoverflow.com/comment/45445927
upvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45446270
has comment: http://stackoverflow.com/comment/45445593
has comment: http://stackoverflow.com/comment/45447236
has comment: http://stackoverflow.com/comment/45446921
type: Answer
has comment: http://stackoverflow.com/comment/45447121
downvote count: 2
has body: Try their website directly: http://gridster.net/ They have excellent documentation, and a series of demos covering a variety of scenarios. Looks like you are using jQuery 2.1.3, while they are using 1.10.2. As jQuery is the primary dependency for gridster.js I would use the same version that they are using in their demo examples. Use &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt;&lt;/script&gt; Or download the correct version directly See this fiddle: http://jsfiddle.net/tuipopenoe/jnhb3yp2/

http://stackoverflow.com/q/28440262
has answer: http://stackoverflow.com/a/40206411
has answer: http://stackoverflow.com/a/28440385
accepted answer: http://stackoverflow.com/a/28440385
has comment: http://stackoverflow.com/comment/45262470
downvote count: 0
upvote count: 55
tagged with: web-audio-api
favorite count: 0
has comment: http://stackoverflow.com/comment/45219481
has body: We need to streaming live audio (from a medical device) to web browsers with no more than 3-5s of end-to-end delay (assume 200mS or less network latency). Today we use a browser plugin (NPAPI) for decoding, filtering (high, low, band), and playback of the audio stream (delivered via Web Sockets). We want to replace the plugin. I was looking at various Web Audio API demos and the most of our required functionality (playback, gain control, filtering) appears to be available in Web Audio API. However, it is not clear to me if Web Audio API can be used for streamed sources as most of the Web Audio API makes use of short sounds and/or audio clips. Can Web Audio API be used to play live streamed audio? Update (11-Feb-2015): After a bit more research and local prototyping, I am not sure live audio streaming with Web Audio API is possible. As Web Audio API's decodeAudioData isn't really designed to handle random chunks of audio data (in our case delivered via WebSockets). It appears to need the whole 'file' in order to process it correctly. See stackoverflow: How to stream MP3 data via WebSockets with node.js and socket.io? Define 'valid mp3 chunk' for decodeAudioData (WebAudio API) Now it is possible with createMediaElementSource to connect an &lt;audio&gt; element to Web Audio API, but it has been my experience that the &lt;audio&gt; element induces a huge amount of end-to-end delay (15-30s) and there doesn't appear to be any means to reduce the delay to below 3-5 seconds. I think the only solution is to use WebRTC with Web Audio API. I was hoping to avoid WebRTC as it will require significant changes to our server-side implementation. Update (12-Feb-2015) Part I: I haven't completely eliminated the &lt;audio&gt; tag (need to finish my prototype). Once I have ruled it out, I suspect the createScriptProcessor (deprecated but still supported) will be a good choice for our environment as I could 'stream' (via WebSockets) our ADPCM data to the browser and then (in JavaScript)…
score: 55
linked to: http://stackoverflow.com/q/10470742
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28459245
has comment: http://stackoverflow.com/comment/45255275
has answer: http://stackoverflow.com/a/62870119
answer count: 4
has comment: http://stackoverflow.com/comment/45210968
linked to: http://stackoverflow.com/q/8759842
type: AnsweredQuestion
tagged with: html5-audio
has comment: http://stackoverflow.com/comment/45210243
has comment: http://stackoverflow.com/comment/108314871
type: Question
has comment: http://stackoverflow.com/comment/45210133
tagged with: audio-streaming
tagged with: javascript
has answer: http://stackoverflow.com/a/28459245
linked to: http://stackoverflow.com/q/43366627
has comment: http://stackoverflow.com/comment/45286914
has title: Web Audio API for live streaming?

http://stackoverflow.com/comment/45312654
has text: Another relevant dup reference: [Is there a way to hide javascript code?](http://stackoverflow.com/questions/7862880/is-there-a-way-to-hide-javascript-code/7862891#7862891) and [How can I “cloak” my Javascript and CSS files using PHP?](http://stackoverflow.com/questions/8691941/how-can-i-cloak-my-javascript-and-css-files-using-php/8691957#8691957).
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28496485
type: QuestionComment

http://stackoverflow.com/comment/45308351
type: AnswerComment
type: Comment
has text: It will not work, as `:empty` checks content of the element, not its value.
score: 0
comment on: http://stackoverflow.com/a/28494098

http://stackoverflow.com/q/28462395
answer count: 1
has answer: http://stackoverflow.com/a/28462601
tagged with: callback
type: UnansweredQuestion
has title: Function not calling in javascript
type: Question
tagged with: javascript
score: 0
has body: $.get('/share_win/get_contacts/',function(data){ alert("HELLO"); }); What is wrong in this AJAX call? I'm not giving any error, but it does not print anything.

http://stackoverflow.com/a/28837393
type: AcceptedAnswer
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28557221
has body: Okay so the problem is solved. first, i change file from html to aspx. second, on my app dashboard i change link https://awgame.8ternals.com/games/ to https://awgame.8ternals.com/games/tes.aspx?
accepted answer of: http://stackoverflow.com/q/28557221

http://stackoverflow.com/q/28507074
tagged with: jquery
favorite count: 0
type: Question
has title: Javascript create hierarchical list of variable depth
tagged with: recursion
score: 0
upvote count: 1
answer count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28507212
has body: I have a list of categories, each of which has an array of children categories, which themselves can contain children. I'm trying to create a list of the categories, with each category also containing a sublist of it's children. My HTML is simply the container for the top-level list: Then I have the following Javascript: function addCategories($list, cats) { $.each(cats, function(i, cat) { $item = $(' ' + cat.name + ' '); if(cat.children.length) { $subList = $(' '); $item.append($subList); addCategories($subList, cat.children); } $list.append($item); }); } var categories = [ { "name": "Category 1", "children": [] }, { "name": "Category 2", "children": [ { "name": "Subcategory 2", "children": [ { "name": "Subsubcategory 2", "children": [] } ] } ] }, { "name": "Category 3", "children":[] } ]; $(function() { addCategories($('#categories'), categories); }); What I would like to see is: Category 1 Category 2 Subcategory 2 Subsubcategory 2 Category 3 However, instead I see: Category 1 Subsubcategory 2 Category 3 Here's a fiddle: http://jsfiddle.net/qacf2mn6/ What am I doing wrong?
has comment: http://stackoverflow.com/comment/45333387
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/a/28447166
has body: JS code : $(document).ready(function() { console.log('dom ready'); $('#student_list_ul li').click(function(){ alert('li clicked'); }); }); this will help you
score: 0
answers question: http://stackoverflow.com/q/28447099
type: Answer

http://stackoverflow.com/comment/45333308
has text: @SamuelGoodell just added one to post
comment on: http://stackoverflow.com/q/28506955
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45479476
type: Comment
has text: In looking at user1986882's code base, this probably suites him well.
type: AnswerComment
comment on: http://stackoverflow.com/a/28585371
score: 0

http://stackoverflow.com/comment/45503650
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28506718
type: Comment
has text: Does your DOM create SVG tag?

http://stackoverflow.com/comment/45264098
type: QuestionComment
comment on: http://stackoverflow.com/q/28469325
type: Comment
has text: @JonathanLonowski The diference is that I am trying to set cookie for subdomains (have a dot before mydomain.ca), not for a total srtanger domain. I have the impression that this is possible. CORS may be the reason, I would appreciate if you can provide answer on how to set the cookie when working on localhost.
score: 0

http://stackoverflow.com/q/28526734
type: Question
score: -2
tagged with: javascript
upvote count: 0
answer count: 1
has title: php javascript query structure
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28529412
tagged with: php
tagged with: structure
has body: I just want to get an idea if i'm on the right track with regards to loading my page dynamically. Basically i have a home page where i want combo box to load from my mysql database. Currently I have a onload="load_home(); function in my body tag. This calls a function in my js file which in turn calls my load_home.php file. The load_home.php creates my combo box in html and returns it. The js then uses document.getElementById("change").innerHTML+=xmlhttp.responseText; line to add the combo box to my page. Is this a long version of what I'm trying to achieve??? Would I be better just returning a resultSet to the javascript and using json or something to build the html for my page. I just want to know before I do any more coding. The selected item in the first combo will in turn lod the information in another combo(makes and models). I'm using js so that this can be done without a page reload. Thanks in advance peeps. EDIT................. JavaScript file: function load_home() { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById("data").innerHTML = xmlhttp.responseText; } } xmlhttp.open("GET", "load_home.php", true); xmlhttp.send(); } } HTML file: Welcome to my page This is what i'm doing each time i want to change an element of a page. Seems like a lot of functions with XMLHttpRequest()'s to achive what I want. The load_home.php will generat a table in html from a mysql database.
downvote count: 2

http://stackoverflow.com/a/28471409
upvote count: 1
answers question: http://stackoverflow.com/q/28437563
score: 1
downvote count: 0
has body: Interesting, I've actually not used this scenario with RequireJS, however this structure would make sense for bundles/progressively loading files. What I've done in the past is one of two things: 1) Use the existing /app directory for progressively loaded modules. /dist would only contain main.js/css or output the minified files to the root(if it's only 1-2 files) 2) Re-create the entire structure with only necessary files inside /dist. For example: /dist/index.html, /dist/app/modules/*, /dist/main.js would all exist. This way you can copy the entire /dist contents to any deployment package you use, vs cherry-picking which files you'll need on a production server. Typically, I've found #2 is more common in my experience.
has comment: http://stackoverflow.com/comment/45291452
type: Answer

http://stackoverflow.com/q/28591273
linked to: http://stackoverflow.com/q/124269
has comment: http://stackoverflow.com/comment/45489886
linked to: http://stackoverflow.com/q/28582872
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45489164
has title: How to simply make a HTML send a number and receive a number back?
tagged with: web-services
has comment: http://stackoverflow.com/comment/45489027
type: Question
accepted answer: http://stackoverflow.com/a/28591880
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28602198
tagged with: wsdl
tagged with: javascript
has comment: http://stackoverflow.com/comment/45514157
has comment: http://stackoverflow.com/comment/45489116
has comment: http://stackoverflow.com/comment/45489087
possible better answer: http://stackoverflow.com/a/28602198
has body: There are a lot of questions that look like mine such as: This one, and This one, but they're not. Can someone give me an example of a HTML example that sends a number and shows the response. I need it to implement in my HTML app. e.g.: Sends: 8 Returns: 16 Thanks in advance. HTML application that should send a Request SOAP JavaScript Client Test WSDL Request/Response OBS.: I've got the Request/Response from SoapUI 5.0.0 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:services-progress-com:sys:server:Estagio"> <soapenv:Header/> <soapenv:Body> <urn:lnestagio> <urn:vvalor>8</urn:vvalor> </urn:lnestagio> </soapenv:Body> </soapenv:Envelope> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <SOAP-ENV:Body> <result xsi:nil="true"/> 16 </SOAP-ENV:Body> </SOAP-ENV:Envelope> This is another example: (but it works...) Fahrenheit to Celsius: Celsius to Fahrenheit:
tagged with: http://stackoverflow.com/tag/html
tagged with: soap
has answer: http://stackoverflow.com/a/28591880

http://stackoverflow.com/q/28504545
type: AnsweredQuestion
upvote count: 160
downvote count: 0
has answer: http://stackoverflow.com/a/42685598
has answer: http://stackoverflow.com/a/57599680
favorite count: 0
has answer: http://stackoverflow.com/a/72619146
linked to: http://stackoverflow.com/q/60912023
type: Question
has answer: http://stackoverflow.com/a/74260971
has comment: http://stackoverflow.com/comment/45328679
tagged with: jestjs
has answer: http://stackoverflow.com/a/60722641
has answer: http://stackoverflow.com/a/76306853
possible better answer: http://stackoverflow.com/a/65548068
score: 160
accepted answer: http://stackoverflow.com/a/57599680
has answer: http://stackoverflow.com/a/52101569
has answer: http://stackoverflow.com/a/65548068
has title: How to mock a constructor like new Date()
has answer: http://stackoverflow.com/a/28507790
linked to: http://stackoverflow.com/q/52828824
has answer: http://stackoverflow.com/a/42683671
has answer: http://stackoverflow.com/a/65019823
has answer: http://stackoverflow.com/a/64512438
tagged with: javascript
has answer: http://stackoverflow.com/a/64584745
has answer: http://stackoverflow.com/a/64068056
has comment: http://stackoverflow.com/comment/45332801
has body: I have a method which depends on new Date to create a date object and then manipulates it. I'm testing that the manipulation works as expected, so I need to compare the returned date with expected date. In order to do that I need to make sure that new Date returns the same value in the test and in the method being tested. How can I do that? Is there a way to actually mock the return value of a constructor function? I could create a module that can be required with a function that provides a date object and can be mocked. But that seems like an unnecessary abstraction in my code. an example function to be tested... module.exports = { sameTimeTomorrow: function(){ var dt = new Date(); dt.setDate(dt + 1); return dt; } }; how do I mock the return value of new Date()?
answer count: 15
has answer: http://stackoverflow.com/a/47424685

http://stackoverflow.com/a/28507422
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/28497338
has body: The classSet addon is deprecated as of 0.13. The offical recomendation is to use JedWatson/classnames. var cx = require('classnames'); var Overlay = React.createClass({ render: function() { var prod_id = this.props.prop_id; var modal_classes = cx('large_prod_modal_' + prod_id, { 'large_prod_modal': true, 'hidden': true }); return ( lorem ipsum ); } }); If all of the class names are always true, you can just pass them as strings. var prod_id = this.props.prop_id; var modal_classes = cx( 'large_prod_modal_' + prod_id, 'large_prod_modal' 'hidden' }); You can mix strings and objects as desired. You don't get this flexibility with the addon classSet.
score: 9
upvote count: 9

http://stackoverflow.com/comment/45247573
score: 2
comment on: http://stackoverflow.com/a/28459991
type: AnswerComment
type: Comment
has text: @sindis your app still downloads everything with fast render and meteor doesn't have server side rendering yet (spiderable is only for search engines)

http://stackoverflow.com/comment/45305053
type: Comment
has text: @progrAmmar didn't mention anything about order, so I've made an assumption about it right at the start.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28491913

http://stackoverflow.com/comment/45470812
type: AnswerComment
comment on: http://stackoverflow.com/a/28538706
type: Comment
has text: I didn't understand your Q properly, and setTimeout is "asynchronous" function.But i think what you want to achieve is what jquery does in http://api.jquery.com/fadeOut/. This will slowly fadeout your element and you can also pass callback function which will get execute only after animation is complete
score: 1

http://stackoverflow.com/a/31995935
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/51916904
has body: It breaks too many sites, so it was removed. These are the two relevant issues to keep an eye on: https://code.google.com/p/chromium/issues/detail?id=462936 https://bugzilla.mozilla.org/show_bug.cgi?id=875433 There's no ETA as far as I've gathered.
answers question: http://stackoverflow.com/q/28514411
has comment: http://stackoverflow.com/comment/51902874
downvote count: 0
has comment: http://stackoverflow.com/comment/51937659

http://stackoverflow.com/a/28556752
accepted answer of: http://stackoverflow.com/q/28556723
type: Answer
has body: Yes your lines that say q.then(log("...")) should say q.then(function() { log("...") }). Your log function is fine but the way your code currently works is that you are already calling it and passing its return value to the then function. That's why you need to create a new function which the deferred will call later when it resolves.
answers question: http://stackoverflow.com/q/28556723
upvote count: 5
score: 5
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28530045
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28529636
answers question: http://stackoverflow.com/q/28529636
has comment: http://stackoverflow.com/comment/45376059
type: Answer
has comment: http://stackoverflow.com/comment/45375406
downvote count: 0
score: 1
has body: I will suggest using your second solution but passing the value of i and creating another function which encloses that variable. By this I mean the following: (function(){ var index = i; http.get(process.argv[i], function (response) { response.setEncoding('utf8'); response.on('data', handleGetFrom(index)); response.on('error', handleError); response.on('end', handleEnd); }) }()); and the handleGetFrom: var handleGetFrom = function(i) { return function(data) { results[i-2] += data; } } Edited my original answer.
has comment: http://stackoverflow.com/comment/45375367

http://stackoverflow.com/q/28440838
accepted answer: http://stackoverflow.com/a/28458111
answer count: 2
has title: Highcharts Line Chart with Only x-axis
tagged with: highcharts
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
has body: I've recently made the switch to Highcharts, for easy compatibility with IE8, and have been updating past projects because of the simplicity, but I have run into a minor hurdle. In one project the last SVG element remaining is a single x-axis without any accompanying chart (see below). Is it possible to show only an x-axis in Highcharts without any accompanying series or y-axis? Or if not, is there a way to create this type of design as a DIV?
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg
has answer: http://stackoverflow.com/a/28458111
upvote count: 1
type: Question
tagged with: charts
possible better answer: http://stackoverflow.com/a/28441297
tagged with: javascript
has answer: http://stackoverflow.com/a/28441297

http://stackoverflow.com/comment/45264384
has text: @JuanMendes - I have used your method. While the JSON is correct in the response the object is not updated with the proper values. Any ideas on cause of that?
type: QuestionComment
comment on: http://stackoverflow.com/q/28469279
score: 0
type: Comment

http://stackoverflow.com/q/28517771
has body: I know this has been asked multiple times, but neither of the answers seem to help me. I've been almost two days trying to get around this but I haven't been able to figure out what's going on. I have the following code: alert('Before document.ready'); $(document).ready(function () { alert('Actual document.ready'); addNumberValidation($("#quantity"), $("#quantityError")); addNumberValidation($("#price"), $("#priceError")); $("#form").submit(function(){ var quantityValid = validar( $("#quantity"), $("#quantityError") ); var priceValid= validar( $("#price"), $("#priceError")); var formValid = quantityValid &amp;&amp; priceValid; return formValid ; }); }); function addNumberValidation(mainElement, errorElement) { mainElement.keyup(function () { validate($(this), errorElement); }); } function validate( mainElement, errorElement) { var regex = /^[0-9]+$/; var result = false; if ( mainElement.val().match(regex)) { errorElement.text(''); result = true; } else { errorElement.text('Must be a number'); result = true; } return result; } The script is getting loaded correctly because the "Before document.ready" alert is getting called correctly. Also, jQuery is getting loaded as well because other js code is executing properly. My console shows no error whatsoever and the script under the sources tab in Chrome is complete. I documented the functions to see if there was something wrong with that and it still didn't work. Any insights of what could be going on?
tagged with: jquery
has comment: http://stackoverflow.com/comment/45352728
has comment: http://stackoverflow.com/comment/45352746
answer count: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45352806
score: -3
has comment: http://stackoverflow.com/comment/45353014
has comment: http://stackoverflow.com/comment/45352689
has comment: http://stackoverflow.com/comment/45352731
has answer: http://stackoverflow.com/a/28517827
downvote count: 3
has title: $(document).ready(function(){ code }); not getting called
tagged with: dom
has comment: http://stackoverflow.com/comment/45352751
has comment: http://stackoverflow.com/comment/45352708
type: Question
has comment: http://stackoverflow.com/comment/45352772
has comment: http://stackoverflow.com/comment/45353427
upvote count: 0
has comment: http://stackoverflow.com/comment/45352729
tagged with: javascript

http://stackoverflow.com/q/28554762
has comment: http://stackoverflow.com/comment/45423476
score: 0
has comment: http://stackoverflow.com/comment/45423681
has body: I was trying to figure out how exactly this function might look like?? Help appreciated Write a function circles_overlap that takes as input two circles as defined above. Your function must check whether the circles overlap. If the circles overlap then your function shall return -1. If the circles do not overlap then your function shall return 1. If the circles are touching then your function shall return 0.
linked to: http://stackoverflow.com/q/2440377
type: UnansweredQuestion
has title: Circle Overlap Function
answer count: 0
has comment: http://stackoverflow.com/comment/45423375
type: Question
tagged with: javascript

http://stackoverflow.com/comment/45358545
has text: What's wrong with using [*Math.ceil*](http://ecma-international.org/ecma-262/5.1/#sec-15.8.2.6)? `| 0` effectively floors the value.
comment on: http://stackoverflow.com/q/28520838
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28513274
has answer: http://stackoverflow.com/a/28513324
has title: submit button inside iframe tag
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45344819
tagged with: iframe
has answer: http://stackoverflow.com/a/28513382
has comment: http://stackoverflow.com/comment/45344738
type: Question
answer count: 2
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I have a iframe tag inside my webpage. The iframe page(imported page ) contains a submit button. When I click this button the link loads in the same iframe area, I want to open this link as a new page other than loading in the same iframe area.

http://stackoverflow.com/comment/45267105
comment on: http://stackoverflow.com/a/28471133
has text: But say you have `pdf` or a `song` and the user has a plugin installed on his/her browser to show/play the file instead of downloading it (which is a highly probable case). Now if user will click on your link and the link opens up in the same tab then user will loose your page(which you probably dont want).
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45341652
comment on: http://stackoverflow.com/q/28511332
type: QuestionComment
has text: I'm not sure you've given enough info here. `gyp` is used to compile things, so perhaps you are downloading modules that cannot be compiled on your system? Your question seems like it asks how to not install certain things, but that seems weird since if some sub-dependency doesn't get installed, chances are nothing will work. Also, what do you mean by "downloading core packages"?
score: 0
type: Comment

http://stackoverflow.com/q/28548165
has title: Override Javascript's toString for numbers
score: 1
tagged with: overriding
type: Question
possible better answer: http://stackoverflow.com/a/37298881
answer count: 2
upvote count: 1
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28548197
has body: I'm overriding the toString method for numbers in javascript, because I need it to return "" for NaN values, instead of the default "NaN": Number.prototype.original_toString = Number.prototype.toString; Number.prototype.toString = function(radix) { var originalValue = this.original_toString(radix); if (originalValue == "NaN") { return ""; } else { return originalValue; } }; Then I get the following behavior: (3).toString() =&gt; "3" Number.NaN.toString() =&gt; "" That's ok. The problem is when I convert numbers to string the following way: "" + 3 =&gt; "3" "" + Number.NaN =&gt; "NaN" # This is not what I expected As you can see, in this case the overridden method is not being used. Is there any other way to do this so that it works fine in both cases? I also tried overriding Number.prototype.toLocaleString and no luck. Here's a jsfiddle to play around with: http://jsfiddle.net/tmjf8cao/3/
has comment: http://stackoverflow.com/comment/45409552
downvote count: 0
has answer: http://stackoverflow.com/a/28548197
tagged with: tostring
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/37298881

http://stackoverflow.com/q/28496661
has comment: http://stackoverflow.com/comment/45312979
tagged with: ruby-on-rails
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45313052
tagged with: ruby-on-rails-3
tagged with: yslow
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45313217
has body: I have analyzed my site in GTmetrix site in the Yslow section it has shown me that This page has 6 external Javascript scripts. Try combining them into one. How to find out in which location of javascripts i should combine. does any one have previous experience on minimizing Http requests.
has title: How to achieve Fewer HTTP Requests
tagged with: ruby
answer count: 0

http://stackoverflow.com/comment/45206797
comment on: http://stackoverflow.com/q/28438330
score: 0
has text: It works, just make sure you are passing the right value...
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45479738
type: Comment
has text: This looks to be a solution however it still hits the Create method after hitting the CreateAndPrint method. I think the Create method is the default for the form. Is there a way to bypass Create() if CreateAndPrint() is called? Thank you!
comment on: http://stackoverflow.com/a/28584976
score: 0
type: AnswerComment

http://stackoverflow.com/q/28592859
type: AnsweredQuestion
score: 1
has body: I have a question about geolocation and the javascript variable scope. Ive been toying around with it a bit but I'm a php guy, js is not my best language. Im making a google map and I want to set the users coords as the map center and set a zoom. If the request fails/is denied then I'm hitting a web service to get their approximate coords from the IP. I would like to get the position/zoom back from the getLocation() function, but I can't get the information out of navigator.geolocation.getCurrentPosition() I've tried returning the object from within the error and position functions but it looks like its not set up for that, I can't get anything back but an error code. I thought I might be able to set the var and then overwrite it but I can't get it to return anything but undefined, I still don't 100% understand scope and hoisting enough to find the solution. the geolocFail() works as expected, returning the object correctly. Since its called from the error function within navigator.geolocation.getCurrentPosition - I can't get the information out of there. function getLocation() { var mapLocation; if (navigator.geolocation) { var location_timeout = setTimeout("geolocFail()", 10000); navigator.geolocation.getCurrentPosition( function(position) { clearTimeout(location_timeout); mapLocation = {position: position.coords.latitude + "," + position.coords.longitude, zoom:10}; }, function(error) { clearTimeout(location_timeout); switch(error.code) { case error.PERMISSION_DENIED: alertDiv.innerHTML=" User denied the request for Geolocation. "; break; case error.POSITION_UNAVAILABLE: alertDiv.innerHTML=" User Location information is unavailable. "; break; case error.TIMEOUT: alertDiv.innerHTML=" The request to get user location timed out. "; break; case error.UNKNOWN_ERROR: alertDiv.innerHTML=" An unknown error occurred. "; break; } mapLocation = geolocFail(); }); } else { // Fallback for no geolocation alertDiv.innerHTML=" Geolocation is not supported by this browser. "; mapL…
type: Question
tagged with: google-maps
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28594067
accepted answer: http://stackoverflow.com/a/28594067
favorite count: 0
has title: Geolocation / Javascript Scope Issue
upvote count: 2
tagged with: geolocation
linked to: http://stackoverflow.com/q/23667086
downvote count: 1

http://stackoverflow.com/comment/45295241
type: QuestionComment
type: Comment
has text: You should store them in a container (push them into an array) and show it together.
score: 0
comment on: http://stackoverflow.com/q/28486757

http://stackoverflow.com/comment/45241156
type: Comment
score: 0
type: AnswerComment
has text: Loop through all frames and compare if it has the cless name you want and refresh it
comment on: http://stackoverflow.com/a/28455876

http://stackoverflow.com/comment/45443918
has text: But be aware that your app will never be approved for user_likes if that is what you are using it for. And like gating is not allowed by Facebook Platform Policy
comment on: http://stackoverflow.com/a/28565873
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/q/28587067
score: 1
has comment: http://stackoverflow.com/comment/45481319
has answer: http://stackoverflow.com/a/28587140
accepted answer: http://stackoverflow.com/a/28587140
has comment: http://stackoverflow.com/comment/45481303
type: Question
tagged with: javascript
has body: I have the following code where for display I want to hide the detail code and only should during print: #dateformat(startdate, "mm-dd-yyyy")# - #dateformat(enddate, "mm-dd-yyyy")# #fullLeft(stripHTML(details),30)# #details# $(window).load(function() { $('li').each(function () { $(this).css({ "page-break-after": "always" }); $(".completedata").css('display','block'); window.print(); }); }); It shows the printing code on load with hidden display data, but when i cancel the printing command, it keeps the hidden div displays as block and shows in the display screen too.
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45481194
has title: printing hidden data through jquery
tagged with: jquery
favorite count: 0
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/45481283

http://stackoverflow.com/q/28438630
has answer: http://stackoverflow.com/a/35926683
favorite count: 0
has comment: http://stackoverflow.com/comment/45207179
upvote count: 2
type: UnansweredQuestion
has body: this is my views.py from flask import Flask app = Flask(__name__) @app.route('/autocomplete') *def get_contacts():* cat_list = [] cat_list = contact.objects.all() return dumps(cat_list) and this is my js function showDialog() { $("#dialog").dialog( { width: 600, height: 400, }); $.ajax({ url:'{{url_for("autocomplete")}}' }).done(function(data){ $( "#search" ).autocomplete({ source: data }); }); } when I'm trying to run this i give the following error GET http://127.0.0.1:8000/share_win/%7B%7Burl_for(%22autocomplete%22)%7D%7D 404 (NOT FOUND) Any idea?
tagged with: python
has comment: http://stackoverflow.com/comment/45207457
score: 2
type: Question
has answer: http://stackoverflow.com/a/28438780
tagged with: javascript
tagged with: jquery
has title: python functions call in javascript autocomplete
answer count: 2
downvote count: 0

http://stackoverflow.com/comment/45286108
type: QuestionComment
score: 0
has text: See Google Closure in Advanced Mode.
comment on: http://stackoverflow.com/q/28481750
type: Comment

http://stackoverflow.com/q/28507344
tagged with: twitter-bootstrap
type: UnansweredQuestion
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/74668433
score: 5
has comment: http://stackoverflow.com/comment/45334699
has body: I have a function that pulls up a dialog that the user can optionally interact with or just close. Canceling the modal should cancel the calling function altogether, but completing the modal changes the outcome of the calling function, so I would like to open the modal and wait for the response, like you would with a forms application or similar. Is this possible? The modal is meant to be modular and will not always be called by this function, so I don't want to just call a separate function when the user makes a choice in the modal, but rather return to the previous execution. Here's the basic idea: function sendComment() { var response = $("#myModal").modal("toggle"); //wait if (response) { //do some stuff } else { //do some other stuff } }
downvote count: 0
tagged with: jquery
has title: Is it possible to open a bootstrap modal synchronously and wait for the result?
favorite count: 0
upvote count: 5
has comment: http://stackoverflow.com/comment/45333812
answer count: 0

http://stackoverflow.com/comment/45366115
score: 0
type: AnswerComment
type: Comment
has text: have you included bootstrap scripts?
comment on: http://stackoverflow.com/a/28525030

http://stackoverflow.com/q/28538322
type: Question
has comment: http://stackoverflow.com/comment/45390700
linked to: http://stackoverflow.com/q/19046641
answer count: 1
tagged with: javascript
tagged with: scope
score: 0
tagged with: angular-filters
has comment: http://stackoverflow.com/comment/45401851
tagged with: angularjs
has body: I'd like to do an $http get request and return the result to the front-end. On the front-end, I use. 'use strict' angular.module( 'iframely', [] ).filter( 'iframely', [ '$http', function ( $http ) { return function ( url ) { var result = $http( { url: 'http://localhost:8061/iframely', method: 'GET', params: { url: url } }) return( result.then( function ( result ) { console.log( result.data.html ) return result.data.html })) } }]) The result is on the front-end I just get {} (looks like an empty object). But my console log shows the desired HTML. I'm pretty sure the general set-up is right because if I just do return "it works" in there, that works. I think the problem is something about JS scoping, returns or $http that I'm not getting.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28539436
has title: Making an Angular filter using $http?
accepted answer: http://stackoverflow.com/a/28539436

http://stackoverflow.com/comment/45282971
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28451199
has text: Agreed, by the various definition sites it didn't look like there should have been an issue.
type: AnswerComment

http://stackoverflow.com/q/28560376
has comment: http://stackoverflow.com/comment/45432246
has title: addEventListener is not working when on click
upvote count: 2
accepted answer: http://stackoverflow.com/a/28560454
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45432235
has comment: http://stackoverflow.com/comment/45432275
type: Question
has comment: http://stackoverflow.com/comment/45432213
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45432281
tagged with: jquery
has answer: http://stackoverflow.com/a/28560454
has comment: http://stackoverflow.com/comment/45432253
favorite count: 0
has comment: http://stackoverflow.com/comment/45433432
has body: Hi i am trying to use addEventlistener on an event firing.But it is not working. When i click on header_search button it works fine and log on console "clicked" and a window opens . On the opened window there is a close button which id is "search-close" . and when i press on the button that does not work.Even it does not console log "clicked". Could anyone help? Is that a browser problem? var search = document.getElementById('header_search'); var close = document.getElementById('search-close'); console.log(search); console.log(close); search.addEventListener('click', function(event){ console.log("clicked"); event.preventDefault(); showFullScreen(); document.getElementById('search-top').focus(); }); close.addEventListener('click', function(event){ event.preventDefault(); console.log("clicked"); searchClose(); }); function showFullScreen(){ $('html').prepend('&lt;div class="full-screen-search" /&gt;'); var search_form = document.getElementById('search-header-form').innerHTML; $(".full-screen-search").html(search_form); $(".full-screen-search").fadeIn(1000); }; function searchClose(){ $(".full-screen-search").fadeOut(200); $(".full-screen-search").remove(); };
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45434935
comment on: http://stackoverflow.com/a/28562102
type: Comment
has text: I still try this almost same
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45384961
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28535302
has text: if you are familiar with jquery you can easily use this plugin http://jqueryui.com/resizable/

http://stackoverflow.com/comment/45209074
comment on: http://stackoverflow.com/q/28438808
score: 0
type: QuestionComment
type: Comment
has text: @RoydonD'Souza good point. If you don't mind, outline this in more detail in your answer, I'll mark it as an answer.

http://stackoverflow.com/comment/45268481
comment on: http://stackoverflow.com/q/28472054
score: 0
type: QuestionComment
has text: How do you print your data from PHP?
type: Comment

http://stackoverflow.com/comment/45430157
comment on: http://stackoverflow.com/q/28559319
has text: Cannot reproduce: http://jsfiddle.net/yqagzvb7/1/
type: Comment
type: QuestionComment
score: 3

http://stackoverflow.com/comment/45218783
comment on: http://stackoverflow.com/q/28444576
score: 2
type: Comment
type: QuestionComment
has text: Welcome to the world of asynchronous javascript.

http://stackoverflow.com/q/28490199
has comment: http://stackoverflow.com/comment/45301866
has comment: http://stackoverflow.com/comment/45301784
has comment: http://stackoverflow.com/comment/45302063
score: 0
has comment: http://stackoverflow.com/comment/45301815
has comment: http://stackoverflow.com/comment/45301800
answer count: 1
has answer: http://stackoverflow.com/a/28490417
tagged with: session-variables
has title: Why does a php page refresh release session variable
type: UnansweredQuestion
tagged with: session-timeout
has comment: http://stackoverflow.com/comment/45301849
tagged with: php
has comment: http://stackoverflow.com/comment/45301998
has comment: http://stackoverflow.com/comment/45302051
has comment: http://stackoverflow.com/comment/45301727
has comment: http://stackoverflow.com/comment/45301983
type: Question
has body: I am trying to release/unset a session variable after 2 minutes through unsetsession.php: &lt;?php session_start(); if (isset($_SESSION['LAST_ACTIVITY']) &amp;&amp; (time() - $_SESSION['LAST_ACTIVITY'] &gt; 120)) { // last request was more than 2 minutes ago unset($_SESSION['logged_in']); // unset $_SESSION variable for the run-time unset($_SESSION['LAST_ACTIVITY']); session_unset(); // unset $_SESSION variable for the run-time session_destroy(); // destroy session data in storage } $_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp ?&gt; where the session variables are: $_SESSION['logged_in'] = 1; $_SESSION['LAST_ACTIVITY'] = time(); However, the session variables do not get unset but are unset when I refresh the page. The page is making a call to the file unsetsession.php. Why is the session not getting unset after 2 minutes? EDIT: The page file.php has &lt;?php include("includes/unsetsession.php") ?&gt; on top of the page. When file.php is refreshed on the browser, the value of the session variable $_SESSION['logged_in'] = 1; gets changed to 0. It would not change after 2 mins. It only changes to 0 when the page is refreshed. I am checking the value by running getsession.php on the browser which is: &lt;?php session_start(); if(isset($_SESSION['logged_in'])) echo "1"; else echo "0"; ?&gt;
tagged with: session
tagged with: javascript

http://stackoverflow.com/a/28563533
type: Answer
has body: could you not just use the read/write API for nodejs? http://nodejs.org/api/fs.html Request->ReadFile->Send Content to client At least for static content as html.
answers question: http://stackoverflow.com/q/28524862
score: 0

http://stackoverflow.com/a/28590658
downvote count: 0
has comment: http://stackoverflow.com/comment/45488012
has comment: http://stackoverflow.com/comment/45488042
type: Answer
accepted answer of: http://stackoverflow.com/q/28589875
answers question: http://stackoverflow.com/q/28589875
score: 1
upvote count: 1
has body: You could do something like this: define(function (require, exports, module) { // module.config returns only that section of the configuration that // pertains to **this** module; not the whole configuraiton. var config = module.config(); var env = config.env; // Compute the dependency... var env_to_module_map = { stage: 'app/stage/mymodule', production: 'app/prod/mymodule' }; var dep = env_to_module_map[env]; if (!dep) // configuration error throw new Error("..."); // Whatever appropriate. require([dep], function (mod) { mod.method1(1, 2); }); }); Assuming the module above is called main, your RequireJS config would have something like: require.config({ ...., config: { main: { env: "stage" // Or "production". } } }); Note that this complicates optimizing a little bit because r.js is unable to follow dependencies that are computed at run time. You will have to explicitly list one or both modules ('app/stage/mymodule' and 'app/prod/mymodule') in the build configuration you give to r.js, otherwise neither will be included. This method is the one that allows maximum flexibility at run time. You can create a bundle that contains everything needed and let whoever is responsible decide when they install the bundle whatever value of env they want to use, and the right module will be loaded.
has comment: http://stackoverflow.com/comment/45488147
type: AcceptedAnswer

http://stackoverflow.com/q/28557221
has comment: http://stackoverflow.com/comment/45780784
answer count: 1
has comment: http://stackoverflow.com/comment/45432496
has comment: http://stackoverflow.com/comment/45779438
has comment: http://stackoverflow.com/comment/45780929
has title: facebook canvas blank on javascript
tagged with: facebook
has comment: http://stackoverflow.com/comment/45779770
has comment: http://stackoverflow.com/comment/45779716
has comment: http://stackoverflow.com/comment/45779487
type: AnsweredQuestion
has body: can anyone can solve this problem because why on this code in my facebook canvas app it loads blank page?. when i linked to https://awgame.8ternals.com/games with my facebook account logged in it seems works fine. here is the code: &lt;script&gt; window.fbAsyncInit = function() { FB.init({ appId : '609246715874390', xfbml : true, version : 'v2.2' }); // ADD ADDITIONAL FACEBOOK CODE HERE FB.Canvas.setSize({ width: 640, height: 480 }); var element = document.getElementById('allContent'); FB.Canvas.showFlashElement(element); function onLogin(response) { if (response.status == 'connected') { FB.api('/me?fields=first_name', function(data) { var welcomeBlock = document.getElementById('fb-welcome'); welcomeBlock.innerHTML = 'Hello, ' + data.first_name + '!'; }); } } FB.getLoginStatus(function(response) { // Check login status on load, and if the user is // already logged in, go directly to the welcome message. if (response.status == 'connected') { onLogin(response); } else { // Otherwise, show Login dialog first. FB.login(function(response) { onLogin(response); }, {scope: 'user_friends, email'}); } }); }; (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')); &lt;/script&gt; Any Help Will Be grateful to shown my facebook canvas app
has comment: http://stackoverflow.com/comment/45448365
has comment: http://stackoverflow.com/comment/45781207
accepted answer: http://stackoverflow.com/a/28837393
type: Question
has comment: http://stackoverflow.com/comment/45440544
has comment: http://stackoverflow.com/comment/45781021
tagged with: canvas
has comment: http://stackoverflow.com/comment/45779873
has comment: http://stackoverflow.com/comment/45781120
tagged with: javascript
has answer: http://stackoverflow.com/a/28837393
score: 0
has comment: http://stackoverflow.com/comment/45781454

http://stackoverflow.com/comment/45452954
comment on: http://stackoverflow.com/q/28571145
score: 0
has text: Didn't even notice that at frist @Fred-ii- So ya, Thanks!
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45253728
type: Comment
has text: possible duplicate of [js/css changing cursor](http://stackoverflow.com/questions/3173666/js-css-changing-cursor)
comment on: http://stackoverflow.com/q/28463644
score: 0
type: QuestionComment

http://stackoverflow.com/q/28457473
tagged with: dynamic
downvote count: 3
has comment: http://stackoverflow.com/comment/45241434
type: Question
has body: I would like to display the live countdown clock for each row of my diagram. and @solicitation.SolicitationResponseDeadLine is the due time for each row. I can display the countdown, but only for first row(duplicate ID). Please help me. Thank you @foreach (var solicitation in Model) { @solicitation.SolicitationNumber @solicitation.GetNoticeTypeName() @solicitation.SolicitationTitle @*@solicitation.eCPSUser_UserType.AppUser.AppUserFullName*@ @solicitation.PrimaryAssociation.appUser.AppUserFullName @solicitation.SolicitationResponseDeadline @solicitation.SolicitationResponseDeadline }
tagged with: javascript
has answer: http://stackoverflow.com/a/28457659
upvote count: 0
answer count: 1
tagged with: countdown
favorite count: 0
type: UnansweredQuestion
has title: Javascript countdown clock in foreach loop
tagged with: countdowntimer
score: -3
tagged with: model-view-controller

http://stackoverflow.com/comment/45388106
type: AnswerComment
score: 0
type: Comment
has text: Sure, but why is that wrong? it's going to be global unless you take the external script and wrap it in a service (and even then it's going to be global because angular is global).
comment on: http://stackoverflow.com/a/28529953

http://stackoverflow.com/q/28470646
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28471192
has comment: http://stackoverflow.com/comment/45266236
has title: jQuery breaking my fizzbuzz, why?
has comment: http://stackoverflow.com/comment/45265871
downvote count: 1
has body: Trying to solve the fizzbuzz problem in javascript with a little html. I want to put the answers in a and display them on the page. To do this, I need to take the fizz-buzz's and somehow add them in a element to the UL, with a prepend or append in jQuery. My code runs fine, until I add jQuery to the equation to prepend the s into the html. I currently have the numbers/fizz-buzzes popping up with alerts. I have tried putting in $(document).ready(function() {}, wrapping all javascript inside brackets. If I do, it breaks, even if there is 0 jQuery actually in the javascript section. Simply breaks, as if the page is never actually ready and thus the javascript will never run. Assuming I can get any jQuery in to work, can I simply put jQuery statemments inside of my elseif statements? example: else if (n1 % 5 === 0) { $("ul").prepend(" n1 ") } Javascript: var number = prompt("number?"); var num_int = parseInt(number); var smack = new Array(num_int); //populating array with numbers 1 through num_int for (i = 0; i < smack.length; i++) { smack[i] = i+1; } //test again still working? smack.forEach(function(n1) { //going through each array element, checking for fizz/buzz if (n1 % 3 === 0 && n1 % 5 === 0) { alert("fizz-buzz") } else if (n1 % 3 === 0) { alert("fizz") } else if (n1 % 5 === 0) { alert("buzz") } else { alert(n1) } }); //end of forEach HTML: <hmtl> Fizzbuzz test JSFiddle Thanks in advance for any help! I'm sure this is a ridiculously easy question for anyone who has experience. I'm just getting into it, and while the math/logic section of fizzbuzz was pretty straightforward, getting it to display correctly is killing me.
type: Question
has answer: http://stackoverflow.com/a/28470952
tagged with: fizzbuzz
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/45266265
answer count: 2
upvote count: 0
favorite count: 0

http://stackoverflow.com/q/28523197
tagged with: javascript
score: 0
has title: how to call 2 javascript on client click event in asp.net
answer count: 1
tagged with: asp.net
has answer: http://stackoverflow.com/a/28523220
accepted answer: http://stackoverflow.com/a/28523220
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45363018
has body: I am trying to call 2 javascript one time on client click event. I am only able to call them one of the javascript. Once the user clicks the button, i want to call 2 javascript because each javascript is checking 2 diferent gridviews. How can i call both of them one time on client click event. Here is my button <asp:LinkButton ID="btn_Submit" runat="server" CssClass="btn btn-primary" OnClientClick="return validate_1();" OnClick="btn_Submit_Click"> Submit </asp:LinkButton> here is the 1st one: here is the 2nd one i want to call both validate_1() and validate_2(). Thanks
type: Question
tagged with: c#

http://stackoverflow.com/comment/45482575
has text: Reload the page just for one element?
type: AnswerComment
comment on: http://stackoverflow.com/a/28586338
score: 0
type: Comment

http://stackoverflow.com/q/28553481
has title: Single view subscribes to multiple Meteor publishes onWait
type: Question
score: 0
has comment: http://stackoverflow.com/comment/45419835
has answer: http://stackoverflow.com/a/28553520
answer count: 1
tagged with: javascript
has body: How do I return two Meteor.subscribe() methods in my waitOn method? I am trying to render two collections' publications in a single view. I currently have waitOn: function(){ return Meteor.subscribe('lists'); //return Meteor.subscribe('details'); } But I obviously can't return twice.
tagged with: meteor
accepted answer: http://stackoverflow.com/a/28553520
type: AnsweredQuestion

http://stackoverflow.com/comment/45335013
type: QuestionComment
comment on: http://stackoverflow.com/q/28507946
has text: @CodeGodie just FYI, the way of talking about jquery functions that belong to the matching set is `$.fn.change`
score: 0
type: Comment

http://stackoverflow.com/q/28553667
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28553696
has title: Appending a form with select option fields
has comment: http://stackoverflow.com/comment/45420159
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
type: Question
has body: Im trying to append a table with an additional row. It appends correctly except for the select option. My append jquery is: $("#add_item").click(function(){ $( "#itemlist" ).append( "\ \ \ \ \ \ \ Service \ Hours \ Days \ Product \ \ \ \ \ \ \ \ \ \ \ \ " ); }); The html within my browser inspector is showing the options out of the select tag like this: any idea why?
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28553703
has answer: http://stackoverflow.com/a/28553703
has answer: http://stackoverflow.com/a/28553696
score: 0
answer count: 2

http://stackoverflow.com/a/39987804
type: Answer
has body: Not sure if this helps but I did this instead and it worked for me. While I am not playing an MP3 I am getting a voice to prompt the user through a loop. function speak(text) { var msg = new SpeechSynthesisUtterance(); var voices = speechSynthesis.getVoices(); msg.voice = voices[2]; msg.voiceURI = 'native'; msg.volume = 1; msg.rate = 1; msg.pitch = 1; msg.text = text; msg.lang = 'en-US'; speechSynthesis.speak(msg); } // insert this bottom bit to call the function and it will read in the mobiles native voice what you type in ie....rest works on android have not tried iphone. speak('rest');
score: 0
answers question: http://stackoverflow.com/q/28515237

http://stackoverflow.com/comment/45282865
comment on: http://stackoverflow.com/q/28480253
has text: Not sure I get it, `Array.map` creates an array, and you seem to be creating an object, so why would you use `map` ?
type: Comment
type: QuestionComment
score: 3

http://stackoverflow.com/comment/45312361
comment on: http://stackoverflow.com/q/28496321
has text: what's the problem with your posted code?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28534840
has comment: http://stackoverflow.com/comment/45388769
type: UnansweredQuestion
type: Question
tagged with: google-maps
tagged with: javascript
has answer: http://stackoverflow.com/a/28535181
has answer: http://stackoverflow.com/a/28535313
tagged with: google-maps-api-3
score: 0
answer count: 2
has title: asynchronous javascript functions
upvote count: 1
downvote count: 1
has body: so I am trying to call the google geocoder to get some values but I am do not fully understand what I can and cant do within the realm of asynchronous functions. There is another example on SO that helped me set this up like so, but I still cannot figure out how to get those values into an array Here is my call to the geocoder: function getLng(name,func){ geocoder.geocode( {'address': name}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { func(results[0].geometry.location.lng()); } else { alert("Something got wrong " + status); } }); } here is the building of an array using the geocoder values: ('.action').click(funciton(){ var homes =[]; homes.push({name: Name, type: "dwelling", lat: getLat(Name, function(location){return location;}), lng: getLng(Name, function(location){return location;}) }); console.log(homes); }); Sincere thanks for any help... It is greatly appriciated.
favorite count: 0

http://stackoverflow.com/comment/45520311
type: AnswerComment
score: 0
type: Comment
has text: Hello @PawełFus this is the think I have searched for. I also use the stack column diagramm, this example I can use, thank you :). But do you have any suggestions how I can do the same for a gauge diagram?
comment on: http://stackoverflow.com/a/28587744

three.js
tags question: http://stackoverflow.com/q/28569026
tags question: http://stackoverflow.com/q/28449382
tag name: three.js
tags question: http://stackoverflow.com/q/28534267
tags question: http://stackoverflow.com/q/28568608
tags question: http://stackoverflow.com/q/28532878
tags question: http://stackoverflow.com/q/28486007
tags question: http://stackoverflow.com/q/28441505
tags question: http://stackoverflow.com/q/28591858
tags question: http://stackoverflow.com/q/28556048
tags question: http://stackoverflow.com/q/28471675
tags question: http://stackoverflow.com/q/28575152
tags question: http://stackoverflow.com/q/28544873
tags question: http://stackoverflow.com/q/28443761
tags question: http://stackoverflow.com/q/28543574
tags question: http://stackoverflow.com/q/28518722
type: Tag
tags question: http://stackoverflow.com/q/28466214
tags question: http://stackoverflow.com/q/28549129
tags question: http://stackoverflow.com/q/28560130
tags question: http://stackoverflow.com/q/28453895
tags question: http://stackoverflow.com/q/28555448
tags question: http://stackoverflow.com/q/28513636
tags question: http://stackoverflow.com/q/28543659
tags question: http://stackoverflow.com/q/28577347
tags question: http://stackoverflow.com/q/28535956
tags question: http://stackoverflow.com/q/28575290
tags question: http://stackoverflow.com/q/28527453
tags question: http://stackoverflow.com/q/28552180
tags question: http://stackoverflow.com/q/28533150
tags question: http://stackoverflow.com/q/28527208
tags question: http://stackoverflow.com/q/28482776
tags question: http://stackoverflow.com/q/28530125

http://stackoverflow.com/comment/45460125
type: QuestionComment
comment on: http://stackoverflow.com/q/28575374
score: 0
type: Comment
has text: Alex, you may want to add that clarification to your question; that way it's obvious to those coming to the question later (and saves people having to read comments to determine the question).

http://stackoverflow.com/comment/45434538
has text: @OliSoproniB. I understood the server must enforce it. I use array code in change_theme.php if you check then you can see. But there is one problem. The problem is: If user change only `input[name="change-text-color"]:checked').val()` color then it is posted. but if user change two color : `change-text-color:$('input[name="change-text-color"]:checked').val(),change-background-color:$('input[name="change-background-color"]:checked').val()`
score: 0
comment on: http://stackoverflow.com/q/28561676
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28533695
answers question: http://stackoverflow.com/q/28533612
downvote count: 0
score: 4
type: AcceptedAnswer
has body: getImageData returns an ImageData object, whose data property is the array containing the actual RGB values. Basically, you're missing a .data: var p = ctx.getImageData(x,y,1,1).data;
type: Answer
accepted answer of: http://stackoverflow.com/q/28533612
has comment: http://stackoverflow.com/comment/45382206
upvote count: 4

http://stackoverflow.com/comment/45294191
comment on: http://stackoverflow.com/q/28485543
has text: Yes, its nice BUT this exception is thrown on serverside so there is no possibility to debug the code as far as I can see? All I get is a cryptic error message that points to the wrong line.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45313150
score: 0
type: Comment
type: AnswerComment
has text: @Bob John:Call the load() on onLoad event. check this. http://jsfiddle.net/mwpmk9kk/11/
comment on: http://stackoverflow.com/a/28473641

http://stackoverflow.com/q/28513993
type: Question
has comment: http://stackoverflow.com/comment/45345944
upvote count: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/28514170
tagged with: javascript
favorite count: 0
tagged with: onsen-ui
has comment: http://stackoverflow.com/comment/45345895
has answer: http://stackoverflow.com/a/28514170
has title: CordovaApp - AngularJs - app.initialize() -> undefined is not a function
tagged with: cordova
downvote count: 0
tagged with: angularjs
has body: I've an hybrid for android, made with cordova + onsen + angularJs. This is the index.html file: AppModel And this is the appStart.js file: var app = { // Application Constructor initialize: function() { this.bindEvents(); }, // Bind Event Listeners // // Bind any events that are required on startup. Common events are: // 'load', 'deviceready', 'offline', and 'online'. bindEvents: function() { document.addEventListener('deviceready', this.onDeviceReady, false); }, // deviceready Event Handler // // The scope of 'this' is the event. In order to call the 'receivedEvent' // function, we must explicity call 'app.receivedEvent(...);' exitFunction : function(){ if (navigator.notification.confirm("Vuoi chiudere l'app?", function(index) { if (index == 1) { // OK button navigator.app.exitApp(); // Close the app } }, "AppModel", ["Ok","Annulla"] )); }, onDeviceReady: function() { app.receivedEvent('deviceready'); ons.setDefaultDeviceBackButtonListener(function() { if (navigator.notification.confirm("Vuoi chiudere l'app?", function(index) { if (index == 1) { // OK button navigator.app.exitApp(); // Close the app } }, "AppModel", ["Ok","Annulla"] )); }); /* // Open any external link with InAppBrowser Plugin $(document).on('click', 'a[href^=http], a[href^=https]', function(e){ e.preventDefault(); var $this = $(this); var target = $this.data('inAppBrowser') || '_blank'; window.open($this.attr('href'), target); }); */ $(document).on('click', 'a', function(e){ e.preventDefault(); var $this = $(this); //var target = $this.data('inAppBrowser') || '_blank'; window.open($this.attr('href'), "_system"); }); }, // Update DOM on a Received Event receivedEvent: function(id) { //var parentElement = document.getElementById(id); //var listeningElement = parentElement.querySelector('.listening'); //var receivedElement = parentElement.querySelector('.received'); //listeningElement.setAttribute('style', 'display:none;'); //receivedElement.setAttribute('style', 'display:block;'); console.log('Recei…
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/45457036
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28573732
type: Comment
has text: It can also be accessed using the constructor of an object like `foo.constructor.create(foo)`

http://stackoverflow.com/q/28504448
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has body: I write simple code in angularjs and i will facing these two erros that are the following: Uncaught SyntaxError: Unexpected token ) Uncaught Error: [$injector:modulerr] And my html file is this Invoice1 Invoice Quantity: Cost: {{c}} Total: Pay I think the main error with this file due to which my app not work properly and i will see the complete code and cant find error in the code And script file is this (function(angular)){ 'use strict'; angular.module('invoice1',[]) .controller('InvoiceController',function()){ this.qant=1; this.cost=2; this.incurr='EUR'; this.currencies=['USD','EUR','CNY']; this.usdToForeignRates={ USD:1, EUR:0.79, CNY:6.09 }; this.total=function.total(outcurr){ return this.convertCurrency(this.qant * this.cost, this.incurr,outcurr); }; this.convertCurrency=function convertCurrency(amount,incurr,outcurr){ return amount * this.usdToForeignRates[outcurr]/this.usdToForeignRates[incurr] }; this.pay=function pay(){ window.alert("Thanx! check your currency"); }; }); })(window.angular); //window.alert("thanx!");
has answer: http://stackoverflow.com/a/28504670
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45327931
has title: javascript two error of uncaught of syntax error
has answer: http://stackoverflow.com/a/28504555
tagged with: javascript
score: -1
answer count: 2
upvote count: 0

http://stackoverflow.com/comment/45459954
score: 0
type: AnswerComment
has text: Sorry @marcpt, the title of your question is completely wrong given the actual question. I would suggest you rephrase it so that you get better eyes. Please see my update. Good luck.
type: Comment
comment on: http://stackoverflow.com/a/28575112

http://stackoverflow.com/comment/45359888
score: 1
comment on: http://stackoverflow.com/q/28521584
type: Comment
type: QuestionComment
has text: Object properties aren't ordered by definition, so I don't think you should make assumptions about it; though, `map[Object.keys(map)[0]]` would be the replacement.

http://stackoverflow.com/comment/45229319
comment on: http://stackoverflow.com/q/28450736
type: Comment
has text: Could you be more specific? Which function you want to remove?
type: QuestionComment
score: 1

cocoonjs
type: Tag
tags question: http://stackoverflow.com/q/28532215
tag name: cocoonjs

http://stackoverflow.com/comment/45395400
score: 0
type: Comment
type: QuestionComment
has text: I have, e.g. two submit buttons on the same form, loginButton and HelpButton. If I press loginButton, then isOK() validation function is called. When I press HelpButton, no validation is needed
comment on: http://stackoverflow.com/q/28540895

onload
tags question: http://stackoverflow.com/q/28574036
tags question: http://stackoverflow.com/q/28518307
tag name: onload
tags question: http://stackoverflow.com/q/28474820
type: Tag
tags question: http://stackoverflow.com/q/28552534
tags question: http://stackoverflow.com/q/28508670
tags question: http://stackoverflow.com/q/28526898

http://stackoverflow.com/q/28472395
score: 0
linked to: http://stackoverflow.com/q/28314323
possible better answer: http://stackoverflow.com/a/28472546
tagged with: angularjs
has answer: http://stackoverflow.com/a/28472546
accepted answer: http://stackoverflow.com/a/28472485
type: AnsweredQuestion
type: Question
answer count: 2
tagged with: javascript
has title: How to cache http in Angular until parameters changed?
has answer: http://stackoverflow.com/a/28472485
has body: Is it possible to cache some http until parameters used in url change: app.factory('dataService', function ($http,$rootScope) { return { getData: function () { return $http.get(rest.getData + $rootScope.number + "/" + $rootScope.blb ).then(function (result) { return result.data; }); } } }); So, when $rootScope.number changes in controller, I need to call http again, until then it should be cached. Is it possible and how?

http://stackoverflow.com/comment/45449273
comment on: http://stackoverflow.com/q/28569485
type: QuestionComment
type: Comment
has text: My doClick is triggered here:
score: 0

http://stackoverflow.com/q/28536779
has answer: http://stackoverflow.com/a/28537145
has body: I'm sending the server time object with zero date, the sent date is: Thu Jan 01 1970 01:02:01 GMT+0200 How can I convert it to GMT+0000? I need to tell the server about some task duration, so I want it to be just 01:02:01 as a duration. But the sent date is local and the server understands it as 03:02:01! How can I zero the GMT index? Thanks
tagged with: datetime
possible better answer: http://stackoverflow.com/a/28537145
score: 2
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/45387815
has comment: http://stackoverflow.com/comment/45387828
type: Question
linked to: http://stackoverflow.com/q/8945029
tagged with: javascript
tagged with: date
has answer: http://stackoverflow.com/a/28536893
accepted answer: http://stackoverflow.com/a/28536893
upvote count: 2
answer count: 2
favorite count: 0
has title: Javascript Date(): How to convert the local date to GMT

http://stackoverflow.com/comment/45402146
comment on: http://stackoverflow.com/q/28544336
type: Comment
type: QuestionComment
has text: The MDN doc you post also mentioned about `image/webp`
score: 0

http://stackoverflow.com/a/28495142
answers question: http://stackoverflow.com/q/28494814
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45310648
accepted answer of: http://stackoverflow.com/q/28494814
has body: http://jsfiddle.net/gwqn2eqa/ //HTML Spatial Unlimited 158 Google Maps API Examples 0 Jquery Mobile Examples 1 Facebook likes - Spatial Unlimited 12 //JS $(document).ready(function () { $.each($('.ui-li-count'), function (i, v) { if($(this).html() == 0) { $(this).hide(); } }); }); without listview : //html 12 //css .countBubl {float:left;margin-top:-42px;margin-left:35px;background:#ed1d24;color:#fff;padding:2px;}
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/45310291
score: 1

http://stackoverflow.com/comment/45218393
type: Comment
type: QuestionComment
has text: No it's not, setting and deleting cookies is done synchronously.
score: 2
comment on: http://stackoverflow.com/q/28444378

http://stackoverflow.com/q/28564756
type: Question
tagged with: angularjs-directive
accepted answer: http://stackoverflow.com/a/28565759
has title: Angular Directive formatter/render does not update
tagged with: javascript
score: 0
answer count: 1
tagged with: angularjs
has answer: http://stackoverflow.com/a/28565759
type: AnsweredQuestion
has body: I wrote a pretty simple directive that turns minutes into a range slider, as well as displaying hours and minutes next to it. The problem is that moving the range slider does update the scope, so Watch and Parser gets called, but Formatters/Render does not get called again, ever. So my minutes do get updated and propagate to changing the model, but directive's "internal" hours and minutes never update. Only if I make changes from the outside on the ng-model value. I am not sure what's going on anymore, because similar directives all work as expected. :s // Here is a shortened version angular.module('TestApp', ['TestDirectives']); angular .module('TestDirectives', []) .directive("rangeMinutes", [function RangeMinutesDirective () { return { require: 'ngModel', replace: true, scope: true, templateUrl: 'minutesHoursRange.html', link: function (scope, element, attributes, ngModelCtrl) { ngModelCtrl.$formatters.push(function (modelValue) { var totalMinutes = (modelValue ? modelValue : 0); return { totalMinutes : totalMinutes, hours : Math.floor(totalMinutes/60), minutes : parseInt(totalMinutes%60, 10) }; }); ngModelCtrl.$render = function () { if (!ngModelCtrl.$viewValue) { ngModelCtrl.$viewValue = { hours: 0, minutes: 0, totalMinutes: 0 }; } scope.totalMinutes = ngModelCtrl.$viewValue.totalMinutes; scope.hours = Math.floor(scope.totalMinutes/60); scope.minutes = parseInt(scope.totalMinutes%60, 10); }; scope.$watch('totalMinutes', function () { ngModelCtrl.$setViewValue({ totalMinutes: scope.totalMinutes, hours: scope.hours, minutes: scope.minutes }); }); ngModelCtrl.$parsers.push(function (viewValue) { return parseInt(viewValue.totalMinutes, 10); }); } }; }]) .controller("TestController", ["$scope", function ($scope) { $scope.testObject = { testValue: 40 }; }]); directive's template: {{hours}} hrs {{minutes}} mns view:

http://stackoverflow.com/a/28538350
has comment: http://stackoverflow.com/comment/45391063
has comment: http://stackoverflow.com/comment/45391001
upvote count: 1
answers question: http://stackoverflow.com/q/28538062
score: 1
has comment: http://stackoverflow.com/comment/45390962
has comment: http://stackoverflow.com/comment/45391304
has body: Please check the browser console and see if you get any error. do one thing remove the reference you added and just drag the file into your page and see. I think link href="@Url.Content("~/style/sample.css")" rel="stylesheet" type="text/css" /> is causing the problem. The quots are not well formatted.
has comment: http://stackoverflow.com/comment/45421485
downvote count: 0
has comment: http://stackoverflow.com/comment/45390879
type: Answer
has comment: http://stackoverflow.com/comment/45391680

http://stackoverflow.com/a/28578443
accepted answer of: http://stackoverflow.com/q/28569812
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
has comment: http://stackoverflow.com/comment/45474568
answers question: http://stackoverflow.com/q/28569812
upvote count: 1
has body: You have to use unique ids in your HTML but you don't need to bind your event to a specific id in this case. Try this: HTML: {{ song.name }}-{{ song.artist }} {% if song.attr %} {{ song.attr }} {% else %} {{ song.change }} {% endif %} And in your JS, use a class selector: function func1() { $(this).find('div.showOrNo').css({'display':''}); } function func2() { $(this).find('div.showOrNo').css({'display':'none'}); } $('li').on('mouseover', func1); $('li').on('mouseout', func2); This will bind every li in your HTML document and when you mouseover/out, it will find the first div with a class containing showOrNo. You can see the result here: http://jsfiddle.net/7qx5ge9m/1/

http://stackoverflow.com/a/76502155
has body: I was curious about this recently, and I've just tested it. In Chrome and Firefox (as of 2023), an infinite loop is interrupted by worker.terminate(). However, in Chrome, it takes a couple of seconds for termination to occur, whereas in Firefox, it happens instantly. I posted a crbug issue about this here. You can test the behaviour in your browser of choice by running this code: let myWorker = new Worker(URL.createObjectURL(new Blob([` self.onmessage = function() { let i = 1; while(i++){ if(i % 10000000 === 0) console.log(i); } } `], { type: 'text/javascript' }))); myWorker.postMessage('start'); setTimeout(() =&gt; { console.log('Terminating worker...'); myWorker.terminate(); }, 5000); In Chrome, the console.log(i)'s occur for a couple of seconds after Terminating worker... is logged, whereas in Firefox, Terminating worker... is always the last thing that's logged.
score: 2
downvote count: 0
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/28502868

http://stackoverflow.com/a/28589566
score: 2
answers question: http://stackoverflow.com/q/28589155
downvote count: 0
upvote count: 2
type: Answer
has body: You could iterate over the object's keys to get both the key names and their corresponding values. Not incredibly elegant but since the desired format of your string is uncommon, it requires a little work. var info = {name:"username",age:20}; var keys = Object.keys(info); var returnVal = "" for(var i = 0; i &lt; keys.length; i++) { if(returnVal.length &gt; 0) returnVal += "||"; returnVal += keys[i] + "(" + info[keys[i]] + ")"; } alert(returnVal) Here is a jsfiddle of the solution: http://jsfiddle.net/pstricker/ec1oohsk/

http://stackoverflow.com/comment/45442293
type: Comment
has text: I really like the ECMAScript6 fat arrow functions. They can even compete with genuinely functional languages like Scheme and Haskell in syntactic lightweightness (if that's a word … OSX doesn't seem to think it is :-D).
comment on: http://stackoverflow.com/a/28563879
type: AnswerComment
score: 0

http://stackoverflow.com/q/28457204
tagged with: jquery
score: 0
has title: Fyneworks jQuery Star Rating Plugin - half ratings
tagged with: css
has body: I am trying to implement a star rating system for articles and found this nice plugin. I have exchanged the default star.gif with my own stars. Everything works fine if I use a full star rating. As soon as I am trying to use the split star function, the stars are not displayed correctly anymore. The stars itself have a width of 32px. The half stars should be on top of the right side of the full stars. The following if-clause seems to be responsible for calculating the position: // Prepare division control if(typeof control.split=='number' &amp;&amp; control.split&gt;0){ var stw = ($.fn.width ? star.width() : 0) || control.starWidth; var spi = (control.count % control.split), spw = Math.floor(stw/control.split); star // restrict star's width and hide overflow (already in CSS) .width(spw) // move the star left by using a negative margin // this is work-around to IE's stupid box model (position:relative doesn't work) .find('a').css({ 'margin-left':'-'+ (spi*spw) +'px' }) }; it is embedded in a "for-each star" loop. I have debugged this with firebug and the calculation seems to be correct. Each second star should have a left-margin of -16px. For some reason this is not displayed on the site though. Does anyone know what I am doing wrong? I have to mention that I do not have much experience with JS. Here is the css: div.rating-cancel, div.star-rating { background: none repeat scroll 0 0 transparent; cursor: pointer; display: block; float: left; height: 32px; overflow: hidden; text-indent: -999em; width: 17px; } div.rating-cancel, div.rating-cancel a { background: url("delete.gif") no-repeat scroll 0 -16px rgba(0, 0, 0, 0); } div.star-rating, div.star-rating a { background: url("star.gif") no-repeat scroll 0 0 rgba(0, 0, 0, 0); } div.rating-cancel a, div.star-rating a { background-position: 0 0; border: 0 none; display: block; height: 100%; width: 32px; } div.star-rating-on a { background-position: 0 -32px !important; } div.star-rating-hover a { background-position: 0 -64…
has answer: http://stackoverflow.com/a/28558513
accepted answer: http://stackoverflow.com/a/28558513
type: AnsweredQuestion
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/28511760
type: Question
answer count: 2
tagged with: grammar
accepted answer: http://stackoverflow.com/a/28512065
has comment: http://stackoverflow.com/comment/45342215
tagged with: arrays
downvote count: 0
tagged with: javascript
tagged with: programming-languages
tagged with: jison
has answer: http://stackoverflow.com/a/28511984
favorite count: 0
possible better answer: http://stackoverflow.com/a/28511984
has answer: http://stackoverflow.com/a/28512065
upvote count: 1
has title: Making Arrays in Jison
type: AnsweredQuestion
score: 1
has body: I'm trying to add support for arrays in my programming language and am having trouble Array : '[' Expr ("," Expr)* ']' {{ $$ = ['ArrayList', $1]; }} | '[' Expr ']' {{ $$ = ['Array', $2]; }} | '[' ']' {{ $$ = ['Empty']; }} ; This however, will not parse "[1,2,3,4]." Jison tells me that it expects "]" but it got ",". Any ideas?

http://stackoverflow.com/comment/45292554
score: 0
type: Comment
has text: Very heavily opinion based, that style guide is the first to admit it. It is not necessarily the best way to do things, and should definitely not be considered the 'de-facto standard'.
type: AnswerComment
comment on: http://stackoverflow.com/a/28485163

http://stackoverflow.com/comment/45377563
type: QuestionComment
has text: I didn't say remove the scale. You should probably start with this example and add central axes: http://bl.ocks.org/mbostock/3892919
comment on: http://stackoverflow.com/q/28528875
score: 0
type: Comment

http://stackoverflow.com/q/28567692
has body: we have an existing silverlight app which runs in browser + on hardware. we want to rewrite this app using angular js and html5. one of the key requirements with new system is support of internationalization and localization. and target countries are usa, brazil, italy for now. Am new to this area and have lot of basic questions. does existing database needs to be redesigned to support same ? i mean to identify columns (product_name/customer_name etc) that needs to have locale specific data and then store data for each locale and modify sprocs and webapi to accept language parameter and then get content based on that. ? I believe we need to user nvarchar for such columns. what will happen to currency and date time columns in db ? say there is quantity column then what should be data type of this column in db ? if current locale is Portuguese then will qty stored in Portuguese number. what is the best practices for storing and retrieving currency column based on locale. what is the best practices for storing and retrieving date column based on locale. how to handle string checks, numeric checks in webapi methods ? how to do comparison and checks in javascript for string,number,datetime please share link to some good pointers which could help. so in short right from javascript to .net webapi to database (sql) how should we take care of locale dependent logic and fields thanks.
tagged with: localization
type: Question
tagged with: asp.net-web-api2
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28570680
answer count: 1
has title: Angular app and internationalization and localization
tagged with: angularjs
type: UnansweredQuestion
tagged with: internationalization

http://stackoverflow.com/a/28570335
type: AcceptedAnswer
type: Answer
upvote count: 11
downvote count: 1
has body: Finally I found the answer : We just need to add class 'folded' in body tag to make admin menu folded. I added the class in body tag using JavaScript : document.body.className+=' folded'; here is the complete code that I added to the functions.php ( you can add that to your plugin also ) the code := function custom_admin_js() { echo "&lt;script type='text/javascript' &gt; document.body.className+=' folded'; &lt;/script&gt;"; } add_action('admin_footer', 'custom_admin_js'); and it worked :)
score: 10
answers question: http://stackoverflow.com/q/28567965
accepted answer of: http://stackoverflow.com/q/28567965

http://stackoverflow.com/comment/45431044
type: Comment
has text: Yep, that works. It will be a refactoring exercise but I would much rather be able to change one place at a time and have a working product. Thanks for that
comment on: http://stackoverflow.com/a/28559095
type: AnswerComment
score: 1

http://stackoverflow.com/a/28555506
score: 4
type: Answer
upvote count: 4
downvote count: 0
has body: Because event.target.responseText isn't an array, it's a string. The length of a string object refers to the amount of characters in a string. You will need to call a JSON.parse on your response to get it in the correct format you want. var responseText = '["4.wav","2.wav","3.wav","6.mp3","1.mp3","5.wav"]'; responseText.length //49 at this point, the length of the string var responseArray = JSON.parse(responseText); responseArray.length //6, because it's an array
answers question: http://stackoverflow.com/q/28555463

http://stackoverflow.com/comment/45253190
type: QuestionComment
comment on: http://stackoverflow.com/q/28463542
has text: So this is likely a question related to server-side code as the server is sending the headers to set the session cookie (and probably other cookies as well unless you are setting cookies in javascript).
score: 0
type: Comment

http://stackoverflow.com/q/28471201
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28474907
tagged with: node.js
type: AnsweredQuestion
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45266917
has title: Do full-stack JavaScript frameworks create the HTML on the client or server?
tagged with: javascript
has answer: http://stackoverflow.com/a/28474907
score: 0
answer count: 1
tagged with: meteor
favorite count: 0
has body: According to this article from AirBnB it says A Hybrid Approach At the end of the day, we really want a hybrid of the new and old approaches: we want to serve fully-formed HTML from the server for performance and SEO, but we want the speed and flexibility of client-side application logic. To this end, we’ve been experimenting at Airbnb with “Isomorphic JavaScript” apps, which are JavaScript applications that can run both on the client-side and the server-side. So, I am a bit confused as to whether full-stack JavaScript frameworks render HTML files on the server or on the client. My most current educated guess is that some frameworks create HTML files exclusively on the client, some exclusively on the server and some are mixed. But which are which?

http://stackoverflow.com/q/28473688
has answer: http://stackoverflow.com/a/28474090
has comment: http://stackoverflow.com/comment/45275919
has title: How to refresh/update data source in a specific interval
has body: This script's purpose is to load the data source into table first, And then there is a search box to search data. The dataSource only load at the first time page load, How to make it reload the data source every 30 seconds, thanks <TableSorter dataSource={"/welcome/get_winner_list"} config={CONFIG} /> Here's the whole script /** @jsx React.DOM */ var CONFIG = { sort: { column: "_id", order: "desc" }, filterText: "", columns: { _id: { name: "獎次"}, name: { name: "獎品"}, can_accept_prize_now: { name: "現領"}, staff_name: {name: "姓名"}, staff_id: {name: "工號"}, } }; var TableSorter = React.createClass({ getInitialState: function() { return { items: this.props.initialItems || [], sort: this.props.config.sort || { column: "", order: "" }, columns: this.props.config.columns, filterText:this.props.config.filterText }; }, componentWillMount: function() { this.loadData(this.props.dataSource); }, loadData: function(dataSource) { if (!dataSource) return; $.get(dataSource).done(function(data) { console.log("Received data"); this.setState({items: data}); }.bind(this)).fail(function(error, a, b) { console.log("Error loading JSON"); }); }, handleFilterTextChange: function (event){ this.setState({filterText:event.target.value}) }, editColumnNames: function() { return Object.keys(this.state.columns); }, receive_click:function(event){ name_staff=event.target.name.split(',') dataSource='/take/'+name_staff[0]+'/'+name_staff[1]; $.getJSON(dataSource).done(function() { console.log("Input success"); }.bind(this)).fail(function(error, a, b) { console.log("Error :Input Prize"); }); itemsColumn=_.find(this.state.items,function(column){return column['_id']==name_staff[0]}); itemsColumn['taken_at']=true; this.setState() }, render: function() { var rows = []; var columnNames = this.editColumnNames(); var filters = {}; columnNames.forEach(function(column) { var filterText = this.state.filterText; filters[column] = null; if (filterText.length > 0 ) { filters[column] = function(x) { if(x) return (x.toSt…
has answer: http://stackoverflow.com/a/28473848
type: Question
tagged with: reactjs
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45271192
has comment: http://stackoverflow.com/comment/45271184
score: 0
type: UnansweredQuestion

http://stackoverflow.com/q/28588719
tagged with: css
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45484395
has answer: http://stackoverflow.com/a/28588884
tagged with: javascript
type: UnansweredQuestion
has body: The onchange script that changes the color of the page navigation is only working for the first div. Centennial works, but not Denver. I copied the script from another source. window.onload = function() { setStyles(); }; function setStyles() { ids = new Array('header1', 'header2', 'header3'); for (i = 0; i < ids.length; i++) { document.getElementById(ids[i]).className = 'menu_head2'; document.getElementById(ids[i]).onclick = function() { CngClass(this); } } } function CngClass(obj) { var currObj; for (i = 0; i < ids.length; i++) { currObj = document.getElementById(ids[i]); if (obj.id == currObj.id) { currObj.className = (currObj.className == 'menu_head2') ? 'menu_head2_active' : 'menu_head2'; } else { currObj.className = 'menu_head2'; } } } .city { float: left; margin: 15px; padding: 10px; width: 270px; height: 400px; border-bottom: 1px solid black; } h2 { color: #333333; font-size: 30px; font-family: Helvetica, sans-serif } .menu_head2 { color: blue; font-size: 18px; } .menu_head2_active { color: black; font-size: 18px } Castle Rock Centennial 1 - 2 Denver 1 - 2
downvote count: 0
score: 1
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has title: Onclick class change not working

http://stackoverflow.com/a/28481770
answers question: http://stackoverflow.com/q/28446892
type: Answer
has body: I agree that it is better to fix the source, but the source even if formatted correctly will still have the NULLs (just not as strings) and since your question addressed removing those as well I would just use lodash or underscore to pop out the bad information. This is an example. You should play around with it to get it just right. Sails includes lodash as a dependency, otherwise to practice outside of sails just make sure to include the lodash library and refer to the docs if neccessary https://lodash.com/docs _.mixin({ cleanObject: function(o) { _.each(o, function(v, k) { if(k === 'NULL') { delete o[k]; } else if(!v) { delete o[k]; } }); return o; } }); var cleanedUp = _.cleanObject(JSONobj); I can understand that sometimes you get bad information from the source. I have had to patch into plenty of legacy systems in my time.
has comment: http://stackoverflow.com/comment/45687359
score: 0

http://stackoverflow.com/comment/45300807
type: QuestionComment
type: Comment
has text: `html` isn't a good var name there.
comment on: http://stackoverflow.com/q/28489711
score: 0

http://stackoverflow.com/comment/45360662
score: 0
type: AnswerComment
has text: @cfi this is what I'm getting now on my homepage: http://cl.ly/image/2q0b1D2j3g0t But the result should be: http://cl.ly/image/0b3g0S050732
type: Comment
comment on: http://stackoverflow.com/a/28521896

http://stackoverflow.com/q/28503206
answer count: 1
has answer: http://stackoverflow.com/a/28503608
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45339426
has body: Note: regarding the comment about the similar question I would like to point out that I am not interested in the difference between module.exports and exports. Rather, my focus in this question is on the difference between exporting a function that - upon calling it - creates an object with the functions we wish to share versus directly assigning these functions as properties of the exports object. I would like to understand the difference between the following two ways of exporting a module's functions (and hiding local state) in JavaScript: way 1 var x = 0; function get() {return x;} function set(_x) {x = _x;} exports.get = get; exports.set = set; way 2 module.exports = function () { var x = 0; function get() {return x;} function set(_x) {x = _x;} return {get:get, set:set}; }; (note that in way 2 I had to assign to module.exports, assigning to exports didn't work). The way the code in way 1 is used is: var gs = require('./get-set-a.js'); console.log(gs.get()); gs.set(100); console.log(gs.get()); The way the code in way 2 is used is: var gs = require('./get-set-b.js')(); console.log(gs.get()); gs.set(100); console.log(gs.get()); When running both from the command line, under node.js I get identical results. Is there any difference between way 1 and way 2 I should be aware of? Are they perhaps appropriate for different use cases? If not, which is more idiomatic?
linked to: http://stackoverflow.com/q/16383795
has title: difference between module export idioms
accepted answer: http://stackoverflow.com/a/28503608
has comment: http://stackoverflow.com/comment/45325725
upvote count: 1
downvote count: 1
tagged with: node.js
type: AnsweredQuestion
type: Question
score: 0

http://stackoverflow.com/a/51054362
answers question: http://stackoverflow.com/q/28513263
has body: Grunt.js. Simply break out the part you don't want minified into a standalone file. Uglify the other file then concatenate the ugly file and the pretty file. Of course if you're keeping an if statement pretty, the precise location of that code is important (vs a function that gets hoisted). So, maybe you need to break out your script into 3 files to sandwich the pretty if in the middle, but this is doable. If you want an easy Grunt getting started guide: https://hightechtele.com/articles/grunt-getting-started Checking out Grunt uglify documentation: (this may or may not be what your looking for too) exceptionsFiles Type: Array Default: [] Use this with mangle.properties to pass one or more JSON files containing a list of variables and object properties that should not be mangled. See the UglifyJS docs for more info on the file syntax.
type: Answer
score: 0

http://stackoverflow.com/q/28541122
tagged with: ember.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45401272
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/28544274
type: Question
tagged with: javascript
has body: I have two very similar routes: App.DiscountRoute = Ember.Route.extend({ model: function() { return Ember.RSVP.hash({ categories: this.store.findAll('discountCategory'), discounts: this.store.findAll('discount'), total_size: 6 }); } }); and App.CategoryRoute = Ember.Route.extend({ renderTemplate: function() { this.render('discount'); }, model: function(params) { return Ember.RSVP.hash({ categories: this.store.findAll('discountCategory'), discounts: this.store.filter('discount',function(discount) { return discount.get('discountCategory').get('id')==params.category_id }), total_size: 6 }); } }); Where should I place categories model and total_size counter, which will be available from any routes in my application?
has title: Move duplicated routes code in emberjs
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/28544274
favorite count: 0

http://stackoverflow.com/comment/45401592
type: QuestionComment
comment on: http://stackoverflow.com/q/28543739
score: 0
has text: `Foo` seems to be called fine, but you're not returning anything from it. If `iframe.contentWindow` was `undefined`, calling `Foo` of it would throw a reference error, it wouldn't return `undefined`.
type: Comment

node.js
tags question: http://stackoverflow.com/q/28547436
tags question: http://stackoverflow.com/q/28460564
tags question: http://stackoverflow.com/q/28562142
tags question: http://stackoverflow.com/q/28570622
tags question: http://stackoverflow.com/q/28497476
tags question: http://stackoverflow.com/q/28570061
tags question: http://stackoverflow.com/q/28581861
tags question: http://stackoverflow.com/q/28558476
tags question: http://stackoverflow.com/q/28448809
tags question: http://stackoverflow.com/q/28529636
tags question: http://stackoverflow.com/q/28438527
tags question: http://stackoverflow.com/q/28581454
tags question: http://stackoverflow.com/q/28573628
tags question: http://stackoverflow.com/q/28441002
tags question: http://stackoverflow.com/q/28550176
tags question: http://stackoverflow.com/q/28566996
tags question: http://stackoverflow.com/q/28549028
tags question: http://stackoverflow.com/q/28447944
tags question: http://stackoverflow.com/q/28491640
tags question: http://stackoverflow.com/q/28570599
tags question: http://stackoverflow.com/q/28587150
tags question: http://stackoverflow.com/q/28535107
tags question: http://stackoverflow.com/q/28537866
tags question: http://stackoverflow.com/q/28548690
tags question: http://stackoverflow.com/q/28479952
tags question: http://stackoverflow.com/q/28526980
tags question: http://stackoverflow.com/q/28468300
tags question: http://stackoverflow.com/q/28511332
tags question: http://stackoverflow.com/q/28442880
tags question: http://stackoverflow.com/q/28515351
tags question: http://stackoverflow.com/q/28468818
tags question: http://stackoverflow.com/q/28525571
tags question: http://stackoverflow.com/q/28555395
tags question: http://stackoverflow.com/q/28589991
tags question: http://stackoverflow.com/q/28577114
tags question: http://stackoverflow.com/q/28575569
tags question: http://stackoverflow.com/q/28439611
tags question: http://stackoverflow.com/q/28481405
tags question: http://stackoverflow.com/q/28517050
tags question: http://stackoverflow.com/q/28469146
tags question: http://stackoverflow.com/q/28484014
tags question: http://stackoverflow.com/q/28587266
tags question: http://stackoverflow.com/q/28494415
tags question: http://stackoverflow.com/q/28471201
tags question: http://stackoverflow.com/q/28575374
tags question: http://stackoverflow.com/q/28577922
tags question: http://stackoverflow.com/q/28503617
tags question: http://stackoverflow.com/q/28571434
tags question: http://stackoverflow.com/q/28472359
tags question: http://stackoverflow.com/q/28568370
tags question: http://stackoverflow.com/q/28442033
tags question: http://stackoverflow.com/q/28505725
tags question: http://stackoverflow.com/q/28549430
tags question: http://stackoverflow.com/q/28441686
tags question: http://stackoverflow.com/q/28527420
tags question: http://stackoverflow.com/q/28587612
tags question: http://stackoverflow.com/q/28591181
tags question: http://stackoverflow.com/q/28464198
tags question: http://stackoverflow.com/q/28497863
tags question: http://stackoverflow.com/q/28517597
tags question: http://stackoverflow.com/q/28572193
tags question: http://stackoverflow.com/q/28543573
tags question: http://stackoverflow.com/q/28476629
tags question: http://stackoverflow.com/q/28526464
tags question: http://stackoverflow.com/q/28536562
tags question: http://stackoverflow.com/q/28527370
tags question: http://stackoverflow.com/q/28574341
tags question: http://stackoverflow.com/q/28550827
tags question: http://stackoverflow.com/q/28514856
tags question: http://stackoverflow.com/q/28589809
tags question: http://stackoverflow.com/q/28583357
tags question: http://stackoverflow.com/q/28482021
tags question: http://stackoverflow.com/q/28480879
tags question: http://stackoverflow.com/q/28526354
tags question: http://stackoverflow.com/q/28439002
tags question: http://stackoverflow.com/q/28576911
tags question: http://stackoverflow.com/q/28542863
tags question: http://stackoverflow.com/q/28444230
tags question: http://stackoverflow.com/q/28581117
tags question: http://stackoverflow.com/q/28442920

http://stackoverflow.com/comment/115560390
type: Comment
has text: info on this feature... pretty well supported but often not enough to tell if the user can actually connect to all your servers https://caniuse.com/online-status
comment on: http://stackoverflow.com/a/56987970
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45474204
type: QuestionComment
has text: It sounds like you want a normal login-system? If that is the case you need a server-sided script, such as PHP. You would also need a database to store the accounts and their information.
comment on: http://stackoverflow.com/q/28582844
score: 0
type: Comment

http://stackoverflow.com/comment/45410248
type: QuestionComment
type: Comment
has text: @martialdidit I tried not using `transform` to move my carousel and it still does not play the video.
comment on: http://stackoverflow.com/q/28504669
score: 0

http://stackoverflow.com/comment/45434119
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28540534
type: Comment
has text: Any chance you can put together a JSFiddle to demonstrate this?

http://stackoverflow.com/q/28542957
has answer: http://stackoverflow.com/a/28543093
tagged with: javascript
has answer: http://stackoverflow.com/a/28543092
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 5
accepted answer: http://stackoverflow.com/a/28543092
tagged with: css
has answer: http://stackoverflow.com/a/28543078
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28543111
has answer: http://stackoverflow.com/a/28543051
possible better answer: http://stackoverflow.com/a/28543078
has body: This may be a very silly question with a very simple answer, but here goes: I'm creating a Movie Catalogue in HTML to come up on my Galaxy 3 Tablet to help me chose what movies to watch (not commercial or professional). I currently have around 10x various HTML pages for lists, main menu, frames, etc, and will be soon creating a further 20x pages for individual genres soon. At the bottom centered on every page I have a small foot-note containing my name and the date I last updated my catalogue: Gus Diaz - 16/02/2015 That's it! It's pretty simple! This little footnote helps me understand just exactly how badly outdated my catalogue might be. QUESTION: Is there a way to dynamically update every HTML file with one central file using "quite possibly" a .CSS file or a Javascript file? I tried looking into the (STRING) command but couldn't find any answers. IDEALLY: I'd like to simply open a central .CSS file with the following string: "Gus Diaz - 16/02/2015" and manually change it, and that could then update all other 20-30x various HTML files dynamically with a special code (maybe?)... I even experimented this code on my HTML files, but it didn't work: CSS: .string .update { "Gus Diaz - 16/02/2015" } HTML: &lt;string class="update"&gt;&lt;/string&gt; Any ideas? Any help? Thanks in advance, the help I've received earlier on from this forum was tremendous! Gus
type: Question
has title: How can I import a single string line of text to multiple HTML files?

http://stackoverflow.com/comment/45402755
score: 0
type: QuestionComment
has text: Hey Hoppy... you still have more edits to do. You have `a=b` and stuff still in the lower part of the question.
type: Comment
comment on: http://stackoverflow.com/q/28543611

http://stackoverflow.com/comment/45504977
type: Comment
comment on: http://stackoverflow.com/a/28580562
has text: if(index==1){ selectBoxes[0].disabled=false; }else if(index==3){ selectBoxes[1].disabled=false; }else if(index==5){ selectBoxes[2].disabled=false; } can u give small explaination ?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45279830
type: AnswerComment
comment on: http://stackoverflow.com/a/28478374
has text: @MCJames Not in pure javascript, no. Next time you should try for yourself though!
type: Comment
score: 0

http://stackoverflow.com/comment/45433755
type: AnswerComment
score: 0
type: Comment
has text: You can use Jquery Ajax call as follows :$.ajax({ type: "GET", url: "http://localhost:3085/BasicService.svc/sess_details?subject=999", dataType: "xml", success: parseXml(response) });
comment on: http://stackoverflow.com/a/28561113

http://stackoverflow.com/comment/94654641
type: Comment
comment on: http://stackoverflow.com/a/28551768
type: AnswerComment
has text: @Hacketo Create a promise that waits for the script element's 'load' or 'error' event. Once either of those two are called, then check. Some errors will emit the 'error' event while others will emit the 'load' event even though your script was never run.
score: 0

http://stackoverflow.com/comment/45289231
has text: Well why not just use a `switch` statement?
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/28483576

http://stackoverflow.com/q/28514868
has body: I'm trying to mock an object (which I created) in Jest so I can provide default behaviour within the react component (so the real implementation isn't used) This is my react component ChatApp (it's very straight forward) 'use strict'; var React, ChatApp, ChatPanel, i18n; React = require('react'); ChatPanel = require('./chat_panel'); i18n = require('../support/i18n'); ChatApp = React.createClass({ render() { return ( &lt;div className="chat-app"&gt; &lt;h1&gt;{i18n.t("app.title")}&lt;/h1&gt; &lt;ChatPanel /&gt; &lt;/div&gt; ); } }); module.exports = ChatApp; So I have a custom I18n dependency that does translations (I18n is something I've written that is a wrapper for node-polyglot). So I want to do a basic test to see if the H1 has the correct word in it, but I don't want to set jest.dontMock() on my I18n object, because I don't want it to use the real object in the ChatApp test. So following the basic instructions on the jest website, I created a mocks folder and created a mock file for i18n, which generates a mock from the original object and then overrides the t method and adds a method to allow me to set the return string for t. This is the mock object 'use strict'; var i18nMock, _returnString; i18nMock = jest.genMockFromModule('../scripts/support/i18n'); _returnString = ""; function __setReturnString(string) { _returnString = string; } function t(key, options = null) { return _returnString; } i18nMock.t.mockImplementation(t); i18nMock.__setReturnString = __setReturnString; module.exports = i18nMock; Now in my ChatApp test I require the mock in a before each, like so: 'use strict'; var React, ChatApp, TestUtils, path; path = '../../../scripts/components/'; jest.dontMock( path + 'chat_app'); React = require('react/addons'); ChatApp = require( path + 'chat_app'); TestUtils = React.addons.TestUtils; describe('ChatApp', () =&gt; { beforeEach(() =&gt; { require('i18n').__setReturnString('Chat App'); }); var ChatAppElement = TestUtils.renderIntoDocument(&lt;ChatApp /&…
tagged with: unit-testing
type: Question
has answer: http://stackoverflow.com/a/28516589
tagged with: javascript
score: 15
upvote count: 15
tagged with: reactjs
answer count: 3
has answer: http://stackoverflow.com/a/41986610
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: jestjs
has title: How do you manually mock one of your own files in Jest?
has answer: http://stackoverflow.com/a/29805544

http://stackoverflow.com/comment/63220851
comment on: http://stackoverflow.com/a/28558545
score: 0
type: Comment
type: AnswerComment
has text: So I'm assuming that one could use `react-router` for certain sub-routes? For example, if someone wanted to use react to create a dashboard it would be possible to mount a `react-router` just to all `/dashboard` routes?

http://stackoverflow.com/q/28543433
tagged with: infragistics
answer count: 1
tagged with: javascript
favorite count: 0
upvote count: 3
has title: igCombo template doesn`t effect selected item
has body: When I set index in selectedItems properety in order to display preset value in igCombo, provided itemTemplate is not used for generating the text value. $(selector).igCombo({ dataSource: this.userComboDs, width: '300px', textKey: 'line1', valueKey: 'id', mode: 'dropdown', enableClearButton: false, closeDropDownOnSelect: true, itemTemplate: "&lt;span&gt;${city}, ${line1}&lt;/span&gt;", selectedItems: [ { index: 1 // random index value }], selectionChanged: function (evt, ui){ }, filteringType: "local", filterCondition: "contains", renderMatchItems: "contains" });
downvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28840592
type: Question
score: 3
tagged with: ignite-ui

http://stackoverflow.com/a/28549106
answers question: http://stackoverflow.com/q/28549073
upvote count: 3
has body: Change the textDecoration property from the style object which, in turn, will modify the text-decoration CSS style: function underline_text(){ document.getElementById("myP").style.textDecoration = "underline"; } JSFiddle
score: 3
downvote count: 0
type: Answer

http://stackoverflow.com/q/28556398
has comment: http://stackoverflow.com/comment/51076516
has title: How to catch net::ERR_CONNECTION_REFUSED
type: Question
has answer: http://stackoverflow.com/a/44195713
has answer: http://stackoverflow.com/a/56987970
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/79313012
score: 79
has answer: http://stackoverflow.com/a/78203520
upvote count: 79
downvote count: 0
has answer: http://stackoverflow.com/a/75296017
tagged with: jquery
favorite count: 0
tagged with: ajax
has body: Is there a way to catch failed to load resource: net::ERR_CONNECTION_REFUSED, I've tried: try { $.post('',{},function(res) { }).fail(function (xhr, textStatus, errorThrown) { xhr.textStatus = textStatus; xhr.errorThrown = errorThrown; console.log('fail',xhr); // how to get the 'ERR_CONNECTION_REFUSED' or anything else as string? }); } catch(e) { console.log('catch',e); } The fail function could catch, but I got no information about the error, either it is: ERR_NAME_NOT_RESOLVED ERR_CONNECTION_REFUSED ERR_BLOCKED_BY_CLIENT ERR_TUNNEL_CONNECTION_FAILED (when using proxy) or anything else.. the question would be, how to get the kind of error?
tagged with: exception
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/31555839

http://stackoverflow.com/q/28549807
has body: I have two arrays of strings that I want to repeat within my page. Here are the arrays (infoData and modelData) in the debugger: Screenshot of arrays in Chrome inspector: Here is my html: {{info}} {{stats}} However the page only displays the contents of infoData as shown below: XPE www.sampleurl.com Sample summary has nulla quis lorem ut libero malesuada feugiat... My question is why does this happen and how can I get the elements of the second array to display like the first? Here is some additional info that may be useful to you. As I was trying out different things this struck me as interesting: The following HTML: {{pTab.infoData}} {{pTab.modelData}} displays the infoData array in square brackets as a string 3 times (infoData has a length of 3).While the following HTML: {{pTab.modelData}} {{pTab.infoData}} displays the modelData array in square brackets as a string 3 times. Is there something wrong with the ? Because whatever is in that div never repeats, even if I move that div ahead of the If I'm being unclear or you'd like to see more of the code, please let me know. Thank you very much for your time.
score: 0
has answer: http://stackoverflow.com/a/34385945
has comment: http://stackoverflow.com/comment/45413990
tagged with: angularjs-ng-repeat
has title: ng-repeat not working consistently with arrays of items
tagged with: angularjs
type: UnansweredQuestion
type: Question
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/56512584

http://stackoverflow.com/q/28517590
possible better answer: http://stackoverflow.com/a/28523199
upvote count: 3
has comment: http://stackoverflow.com/comment/45368032
has comment: http://stackoverflow.com/comment/45480432
has body: I am trying to make a custom binding that is to be used within a foreach binding and would need access to the current observableArray and the $data. Now I notice the bindingContext arg contains the $data, $parent, $root etc however I cannot seem to find a way to access the array being iterated, so is there a way? Just to be clear here is a sort of example of what I mean: DoSomethingWithArrayAndElement In this instance customBinding seems to yield: $data = current element in iteration $parent = view model containing the People array root = same as $parent $index = current index in the iterating array $parents = array containing the view model
type: Question
score: 3
has comment: http://stackoverflow.com/comment/45430010
tagged with: knockout.js
has answer: http://stackoverflow.com/a/28517877
answer count: 2
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45369152
favorite count: 0
has comment: http://stackoverflow.com/comment/45352477
has answer: http://stackoverflow.com/a/28523199
has comment: http://stackoverflow.com/comment/45352544
has title: Knockout custom binding in foreach to get iterator
accepted answer: http://stackoverflow.com/a/28517877
type: AnsweredQuestion

http://stackoverflow.com/comment/45431026
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28559587
has text: I am in dialema. Should I post the answer which OP should know himself by debugging the code.

http://stackoverflow.com/comment/45387843
score: 0
has text: @Piwwoli: Hi sir you are right.
type: Comment
comment on: http://stackoverflow.com/q/28536526
type: QuestionComment

http://stackoverflow.com/q/28557186
tagged with: javascript
has title: Wijemo event calender bind to angular controller
has answer: http://stackoverflow.com/a/28577784
score: 0
tagged with: wijmo
answer count: 1
has comment: http://stackoverflow.com/comment/45427332
has body: I'm trying to bind the wijeval to an array of events in an angularjs Controller. This is what if tried so far: View: &lt;div ng-app="MyApp" ng-controller="MainController"&gt; &lt;wijevcal viewtype="week" eventsdata="{{events}}"&gt; &lt;/wijevcal&gt; &lt;/div&gt; Controller: var app = angular.module("MyApp", ["wijmo"]); function MainController($scope) { $scope.events = [{ id: "ev1", subject: "First event", start: new Date(2013, 5, 23, 15, 30), end: new Date(2013, 5, 23, 17, 35) }, { id: "ev2", subject: "Second event", start: new Date(2013, 5, 23, 10, 30), end: new Date(2013, 5, 23, 11, 35) }]; } The eventsdata binding is not working and if I create a new event it's stored in the local browser stroage. I hope somebody can help me to get the binding work because the "documentation" I found is terrible Link to documentation: http://wijmo.com/5/docs/topic/wijmo.angular.WjCalendar.Class.html Ceddy
has comment: http://stackoverflow.com/comment/45426984
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45427130
has comment: http://stackoverflow.com/comment/45426866
tagged with: componentone
has comment: http://stackoverflow.com/comment/45427457
type: Question

http://stackoverflow.com/q/28516551
has title: d3.js: Collision detection for label placement at fixed distances
has body: I want to use d3.js to place labels at fixed distances from their nodes, yet prevent their overlap. So far, I using force-based layout with negative charge to place labels. I used code for collision detection between rectangle-shaped nodes (Here). What I need is to fix the distance between labels and their respective nodes. This is my collide function. Also, this is a full JSfiddle function collide(node) { var n_width = node.bbox.width/2, n_height = node.bbox.height/2, nx1 = node.x - n_width, nx2 = node.x + n_width, ny1 = node.y - n_height, ny2 = node.y + n_height; return function(quad, x1, y1, x2, y2) { if (quad.point &amp;&amp; (quad.point !== node)) { var dx = node.x - quad.point.x, adx = Math.abs(dx), dy = node.y - quad.point.y, ady = Math.abs(dy), mdx = quad.point.bbox.width/2 + n_width, mdy = quad.point.bbox.height/2 + n_height; /******** This part should be modified*********/ if (adx &lt; mdx &amp;&amp; ady &lt; mdy) { var l = Math.sqrt(dx * dx + dy * dy); var lx = (adx - mdx) / l * 0.5 var ly = (ady - mdy) / l * 0.5 // choose the direction with less overlap if (lx &gt; ly &amp;&amp; ly &gt; 0) lx = 0; else if (ly &gt; lx &amp;&amp; lx &gt; 0) ly = 0; dx *= lx dy *= ly node.x -= dx node.y -= dy quad.point.x += dx quad.point.y += dy } } return x1 &gt; nx2 || x2 &lt; nx1 || y1 &gt; ny2 || y2 &lt; ny1; }; }
tagged with: javascript
tagged with: label
downvote count: 0
favorite count: 0
upvote count: 2
tagged with: d3.js
type: UnansweredQuestion
score: 2
answer count: 0
tagged with: collision-detection
type: Question

http://stackoverflow.com/q/28557617
has answer: http://stackoverflow.com/a/28557707
tagged with: javascript
score: -1
has title: How to fixed right hand side div with jquery?
answer count: 1
downvote count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
upvote count: 0
has body: Inside row two individual div how can one right hand side dive fixed when scrolling page then fixed and when come footer area then up this fixed div. This is my code example below: I want col-md-4 class fixed when come footer content then up.
type: Question

http://stackoverflow.com/comment/45352234
has text: it works a little syntax error from email formula i will find it thanks very much i really appreciate your effort
type: Comment
comment on: http://stackoverflow.com/a/28516824
score: 0
type: AnswerComment

http://stackoverflow.com/q/28491840
score: 1
has comment: http://stackoverflow.com/comment/45306285
has comment: http://stackoverflow.com/comment/45304568
has comment: http://stackoverflow.com/comment/45305677
type: Question
tagged with: google-maps
has answer: http://stackoverflow.com/a/28567628
has comment: http://stackoverflow.com/comment/45306228
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I have a Google map on my site that has worked great since early December. All of a sudden the other night, the map defaults to open when I enter the site. I cant close it. All my Google maps are that way... but no one has touched the code in months? what would cause this? Inspect elements in Firefox tells me the div is hidden, but its quite visible. My console shows no errors. I know this is broad, but its such strange behavior that is impossible to have been caused by an errant keystroke in the php file. OK. Still not working. Unfortunately, sorry, but I cant share the site. BUT, I've stripped the code down to the bare minimum - and the visibility defaults to VISIBLE. Oh, when I disable the Google code, everything works perfect. The screen defaults to the correct view, and clicking on the image correctly opens the panels - just where the map would have been is grey. CSS... Defines the mapproj div as hidden. #mapproj, #mappers, #mapbuildproj, #mapcurproj { visibility:hidden; background:#666; text-align:left; position:absolute; width: calc(100% - 200px); width: -o-calc(100% - 200px); /* opera */ width: -webkit-calc(100% - 200px); /* google, safari */ width: -moz-calc(100% - 200px); height: calc(100% - 80px); height: -o-calc(100% - 80px); /* opera */ height: -webkit-calc(100% - 80px); /* google, safari */ height: -moz-calc(100% - 80px); overflow-y:auto; left:200px; top:40px; color:black; z-index:1; } HTML... Calls the showprojmap() function with only the variable comp set. &lt;img style="margin-left:5px;" class="icon" src="images/add.png" alt="some_text" title="Add a project" onclick="showprojmap(3)" height="15px" width="15px"&gt; &lt;div id="mapproj"&gt;&lt;/div&gt; Showprojmap function... should set the div as visible as type is not set. function showprojmap(comp, type) { if (typeof type !=='undefined') { var personallog = document.createElement('input'); var createproject = document.getElementById("createproject"); personallog.setAttribute("id","personalid"); pers…
answer count: 1
has title: Google Maps Hidden Div stopped hiding
type: UnansweredQuestion
upvote count: 1
tagged with: css

http://stackoverflow.com/q/28529925
has body: I am working on an app for drawing using HTML 5 Canvas the problem that it's working well on computer browser like this picture http://s28.postimg.org/z0ytnva98/problem.jpg I want to make it working on mobile browser (never mind working on both, mobile browser is what I want). the problem in my code concerning the Java Script events. I change it to canvas.addEventListener('touchstart' , engage); canvas.addEventListener('touchmove', putpoint); canvas.addEventListener('touchend' , disengage); but didn't work i also tried canvas.addEventListener('touchstart' , engage); canvas.addEventListener('touchmove', putpoint); canvas.addEventListener('touchleave' , disengage); also didn't work. when I leave it to as it was like this canvas.addEventListener('mousedown' , engage); canvas.addEventListener('mousemove', putpoint); canvas.addEventListener('mouseup' , disengage); it make just a point like this picture http://s14.postimg.org/tadk87jpt/Screenshot_2015_02_15_20_16_32.png here is my code Drawing app Your browser does not support canvas element.
has title: How is it possible to make this app working with mobile browsers?
type: Question
tagged with: jquery-mobile
tagged with: javascript
tagged with: android-canvas
score: 0
has answer: http://stackoverflow.com/a/28530163
tagged with: html5-canvas
answer count: 1
type: UnansweredQuestion
tagged with: mobile-browser

http://stackoverflow.com/q/28585323
tagged with: ajax
type: Question
has answer: http://stackoverflow.com/a/28585560
score: 0
answer count: 1
type: UnansweredQuestion
has title: Ajax Script make my server to much busy. Have any others process to do it?
tagged with: javascript
tagged with: jquery
has body: I have 3 notification with drop-down window with detail like facebook. for Friend for Massage for Wall notification So update notification I used Ajax, But I think It's make my server more busy. I also learn and spend many days about comet, long poll, web socket etc but I cannot apply them in my web because of my weak knowledge. Please give a guideline? $(document).ready(function(){ $.ajaxSetup({ cache: false }); var auto_refresh = setInterval(function() { $('.count1').load('/notificationfollow.php'); $('.notif1').load('/updatefollow.php'); }, 56000); // refresh every 10000 milliseconds $.ajaxSetup({ cache: false }); var auto_refresh = setInterval(function() { $('.count5').load('/notificationmail.php'); $('.notif5').load('/updatemail.php'); }, 36000); // refresh every 10000 milliseconds $.ajaxSetup({ cache: false }); var auto_refresh = setInterval(function() { $('.count3').load('/notificationcount.php'); $('.notif').load('/updatenotification.php'); }, 11000); // refresh every 10000 milliseconds }); notificationmail.php <?php include("db.php"); include_once("include/session.php"); // This script create by and all right reserve by ?> <? global $dbh; $userid=$session->bdid; $query = mysqli_query($dbh,"SELECT * FROM messages WHERE `to` = '".$userid."' && `to_viewed` = '0' ORDER BY `created` DESC") or die(mysqli_error($dbh)); $count6 = mysqli_num_rows($query); if($count6 > 0) { echo ''.$count6.''; } else { echo ''; } ?> And notification mail html <?php include_once("notificationmail.php"); if($count6 > 0) { echo ''.$count1.''; } else { echo ''; } ?>

http://stackoverflow.com/comment/45264402
comment on: http://stackoverflow.com/a/28469532
type: AnswerComment
score: 0
type: Comment
has text: what is response.d ??

http://stackoverflow.com/comment/45277639
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28477304
has text: @MCJames okay, another prod in the right direction for *a* solution. You need to use strings. You need to force the MM and DD parts to always be 4 characters long (i.e. leading spaces). To do this you should add zeroes to the front of the string and then "chop" it to two characters from the right.

http://stackoverflow.com/q/28566375
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/125255679
upvote count: 2
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28566620
has body: I have noticed that the length attribute of a textbox is not set to 0 when ng-model is used. Take a look at this : Textbox length : 2 Textbox length : 1 Textbox length : 0 JS Bin here I tough the text Textbox length : 0 would appear when the page is loaded, but it is not the case. I am currently learning AngularJS, and I don't get it. Is there a reason behind that ?
answer count: 3
has answer: http://stackoverflow.com/a/28566656
has title: Why AngularJS doesn't set the length attribute on a textbox when ng-model is used
has answer: http://stackoverflow.com/a/28566495
downvote count: 0
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/28566495
accepted answer: http://stackoverflow.com/a/28566620

http://stackoverflow.com/comment/45277643
type: QuestionComment
comment on: http://stackoverflow.com/q/28477312
has text: @Ganesh little confusion...How to correlate `"12:30 am"` with `750 min`.
score: 0
type: Comment

http://stackoverflow.com/q/28561260
has comment: http://stackoverflow.com/comment/45433838
has comment: http://stackoverflow.com/comment/45433544
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45433543
has answer: http://stackoverflow.com/a/28561398
has answer: http://stackoverflow.com/a/28561313
type: Question
has answer: http://stackoverflow.com/a/28561317
has comment: http://stackoverflow.com/comment/45433574
has comment: http://stackoverflow.com/comment/45433551
has body: I have a field which I encode/decode using the following i.e. when the user updates in the child modal, I do self.options.eventDispatcher.trigger("updateMyField", encodeURIComponent(myFieldVal)); and I listen for this in the parent modal and say $("#myFieldDiv").html(decodeURIComponent(response)); Here response is the field value. Now my question is if I enter I am getting an alert. How do I fix this, so that it does not alert but just writes it as text in my div myFieldDiv ?
tagged with: javascript
has title: Javascript encode/decode field
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/45433678
tagged with: jquery

http://stackoverflow.com/a/28742162
has body: Animating the alpha of SVG images is not supported on iOS. But i found a solution. If you create a fullscreen canvas using the following code to scale it: var ratio = window.devicePixelRatio || 1, width = $(window).width(), height = $(window).height(); this.canvas.width = width * ratio; this.canvas.height = height * ratio; this.canvas.style.width = width + "px"; this.canvas.style.height = height + "px"; this.update(); You will be able to use double sized images to give retina support, that way you don't have to use SVG elements in your canvas (which is IMHO terrible for your memory as well). And the good thing is that images will accept setting the globalAlpha of your context. Hope the reader is informed enough :-).
answers question: http://stackoverflow.com/q/28551822
type: Answer
accepted answer of: http://stackoverflow.com/q/28551822
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/45389529
has text: Same as @Gauillaume, got it working locally and I just pasted your code and added my own images. Did you try turning off and on javascript? :P
comment on: http://stackoverflow.com/a/28537472
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28572272
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/28572092
score: 1
has comment: http://stackoverflow.com/comment/45454992
has body: __proto__ is the actual object used in the lookup chain to resolve methods. prototype is the object used to create __proto__ with new. Also, you have a typo, it should be .__proto__ not .__proto.__ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor
downvote count: 1

http://stackoverflow.com/comment/45343229
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28512362
has text: string to base36... `sVar` has string

http://stackoverflow.com/q/28513827
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45345644
has comment: http://stackoverflow.com/comment/45345634
has answer: http://stackoverflow.com/a/28513981
has comment: http://stackoverflow.com/comment/45345633
has comment: http://stackoverflow.com/comment/45345660
has comment: http://stackoverflow.com/comment/45345667
tagged with: dom
has comment: http://stackoverflow.com/comment/45345693
type: Question
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45345902
has body: This code isn't working in IE , so I need put DOM code instead of INNER HTML, ths Gabriel. So, problem is that IE didn't understand innerHTML with TABLE, TR, TD. I need another one way. But I didn't know how, mbe u have links $(document).ready(function () { var request = new XMLHttpRequest(); request.open('GET', 'http://api.randomuser.me/?results=11', true); request.onreadystatechange = function() { if (this.readyState === 4) { if (this.status >= 200 && this.status < 400) { var resp = this.responseText; var yourEvent = JSON.parse(resp); alert(resp); var u = yourEvent.results[0].user; //alert(yourEvent.results[0].user.name.title); //document.getElementById("table-wrapper").innerHTML=u; var our_html = " "; our_html += " № Имя Фамилия Отчество Адрес Фото Действие "; yourEvent.results.forEach(function(item, item_number){ var u = item.user; // задрало уже длинно )) our_html += " "; our_html += " " + (parseInt(item_number)+1) + " "; our_html += " " + u.name.title + "." + "" + u.name.first + "" + " " + "" + u.name.last +"" + " "; our_html += " " + "" + u.location.city + "" + ", " + u.location.street + " "; // чтобы табличку не растаращило, на время отладки our_html += ' '; our_html += ' Просмотреть '; our_html += " "; }); our_html += " "; document.getElementById("table-wrapper").innerHTML=our_html; } else { //Debug error here! console.error("An error occurred"); } } }; request.send(); request = null; });
linked to: http://stackoverflow.com/q/8302166
downvote count: 2
answer count: 1
has comment: http://stackoverflow.com/comment/45345655
has title: How to make table with DOM?
favorite count: 0
upvote count: 0
has comment: http://stackoverflow.com/comment/45345876

http://stackoverflow.com/a/28572789
accepted answer of: http://stackoverflow.com/q/28572482
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28572482
type: Answer
score: 0
has body: It looks like you need to be iterating through that list using a for loop instead of a foreach. @for(int i = 0; i < Model.LocationList.Count(); i++) { @Html.LabelFor(m => Model.LocationList[i].FirstName, new { @class = "label-asterisk form_question_label" }) @Html.TextBoxFor(m => Model.LocationList[i].FirstName, new { @class = "text_field", Name = count + "FirstName" }) @Html.ValidationMessageFor(m => Model.LocationList[i].FirstName) @Html.CheckBoxFor(m => Model.LocationList[i].EnrollLocation)@Html.LabelFor(m => Model.LocationList[i].EnrollLocation, new { @class = "form_question_label" }) { count++; } } This will generate unique id values for each property on each Location. E.G. LocationList[0].FirstName will be the id of the first element while LocationList[1].FirstName will be the name of the second.

http://stackoverflow.com/a/28540585
has body: Providing that you know input field element that you want to show/hide validation messages for, you can use after method to add message: $field.after('Test message.'); and remove to remove it: $field.next('.field-validation-error').remove(); So $field can be something like this: var $field = $('#txtCvc');
score: 0
answers question: http://stackoverflow.com/q/28540415
type: Answer

http://stackoverflow.com/comment/45436673
comment on: http://stackoverflow.com/a/28563028
type: AnswerComment
has text: Awesome that works! Thanks! But now the row doesn't dissapear, element not parsed correctly? this is how I hide the row : $(element).parents(".role-row").fadeOut("slow", function () { $(this).remove(); });
score: 0
type: Comment

http://stackoverflow.com/comment/45382206
has text: Upvote. Yep...And also mentioning that if the canvas is not on the top-left of the document then you must also adjust the x,y mouse coordinates by the offset of the canvas element.
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28533695

http://stackoverflow.com/q/28547828
has title: What is the best way in AngularJS to get data using ajax
has comment: http://stackoverflow.com/comment/45408720
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
has answer: http://stackoverflow.com/a/28548199
has comment: http://stackoverflow.com/comment/45408727
type: Question
accepted answer: http://stackoverflow.com/a/28547985
has comment: http://stackoverflow.com/comment/45408901
possible better answer: http://stackoverflow.com/a/28548199
tagged with: javascript
answer count: 2
downvote count: 0
score: 1
has body: I have a controller called MoviesListsCtrl that applied using ng-controller on 3 elements in the html document. If I use the $http service inside the controller, it will be executed 3 times for the same data. What is the best way to retrieve a json data with ajax once and use it for the controller.
favorite count: 0
tagged with: ajax
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45408656
has answer: http://stackoverflow.com/a/28547985

http://stackoverflow.com/q/28514411
has title: ES6 Array.prototype.values shouldn't it exist by now?
has comment: http://stackoverflow.com/comment/45347160
upvote count: 1
has comment: http://stackoverflow.com/comment/45351485
downvote count: 1
type: Question
tagged with: ecmascript-6
has comment: http://stackoverflow.com/comment/45346606
has answer: http://stackoverflow.com/a/31995935
tagged with: javascript
has comment: http://stackoverflow.com/comment/45357438
score: 0
has comment: http://stackoverflow.com/comment/45346616
answer count: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45351334
has comment: http://stackoverflow.com/comment/45346609
has comment: http://stackoverflow.com/comment/45346599
has comment: http://stackoverflow.com/comment/45352652
has body: Shouldn't ES6 Array.protoype.values exist already by now since this already works: Array.prototype.values = function(){ return this[Symbol.iterator](); } let arr = [1,2,3,4,5]; let iterator = arr.values(); for(let num of iterator) console.log(num) // 1, 2, 3, 4, 5

http://stackoverflow.com/q/28543824
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45401874
has comment: http://stackoverflow.com/comment/45402616
has title: How to prevent Ajax long-poll from reloading div in Chrome?
answer count: 1
tagged with: javascript
tagged with: ajax
has answer: http://stackoverflow.com/a/28548313
accepted answer: http://stackoverflow.com/a/28548313
score: 0
tagged with: css
has body: Edit: After some more research, I think I may be on the path to an answer, but I still need some help. If I understand correctly, what's happening is that my php script is returning empty answers after querying the MySQL database and not finding anything, so instead of holding the request open, if it has nothing to send, it returns an empty answer to the get request, and the JavaScript I have just opens another request, resulting in a deviation from the expected "long-polling" behavior. So, I now think the problem lies in my chatserver.php script. How do I get it to stop returning empty answers? The if(true){break;}else{continue;} thing is something I came across here when I was putting the chatserver script together originally, and I'm not sure I even understand why it works. I'm working on a fairly large scale web application with an awful lot of stuff going on in it, and Chrome is causing me fits. I'll try to explain my issue as concisely as possible, but there is a lot of code that goes into creating this issue. I'm using a long-polling Ajax request that calls a php script to push messages back to a div in the client page. Here's the Ajax code: function poll(){ var messageListener = new XMLHttpRequest(); messageListener.onreadystatechange=function(){ if(messageListener.readyState==4 && messageListener.status==200){ document.getElementById("main_view").innerHTML+=messageListener.responseText; document.getElementById("main_view").scrollTop = document.getElementById("main_view").scrollHeight; poll(); } } messageListener.open("GET","chatserver.php",true); messageListener.send(); } poll(); As you can see, the function starts when the page loads, and on receiving a response, it runs again, so I always have a request open the server can use to push chat messages. All of this is playing nicely in the latest versions of Chrome, IE and Firefox. The problem comes when I send a link to the div with a CSS tooltip. I have set pointer-events: none; as well as positioned and z-…
tagged with: php

http://stackoverflow.com/a/28574253
type: Answer
has body: You are using the same id for each , how is Javascript supposed to know which to load what? You need to use classes instead. foo Then, in your JS use... ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ var ajaxDisplay = document.getElementByClassName('ajaxDiv'); ajaxDisplay.innerHTML = ajaxRequest.responseText; } } By using getElementByClassName() a NodeList will be created which AJAX can then process. Another issue you could be running into, is that AJAX is asynchronous. You may also try experimenting with using synchronous requests instead. var queryString = "?q=" + argId ; queryString += "&o=" + option; ajaxRequest.open("GET", "ajaxGEOInjection.php" + queryString, false); //process as synchronous// ajaxRequest.send(null);
answers question: http://stackoverflow.com/q/28573760
score: 0

http://stackoverflow.com/q/28486670
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
has body: jQuery(function ($) { // Load dialog on page load //$('#basic-modal-content').modal(); // Load dialog on click $("#basic-modal .basic").click(function (e) { $("#basic-modal-content").modal(); //Close the window document.onclick = function(event){ var hasParent = false; for(var node = event.target; node != document.body; node = node.parentNode) { if(node.id == 'simple_close_listener'){ hasParent = true; break; } } if(hasParent){ //alert('inside'); } else{ $.modal.close(); } } //End close the window // Add class specific to browser if (navigator.userAgent.search("MSIE") &gt;= 0) { $("#basic-modal-content div:nth-child(2)").addClass("ie_simple"); $("#simplemodal-container").width(385).height(235); //alert("Browser is InternetExplorer"); } //Check if browser is Chrome or not else if (navigator.userAgent.search("Chrome") &gt;= 0) { $("#basic-modal-content div:nth-child(2)").addClass("crom_simple"); $("#simplemodal-container").width(390).height(300); //$("#simplemodal-container").css({"position": "relative", "left": "460px", "top": "20px"}); //alert("Browser is Chrome"); } //Check if browser is Firefox or not else if (navigator.userAgent.search("Firefox") &gt;= 0) { $("#basic-modal-content div:nth-child(2)").addClass("firefox_simple"); $("#basic-modal-content &gt; a").addClass("btn_simple"); //var x = $("#basic-modal-content").offset(); // $("#simplemodal-container").css({"position": "relative", "left": x.left, "top": x.top}); $("#simplemodal-container").width(340).height(170); //alert("Browser is FireFox"); } //Check if browser is Safari or not else if (navigator.userAgent.search("Safari") &gt;= 0 &amp;&amp; navigator.userAgent.search("Chrome") &lt; 0) { $("#basic-modal-content div:nth-child(2)").addClass("safari_simple"); $("#simplemodal-container").width(370).height(340); //alert("Browser is Safari"); } //Check if browser is Opera or not else if (navigator.userAgent.match(/Opera|OPR\//)) { $("#basic-modal-content div:nth-child(2)").addClass("opera_simple"); $("#simplem…
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 0
upvote count: 1
has title: How to position simplemodal on top of a button / div
type: Question
tagged with: javascript

http://stackoverflow.com/comment/45400843
type: QuestionComment
has text: file_get_contents('php://input') correctly works, but it's not satisfactory imho. See my edit
score: 0
comment on: http://stackoverflow.com/q/28543237
type: Comment

http://stackoverflow.com/comment/45404111
score: 0
type: Comment
type: QuestionComment
has text: @NikosParaskevopoulos - Error: [$injector:cdep] Circular dependency found: $http <- $modal <- globalAjaxInterceptor <- $http <- $compile
comment on: http://stackoverflow.com/q/28545046

timer
tag name: timer
tags question: http://stackoverflow.com/q/28490532
tags question: http://stackoverflow.com/q/28542547
tags question: http://stackoverflow.com/q/28441279
type: Tag
tags question: http://stackoverflow.com/q/28465354
tags question: http://stackoverflow.com/q/28509850
tags question: http://stackoverflow.com/q/28577482
tags question: http://stackoverflow.com/q/28521214
tags question: http://stackoverflow.com/q/28487954
tags question: http://stackoverflow.com/q/28534491
tags question: http://stackoverflow.com/q/28487466
tags question: http://stackoverflow.com/q/28583942

http://stackoverflow.com/q/28548629
score: 0
answer count: 1
has body: I have a webpage that uses JQuery Countdown and I have an audio clip that plays when the coundown reaches zero. Here's the relevant code: The audio plays just fine when I have the page open in it's own window and I'm using a separate window to view another page. However, if I have a different tab open and active in the same window, the audio will not play when the countdown completes. Any sort of assistance or explanation would be wonderful!
has comment: http://stackoverflow.com/comment/45410934
has answer: http://stackoverflow.com/a/28550271
tagged with: audio
type: AnsweredQuestion
has title: JavaScript audio will not play when tab is not in focus
type: Question
has comment: http://stackoverflow.com/comment/45412874
has comment: http://stackoverflow.com/comment/45413481
has comment: http://stackoverflow.com/comment/45413121
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28550271

http://stackoverflow.com/comment/45492087
type: QuestionComment
comment on: http://stackoverflow.com/q/28592766
has text: did you included the other controllers files at the index?
score: 0
type: Comment

http://stackoverflow.com/comment/80890018
score: 0
comment on: http://stackoverflow.com/a/46929378
type: Comment
has text: If the need for testing out deep sub objects, then your third code snippet looks good for me :)
type: AnswerComment

http://stackoverflow.com/comment/45402587
type: Comment
comment on: http://stackoverflow.com/a/28544299
type: AnswerComment
has text: Thank you for this. Could you just explain what the second line does exactly? Wha do you mean by headers?
score: 0

http://stackoverflow.com/comment/45307682
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28493618
has text: try this code http://jsfiddle.net/9m443p1o/

http://stackoverflow.com/comment/45475581
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28579265
has text: Cool..After getting the solution add it as answer..So that it'll will be helpful for other. Thanks.
type: Comment

http://stackoverflow.com/a/28556411
type: Answer
upvote count: 1
score: 1
has body: If you didn't make that much money, you should clear out the element: document.getElementById('liar').innerHTML = "";
answers question: http://stackoverflow.com/q/28556388
downvote count: 0

http://stackoverflow.com/q/28480586
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28480764
has answer: http://stackoverflow.com/a/28480764
has answer: http://stackoverflow.com/a/28480808
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45283541
has title: Eventhandler for classnames is not working correctly
has body: Here's what I am trying to do: Let user create category (done) Add that category to local storage (done) Add that category to a list on the screen (done) Attach an event to that category, so when a user clicks on it, it will show all the posts in that category. I want to have 1 function (or eventlistener, whatever you want to call it) that handles all the clicks. It has to know for which category it has to sort some posts and that is the point where I am stuck. This is my code that does step 1 and 2: document.getElementById("newCategoryButton").onclick = function () { var input = document.getElementById("newCategoryInput"); var li = document.createElement('li'); li.innerHTML = "&lt;a href='#' id='sort" + input.value + "'&gt;" + input.value + "&lt;/a&gt;&lt;/li&gt;"; localStorage.setItem(input.value, input.value); document.getElementById("categories").appendChild(li); } This is the code for step 3. The important stuff happens at the else for (var i = 0, len = localStorage.length; i &lt; len; ++i) { if (localStorage.key(i).indexOf("formObject") &gt; -1) { var value = JSON.parse(localStorage.getItem(localStorage.key(i))); addRow(value); } else { var li = document.createElement('li'); li.className = "category"; li.innerHTML = "&lt;a href='#' id='sort" + localStorage.getItem(localStorage.key(i)) + "'&gt;" + localStorage.getItem(localStorage.key(i)) + "&lt;/a&gt;&lt;/li&gt;"; document.getElementById("categories").appendChild(li); And this is the code for step 4: var categories = document.getElementsByClassName("category"); for (var i = 0; i &lt; categories.length; ++i) { categories[i].addEventListener("Click", SortPosts(categories[i].textContent)); } function SortPosts(value) { alert(value); //Sort coding here } When the page loads, it automatically alerts the value of SortPosts(), without clicking on anything. What is wrong with my code? Also, am I giving all the categories click events or am I doing that wrong, as well?
type: AnsweredQuestion
tagged with: loops
type: Question
accepted answer: http://stackoverflow.com/a/28480808
has comment: http://stackoverflow.com/comment/45283938
tagged with: javascript

http://stackoverflow.com/q/28462931
answer count: 1
tagged with: mongoose
tagged with: javascript
has body: Business case: I don't want to retrieve users who don't want to be retrieved during a range of hours in a day e.g., off-work hours. On a schema close to this { 'name': String, 'from': Number, // 800 (8:00 AM) 'to': Number, // 1700 (5:00 PM) ... } I'm using an aggregation to fetch users while also unwinding subdocument arrays among other operations. The basic search criteria is in the $match operator which is like this. User.aggregate([ { // some aggregation stuff }, { $match: { $and: [ { 'from': { $lte: currentTime }, { 'to': { $gte: currentTime } ] } } ]); Question: How can I allow users to setup reverse ranges also? Like 8PM to 8AM. How can I write a query that will help with this? No hair left to pull for today.
tagged with: mongodb-query
type: UnansweredQuestion
has title: Querying mongo documents by clock range - forward and reverse
type: Question
score: 0
tagged with: mongodb
has answer: http://stackoverflow.com/a/28481978

http://stackoverflow.com/comment/45306228
comment on: http://stackoverflow.com/q/28491840
has text: Thanks Mayhem. They must have done an update. Semi solved the issue, but now the map does not fill the div completely
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45276619
type: QuestionComment
score: 1
has text: It should work. What your console says? http://jsfiddle.net/hadyg1za/
comment on: http://stackoverflow.com/q/28476791
type: Comment

http://stackoverflow.com/comment/107100092
comment on: http://stackoverflow.com/a/42709121
type: Comment
score: 2
has text: One may put the `.` so that `dnsDomainIs("www.notmycompany.com", ".mycompany.com")` returns false.
type: AnswerComment

http://stackoverflow.com/q/28441657
type: Question
downvote count: 4
upvote count: 0
accepted answer: http://stackoverflow.com/a/28442052
tagged with: javascript
tagged with: jquery
has title: generate new input fields from button
favorite count: 0
has answer: http://stackoverflow.com/a/28441773
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has body: I want to generate a set of input boxes from the click of a button. I pretty much just need them to be clones of the original input boxes in my example code along with the text before hand; Angle and Magnitude. From the submit_angle_button I must then be able to retrieve in the information within all the input boxes. Let me know if you need anymore information. HTML Add angled force Angle: Magnitude: Add Enter Javascript $(document).ready(function(){ $("#add_button").click(function(){ //code to create and display new text box }); $("#submit_angle_button").click(function(){ getInputs(); //Function that takes the values of all text boxes }); }); EDIT: I must be able to access the new input box's information separately from the first set of boxes, and since I want to generate more than one set of input boxes, the id would probably need to be categorised. For example id="1_userAngle" id="2_userAngle" etc
score: -4
has answer: http://stackoverflow.com/a/28442052
possible better answer: http://stackoverflow.com/a/28441759
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28441759
has comment: http://stackoverflow.com/comment/45215893

http://stackoverflow.com/comment/45264999
has text: @j08691 More or less. You fixed the issue, but I was more curious about *why* it was happening that way. I thought events were FIFO.
score: 0
comment on: http://stackoverflow.com/q/28469484
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45345718
comment on: http://stackoverflow.com/a/28513760
score: 0
type: Comment
has text: then why is the event also passed as first parameter to the listener function? :o
type: AnswerComment

http://stackoverflow.com/comment/45356454
type: QuestionComment
type: Comment
has text: I need just name. (alt attribute)
score: 0
comment on: http://stackoverflow.com/q/28519754

http://stackoverflow.com/comment/45248722
has text: I dont think they were asking at all how to "create a jquery plugin" I think they wanted to learn JavaScript Object Oriented Notation, and they are just creating a dice game as an example to help learn OOP, your example does what they asked for but does not help them learn what they actually wanted to learn.
comment on: http://stackoverflow.com/a/28461088
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28526232
has comment: http://stackoverflow.com/comment/45368660
has body: You need to use some framework like jquery which turns complext things little bit easy. try like following. $(function(){ var lastTraversed; $('#sendbtn').click(function(){ $('input[type="radio"]:not(:checked)').each(function(a){ if(!$("input:radio[name='"+this.name+"']").is(":checked") &amp;&amp; lastTraversed !== this.name) { lastTraversed = this.name; alert(this.name); } }); }); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script src = "quiz.js"&gt; &lt;/script&gt; &lt;link rel = "stylesheet" href = "quiz_style.css"&gt; &lt;/head&gt; &lt;body&gt; &lt;center&gt;&lt;h1&gt; &amp;copy; JavaScript Quiz by Hamsheed ! :) &lt;/h1&gt;&lt;/center&gt; &lt;div id = "wrapper"&gt; &lt;form id = "quiz"&gt; &lt;fieldset&gt; &lt;legend&gt; Question 1 &lt;/legend&gt; He _____ it. &lt;br&gt; &lt;label&gt;&lt;input type = "radio" value = "wrong" name = "q1" id = "q"&gt; don't like &lt;br&gt;&lt;/label&gt; &lt;label&gt;&lt;input type = "radio" value = "right" name = "q1" id = "q"&gt; doesn't like &lt;br&gt;&lt;/label&gt; &lt;label&gt;&lt;input type = "radio" value = "wrong" name = "q1" id = "q"&gt; don't likes &lt;br&gt;&lt;/label&gt; &lt;/fieldset&gt; &lt;br&gt; &lt;fieldset&gt; &lt;legend&gt; Question 2 &lt;/legend&gt; They _____ here very often. &lt;br&gt; &lt;label&gt;&lt;input type = "radio" value = "right" name = "q2" id = "q"&gt; don't come &lt;br&gt;&lt;/label&gt; &lt;label&gt;&lt;input type = "radio" value = "wrong" name = "q2" id = "q"&gt; doesn't comes &lt;br&gt;&lt;/label&gt; &lt;label&gt;&lt;input type = "radio" value = "wrong" name = "q2" id = "q"&gt; doesn't coming &lt;br&gt;&lt;/label&gt; &lt;/fieldset&gt; &lt;br&gt; &lt;fieldset&gt; &lt;legend&gt; Question 3 &lt;/legend&gt; John and Mary _____ twice last week. &lt;br&gt; &lt;label&gt;&lt;input type = "radio" value = "wrong" name = "q3"&gt; comes &lt;br&gt;&lt;/label&gt; &lt;label&gt;&lt;input type = "radio"…
has comment: http://stackoverflow.com/comment/45368774
score: 0
answers question: http://stackoverflow.com/q/28525622
type: Answer
has comment: http://stackoverflow.com/comment/45368560

http://stackoverflow.com/a/28496753
score: 1
answers question: http://stackoverflow.com/q/28496321
has body: create script tag &amp; remove script tag cScript(); var nclick=0; $("#button").click(function() { nclick++; if (nclick == 7) { rScript(); nclick = 0; // Make something }; }); function cScript(){ var script = document.createElement( 'script' ); script.type = 'text/javascript'; script.src = 'ADS_URL'; $("#someElement").append( script ); } function rScript(){ var html = $("#someElement"); html.find('script').remove(); }
downvote count: 0
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45313420

http://stackoverflow.com/a/28586095
has comment: http://stackoverflow.com/comment/45479493
score: 1
has comment: http://stackoverflow.com/comment/45479389
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28585969
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28585969
upvote count: 1
has comment: http://stackoverflow.com/comment/45481361
type: Answer
has body: Do not use while. It will hang up the browser. Call your rest of code from checkElementExist function checkElementExist(id) { console.log("checkElementExist runs") advance = document.getElementById(id); if (advance == null){ console.log("advance defined as null"); } else{ console.log("Free from loop"); clearInterval(timer); restOfCode(); } }; timer = setInterval(checkElementExist('hostAndPort'), 1000); --- UPDATE --- setInterval takes function as a first argument so it should be like: setInterval(checkElementExist, 1000);. The previous code just called your function once and interval did nothing.

http://stackoverflow.com/comment/45286001
comment on: http://stackoverflow.com/a/28477788
score: 0
type: AnswerComment
type: Comment
has text: +1 Yes `.find(predicate)` is exactly what I am looking for in node.js. This is still experimental and the specification status is draft.

http://stackoverflow.com/q/28565682
tagged with: javascript
has comment: http://stackoverflow.com/comment/45442593
score: 0
has comment: http://stackoverflow.com/comment/45441700
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45441854
answer count: 0
has body: I need to read my input data from a json file that has this format: {"object" : { "name": "blah", "shapes":[ { "filename": "blahlah", "materials":[ { "texture": "blahblahblah" } ] } ] }} I am using JSON.parse() function to create the object after getting it from the file: var obj = JSON.parse(getJsonFile('file.json')); where getJsonFIle function looks like this. function getJsonFile(url) { var req = new XMLHttpRequest(); req.open('GET', url, false); req.send(null); return req.responseText; } So when i am accessing the elements that i need i take them by going down the children obj.object.shapes[0].filename . My problem is that I have tried to change the name of one field from the json file, lets say shapes to shapes2 and then proceeded to retrieve the attribute that i needed with the new changed version obj.object.shapes2[0].filename and it does not work. I did my research and in my opinion it should work, and i don't understand why it does not. I don't think i need to use special key words or anything am i right?
has comment: http://stackoverflow.com/comment/45442562
tagged with: http://stackoverflow.com/tag/json
has title: Object created after reading from json file uses specific attributes name
type: Question

http://stackoverflow.com/comment/45407400
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28547004
has text: Yeah it helped a lot..just wondering can there be a intermediate format/template like xml->"generic_template"->html @BitwiseCreative

http://stackoverflow.com/comment/45274575
type: Comment
has text: Thank you. I realized that i haven't wrote scope for user friends. Your comment was helpful. @luschn
type: AnswerComment
comment on: http://stackoverflow.com/a/28474203
score: 0

http://stackoverflow.com/comment/45444123
type: Comment
has text: this did not change the outcome :( updated the text
score: 0
comment on: http://stackoverflow.com/a/28566967
type: AnswerComment

http://stackoverflow.com/comment/45410565
has text: The navigation has acutally only one class (.navigation) that I style different with media queries for both, desktop and mobile. Only the mobile nav should be activated with js. How can I add different classes?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28526960

http://stackoverflow.com/q/28480204
has comment: http://stackoverflow.com/comment/45282914
tagged with: javascript
score: 0
has title: How to use jquery fadeToggle
answer count: 2
tagged with: jquery
linked to: http://stackoverflow.com/q/1403615
accepted answer: http://stackoverflow.com/a/28480276
has body: Hi everyone i want to learn how to use jquery fadeToggle for my DEMO In this demo you can see there is a click show div div. When you click this div then .gelen-mesaj-alani is showing. My question is how can a hide this div when clicked other area ? $(document).ready(function(){ $('.click').on('click',function(){ $(".gelen-mesaj-alani").fadeToggle(300); }); });
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28480254
possible better answer: http://stackoverflow.com/a/28480254
type: Question
has answer: http://stackoverflow.com/a/28480276

http://stackoverflow.com/q/28469583
has comment: http://stackoverflow.com/comment/45264321
type: Question
tagged with: javascript
score: 0
has body: So imagine I want to send a request that acts like I was logged on even thought I'm not. This means use cookie that is not set in the document. Can this be done? My site uses jQuery, but raw javascript alternative would be preferred for non-jQuery users. Also I suppose extra problems appear with CORS.
has comment: http://stackoverflow.com/comment/45264632
tagged with: ajax
type: UnansweredQuestion
has title: Can AJAX HTTP request send cookies that are not set on the client?
answer count: 0
tagged with: cookies
has comment: http://stackoverflow.com/comment/45284206

highcharts
tags question: http://stackoverflow.com/q/28545343
tags question: http://stackoverflow.com/q/28582797
tags question: http://stackoverflow.com/q/28573267
tags question: http://stackoverflow.com/q/28559117
tags question: http://stackoverflow.com/q/28449742
tags question: http://stackoverflow.com/q/28515375
tags question: http://stackoverflow.com/q/28456973
tags question: http://stackoverflow.com/q/28470898
tags question: http://stackoverflow.com/q/28563073
tags question: http://stackoverflow.com/q/28563599
tags question: http://stackoverflow.com/q/28580944
tags question: http://stackoverflow.com/q/28522210
tags question: http://stackoverflow.com/q/28564610
tags question: http://stackoverflow.com/q/28564586
tags question: http://stackoverflow.com/q/28482768
tags question: http://stackoverflow.com/q/28584236
tags question: http://stackoverflow.com/q/28461802
tags question: http://stackoverflow.com/q/28571280
tags question: http://stackoverflow.com/q/28460090
tags question: http://stackoverflow.com/q/28551361
tags question: http://stackoverflow.com/q/28587496
tags question: http://stackoverflow.com/q/28496101
tags question: http://stackoverflow.com/q/28456981
tags question: http://stackoverflow.com/q/28440838
tags question: http://stackoverflow.com/q/28592552
tags question: http://stackoverflow.com/q/28475796
tags question: http://stackoverflow.com/q/28506602
tags question: http://stackoverflow.com/q/28485861
tags question: http://stackoverflow.com/q/28559843
tags question: http://stackoverflow.com/q/28466255
tags question: http://stackoverflow.com/q/28474771
tags question: http://stackoverflow.com/q/28495286
tags question: http://stackoverflow.com/q/28546828
tags question: http://stackoverflow.com/q/28477787
tags question: http://stackoverflow.com/q/28578197
tags question: http://stackoverflow.com/q/28437413
tags question: http://stackoverflow.com/q/28515465
tags question: http://stackoverflow.com/q/28583959
tags question: http://stackoverflow.com/q/28497449
tags question: http://stackoverflow.com/q/28441121
tags question: http://stackoverflow.com/q/28567189
type: Tag
tags question: http://stackoverflow.com/q/28480733
tags question: http://stackoverflow.com/q/28483406
tag name: highcharts
tags question: http://stackoverflow.com/q/28480529

http://stackoverflow.com/comment/45245160
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28459283
has text: I would only want to remove the last div listed with an id of product(x) that had all three exact images (img.vehicleInShpment, img.WheelsInShipment and img.patternInShipment) to another div#product(x) above it. Let me know if that makes sense.

http://stackoverflow.com/comment/45503677
has text: Thanks a lot Bergi. Power set did not come to my mind :P
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28585563
type: Comment

http://stackoverflow.com/q/28590962
score: -1
has comment: http://stackoverflow.com/comment/45489001
has comment: http://stackoverflow.com/comment/45488613
answer count: 2
upvote count: 0
tagged with: javascript
favorite count: 0
has title: Is it possible to set up a functioning "contact us" page using HTML/CSS?
has answer: http://stackoverflow.com/a/28591084
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28591249
tagged with: css
has body: I'm wondering if it's possible to set up a functioning "contact us" page using HTML/CSS. For example, a user can go to the "contact" page and input their email address and message to me, and I will receive their message in my email. Can you do this with just html/css? if so what would that be called? Or will have I have to use some JavaScript?
type: UnansweredQuestion
downvote count: 1
type: Question

http://stackoverflow.com/comment/45242773
has text: Ahhh...thanks. Any idea about the rel tags?
comment on: http://stackoverflow.com/a/28458124
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28567079
accepted answer: http://stackoverflow.com/a/28567552
has body: I have managed to get the circles on top of each other but I have no clue how to make a line of circles that do not overlap. This is what I have gotten so far. HTML JavaScript var canvas = document.getElementById("myCanvas"); var ctx = canvas.getContext('2d'); for(var i = 0; i < 10; i++) { ctx.fillStyle="rgba(0,0,0,0.5)"; fillCircle(200,200,i*20) } var width = window.innerWidth; var height = 100; function fillCircle(x, y, radius) { ctx.beginPath(); ctx.arc(x, y, radius, 0, Math.PI * 2); ctx.closePath(); ctx.fill(); }
score: 0
has comment: http://stackoverflow.com/comment/45446332
tagged with: html5-canvas
answer count: 1
type: AnsweredQuestion
has title: How would I align circles horizontally using loops?
tagged with: loops
type: Question
has answer: http://stackoverflow.com/a/28567552
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/comment/45419546
comment on: http://stackoverflow.com/q/28553177
type: Comment
type: QuestionComment
has text: @Claies Thanks for suggestion, but it stayed same.
score: 0

http://stackoverflow.com/q/28515375
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28515476
possible better answer: http://stackoverflow.com/a/28515413
accepted answer: http://stackoverflow.com/a/28515476
has body: So, I've bene looking at the highcharts API, for an option to change the color of the point background color, when hovering the chart. This is my current chart: JSFiddle Example And the code: $(function () { $('#main-chart').highcharts({ chart: { type: 'area' }, plotBorderColor: '#000000', plotBackgroundColor: '#000000', title: { text: '' }, subtitle: { text: '' }, xAxis: { allowDecimals: false, labels: { formatter: function () { return this.value; // clean, unformatted number for year } } }, yAxis: { title: { text: 'Number of Clicks' }, labels: { formatter: function () { return this.value / 1000 + 'k'; } } }, tooltip: { pointFormat: '{series.name} produced &lt;b&gt;{point.y:,.0f}&lt;/b&gt;&lt;br/&gt;warheads in {point.x}' }, plotOptions: { area: { pointStart: 1940, marker: { enabled: false, symbol: 'circle', radius: 2, states: { hover: { enabled: true } } } } }, series: [{ name: 'USA', lineColor: '#4adefa', color: '#f1faf7', data: [251, 122, 511, 424, 291, 426, 121, 342, 110, 235, 369, 640,250] }, { name: 'USSR/Russia', lineColor: '#44d99f', color: '#f1faf7', data: [215, 125, 450, 120, 150, 200, 426, 660, 869, 1060, 900, 340, 429] }] }); }); When hovering the chart, the "point marker" is a round gray circle - I want to change that to be a round circle with a white background and green border. Is this possible?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28515614
has comment: http://stackoverflow.com/comment/45348140
has title: Highcharts - Change color of hover points
type: Question
has answer: http://stackoverflow.com/a/28515413
tagged with: highcharts
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3

http://stackoverflow.com/comment/45601519
type: QuestionComment
comment on: http://stackoverflow.com/q/28568043
score: 0
has text: Okay, so what I'm actually starting to think now is that it has nothing to do with the routeParam at all. I believe it might have to do with the fact that Angular isn't waiting to hear back from firebase before displaying the view. However, I'm not sure why it's perfectly able to do so with Angular already being loaded (IE Navigating between routes/views) and why it only seems to have the problem whenever I directly type the URL in to a new window/tab.
type: Comment

http://stackoverflow.com/comment/45325387
type: Comment
has text: Would need to see your code, but ngInclude creates a child scope, not an isolated scope. It should work just fine, although I'd make sure to use dot notation on all of your ngModels inside the templates. No need to use $parent.
comment on: http://stackoverflow.com/a/28494966
type: AnswerComment
score: 0

http://stackoverflow.com/q/28442942
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28443005
has answer: http://stackoverflow.com/a/28443090
favorite count: 0
tagged with: ajax
type: Question
score: 3
answer count: 3
accepted answer: http://stackoverflow.com/a/28443005
tagged with: php
upvote count: 3
possible better answer: http://stackoverflow.com/a/28443058
has body: I'm having trouble using the information I get from my PHP file after an AJAX call. I currently have the following AJAX code that triggers after clicking a button: &lt;script&gt; $(document).ready(function(){ $('.button').click(function(){ $.ajax({ type: "POST", url: "nano.php", data: { action: "authenticate" } }).done(function( msg ) { alert( "Done: " + msg ); }); }); }); &lt;/script&gt; Than, in the nano.php file I do some authentication and information fetching. In the end of my PHP code I do the following: print_r($member_info); print_r($activity_info); This information (two arrays with a lot of information) appear in the alert box that is called in the Ajax done function, which means that this information is available in the client side. I want to be able to treat the arrays and show the information on the page. Is print_r the right way to send the information? How can I treat and show the information in the arrays in my page after this?
has answer: http://stackoverflow.com/a/28443058
has title: Ajax using information from PHP
type: AnsweredQuestion

http://stackoverflow.com/comment/45410091
score: 0
type: Comment
has text: Thanks! Did you only change the script? Cause when I try the script it fails.
type: AnswerComment
comment on: http://stackoverflow.com/a/28548483

http://stackoverflow.com/q/28489711
has title: JS Switchery doesn't work
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/14028959
has comment: http://stackoverflow.com/comment/45300807
duplicate of: http://stackoverflow.com/q/14028959
has body: I use switchery.js for my project https://github.com/abpetkov/switchery ... ... But the problem is, that it looks like the standart checkbox. Help pls!
answer count: 0
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45300806

http://stackoverflow.com/q/28576535
has body: I am working on angularjs java project. I won't to load local files of all file types (txt, pdf, image files etc.) from my system into new tab on click of button using javascript, angularjs or java code. I able to load the content of the files but it is not displayed in correct format ie. I won't to load the file in similar format as they are placed on my system. I would be thankful if anyone could help me in finding the solution.
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45462694
has comment: http://stackoverflow.com/comment/45462762
type: Question
has comment: http://stackoverflow.com/comment/45462493
answer count: 2
has title: How to load local file in new tab?
tagged with: javascript
has answer: http://stackoverflow.com/a/28577502
has answer: http://stackoverflow.com/a/28577073
has comment: http://stackoverflow.com/comment/45462188
score: 0
has comment: http://stackoverflow.com/comment/45462546

http://stackoverflow.com/q/28455733
favorite count: 0
accepted answer: http://stackoverflow.com/a/28455781
downvote count: 2
has body: Hello every one i want to get text from this code $content = '&lt;span class="version_host"&gt; &lt;script type="text/javascript"&gt; document.writeln('streamin.to'); &lt;/script&gt; &lt;/span&gt;'; I want to get the text between ('streamin.to') streamin.to I am using strip_tags() function of php $test = strip_tags($content); echo $test; output: document.writeln('streamin.to'); please help me i want the text streamin.to only.
tagged with: php
has title: How to get text from html and javascript tags and functions
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45238384
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28455781
has answer: http://stackoverflow.com/a/28455967
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/28455944
answer count: 3
possible better answer: http://stackoverflow.com/a/28455944

http://stackoverflow.com/comment/45293605
type: Comment
has text: @Mike he is already checking the variable with isset condition and whether it is empty or not that is a nested if, better read the code before voting down
score: 0
comment on: http://stackoverflow.com/a/28484905
type: AnswerComment

http://stackoverflow.com/comment/45358471
has text: What kind of ASP.NET application are you using (Webforms, MVC?)
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28520756
type: QuestionComment

http://stackoverflow.com/comment/45227482
type: Comment
comment on: http://stackoverflow.com/a/28449311
type: AnswerComment
has text: I went with a `XMLHttpRequest();` to my server with CORS enabled from the background script and passing the `responseText` to my content script, then using `eval()` on it. No extra permissions were required and it seems to work just fine.
score: 0

http://stackoverflow.com/comment/45357022
type: QuestionComment
has text: it's very helpful to read js and php docs, before you start to write any scripts....
comment on: http://stackoverflow.com/q/28520088
score: 0
type: Comment

http://stackoverflow.com/comment/45406484
comment on: http://stackoverflow.com/q/28546474
type: QuestionComment
has text: boolean sub = true;? How about var sub = true;
type: Comment
score: 1

http://stackoverflow.com/comment/45406332
comment on: http://stackoverflow.com/q/28546244
has text: @Quentin, V8 for example. Can you say anything about one that you know?
score: 0
type: Comment
type: QuestionComment

acrobat
type: Tag
tags question: http://stackoverflow.com/q/28567281
tag name: acrobat
tags question: http://stackoverflow.com/q/28551165

http://stackoverflow.com/a/45836599
type: Answer
answers question: http://stackoverflow.com/q/28517910
has body: The (possbily new in v4) way of doing this is to wrap the component you're testing in the MemoryRouter provided by react-router. import {MemoryRouter} from 'react-router-dom'; import {render} from 'react-dom'; render(&lt;MemoryRouter&gt; &lt;YourComponent&gt; &lt;/MemoryRouter&gt;, node, () =&gt; {});
score: 0

http://stackoverflow.com/a/28464442
answers question: http://stackoverflow.com/q/28463834
type: Answer
score: 1
downvote count: 0
upvote count: 1
has body: It's too complicated to me, however I found this, it might be useful: highlightTextarea aim is to highlight portions of text into a textarea or a input. It can highlight a set of words or a specific range. http://mistic100.github.io/jquery-highlighttextarea/ Source: mistic100

http://stackoverflow.com/a/28576528
answers question: http://stackoverflow.com/q/28576223
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45462552
score: 0
type: Answer
has body: As Mhammad said, mediaquery will work @media (max-width: 600px) { #container { font-size:25pt; } } Or for a smoother transition: $( window ).resize(function() { $( "#container" ).css("font-size",function() { var value = $( "#container" ).css("width"); console.log(parseInt(value)/24 + "pt"); return parseInt(value)/24 + "pt"; }) ; }); https://jsfiddle.net/w2onp4me/
accepted answer of: http://stackoverflow.com/q/28576223
has comment: http://stackoverflow.com/comment/45462574

http://stackoverflow.com/a/28452505
answers question: http://stackoverflow.com/q/28452463
score: 4
type: Answer
has body: No. All the local storage mechanisms with JS APIs are sandboxed and accessible only to the browser that created them.
upvote count: 4
downvote count: 0

http://stackoverflow.com/q/28479754
has title: Why does this return 3, 1?
has answer: http://stackoverflow.com/a/28480582
has body: I understand the later, we call the alert on the foo object, which has another object named baz as its property, which in turn has a method named bar that returns the value of x. And because of lexical scope (I think :) ) the JS compiler/interpreter goes up the chain, finds x in baz and returns 1. My guess is when assigned to the variable go and then called from the global scope, you get 3? Just want to find out what's happening in the background. Any help will be appreciated!!! var x = 3; var foo = { x: 2, baz: { x: 1, bar: function() { return this.x; } } } var go = foo.baz.bar; alert(go()); alert(foo.baz.bar());
upvote count: 5
answer count: 5
has answer: http://stackoverflow.com/a/28479796
has comment: http://stackoverflow.com/comment/45282061
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28480098
has answer: http://stackoverflow.com/a/28479865
accepted answer: http://stackoverflow.com/a/28479865
type: Question
score: 5
tagged with: javascript
has comment: http://stackoverflow.com/comment/45282042
possible better answer: http://stackoverflow.com/a/28480098
downvote count: 0
has answer: http://stackoverflow.com/a/28479850
favorite count: 0

http://stackoverflow.com/a/28555072
downvote count: 2
accepted answer of: http://stackoverflow.com/q/28554407
answers question: http://stackoverflow.com/q/28554407
score: -2
upvote count: 0
type: AcceptedAnswer
has body: If you Google "rate limiting algorithm", you will find all sorts of algorithm possibilities including this StackOverflow question: What's a good rate limiting algorithm?
type: Answer

http://stackoverflow.com/comment/45465626
has text: Nope, the answer is not helpful. I want to point right into the setting, which is currently not activated. I don't want the user to leave the app and reopen it again. Like in google maps. If your GPS is not active, it will warn you and point directly into android gps settings menu
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/28563466

http://stackoverflow.com/q/28524138
has comment: http://stackoverflow.com/comment/45364492
has answer: http://stackoverflow.com/a/28526283
has comment: http://stackoverflow.com/comment/45368561
has comment: http://stackoverflow.com/comment/45365845
has comment: http://stackoverflow.com/comment/45365903
has comment: http://stackoverflow.com/comment/45364802
accepted answer: http://stackoverflow.com/a/28526283
has comment: http://stackoverflow.com/comment/45374969
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45364480
has comment: http://stackoverflow.com/comment/45378168
type: Question
has title: Setting Object to Chrome Storage
has body: So I'm trying to save an object via the chrome.storage API. The relevant code is: var images = null; var storage = chrome.storage.sync; var key = "key"; images = getImages(source); alert(images.length); // returns 4 storage.set({key: images}); storage.get("key", function(result) { alert(result.length); // returns undefined }); I'm tested that immediately after the getImages() function, images is a wrapped set JQuery object with a length of 4. However, when I try to access images.length via the storage.get callback, the result is undefined. Could someone help identify the error in how I am storing and/or retrieving this JQuery object? Update 1: Thank you all for your help. As clarification for the use case, I am using chrome.storage instead of localStorage because I plan to pass extension info to another script. Fortunately, TranQ/Xan's solution has enabled me to access the array via the storage.get call. I'm still experiencing issues working with the wrapped set JQuery object stored in the array but I'll post a separate question since the current solution encapsulates broader use cases.
tagged with: javascript
tagged with: jquery
score: 0
tagged with: google-chrome-extension
answer count: 1

http://stackoverflow.com/a/28453429
has body: You can make second function var autoLoad2 = setInterval( function () { $('#example').load('index.php?action=add&amp;subdo=loc #example').fadeIn("slow"); }, 5000); this might solve.
downvote count: 0
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28453340

http://stackoverflow.com/comment/45360493
type: AnswerComment
has text: Thank you that is what I was looking for. I have used the code I provided a few times before, it was actually someone on this site that provided me with it.
type: Comment
comment on: http://stackoverflow.com/a/28521793
score: 1

http://stackoverflow.com/q/28501551
accepted answer: http://stackoverflow.com/a/28502165
has answer: http://stackoverflow.com/a/28501878
score: -1
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28501878
downvote count: 1
type: Question
tagged with: jquery-ui
has title: Jquery ui dialog is opening multiple dialogs instead of one
tagged with: javascript
answer count: 2
has body: I am using Jquery UI dialog to display some information coming up from an asp.net mvc view list. so basically you go to the list, you click an icon and you get some info for the specific record as a pop up If there is only one dialog in the page , there is no problem , the dialog will open fine but if i want to have more than one dialog then when i click any of them all will open. Can you please help me with what am i doing wrong ? Catering Details @{Html.RenderAction("ViewEvent", "Home", new { EventId = item.Event.EventId });} @if (item.Event.SpecialRequirements != null) { @item.Event.SpecialRequirements }
upvote count: 0
has answer: http://stackoverflow.com/a/28502165
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/45316813
type: QuestionComment
comment on: http://stackoverflow.com/q/28498556
has text: @Claies I tired to add and if statement but couldn't get it working and I have mentioned that I only have one 'value' in my description. I'm unsure on how to get it to do multiple which is what I'm asking for help with
score: 0
type: Comment

http://stackoverflow.com/comment/45459655
has text: Firefox and IE do not respect `hide()` (`style="display:none"`) on ` ` elements. You'll have todo this a different way. Easiest would probably just to have two different breed ` `s one for cats and one for dogs and then show/hide those.
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28575132

http://stackoverflow.com/q/28457868
score: 0
has comment: http://stackoverflow.com/comment/45242835
has body: I have a drop down menu which is populated dynamically. Im trying to set one of the options as the default value. Given that the options are populated in the drop down only at run time, I cannot use No My code is as follows: Choose your options This refers to another file which has the enum declared. enum options { YES:"YES" NO: "NO" } This line refers the enum "options" to the field option. attribute optional option: options "option" Any ideas on how I can proceed with this?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45242725
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45242195
has answer: http://stackoverflow.com/a/28458302
has comment: http://stackoverflow.com/comment/45242838
has title: Set the default value in a drop down menu where data is entered dynamically
type: Question
has comment: http://stackoverflow.com/comment/45242508
has comment: http://stackoverflow.com/comment/45242957
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45242770

http://stackoverflow.com/q/28470493
accepted answer: http://stackoverflow.com/a/28473881
has title: Kendo Grid: getting an instance in a Angular directive
type: Question
linked to: http://stackoverflow.com/q/28447578
tagged with: kendo-grid
tagged with: javascript
tagged with: kendo-ui
score: 0
has answer: http://stackoverflow.com/a/28473881
answer count: 1
tagged with: angularjs
has body: this follows directly on from this question (with an additional question hence I thought should be a new post?) The link above shows how to get a grid instance in Angular (thanks to Lars) So, following on from this last example, I now have added the following directive.. and in the .js added angular .module("app", ["kendo.directives"]) .controller("Grid", Grid) .directive('pckendo', PCKendo); .... function PCKendo() { function link(scope, element, attrs) { var instance = element; var vm = scope.vm; vm.msg = ""; var grid = scope.grid; } return { link: link } See here for full example. Rather than getting the instance in the controller, I would like to get it via a directive (as from what I understand this is a better place to do event handling etc) I have tried a few things in there, but haven't been able to get the grid instance, so any further help here would be great. Thanks in advance!
type: AnsweredQuestion

http://stackoverflow.com/comment/45447121
comment on: http://stackoverflow.com/a/28567467
type: AnswerComment
has text: Chrome developer's console. Press f12 while viewing your page in Chrome. https://developer.chrome.com/devtools/docs/console
score: 0
type: Comment

http://stackoverflow.com/q/28582724
type: Question
has answer: http://stackoverflow.com/a/28582864
answer count: 1
tagged with: javascript
has title: AngularJS Scope.on and scope.emit calling order in a filter
score: 0
has body: In one of my filters, a value which is changed in another controller, is watched. Based on the updated value, I want to decide whether the emit should be called or not. It is as following. scope.$on('XChanged', function(event, x) { console.error( '==order list has changed : ' + x ); console.warn('INSIDE FILTER ON '+event); scope.bx = true; // bx variable is initialized in the controller where the filter is called and default is false. }); console.warn('AFTER FILTER ON 1 &gt;&gt;'+ scope.bx); if( !scope.bx ){ scope.$emit('handleEmit', {msg: 'RECYCLE' }); console.error( scope.bx+ ' Recycle requested. '); } But the problem is, scope.on is executed firstly and execution doesn't happen from the top to bottom in the filter. Also, even though bx is set to true in the scope.on, if( !scope.bx ) becomes true, that means the assigned true value to bx is not sett... Might be I m going wrong way... can you let me know how can I come up with this. What all I want to do is, based on the value changed in the scope.on, the emit should be executed. (in other words, bx boolean value is changed in the scope.on and the bx's updated value should be able to decide, whether emit should be executed or not.)
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/q/28530447
answer count: 1
tagged with: javascript
has title: Put ExtJS form on javascript method call
tagged with: extjs
score: 0
has answer: http://stackoverflow.com/a/28530665
accepted answer: http://stackoverflow.com/a/28530665
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
tagged with: forms
type: Question
has body: I'm totaly net to javascript and ExtJS. So maybe someone can help me. I want to display ExtJS made form on Web page when I call javascript method. The code is: .html Car Wiki mainPageScript.js (function(exports){ exports.testMethos = function() { var formPanel = Ext.create('Ext.form.Panel',{ title: 'Search Form', width:300, height:200, layout: 'anchor', defaults: { anchor:'80%' }, renterTo: document.body, items:[ { xtype: 'textfield', fieldLabel: 'Car Name', name: 'carName', labelAlign: 'top', cls: 'field-margin', flex:1 }, { xtype: 'textfield', fieldLabel: 'Car Model', name:'carModel', labelAlign:'top', cls:'field-margin', flex: 1 } ] }); }; } )(this.mainModule = {}); where is my mistake? (do not say, that in my genetic code :D)

http://stackoverflow.com/a/28591439
answers question: http://stackoverflow.com/q/28591090
has comment: http://stackoverflow.com/comment/45526337
score: 0
type: Answer
has body: Use a querySelectorAll() and provide the correct CSS selector by keying off of the name attribute. The getRadsByName() function will find all tags that have their name attribute set to the value provided to the function. You can tailor the query to your needs. // Wait for domready document.addEventListener("DOMContentLoaded", function(docE) { // Name of our inputs var answerRadioNames = ["first", "second"]; // Function to find all inputs with a certain name function getRadsByName(name) { var qs = "input[name='" + name + "']"; var rad = document.querySelectorAll(qs); return rad; } // Function to have all found inputs initialize thier handles function radNameInitializer(name) { [].forEach.call(getRadsByName(name), radInitializer); } // Function to attach click handlers to inputs function radInitializer(currRad) { currRad.addEventListener("click", radClickHandler); } // Click hanlder which calls the disabler function radClickHandler(e) { [].forEach.call(getRadsByName(e.target.name), disabler); } // Function which disables the clicked radio function disabler(radToDisable) { radToDisable.disabled = true; } // Attach to all the names answerRadioNames.forEach(radNameInitializer); });

http://stackoverflow.com/q/28550228
answer count: 2
tagged with: firefox-addon
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: xul
score: 2
upvote count: 2
type: Question
has body: For an upcoming version of an add-on I created, I want to detect from which tab, if any, a link was opened in a new tab or window. My add-on is a zoom add-on, and I want to be able to copy the zoom level of the origin tab if a user opens a link in a new tab or window. I've already figured out how to detect the opener if a link is opened with window.open() from content-JavaScript (that was fairly easy), however I have no real idea how to figure out if a new tab/window was opened from the context menu (open link in new tab/new window) or Ctrl/⌘/Shift+click. To detect whether it was opened from content-Javascript, I use: const Cc = Components.classes; const Ci = Components.interfaces; let windowTracker = { observe: function( subject, topic, data ) { if( 'chrome-document-global-created' == topic &amp;&amp; subject instanceof Ci.nsIDOMWindow ) { // here I can use subject.opener } } } let observerService = Cc[ '@mozilla.org/observer-service;1' ].getService( Ci.nsIObserverService ); observerService.addObserver( this, 'chrome-document-global-created', false ); To detect any possible non-content-JavaScript opener I've tried this in observe(): let windowTracker = { observe: function( subject, topic, data ) { if( 'chrome-document-global-created' == topic &amp;&amp; subject instanceof Ci.nsIDOMWindow ) { let topWindow = subject.QueryInterface( Ci.nsIInterfaceRequestor ) .getInterface( Ci.nsIWebNavigation ) .QueryInterface( Ci.nsIDocShellTreeItem ) .rootTreeItem .QueryInterface( Ci.nsIInterfaceRequestor ) .getInterface( Ci.nsIDOMWindow ); // here I tried topWindow.opener, with mixed results } } } ... but got mixed results. When I open a link in a new tab or window with the context menu or Ctrl/⌘/Shift+click, topWindow.opener equals null, but if I, for instance, open the Add-ons Manager with Ctrl+Shift+A, topWindow.opener will be an instance of ChromeWindow. So, it seems I'm kind of on the right track, but not quite, as I'm merely interested in user initiated opening of content l…
tagged with: firefox
tagged with: javascript
has answer: http://stackoverflow.com/a/28564837
has answer: http://stackoverflow.com/a/28572606
has title: Detect origin tab, if any, that opened new tab/window

http://stackoverflow.com/q/28466598
has answer: http://stackoverflow.com/a/28466801
type: Question
has body: Using a specific instance of a model, is there any way to get the type of any given attribute? For example, say I've got a model called Person. Inside a template, I pass an instance of this model and a property name to a helper function. In that function, I want to be able to find out what type of property that is. The closest thing I've seen is this, straight from the Ember docs: App.Person = DS.Model.extend({ firstName: attr('string'), lastName: attr('string'), birthday: attr('date') }); var attributes = Ember.get(App.Person, 'attributes') attributes.forEach(function(name, meta) { console.log(name, meta); }); // prints: // firstName {type: "string", isAttribute: true, options: Object, parentType: function, name: "firstName"} // lastName {type: "string", isAttribute: true, options: Object, parentType: function, name: "lastName"} // birthday {type: "date", isAttribute: true, options: Object, parentType: function, name: "birthday"} This would work, expect that in my helper method, I don't know the model type. I need to be able to do something like this and have it return the same information: Ember.get(person, 'attributes'); Sure, I'd like to do something more like this: person.getMetaInfoFor(property); But that's just wishful thinking at this point. I'm just trying to figure out if some unknown property of some unknown model is a string or a date. Any help would be greatly appreciated.
tagged with: ember-data
accepted answer: http://stackoverflow.com/a/42814159
tagged with: javascript
has title: Getting the attribute type of any property in an ember-data model
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28466801
has answer: http://stackoverflow.com/a/42814159
tagged with: ember.js
type: AnsweredQuestion

http://stackoverflow.com/q/28582783
has body: I have a long-polling web service. Recent response is cached. Web service notifies subscribers whenever new data is available. Is it a good practice to return a deep copy of a response or should the data be shared with all the subscribers? Or does it simply depend on use case?
answer count: 2
has answer: http://stackoverflow.com/a/28693699
downvote count: 0
tagged with: javascript
score: 4
favorite count: 0
accepted answer: http://stackoverflow.com/a/28693699
tagged with: angularjs
tagged with: angular-services
has comment: http://stackoverflow.com/comment/45676668
tagged with: design-patterns
has answer: http://stackoverflow.com/a/28708060
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45480327
has title: Should AngularJS web services return a deep copy of a response?
possible better answer: http://stackoverflow.com/a/28708060
type: Question
upvote count: 4

http://stackoverflow.com/q/28494280
has comment: http://stackoverflow.com/comment/45308724
has body: In my controller with the help of service i'm sending some qr-data to users so: $scope.sendtoList = function () { $scope.qrStatus = false; angular.forEach($scope.users, function (item) { if (item.Selected){ inviteService.sendQR(item.Emails.main, $scope.company.Id).then(function(response) { $scope.qrStatus = true; }, function(err) { $scope.qrStatus = false; }); } }); if ($scope.qrStatus){ $window.alert('QR-code has been sended successfully.'); } else{ $window.alert('Warning! QR-code has not been sended successfully.'); } } and i see some strange behaviour: it always show warning alert, even if method is done succesfully - i think it is of promisses. But how could i show window in my case only after servise promisse is returned?
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45308936
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28494493
accepted answer: http://stackoverflow.com/a/28494493
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45308647
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28494399
score: 0
has answer: http://stackoverflow.com/a/28494399
linked to: http://stackoverflow.com/q/19811655
has title: angularJS: window.alert only after method is done

http://stackoverflow.com/a/28576567
has body: You can use Function.prototype.apply() to pass arguments to a function as an array. $('#id').uploadify.apply(null, ['upload'].concat(imagesToUpload)); This assumes that imagesToUpload is an Array of the arguments you want to pass.
accepted answer of: http://stackoverflow.com/q/28576493
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28576493

http://stackoverflow.com/a/28556735
score: 1
answers question: http://stackoverflow.com/q/28556503
has body: Use ui.draggable.attr('id'); in your dragDrop function to get the id of the dragged image. Simple solution for you to get the id of the dragged item. var draggedElementID = ui.draggable.attr('id'); Here is the code where you can access it. function dragDrop(e, ui) { var x = parseInt(ui.offset.left - offsetX); var y = parseInt(ui.offset.top - offsetY); // Below line gives you the id of the image that is dragged. var draggedElementID = ui.draggable.attr('id'); console.log(x); console.log(y); // 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 }); var x = parseInt(ui.offset.left - offsetX); var y = parseInt(ui.offset.top - offsetY); global_image = image; // layer.add(image); layer.draw(); $("#clear").click(function () { }); document.getElementById('clear').addEventListener('click', function () { }); var x = parseInt(ui.offset.left - offsetX); var y = parseInt(ui.offset.top - offsetY); window.tablePositionList[tableIndex] = [x, y]; window.tableIndex++; }
accepted answer of: http://stackoverflow.com/q/28556503
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0

http://stackoverflow.com/a/28440276
has comment: http://stackoverflow.com/comment/45211098
has comment: http://stackoverflow.com/comment/45210950
upvote count: 1
type: AcceptedAnswer
type: Answer
has body: First, you need to do a below things in code-behind file. Register client IDs of pnl_cancel and ddlStatus controls. You will need these client IDs of the controls to access them in JavaScript Add style attribute to pnl_cancel with value display:none. This is to ensure that the control is rendered in HTML but is hidden This link here simulates the final rendered HTML. It will help resolve your problem. function GetSelectedItem(x) { if (x.value == 4) { if (confirm("Are you sure you want to cancel support ticket ?")) { document.getElementById("pnl_Cancel").style.display = 'block'; } else { x.value = ""; } } }
has comment: http://stackoverflow.com/comment/45210318
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45210777
accepted answer of: http://stackoverflow.com/q/28439628
answers question: http://stackoverflow.com/q/28439628

http://stackoverflow.com/comment/45337009
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28508423
has text: Well the algorithm is for computing minimum transportation costs, so am going for the implementation with the least cost which is java
score: 0

http://stackoverflow.com/q/28489018
has answer: http://stackoverflow.com/a/28489198
score: 3
downvote count: 0
favorite count: 0
has title: 6to5 es6 class, new Date() triggers maximum callstack exceeded
has body: I'm writing an ES6 class using the 6to5 compiler. I have a pretty basic class which calls new Date() in a setter function and unfortunately results in a maximum callstack exceeded Chrome exception, and too much recursion in FireFox. I'm not sure what's wrong with the following pattern, but calling new Date() is the cause of the exception: class DateTime { constructor() { this.active = null } set active() { this.active = new Date() } get active() { return this.active } } new DateTime()
type: Question
has comment: http://stackoverflow.com/comment/45299909
upvote count: 3
tagged with: babeljs
has comment: http://stackoverflow.com/comment/45299594
answer count: 1
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45299855
tagged with: ecmascript-6

http://stackoverflow.com/comment/45340489
has text: Strange... can you post your full code then? You can also try using the Session object, to see if this is the problem. (i.e. Session["value"] = "1" ) then use instead of the ViewBag.projectCount;)
type: AnswerComment
comment on: http://stackoverflow.com/a/28482369
score: 0
type: Comment

http://stackoverflow.com/comment/45447216
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28568215
has text: This conclusion is not working <% string a = Request["param1"]; Response.Write(a); %> in first alert i see code all page

http://stackoverflow.com/comment/45484821
has text: @tkowal yeah, thanks to your suggestions, this fiddle produces in javascript the same byte sequence of the erlang counterpart: https://jsfiddle.net/ou0wknwv/2/
comment on: http://stackoverflow.com/a/28584607
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28462517
answer count: 0
has comment: http://stackoverflow.com/comment/45250879
has title: Javascript Array returns as Array inside array of objects instead of single array of objects
type: Question
has comment: http://stackoverflow.com/comment/45250985
has comment: http://stackoverflow.com/comment/45251196
has comment: http://stackoverflow.com/comment/45251025
tagged with: javascript
has comment: http://stackoverflow.com/comment/45250972
score: 0
has comment: http://stackoverflow.com/comment/45250818
has body: Code: var fruits=[{"Apple":"1"},{"Apple":"1"}{"Apple":"1"},.......]; Here, assume I add more than 100 such objects then in console I see as [[obj1,obj2,...],[obj1,obj2,....]] depending upon length. Above scenario happens only if length is more than 100. It grows in multiples of 100. Issue : I am trying to use filter function of jquery. Once I call [[obj1,obj2,...],[obj1,obj2,....]].filter(obj){()} Here, obj is undefined. But assume if our array is only like this [obj1,obj2,..] then it works. [obj1,obj2,..].filter(obj){()} // Works Fine Please help me here. Why array of objects more than 100 does not use filter function also why in console it outputs as [[obj1,obj2,..],[obj1,obj2,..]] in more than 100 obj scenarios.
has comment: http://stackoverflow.com/comment/45251091
tagged with: jquery
type: UnansweredQuestion

http://stackoverflow.com/q/28438223
has body: I am using a modal with a contact form on my Bootstrap 3 web page, I would like the modal background image to change when the form is submitted. I have implemented the modal-content image using this class in my custom css: .modal-content { max-height: 370px; background-image: url('../images/img_before_submit.png'); } I have been trying to change the .modal-content background image in my form submit ajax script using the following statement: $('.modal-content').css('background-image', 'url(../images/img_after_submit.png)'); This does not work, how can I change the modal background image?
answer count: 0
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45207442
type: Question
has comment: http://stackoverflow.com/comment/45226464
tagged with: bootstrap-modal
tagged with: javascript
has title: Boostrap 3 - Change css background image javascript
tagged with: css
has comment: http://stackoverflow.com/comment/45238701
tagged with: twitter-bootstrap-3

http://stackoverflow.com/comment/45382406
type: QuestionComment
has text: What version of Chrome are you using? Can you also provide a link to the Test page that you're using?
comment on: http://stackoverflow.com/q/28533797
score: 0
type: Comment

http://stackoverflow.com/a/28465111
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28465017
accepted answer of: http://stackoverflow.com/q/28465017
type: AcceptedAnswer
downvote count: 0
has body: You don't have to interpolate expressions bound to value attributes. Try this: div(ng-controller='progressbarController') progress(data-total="{{sum}}", value="sum") bar(class="stock", value="aPercent") {{ stock }} bar(class="lost", value="bPercent") {{lost}} bar(class="unconfirmed", value="cPercent") {{progress}}
type: Answer
has comment: http://stackoverflow.com/comment/45262394

http://stackoverflow.com/comment/45400226
comment on: http://stackoverflow.com/a/28541650
type: Comment
has text: thanks, How to get id of this dynamic selected list in javascript,
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45376057
has text: The output I'm expecting is "Joe Smith" (without the quotes"
comment on: http://stackoverflow.com/q/28530405
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28454909
type: Answer
answers question: http://stackoverflow.com/q/28454759
has body: Never use children().children(), especially with a potentially unknown DOM structure (and when an ID lookup is as fast as it gets). The usual problem is multiple top level elements in the get result or it is not valid HTML starting with a &lt;. The easiest fix is to wrap it in a dummy element first: jQuery.get('single_lesson.html', function(my_html) { var $div = jQuery('&lt;div&gt;').html(my_html); $div.find('#my_von').attr('id', 'my_von1'); // Now do whatever you want to do with $div.html() or $div.children(); }, 'html');
has comment: http://stackoverflow.com/comment/45236581
score: 0

http://stackoverflow.com/comment/45423124
type: AnswerComment
comment on: http://stackoverflow.com/a/28555171
has text: I mean when you clone with DOM `element` then it also `cloned` and when you submit form then which `DOM element` value post? How can you differentiate? My suggestion is use name like array `parts[]`.
type: Comment
score: 0

http://stackoverflow.com/q/28574519
has title: getElementById is null?
has comment: http://stackoverflow.com/comment/45458720
has comment: http://stackoverflow.com/comment/45458516
score: -1
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45458515
tagged with: http://stackoverflow.com/tag/html
has body: So my code seems to always give me this in console without even executing anything outside of this loop: TypeError: document.getElementById(...) is null The thing is though that this is perfectly legitimate code, it works when I enter it alone or pair it with a random number. Heck, it even outputs all the right things but the rest of my scripts don't even execute with the error so I don't understand. This isn't a one in a lifetime thing since this has happened before on the same project. What's going on? If you want to test, set num to 0 and create some dummy elements. $('[id^=strip]').each(function() { var element = document.getElementById("stripprice" + num); prices[num] = element.innerHTML; console.log(prices[num]); num++; })
has comment: http://stackoverflow.com/comment/45458531
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28575119
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/45458535

http://stackoverflow.com/comment/45321053
type: QuestionComment
comment on: http://stackoverflow.com/q/28500727
score: 0
has text: Thanks but why isn't it <=? What's wrong with mixing btw. Could you elaborate a bit please?
type: Comment

http://stackoverflow.com/comment/45493233
score: 0
type: AnswerComment
has text: Sorry, I've done this and it doesn't work. I made an edit to my question to be more clear.
type: Comment
comment on: http://stackoverflow.com/a/28536597

http://stackoverflow.com/q/28464292
type: Question
downvote count: 0
tagged with: javascript
has body: I want to be able to modify the object I provide the stateHelperProvider.state(obj). I have a module like this: (function() { 'use strict'; angular .module('myApp', []) .config(stateConfig); stateConfig.$inject = ['stateConfigObject', 'stateHelperProvider', 'someProvider']; function stateConfig(stateConfigObject, stateHelperProvider, someProvider) { someProvider.$get().getSomeData().then(function(response) { // use the response here to modify the stateConfigObject }); stateHelperProvider.state(stateConfigObject); } })(); Done that way, there will be an a-sync issue and the stateConfigObject will not be the correct one passed into the stateHelperProvider in the end. The config phase will probably finish before the a-sync stuff finishes. So, is there anyway to make this all happen synchronously? I've tried using the stateHelperProvider inside someProvider.$get() like so, but still no luck: someProvider.$get().getSomeData().then(function(response) { // use the response here to modify the stateConfigObject stateHelperProvider.state(stateConfigObject); });
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
score: 2
answer count: 0
upvote count: 2
has title: How can I modify a state config before using it in the config phase of Angular?

http://stackoverflow.com/q/28584504
upvote count: 2
answer count: 1
tagged with: angularjs-directive
has body: I have a directive that takes a few methods as callbacks. All of them require attributes to work. scope: { onEventOne: '&amp;?', onEventTwo: '&amp;?' } function someWork() { onEventOne()(myVar); onEventTwo()(myOtherVar); } My problem is when I don't have some of those callbacks defined, as they are not all required. &lt;div&gt; &lt;myDirective on-event-one="customHandler"&gt;&lt;/myDirective&gt; &lt;/div&gt; In the code above, when calling onEventOne()(myVar); everuthing works, but when calling onEventTwo()(myOtherVar); I get TypeError: undefined is not a function. I tried using the link function to set a blank function as default, function linkFunction(scope, element, attrs) { if (!attrs.onEventOne) {scope.onEventOne = scope.blankHandler;} if (!attrs.onEventTwo) {scope.onEventTwo = scope.blankHandler;} } but that causes the the default function to be called while still throwing TypeError: undefined is not a function. How do I set these default functions?
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/28584666
downvote count: 0
tagged with: javascript
tagged with: default
tagged with: callback
favorite count: 0
type: Question
has title: AngularJS Directives - specify defaults for callbacks
accepted answer: http://stackoverflow.com/a/28584666
tagged with: angularjs

http://stackoverflow.com/a/28550516
type: Answer
score: 1
upvote count: 1
has body: The way to do this is by creating a new Vector3 and transforming it based on the rotation of the camera, which I assume you have access to programmatically. var coefficient = Player.SPEED * delta * this.q; // Right vector this.v.copy(new THREE.Vector3(1, 0, 0).applyQuaternion(camera.quaternion).multiplyScalar(coefficient));
downvote count: 0
answers question: http://stackoverflow.com/q/28534267

http://stackoverflow.com/a/28504713
answers question: http://stackoverflow.com/q/28504105
score: 2
type: AcceptedAnswer
downvote count: 0
has body: Use the following jQuery to access the values: var radnici = $("tfoot th:nth-child(7)").text(); var gorivo = $("tfoot th:nth-child(8)").text(); var inputi = $("tfoot th:nth-child(9)").text(); After accessing the values, you may pass them to create a chart with google visualization. Here's a DEMO.
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/28504105

http://stackoverflow.com/comment/45225804
comment on: http://stackoverflow.com/q/28448042
has text: This URL is not accessible, may be it's not public.. Please upload a screenshot of the pop up in [imgur](http://imgur.com/) and put here.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46833760
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28439931
type: Comment
has text: @anatoly can you post the xmlhttp implementation for downloading the excel shaeet as attachment. i am also strunggling with the same problem.

http://stackoverflow.com/comment/45219167
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28444603
score: 0
has text: fadeSlideshow.js has no documentation?

http://stackoverflow.com/comment/45411663
score: 0
has text: @BenjaminGruenbaum you can use `.reason()` or `.catch(_ => _)`
type: Comment
comment on: http://stackoverflow.com/a/28538882
type: AnswerComment

http://stackoverflow.com/q/28545398
has answer: http://stackoverflow.com/a/28545504
tagged with: jquery-ui-dialog
has comment: http://stackoverflow.com/comment/45405811
has comment: http://stackoverflow.com/comment/45404107
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45404508
has comment: http://stackoverflow.com/comment/45404020
score: 0
type: UnansweredQuestion
has body: I have a html button <input class="showOptions" type="button" style="width:100%" value="<%= (PRCDMU) %>" onclick="programSelector(this.value)" /> That calls some JavaScript function programSelector(value){ var origin = document.getElementById('origin').value(); if(origin === ""){ $( "#popup" ).dialog( "open" ); } if(origin === "Product Specification"){ url = 'http://brmappsvr:7018/Enquiries/CMENPROC.rpgle?ProductCode=' + value; window.location.href = url; }elseif(origin === "Future Requirements Forecast") url = 'http://brmappsvr:7018/Enquiries/CMENPRF.rpgle?ProductCode=' + value; window.location.href = url; } However a part of this process is a pop up in Jquery. $(".showOptions").click(function(){ var $self = this.value; $( "#popup" ).dialog({ modal: true, width: 465, draggable: true, buttons: { "Product Specification": function() { window.location.href = 'http://brmappsvr:7018/Enquiries/CMENPROC.rpgle?ProductCode=' + $self; $( this ).dialog( "close" ); }, "Future Requirements Forecast": function() { //cancel window.location.href = 'http://brmappsvr:7018/Enquiries/CMENPRF.rpgle?ProductCode=' + $self; $( this ).dialog( "close" ); } } }); }); The issue I have is that the popup is appearing regarless, whereas It is only meant to appear depending on the contents of the origin variable, if it's empty the pop up should work EDIT: origin is displayed on a html page. Please click on the Product Code, to use it within the <%= (origin) %> program.
type: Question
has comment: http://stackoverflow.com/comment/45404368
has title: Issue with code running regardless
answer count: 2
tagged with: button
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28545447

http://stackoverflow.com/comment/66111566
comment on: http://stackoverflow.com/a/30001969
score: 1
type: AnswerComment
has text: Just remember: “The scope is not the model, the scope **refers** to the model” and “Whenever you have ng-model **there’s gotta be a dot** in there somewhere. If you don’t have a dot, you’re doing it wrong.” [more](http://jimhoskins.com/2012/12/14/nested-scopes-in-angularjs.html)
type: Comment

http://stackoverflow.com/q/28449581
has title: Javascript change CSS class background image from AJAX if-loop
type: Question
tagged with: php
has body: I have this CSS: .modal-content { max-height: 370px; background-image: url('../images/img_before_submit.png'); } And I am having a php-mail script that will respond with and "ok" for a successful mail sending or "bad" for an error. I am using a AJAX script for mail handling: success:function(response) { if(response == 'ok') { $('.modal-content').css('background-image', 'url(images/success.png)'); sleep(2000); alert(response); } else { $('.modal-content').css('background-image', 'url(images/error.png)') sleep(2000); alert(response); } } From the console and outside the if-loop in the AJAX this code work as expected: $('.modal-content').css('background-image', 'url(images/img.png)'); But inside the AJAX if-loop this code does not apply, but the correct alert msg response is coming through and is showing up! How can I set the background-image from within the if-loop?
tagged with: css
has comment: http://stackoverflow.com/comment/45227222
has comment: http://stackoverflow.com/comment/45227901
score: 0
has comment: http://stackoverflow.com/comment/45228006
answer count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
tagged with: ajax
has comment: http://stackoverflow.com/comment/45229530
has comment: http://stackoverflow.com/comment/45227261

http://stackoverflow.com/comment/45320768
score: 0
type: Comment
type: QuestionComment
has text: @raina77ow Well.. it does work when I put it inside one file, I mean filter and controller, but when I separate controller to one file and filer to another it does not work.
comment on: http://stackoverflow.com/q/28499794

http://stackoverflow.com/comment/45233380
has text: Looks like a simple margin/padding issue on the header to me...reset.css?
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28453081

http://stackoverflow.com/q/28438682
possible better answer: http://stackoverflow.com/a/28438805
has answer: http://stackoverflow.com/a/28438730
has answer: http://stackoverflow.com/a/28439246
has body: I'm confused here, when the if is true it does not go back to the first index. I don't know why I have done it before, but I did not save in a safe place. Now I have spent a lot of time looking for the solution, can someone help me? var digital = document.getElementById("placeDiv").style; var abc = ["red","blue","green"]; for(var i=0;i&lt;3;i++){ digital.backgroundColor=abc[i];alert(i);if(abc["green"]){i=0}; };
has title: Why doesn't this loop return to the first index?
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28438820
accepted answer: http://stackoverflow.com/a/28438730
type: Question
tagged with: indexing
tagged with: javascript
has answer: http://stackoverflow.com/a/28438805
has comment: http://stackoverflow.com/comment/45207378
has comment: http://stackoverflow.com/comment/45207194
score: 0
tagged with: for-loop

http://stackoverflow.com/comment/45439808
has text: See it in action in this plunkr: http://embed.plnkr.co/HMds4u6CWhiuCZ2KXw8D/preview keep in mind you used ` ` so make sure the username is an email address.
type: Comment
comment on: http://stackoverflow.com/a/28562371
score: 0
type: AnswerComment

http://stackoverflow.com/q/28568043
has comment: http://stackoverflow.com/comment/45601519
has comment: http://stackoverflow.com/comment/45583519
favorite count: 0
tagged with: route-provider
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45523532
has comment: http://stackoverflow.com/comment/45486540
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45501668
has comment: http://stackoverflow.com/comment/45542484
has comment: http://stackoverflow.com/comment/45542526
upvote count: 3
has answer: http://stackoverflow.com/a/28730091
type: Question
tagged with: firebase
score: 3
tagged with: javascript
has body: I'm having a problem loading a record from firebase into my view when directly linking to the intended route with the key as a routeParam. As shown below in my routeProvider I've specified the param later called in the SpecController. The problem is, if I directly type the url in or click an offsite link the model bindings are all "undefined" indicating that the record is not loaded. // Snippet from RouteProvider .when('/spec/:urlKey', { templateUrl: 'views/spec.html', controller: 'SpecController', controllerAs: 'spec' }) // Snippet from SpecController var cKey = $routeParams.urlKey; this.check = this.checkList.$getRecord(cKey); After a bit of research it seems I should call a resolve in the routeprovider and run that second bit of code. Though I'm not sure if that's the problem or if it has to do with the way angular loads itself and the routeparams as well as the order thereof. Just as a side note it is fully functional when I load the application from a separate route/view and then click a link within the application which then uses $location to set the url and param as shown below. // Snippet from ListController this.viewCheck = function(check){ var ref = this.checkList.$keyAt(check); $location.path('/spec/'+ref); }; The "key" I'm referring to as well as all other additional functions I'm using and referring to can be found directly at the following section of the Firebase API Guide: https://www.firebase.com/docs/web/libraries/angular/guide.html#section-arrays I can't really reproduce the issue in a fiddle because the only way it happens is if you directly place the link in the url of a browser. I've made a small video showing the problem. When the video opens you see the result of entering the url directly, then by simply clicking "Home" and then "Back" it then loads appropriately. http://screencast.com/t/4OKRTVnc
has comment: http://stackoverflow.com/comment/45719052
has comment: http://stackoverflow.com/comment/45719149
accepted answer: http://stackoverflow.com/a/28730091
has comment: http://stackoverflow.com/comment/45596749
has comment: http://stackoverflow.com/comment/45743453
answer count: 1
downvote count: 0
has title: Incomplete View Loading Before Firebase GetRecord is Resolved

http://stackoverflow.com/q/28477428
upvote count: 9
has answer: http://stackoverflow.com/a/75432355
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45283224
has answer: http://stackoverflow.com/a/28487683
tagged with: click
tagged with: simulate
answer count: 3
has comment: http://stackoverflow.com/comment/45283838
possible better answer: http://stackoverflow.com/a/28477683
has title: Simulate click on GMail div button with JS
has answer: http://stackoverflow.com/a/28477683
has body: I want to simulate click on GMail COMPOSE button using JS without JQuery. Here is button: COMPOSE Here is my js: var element = document.getElementsByClassName('T-I-KE')[0]; element.click(); Result:undefined in all browsers Image: https://i.sstatic.net/Mkscf.png Already tried that: var event = document.createEvent("MouseEvent"); event.initEvent("click",true,true); var element=document.getElementsByClassName("T-I-KE")[0]; element.dispatchEvent(event); Result:true. But nothing happens. Image: https://i.sstatic.net/H3KSH.png
favorite count: 0
has comment: http://stackoverflow.com/comment/122035459
linked to: http://stackoverflow.com/q/11764989
score: 9
linked to: http://stackoverflow.com/q/10213703
accepted answer: http://stackoverflow.com/a/28487683
tagged with: gmail
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/24025165
type: Question

http://stackoverflow.com/q/28560257
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
upvote count: 1
tagged with: ruby-on-rails
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45432043
has title: Rails: Calling to_json method in HTML
score: 1
has comment: http://stackoverflow.com/comment/45432116
has comment: http://stackoverflow.com/comment/45455863
has body: How would I call .to_json on data-filters below? data-filters="&lt;%= t.AB_filterRules %&gt;" The reason I ask is because I have the data-filters attribute in my HTML ERB file, and it displays the database attributes. Example below: data-filters="[[{" noun":"app","comparison":"was","value":”opened in the last two days"},{"noun":"deliverable","comparison":"is","value":"push notification"}]]" However, when I view the value of the data-filters attribute in console, it only shows: "[[{" I'd really like it all to be displayed, so calling .to_json would be very helpful here! Thanks
type: Question
accepted answer: http://stackoverflow.com/a/28581308
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45469051
has answer: http://stackoverflow.com/a/28581308
tagged with: ruby-on-rails-4

http://stackoverflow.com/comment/45238790
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28452492
has text: OK, that makes perfect sense (and I should have already thought of that – apologies) so final piece of the puzzle; is the external stylesheet xlink reference from within the object not working for the same reasons that external use isn't working?
type: AnswerComment

http://stackoverflow.com/a/28540761
has comment: http://stackoverflow.com/comment/45395706
score: 2
has comment: http://stackoverflow.com/comment/45395093
downvote count: 0
has body: You have put a single quote after style= attribute instead of double quotes and also you forget to put double quotes at the end of style attribute. $(this).html().replace(/&lt;span class="gradientizer-done" style="color:rgb\(\d{1,3},\d{1,3},\d{1,3}\)"&gt;.&lt;\/span&gt;/g,''); ^ ^
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28540721
answers question: http://stackoverflow.com/q/28540721
has comment: http://stackoverflow.com/comment/45395157
type: Answer

http://stackoverflow.com/a/29661512
type: Answer
has body: While this may not help the poster due to the age of this question, I hope this will help any that find this searching like I did, specifically for the Kendo().CheckBoxFor while editing a grid item. I was able to check/uncheck the way listeeeek mentioned but due to the under the hood stuff in kendo, the model it was bound to was not updating. I added the second line here to update the model $("#CHECKBOXNAME").prop('checked', desiredBool); $('#GRIDNAME').data().kendoGrid.editable.options.model.CHECKBOXITEM = desiredBool; Hope this helps.
answers question: http://stackoverflow.com/q/28489140
score: 0

http://stackoverflow.com/q/28533091
downvote count: 0
favorite count: 0
score: 9
type: Question
answer count: 2
tagged with: pac
has body: What is the difference between shExpMatch() and dnsDomainIs() The definition says: // dnsDomainIs() // Evaluates hostnames and returns true if hostnames match. Used mainly to match and exception individual host names. // Example: if (dnsDomainIs(host, ".google.com")) return "DIRECT"; // shExpMatch() // Attempts to match hostname or URL to a specified shell expression and returns true if matched. // Example: if (shExpMatch(url, "*vpn.domain.com*") || shExpMatch(url, "*abcdomain.com/folder/*")) return "DIRECT"; If I understand it correct then shExpMatch() - can use some wildcards dnsDomainIs() - can use exact names Is shExpMatch() just superior to dnsDomainIs()
upvote count: 9
tagged with: javascript
type: UnansweredQuestion
has title: PAC - JavaScript - shExpMatch() vs dnsDomainIs()
has answer: http://stackoverflow.com/a/42709121
has answer: http://stackoverflow.com/a/28899921

http://stackoverflow.com/a/28443439
has body: This should give you a start. It passes through the images and determines which column the image is currently placed in using simple arithmetic, as well as the total height of each column. var images = document.getElementsByTagName('img'), cols = [], colHeights = [], baseOffset = images[0].offsetLeft; for (var i=0; i &lt; images.length; i++) { var img = images[i]; var col = Math.round( (img.offsetLeft - baseOffset) / img.width ); if (!cols[col]) { cols[col] = []; colHeights[col] = 0; } cols[col].push( img ); var bottom = img.offsetTop + img.offsetHeight; if (bottom &gt; colHeights[col]) colHeights[col] = bottom; } console.log(cols, colHeights);
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28443014
answers question: http://stackoverflow.com/q/28443014

http://stackoverflow.com/q/28525319
has answer: http://stackoverflow.com/a/28525480
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45366526
has answer: http://stackoverflow.com/a/28525353
has comment: http://stackoverflow.com/comment/45366605
has body: In one PHP file I have a variable named $difficulty. I need to access this file in my javascript file, game.js. I have tried this inside my game.js file: userDif = "&lt;?php echo json_encode($difficulty); ?&gt;"; console.log("Difficulty " + userDif); However, this does not work, it just prints out "&lt;?php echo json_encode($difficulty); ?&gt;" I have also tried just: userDif = &lt;?php echo json_encode($difficulty); ?&gt;; But then you get an error as it doesn't expect "&lt;" Any help would be greatly appreciated. Edit: Apologies: This has already been answered! I was just searching for the wrong thing. Sorry!
tagged with: javascript
has comment: http://stackoverflow.com/comment/45366527
score: 0
duplicate of: http://stackoverflow.com/q/13840429
has comment: http://stackoverflow.com/comment/45366532
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/45366798
has title: Struggling to use PHP inside JavaScript
linked to: http://stackoverflow.com/q/13840429

http://stackoverflow.com/comment/45446724
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28567693
type: AnswerComment
has text: The `...` makes your comment sound possibly condescending. If that's the case, then I'm simply trying to be helpful.

http://stackoverflow.com/q/28494826
tagged with: meteor
has answer: http://stackoverflow.com/a/28502290
accepted answer: http://stackoverflow.com/a/28502290
has title: How to render back form errors to a template?
type: Question
type: AnsweredQuestion
has body: so I'm dead new to MeteorJS, and am implementing error handling for a form. I'm using the simple-validation so I get a list of error keys and an error message. Is there a way I can return them in the controller event handler, so that I can just evaluate them in a {{}} tag? Let's say I have a simplified handler //New thread form on forum page Template.forum_details.events({ "submit .new-thread": function (event) { var errors = [{field: 'title',error: 'title is required'}] // Prevent default form submit return false; } }); Can I render these errors in the template, or do I need to use jquery/etc? I was hoping to be able to just modify the template data and evaluate with e,g. {{#each errors}} Edit: Thanks to the answer below, I was able to come up with the following, which works great! errors.js: throwError = function(field,message) { //format the 'required' error type to make it look a little more readable... if(message == 'required') { message = field + " is required."; } Errors.insert({field:field,message: message}); }; if (Meteor.isClient) { Template.errors.helpers({ errors: function() { return Errors.find(); } }); Template.registerHelper('hasError', function(key) { //console.log("Checking for key:" + key); if(Errors.find({field:key}).count() &gt; 0) { return true; } else { return false; } } ); Template.error.helpers({ //Return the error for the specified key error: function(key) { return Errors.findOne({field:key}); }, message: function(key) { //console.log("Finding message for key: " + key); //console.log(key); Errors.findOne({field:key}).message; return Errors.findOne({field:key}).message; } }); } Errors.html &lt;template name="errors"&gt; &lt;div class="errors"&gt; {{#each errors}} {{&gt; error}} {{/each}} &lt;/div&gt; &lt;/template&gt; &lt;template name="error"&gt; {{#if hasError key }} &lt;div class="alert alert-danger" role="alert"&gt; &lt;button type="button" class="close" data-dismiss="alert"&gt;&amp;times;&lt;/button&gt; {{message key}} &lt;/div&gt; {{/if…
score: 0
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28496320
possible better answer: http://stackoverflow.com/a/28496320

http://stackoverflow.com/a/28544154
type: Answer
has body: Here is the working fiddle for your problem. Refer to this fiddle example https://jsfiddle.net/YameenYasin/gk22kvyw/17/ I have created a test table with two columns Name and Address. It has an Edit link that shows the popup modal. I have created a hidden radio button that shows which row was selected. &lt;table class="table table-bordered table-stripped"&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Address&lt;/th&gt; &lt;th&gt;Action&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="name"&gt;Name1&lt;/td&gt; &lt;td class="address"&gt;Address1&lt;/td&gt; &lt;td class="edit"&gt;&lt;a href="javascript:void(0);"&gt;Edit&lt;/a&gt; &lt;input hidden type="radio" name="select"&gt; &lt;/td&gt; &lt;tr&gt; &lt;tr&gt; &lt;td class="name"&gt;Name2&lt;/td&gt; &lt;td class="address"&gt;Address2&lt;/td&gt; &lt;td class="edit"&gt;&lt;a href="javascript:void(0);"&gt;Edit&lt;/a&gt; &lt;input hidden type="radio" name="select"&gt;&lt;/td&gt; &lt;tr&gt; &lt;/table&gt; &lt;!-- Modal --&gt; &lt;div class="modal fade" id="checkInModal" 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;Check In&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;div class="row"&gt; &lt;div class="col-md-12"&gt; &lt;label&gt;Name:&lt;/label&gt; &lt;input type="text" class="form-control" id="editName"&gt; &lt;/div&gt; &lt;div class="col-md-12"&gt; &lt;label&gt;Address:&lt;/label&gt; &lt;input type="text" class="form-control" id="editAddress"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt; &lt;button type="button" class="btn btn-primary btn-save"&gt;Save…
accepted answer of: http://stackoverflow.com/q/28543144
score: 0
answers question: http://stackoverflow.com/q/28543144
type: AcceptedAnswer

http://stackoverflow.com/q/28445253
has title: Trying To Store Value
answer count: 5
tagged with: input
downvote count: 3
score: -3
has answer: http://stackoverflow.com/a/28445285
has answer: http://stackoverflow.com/a/28445263
has answer: http://stackoverflow.com/a/28445309
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28445285
accepted answer: http://stackoverflow.com/a/28445263
has comment: http://stackoverflow.com/comment/45222002
has answer: http://stackoverflow.com/a/28445325
has body: &lt;input id="value"&gt; app.js has var userNum = $('#value').val(); load browser and type 10 now in chrome console I type userNum but it shows "" Why is it "" and not 10
type: Question
has answer: http://stackoverflow.com/a/28445288
upvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/45413760
type: QuestionComment
comment on: http://stackoverflow.com/q/28550264
score: 0
has text: `var frame = document.createElement('frame'); frame.src = "'site2.html?var=' + variable; document.getElementById('frameId').appendChild(frame);` Might work. Completely untested.
type: Comment

http://stackoverflow.com/comment/45350442
has text: it does same as I do not want. on click of "history" it marks "about" and "vision" as well as "history". What I want is if I select " history" it should mark only" history" and "about"
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28507532
type: Comment

http://stackoverflow.com/comment/45235426
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28453677
has text: @dfsq, it has good ideas. 1. clone table, than modify it and replace child...

http://stackoverflow.com/a/28458832
has comment: http://stackoverflow.com/comment/45244274
type: Answer
has comment: http://stackoverflow.com/comment/45244204
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28458679
answers question: http://stackoverflow.com/q/28458679
score: 1
has body: By returning inside forEach callback won't prevent code outside from executing. In this case it's better to use Array.prototype.some method to check if array contains necessary value, and after that use simple if block to return or continue. $scope.addFav = function ($text, $link, $icon) { var $favlist = $scope.favorites, found = $favlist.some(function (element, index, array) { return element.name == $text; }); if (found) { return false; } $favlist.unshift({ href: $link, name: $text, icon: $icon }); if ($favlist.length &gt; 5) $favlist.pop(); $scope.favorites = $favlist; return false; };
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/45304160
type: Comment
has text: Are those first values meant to be parsed as month/year dates or as math expressions? And, are you using the second value to break ties?
comment on: http://stackoverflow.com/q/28491628
type: QuestionComment
score: 0

dreamweaver
type: Tag
tag name: dreamweaver
tags question: http://stackoverflow.com/q/28570924

http://stackoverflow.com/comment/48215905
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29922474
type: AnswerComment
has text: I doesn't have anything to do with VSync. For some reason Chrome just doesn't like to update windows with high resolutions. If I have a maximized window, it's 20fps. Maximized window with half the resolution, still 20 fps. However, if I shrink the window to half, it increases fps immensely. Firefox doesn't display this issue.

windows-server-2008-r2
tag name: windows-server-2008-r2
tags question: http://stackoverflow.com/q/28551276
type: Tag

http://stackoverflow.com/comment/45443130
has text: @JosephNields If this doesn't work for you, you're doing something wrong.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28565800
type: Comment

http://stackoverflow.com/q/28466951
tagged with: leaflet
score: 1
type: Question
has title: mapbox leaflet javascript pane layer control
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28467308
tagged with: layer
has body: I'm using an approach to create a 'map sandwich' whereby I have a basemap, an overlay layer, and then another tile layer (labels) on top (in a new pane). The problem comes when I try to toggle the labels in a layer control. I can toggle off the layer just fine. However, when I try to re-add the labels, they appear underneath the overlay layer. It seems like the layer control should remember to put layers back in the same order. Regardless, is there any workaround? Here is a JSFiddle which recreates the problem concisely. Fiddle Layer Control Problem var mbstyle = L.mapbox.tileLayer('statecodemog.aa380654'); var mblabels = L.mapbox.tileLayer('statecodemog.798453f5', { 'clickable': 'false' }); var map = L.map("map", { zoom: 8, center: [39, -104.8], minZoom: 4, layers: [mbstyle] }); //create map sandwich var topPane = map._createPane('leaflet-top-pane', map.getPanes().mapPane); var topLayer = mblabels.addTo(map); topPane.appendChild(topLayer.getContainer()); var baseLayers = { "Mapbox: Contrast Base": mbstyle }; var groupedOverlays = { "Labels and Borders": mblabels }; L.control.layers(baseLayers, groupedOverlays).addTo(map); var circle = L.circle([39, -104.8], 200000, { color: 'red', fillColor: '#f03', fillOpacity: 0.5 }).addTo(map);
answer count: 1
downvote count: 0
favorite count: 0
tagged with: mapbox
tagged with: pane
upvote count: 1
has answer: http://stackoverflow.com/a/28467308
type: AnsweredQuestion

http://stackoverflow.com/q/28565254
has title: How to use Qt WebEngine and QWebChannel?
linked to: http://stackoverflow.com/q/39649807
answer count: 4
tagged with: c++
has answer: http://stackoverflow.com/a/61016834
has comment: http://stackoverflow.com/comment/50606630
type: UnansweredQuestion
upvote count: 21
tagged with: qtwebchannel
tagged with: qt
has answer: http://stackoverflow.com/a/62210448
tagged with: qtwebengine
score: 21
has answer: http://stackoverflow.com/a/36601118
has answer: http://stackoverflow.com/a/34049809
has body: I'm using the new WebEngine to play around and learn. I've been trying to find some similar methods found using Qt WebKit: addToJavaScriptWindowObject() I found that using Qt WebEngine, I have to use the QWebChannel to register functions to the JavaScript window object. If this is correct, it takes me to the following question. I've installed Qt 5.4.0 on my computer. I noticed that qwebchannel.js is not found in the SDK installed on my computer. I found it on the Git source. If I have a Qt native desktop application with a QWebEnginePage and QWebEngineView, what do I need to be able to register functions on the JavaScript window object? My desktop application navigates automatically to a http page that I have created. So I have access to the content connected to the QWebEngineView. What are the steps to take so I can make this work?
type: Question
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/a/38799918
has body: Adding to Perry Tew's answer, if you have negative dollar amounts on your axes (e.g. when displaying a profit/loss chart), you can use this: ticks: { callback: function(value, index, values) { if(parseInt(value) &gt; 999){ return '$' + value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); } else if (parseInt(value) &lt; -999) { return '-$' + Math.abs(value).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); } else { return '$' + value; } } } The correct format for displaying negative currencies is -$XXX, so we prepend -$ to the value, and then run it through Math.abs(), which converts it to positive.
score: 10
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28523394
upvote count: 10

http://stackoverflow.com/q/28478597
tagged with: django-templates
type: Question
has title: Using django template tag inside javascript
has comment: http://stackoverflow.com/comment/45281085
tagged with: javascript
has body: I'm developing a project that have not any slug field and this value create in template by: I have to use slug an jquery code, but variable aleays empty: $("select#model").click(function() { var u = $(this).find(":selected").val(); var slg = $(this).find(":selected").text(); var slug = ""; window.location.href("link that createt with u and slug); }); Is there anyway to using django template tag inside javascript? Edit : I have a queryset: Model.objects.all() How can I add manually field in this queryset?
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/1053902
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28478665
has answer: http://stackoverflow.com/a/28488118
tagged with: django

http://stackoverflow.com/comment/45230829
type: QuestionComment
has text: Ah no worries @TomD'Hulster
score: 0
comment on: http://stackoverflow.com/q/28450955
type: Comment

http://stackoverflow.com/q/28449893
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45227818
has comment: http://stackoverflow.com/comment/45228381
has comment: http://stackoverflow.com/comment/45227832
has comment: http://stackoverflow.com/comment/45229209
has comment: http://stackoverflow.com/comment/45228324
has comment: http://stackoverflow.com/comment/45230706
has comment: http://stackoverflow.com/comment/45228342
has comment: http://stackoverflow.com/comment/45227876
upvote count: 1
has title: Javascript Function is not Called onclick() and onsubmit()
downvote count: 1
has comment: http://stackoverflow.com/comment/45227798
type: Question
has comment: http://stackoverflow.com/comment/45227855
has comment: http://stackoverflow.com/comment/45228356
tagged with: javascript
has comment: http://stackoverflow.com/comment/45228220
score: 0
has answer: http://stackoverflow.com/a/28450284
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/45228703
favorite count: 0
has body: Can anyone tell me why below javascript functions are not calling while clicking the button or submitting the form. I am not getting wht is the wrong with this code. Please help &lt;script type="text/javascript"&gt; function confrm() { alert("check1"); if(confirm("Are you going to submit this form?")==true) { return true; } else { return false; } } function checkfrm() { var selcteddate=document.newrequest.sel.value; var sdate=new Date(selcteddate); alert("check 2"); if(document.newrequest.server.value=="select") { alert("Select server"); return false; } else { return true; } } &lt;/script&gt; &lt;form id="newrequest" name="newrequest" method=post action="cgi-bin/newrequest.cgi" onsubmit="return checkfrm();"&gt; &lt;td colspan=2&gt; &lt;input type="submit" id="submit" name="submit" value="Submit" onclick="return confrm();" /&gt; &lt;/td&gt;

http://stackoverflow.com/comment/45376298
type: Comment
type: QuestionComment
score: 0
has text: @void by removing I mean empty, see the code with an empty() ?
comment on: http://stackoverflow.com/q/28530415

http://stackoverflow.com/a/28560903
has comment: http://stackoverflow.com/comment/127122551
type: Answer
answers question: http://stackoverflow.com/q/28560801
score: 14
upvote count: 14
downvote count: 0
has body: In pseudocode, the logic would be the following: Procedure: comparator(a,b) If a &lt; b then return -1 If a = b then call comparator(a1, b1) recursively, where a1 and b1 are the comparable values of the next level in the sorting. If a &gt; b then return 1 In your concrete case, you can do simply do it by modifying your code a bit: if (keyA &lt; keyB) { return -1; } else if (keyA &gt; keyB) { return 1; } else { // keyA == keyB if (titleA &lt; titleB) { return -1; } else if (title &gt; titleB) { return 1; } else { return 0; } }

http://stackoverflow.com/q/28538406
has comment: http://stackoverflow.com/comment/45392116
has comment: http://stackoverflow.com/comment/45392232
has comment: http://stackoverflow.com/comment/45391549
type: UnansweredQuestion
tagged with: cryptojs
tagged with: aes
has title: Different Outputs for AES Encryption using CryptoJS and AES Encryption in Java
answer count: 0
tagged with: java
has comment: http://stackoverflow.com/comment/45391753
type: Question
has comment: http://stackoverflow.com/comment/45392656
has comment: http://stackoverflow.com/comment/45396294
has body: I'm trying to encrypt data using AES encryption using cryptoJS. I want to transfer the encrypted data To / From the Device / Server. But i'm getting different AES encrypted outputs from device and server(Java). Following is my code: Mobile side(USing Titanium Appcelerator): var AES_File = require("aes"); var Pad_File = require("pad-nopadding-min"); function encrypt_data(message) { Titanium.API.info("encrypt_data : "+message); var key = AES_File.CryptoJS.enc.Latin1.parse('0123456789abcdef'); var iv = AES_File.CryptoJS.enc.Latin1.parse('fedcba9876543210'); //var key = AES_File.CryptoJS.enc.Hex.parse('0123456789abcdef'); //var iv = AES_File.CryptoJS.enc.Hex.parse('fedcba9876543210'); var message = "soldier"; var padMsg = padString(message); var encrypted = AES_File.CryptoJS.AES.encrypt(padMsg, key, { iv: iv, pad: AES_File.CryptoJS.pad.NoPadding, mode: AES_File.CryptoJS.mode.CBC}); Titanium.API.log("Encrypted: " + encrypted); Titanium.API.log("Encrypted text: " + encrypted.ciphertext); return encrypted; }; function padString(source) { var paddingChar = ' '; var size = 16; var x = source.length % size; var padLength = size - x; for (var i = 0; i &lt; padLength; i++) source += paddingChar; return source; } exports.encrypt_data = encrypt_data; My Java code on Server : import java.security.Key; import javax.crypto.Cipher; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; import sun.misc.*; public class AesCipher { private static final String algorithm = "AES/CBC/NoPadding"; private static final byte[] keyValue = new byte[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; private static final byte[] ivValue = new byte[] { 'f', 'e', 'd', 'c', 'b', 'a', '9', '8', '7', '6', '5', '4', '3', '2', '1', '0' }; private static final IvParameterSpec ivspec = new IvParameterSpec(ivValue); private static final SecretKeySpec keyspec = new SecretKeySpec(keyValue, "AES"); final protected static char[] hexArray = "0123456789a…
tagged with: javascript
has comment: http://stackoverflow.com/comment/45392084
score: 0
has comment: http://stackoverflow.com/comment/45392936
tagged with: appcelerator

http://stackoverflow.com/a/28577104
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28576750
score: 1
upvote count: 1
has body: your way is also good, but if you find better way to do this, try following : High Scores: your script goes here: (function() { var highScoreArr = [["Dummy1","10"], ["Dummy2", "10"], ["Dummy3", "40"], ["Dummy4", "80"], ["Dummy5", "60"]], template = $.trim( $('#scoreTemplate').html() ), chunk = ''; $.each( highScoreArr, function( index, obj ) { chunk += template.replace( /{{player}}/ig, obj[0] ) .replace( /{{score}}/ig, obj[1] ); }); $('.template-inner').append(chunk); })();

http://stackoverflow.com/comment/53685215
comment on: http://stackoverflow.com/a/28585813
score: 0
type: AnswerComment
type: Comment
has text: It's VERY IMPORTANT to create and set an API key, so don't forget!

mean
tags question: http://stackoverflow.com/q/28520874
tag name: mean
type: Tag

http://stackoverflow.com/a/29084258
accepted answer of: http://stackoverflow.com/q/28545144
upvote count: 2
answers question: http://stackoverflow.com/q/28545144
type: Answer
score: 2
type: AcceptedAnswer
downvote count: 0
has body: i had same issue and found the answer here from @enyo: https://github.com/enyo/dropzone/issues/209 Basically the addedfile.call is a bit clumsy and you need replace this line by the following: myDropzone.emit("addedfile", file); This way the "addedfile" function is called properly. Cheers

http://stackoverflow.com/comment/45480744
type: Comment
type: QuestionComment
has text: Well, in the [API](http://api.highcharts.com/highcharts#plotOptions.series.states.hover) you won't find anything to update font size. Solution may be to use [mouseOver](http://api.highcharts.com/highcharts#plotOptions.series.point.events.mouseOver) event and update point there. And update again on `mouseOut`. Regarding working in the jsFiddle - update Highcharts to 4.1.1.
score: 0
comment on: http://stackoverflow.com/q/28573267

http://stackoverflow.com/q/28540942
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: symfony
has title: responsiveSlides multiple slides in the same page
type: UnansweredQuestion
has body: I have a problem with responsiveSlides(http://responsiveslides.com/). i cant add // multiple sliders with diferents ID, the frist load but the rest only shows the first image. The JS: $(function() { $("#slider1").responsiveSlides({ auto: false, pagination: true, nav: true, fade: 500, maxwidth: 800 }); $("#2-bedroom-apartment").responsiveSlides({ auto: false, pagination: true, nav: true, fade: 500, maxwidth: 800 }); $("#luxury-penthouse").responsiveSlides({ auto: false, pagination: true, nav: true, fade: 500, maxwidth: 800 }); }(jQuery)); The twig code: {% for seccion in imagenes %} {% if loop.first %} &lt;h3 class="social-links editor"&gt;&lt;a href="#slider{{ seccion.id }}"&gt;&lt;i class="fa fa-camera-retro"&gt;&lt;/i&gt;&amp;nbsp;&amp;nbsp;{{ habitacion.etiqueta }}&lt;/a&gt; &lt;/h3&gt; &lt;div class="clearfix"&gt;&lt;/div&gt; &lt;a href="#slider{{seccion.habitacion.slug }}"&gt; &lt;img src=""&gt; &lt;/a&gt; &lt;div id="slider{{seccion.habitacion.slug }}" class="modalDialog"&gt; &lt;div&gt; &lt;a href="#close" title="Close" class="close"&gt;X&lt;/a&gt; &lt;div class="rslides_container img-responsive"&gt; &lt;ul class="rslides" id="{{seccion.habitacion.slug }}"&gt; {% for seccion in imagenes %} &lt;li&gt;&lt;img src="{{ asset(seccion.imagen.webPath) }}" alt="{{ seccion.imagen.alt }}" title="{{ seccion.imagen.descripcion }}"&gt; &lt;/li&gt; {% endfor %} &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; {% endif %} {% endfor %} The web: uhuru.aforrador.com/en/photo-gallery
type: Question
score: 0
has answer: http://stackoverflow.com/a/28541407

http://stackoverflow.com/comment/45293949
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28486000
has text: Would there possibly be a way of calling an angular function from within limelightPlayerCallback like function `limelightPlayerCallback (playerId, eventName, data){ angularCallback(playerId,eventName,data); }`
score: 0

http://stackoverflow.com/comment/45370175
type: AnswerComment
comment on: http://stackoverflow.com/a/28513318
has text: @bg2982 I don't know what CSS you used so I cannot give you a better suggestion since I cannot see your code. Forcing something to position -400px seems like you did something wrong.
score: 0
type: Comment

http://stackoverflow.com/comment/45270900
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28473516
type: QuestionComment
has text: ... and a http://jsfiddle.net would be even better.

http://stackoverflow.com/comment/45404288
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28545354
type: Comment
has text: Thanks a lot ! It works ! :) (Sorry if my question was stupid but it's the first I use programmation language)

http://stackoverflow.com/comment/45449322
type: AnswerComment
type: Comment
has text: Just tired, same effect. This was a good suggestion though and one I have not tried, any other suggestions?
score: 1
comment on: http://stackoverflow.com/a/28569497

http://stackoverflow.com/comment/45410864
comment on: http://stackoverflow.com/a/28548838
score: 1
type: AnswerComment
type: Comment
has text: I think before we can continue to down vote this answer, we should have the op clarify the question. This would have been my answer given my interpretation of the question.

http://stackoverflow.com/comment/45459038
type: Comment
type: QuestionComment
has text: @MichaelColeman I'm adding the script via a page via the Text tab... Do I need a special plugin to run script directly from a page?
comment on: http://stackoverflow.com/q/28574685
score: 0

http://stackoverflow.com/q/28499792
has answer: http://stackoverflow.com/a/28500065
type: Question
tagged with: javascript
score: 0
answer count: 1
tagged with: web
has title: How to deliver a Web Library
type: UnansweredQuestion
has body: I started to develop a library for web applications. Now I see the problem when deliver the new application to the customer with the complete library, because the customer gets the whole library, but he didn't pay for. I was not able to find a strategy in web development on the Internet to solve this. My thought was to somehow strip the library on build time to the needed dependencies. But I dont know how. What is best practice to approach this issue?

http://stackoverflow.com/comment/45318609
score: 0
type: AnswerComment
type: Comment
has text: You realise that your 'AlwaysAtTheEnd` list-item isn't moving anywhere in your demo?
comment on: http://stackoverflow.com/a/28499407

http://stackoverflow.com/comment/45261220
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28467847
has text: what is the generated HTML and JS?

http://stackoverflow.com/a/28543791
score: 2
upvote count: 2
has body: I will try to explain the difference. Explain of first code example: if (a=b=c) {console.log('something')}; // Code above means: if (c) {console.log('something')}; // So if Boolean(c) is false, console.log will not work Explain of second example: if ( (a=b)&amp;&amp;(a=c)&amp;&amp;(b=c) ) {console.log('something')}; // Code above means: if (b &amp;&amp; c &amp;&amp; c) {console.log('something')}; // So if Boolean(c) or Boolean(b) is false, console.log will not work An assignment operator assigns a value to its left operand based on the value of its right operand and return the value of its right operand.
downvote count: 0
has comment: http://stackoverflow.com/comment/45402674
answers question: http://stackoverflow.com/q/28543611
type: Answer

http://stackoverflow.com/q/28498076
linked to: http://stackoverflow.com/q/3255
has body: I would need to determin the Big O of this short code: var iterations = 0; function operation(num){ iterations++; if (num == 0) return 1; return operation(Math.floor((num / 10) * 2)); } var result = operation(1000); alert('Result = ' + result + ', number of iterations = ' + iterations); I came up with something around O(log(logN)) but I'm not sure. Would you please help me a bit? http://jsfiddle.net/qotbu5pq/2/
has comment: http://stackoverflow.com/comment/45315548
accepted answer: http://stackoverflow.com/a/28499026
type: AnsweredQuestion
score: 2
upvote count: 3
has comment: http://stackoverflow.com/comment/45317132
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28499026
tagged with: algorithm
has comment: http://stackoverflow.com/comment/45315540
tagged with: javascript
has title: Big O of this short code
has comment: http://stackoverflow.com/comment/45316049
tagged with: time-complexity
answer count: 1
favorite count: 0
tagged with: big-o

http://stackoverflow.com/comment/45360920
score: 3
comment on: http://stackoverflow.com/q/28522075
has text: The post request runs asynchronously which means it will evaluate once it gets it's response. Your if block will run before the post has returned.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45413958
comment on: http://stackoverflow.com/q/28550431
has text: Is in the penultimate line.
score: 0
type: Comment
type: QuestionComment

facebook
tags question: http://stackoverflow.com/q/28565399
tags question: http://stackoverflow.com/q/28452542
tags question: http://stackoverflow.com/q/28581874
type: Tag
tags question: http://stackoverflow.com/q/28565600
tags question: http://stackoverflow.com/q/28472095
tags question: http://stackoverflow.com/q/28564973
tags question: http://stackoverflow.com/q/28557221
tags question: http://stackoverflow.com/q/28545405
tags question: http://stackoverflow.com/q/28495418
tags question: http://stackoverflow.com/q/28558995
tags question: http://stackoverflow.com/q/28510338
tags question: http://stackoverflow.com/q/28533824
tags question: http://stackoverflow.com/q/28438232
tags question: http://stackoverflow.com/q/28480591
tags question: http://stackoverflow.com/q/28534549
tags question: http://stackoverflow.com/q/28445991
tags question: http://stackoverflow.com/q/28481604
tag name: facebook
tags question: http://stackoverflow.com/q/28575761
tags question: http://stackoverflow.com/q/28463907
tags question: http://stackoverflow.com/q/28530149
tags question: http://stackoverflow.com/q/28577399
tags question: http://stackoverflow.com/q/28476651
tags question: http://stackoverflow.com/q/28546890
tags question: http://stackoverflow.com/q/28554422
tags question: http://stackoverflow.com/q/28537068
tags question: http://stackoverflow.com/q/28592426
tags question: http://stackoverflow.com/q/28457800
tags question: http://stackoverflow.com/q/28465522
tags question: http://stackoverflow.com/q/28574742
tags question: http://stackoverflow.com/q/28549289

http://stackoverflow.com/q/28529919
type: AnsweredQuestion
has title: Convert seconds to hours and minutes in real time
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/28530074
type: Question
has comment: http://stackoverflow.com/comment/45375037
has answer: http://stackoverflow.com/a/28530063
has body: I want to create a website with multiple countdowns activated by a click, some of them have different time, others the same. I need to organize them depending the time left. When one finish I need to return it to his original countdown value, so you can click again. I have this: http://jsfiddle.net/arglab/m19aojmu/11/ HTML element 1 10 seconds element 2 1000 seconds element 3 100 seconds element 4 10 seconds element 5 10000 seconds Javascript function timer(selector) { var self = $(selector); var sec = parseInt(self.find('span.timeout').text()); console.log(sec) order++; var actualTime = $('span.timeout').html(); console.log("Original time " + actualTime) self.addClass('selec').css('order',order+''); var interval = setInterval(function() { sec--; console.log(sec) if (sec >= 0) { self.find('span.timeout').text(sec); } else if($(this).find('span').text() <= 0) { console.log(sec) var text = self.find('span.timeout').text(actualTime); console.log(actualTime) clearInterval(interval); } $('.element').each(function(){ if($(this).find('span').text() == 0){ $(this).removeClass('selec'); $(this).css('order','0'); } }); }, 1000); } var order = 1; $("body").on('click', '.element', function() { timer(this); }); However, I don't know how to transform the seconds to hour - minute - seconds in real time. What should I do? Thanks
tagged with: javascript
answer count: 3
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45375160
possible better answer: http://stackoverflow.com/a/28530073
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28530074
has answer: http://stackoverflow.com/a/28530073

http://stackoverflow.com/q/28492849
downvote count: 0
answer count: 1
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45306406
has comment: http://stackoverflow.com/comment/45306325
upvote count: 2
has answer: http://stackoverflow.com/a/28499052
type: UnansweredQuestion
tagged with: datepicker
has title: issue with ng-change with datepicker
score: 2
has body: I was trying to use ng-change for a date-picker pop as below but the function is not getting called.Looks like ng-change triggers only when there is a keyboard input which otherwise does not happen with a datepicker-pop. Has anyone faced this issue or is there a workaround for this? Code below: &lt;input id="{{modelName}}" type="text" sort datepicker-pop="dd MMMM yyyy" class="form-control" ng-change="changeInDate()" ng-model="formData.expectedDisbursementDate" is-open="opened" /&gt;
has comment: http://stackoverflow.com/comment/45306493
has comment: http://stackoverflow.com/comment/45317267
type: Question
tagged with: javascript

http://stackoverflow.com/a/28550935
has body: Match anything other than whitespace or , after password=: var kv = 'system=blah, user=stevedave, password=1234$32@a, mylocation=amsterdam', re = /password=([^\s,]+)/, match = re.exec(kv); alert(match[1]); Demo: https://regex101.com/r/bE4bZ1/1 Strictly speaking, if you want anything up to the next comma, that can be [^,].
has comment: http://stackoverflow.com/comment/45415031
type: Answer
upvote count: 3
score: 3
has comment: http://stackoverflow.com/comment/45415331
answers question: http://stackoverflow.com/q/28550772
has comment: http://stackoverflow.com/comment/45415301
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28550772

http://stackoverflow.com/comment/45362774
score: 0
has text: If you change the values from the code i.e. controller it should work. Stay tuned. Coming up with a sample code.
comment on: http://stackoverflow.com/a/28523017
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28569669
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45449367
accepted answer of: http://stackoverflow.com/q/28569448
has body: So many of them.. Do it like... Less confusing way... function doStuff() { $('.block-1').addClass('active'); setTimeout(function() { $('.block-2').addClass('active'); }, 500); setTimeout(function() { $('.block-3').addClass('active'); }, 900); setTimeout(function() { $('.block-1, .block-2, .block-3').removeClass('active'); },1300); } doStuff(); setInterval(function() { doStuff(); }, 1400);
answers question: http://stackoverflow.com/q/28569448
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28524807
has comment: http://stackoverflow.com/comment/45368128
tagged with: javascript
tagged with: reactjs
answer count: 2
linked to: http://stackoverflow.com/q/28258517
downvote count: 0
has answer: http://stackoverflow.com/a/28533102
favorite count: 0
has title: Deleting Stateful element from ReactJS array
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45369513
has answer: http://stackoverflow.com/a/28526949
has comment: http://stackoverflow.com/comment/45370196
score: 1
upvote count: 1
has body: I am having issues with removing stateful elements in an React array. In the following example, if you click 'toggle' on the second element ('B'), you will see: Entry id: 0 name: A Is Active Toggle Remove Entry id: 1 name: B Is Not Active Toggle Remove Entry id: 2 name: C Is Active Toggle Remove If you now click 'Remove' on the first element ('A'): Entry id: 0 name: B Is Active Toggle Remove Entry id: 1 name: C Is Not Active Toggle Remove B has changed, but all I wanted to do was delete A and not impact any other elements. I've got a key as per the docs, and have tried using a key with a string prefix but it didn't help. Is there any way to do this without pushing state up to TestContainer? (In my real situation I have a lot of disparate elements with different types of states).
type: Question

http://stackoverflow.com/a/28457737
has comment: http://stackoverflow.com/comment/45249219
has comment: http://stackoverflow.com/comment/45242314
upvote count: 2
has comment: http://stackoverflow.com/comment/45242345
accepted answer of: http://stackoverflow.com/q/28457547
has comment: http://stackoverflow.com/comment/45246897
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28457547
has body: Instead of extracting and iterating, as you would in this case, documents you don't need using $cond you can just omit them from the find: Model.aggregate([ { '$match': {'tof': true} }, { '$group': { '_id': '$id', 'name': { '$first': '$name' }, 'tof': { $sum: 1 }, } } ]) However, since you are using multiple counts you need $cond ( http://docs.mongodb.org/manual/reference/operator/aggregation/cond/ ) so here is an example: Model.aggregate([ { '$group': { '_id': '$id', 'name': { '$first': '$name' }, 'tof': { $sum: {$cond: [{$eq:['$tof', true]}, 1, 0]} }, } } ])
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/q/28442312
accepted answer: http://stackoverflow.com/a/28442373
upvote count: 7
downvote count: 1
type: Question
tagged with: javascript
tagged with: sorting
has answer: http://stackoverflow.com/a/28442376
score: 6
tagged with: decimal
answer count: 3
has title: Sorting an array of decimal & whole numbers
tagged with: arrays
linked to: http://stackoverflow.com/q/1063007
has answer: http://stackoverflow.com/a/28442373
has answer: http://stackoverflow.com/a/28442382
favorite count: 0
has body: I can't seem to figure this one out. var arr = [2.62, 111.05, 1.05] arr.sort(); This returns [1.05, 111.05, 2.62], but I'm expecting [1.05, 2.62, 111.05]. How can this be achieved? I've read a bit about writing a custom sort to split the "decimal" but haven't managed to have any success.
duplicate of: http://stackoverflow.com/q/1063007
has comment: http://stackoverflow.com/comment/45214268
possible better answer: http://stackoverflow.com/a/28442382
type: AnsweredQuestion

http://stackoverflow.com/a/28621658
upvote count: 0
answers question: http://stackoverflow.com/q/28471582
score: -1
has body: Is it possible to add a mouseover effect on this script? So that when you mouse over the images, it will also show the hidden div. if you mouse out, it will hide the div. But still when you click on the image, it will show the hidden div. (how it works now) I just want to add the option of showing the hidden divs during mouseover/mouseout as well. Thank you.
downvote count: 1
type: Answer

http://stackoverflow.com/comment/45383848
has text: ObjectAssignmentPattern has a AssignmentPropertyList has a AssignmentProperty has a AssignmentElement has a DestructuringAssignmentTarget.
comment on: http://stackoverflow.com/a/28534567
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/102896763
has text: You've got no idea how long it took me to find that you had exactly the same issue. For those of looking for promise-based async/await result: const fileReader = new FileReader(); await new Promise((resolve, reject) => { fileReader.onerror = () => { fileReader.abort(); reject(new Error('Problem parsing input file.')); }; fileReader.onload = (e) => { video = new Blob([e.target.result], { type: 'video/webm' }); resolve(); }; fileReader.readAsArrayBuffer(video);
comment on: http://stackoverflow.com/a/28501225
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45484511
has text: from where I will get the BaseCtrl? it is in separate script file and not globally set(also see the note in the question).
type: Comment
comment on: http://stackoverflow.com/a/28588779
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45460848
comment on: http://stackoverflow.com/q/28575628
type: Comment
type: QuestionComment
score: 0
has text: Remove all template things from your code and show us what the actual browser sees in your question. We can't possibly know what those template or server-side tags resolve to so can't possibly undestand what code is actually executing.

http://stackoverflow.com/a/28514497
has body: You should be using var arr = [{ "id": 1, "fn": "bill", "ln": "blogs" }, { "id": 2, "fn": "jim", "ln": "jones" }, { "id": 3, "fn": "bill", "ln": "smith" }]; var lookFor = "bill"; var result = arr.filter(function(item) { return item.ln === lookFor; }); alert(result.length); alert(result[0]["id"] + result[0]["fn"] + result[0]["ln"]); But I guess its not ln which you want, instead you want fn cause their is no ln which is equal to bill.
answers question: http://stackoverflow.com/q/28514435
score: 0
type: Answer

http://stackoverflow.com/comment/45413877
comment on: http://stackoverflow.com/a/28550346
type: AnswerComment
has text: @RamsayLanier ahah =p
type: Comment
score: 1

http://stackoverflow.com/q/28558476
tagged with: pug
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45433277
score: 0
tagged with: node.js
has answer: http://stackoverflow.com/a/28710400
has title: Active becomes [Object Object] in Jade
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45429575
has comment: http://stackoverflow.com/comment/45666531
has comment: http://stackoverflow.com/comment/45433138
accepted answer: http://stackoverflow.com/a/28710400
has comment: http://stackoverflow.com/comment/45702753
has body: Refer to http://jade-lang.com/reference/attributes/ example: - var currentUrl = '/about' a(class={active: currentUrl === '/'} href='/') Home a(class={active: currentUrl === '/about'} href='/about') About So attempted to set my code like this: li(class={active: category === "A"}) a(href="a") A li(class={active: false}) a(href="b") B li(class={active: category === "C"}) a(href='c') C li(class={active: false}) a(href="/directory") D Categories, A and C are "dynamic" via editor which user selects for posts. B and D has no categories. So when it is true, it will set active otherwise not set active. The problem is that when rendering, it will show: A I do not understand why it shows [object Object]. Help and explanation appreciated.

http://stackoverflow.com/q/28518813
tagged with: regex
has comment: http://stackoverflow.com/comment/45364861
score: 0
has comment: http://stackoverflow.com/comment/46116398
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45360333
tagged with: java
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
type: UnansweredQuestion
answer count: 0
tagged with: jquery
favorite count: 0
has body: I've an INPUT that is of the form of a jquery variable. ./Simple Root/ ./Root 1/Child 1/ ./Root 1/Child 2/ ./Thumbs.db ./timepass I would like to convert it into a neat JSON structure like (Update : Here is a JSON structure that I would like to convert http://www.jstree.com/docs/json/) 'data' : [ 'Simple root node', { 'text' : 'Root node 2', 'state' : { 'opened' : true, 'selected' : true }, 'children' : [ { 'text' : 'Child 1' }, 'Child 2' ] } ] NOTE: I havn't mentioned all the cases where the root itself has standalone children,nested children and so on. Basically, the slashes '\' would determine all that. I wasn't able to think of any solution apart from the regex matcher var patt1 = /^[^\/]*\/[^\/]*\/?/i; Can someone please guide me
has title: Converting a file directory strutute to JSON iusing jQuery
type: Question

http://stackoverflow.com/comment/45391464
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28538050
has text: This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post.

http://stackoverflow.com/comment/45467420
score: 0
has text: It working fine check http://jsfiddle.net/L4s645v2/
type: QuestionComment
comment on: http://stackoverflow.com/q/28579491
type: Comment

http://stackoverflow.com/q/28578659
answer count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28580801
tagged with: php
type: AnsweredQuestion
has body: &lt;script language="javascript"&gt; function get_ver() { var ver = $("#OSVER option:selected" ).text(); alert ('valllllllllis' + ver); } &lt;/script&gt; print "&lt;table width=100% cellSpacing=0 cellPadding=5 border=1 bordercolor='#006600' height=20 valign=top &gt;"; print "&lt;tr&gt;&lt;td&gt;&lt;h3&gt;User Created BaaS Profiles&lt;/h3&gt;"; print "&lt;/td&gt;&lt;/tr&gt;"; while ($row=mysql_fetch_array($query)) { $pol_type=$row['3']; $pol_id=$row['0']; $account_id=$row['2']; $pol_ver=$row['pol_ver']; $create_date=$row['create_date']; $modifiy_date=$row['modifiy_date']; if($uid == "1") { $sq="select * from baas_account where id=".$account_id; } else { $sq="select * from baas_account where id=" . $account_id . " and user_id=" .$uid; } $q=mysql_query($sq); $row1=mysql_fetch_row($q); $user_id=$row['user_id']; $policy_name=$row1['2']; $CSSUBS=$row['CSSUBS']; $CSWKLYday=$row['CSWKLYday']; $CSMNTday=$row['CSMNTday']; //print "&lt;form enctype='multipart/form-data' action='direct_submit.php' method='post' onSubmit='return validate();'&gt;"; print "&lt;tr id='info' name='info'&gt;"; //print "&lt;td&gt;&lt;input type='radio' name='profile_select' value='$pol_id' /&gt;&lt;/td&gt;"; { print "&lt;td&gt;&lt;a href='index.php?xtype=user_admin'&gt;$user_id&lt;/a&gt;&lt;/td&gt;"; } print "&lt;td&gt;"; //print "&lt;p&gt;$policy_name&lt;/p&gt;"; print "&lt;div class='texthv'&gt;"; print "&lt;a href='dnd.php?pid=$pol_id'&gt;$policy_name&lt;/a&gt;"; if($pol_type=='baseline') { print " "; } else { //print "&lt;div class='texthv'&gt;"; print "&lt;/br&gt;&lt;b&gt;&lt;a href='dnd.php?pid=$pol_id' class='texthidevisi'&gt;View |&lt;/a&gt;&lt;/b&gt; &lt;b&gt;&lt;a href='index.php?xtype=create_policy&amp;pol_id=$pol_id&amp;pol_type=$pol_type&amp;os_ver=b' class='texthidevisi' &gt;Edit |&lt;/a&gt;&lt;/b&gt; &lt;b&gt;&lt;a href='index.php?pid=$pol_id&amp;acc_id=$account_id&amp;xtype=rename' class='texthidevisi'&gt;Rename |&lt;/a&gt;&lt;/b&gt; &lt;b&gt;&lt;a href='index.php?pid=$pol_id&amp;acc_i…
has comment: http://stackoverflow.com/comment/45467599
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45466708
accepted answer: http://stackoverflow.com/a/28580801
has title: How to get the dropdown selected value inside the table that is in grid format
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45468598
tagged with: html-table
upvote count: 0
has comment: http://stackoverflow.com/comment/45467528

http://stackoverflow.com/a/28552076
type: Answer
has comment: http://stackoverflow.com/comment/45443765
upvote count: 10
accepted answer of: http://stackoverflow.com/q/28545747
score: 10
has body: If you're just after an illustrative approximation you can use a combination of blending and composition modes. First thing is to make sure your main image has transparency - this is important for composition to work (I made a rough cut-off in the following demo). Main steps: Draw the pattern Draw the main image on top with blending mode multiply Draw the main image on top with compositing mode destination-in - this will make a cut-out If you want to reduce the size of the pattern you can either do this by using a smaller version of the image, draw to a temporary canvas at a smaller size and use that as pattern, or use the new transform methods on the pattern itself. Demo var img1 = new Image, img2 = new Image, cnt = 2, canvas = document.getElementById("canvas"), ctx = canvas.getContext("2d"); // image loading for demo (ignore) img1.onload = img2.onload = function() {if (!--cnt) go()}; img1.src = "//i.imgur.com/8WqH9v4.png"; // sofa img2.src = "//i.sstatic.net/sQlu8.png"; // pattern // MAIN CODE --- function go() { // create a pattern ctx.fillStyle = ctx.createPattern(img2, "repeat"); // fill canvas with pattern ctx.fillRect(0, 0, canvas.width, canvas.height); // use blending mode multiply ctx.globalCompositeOperation = "multiply"; // draw sofa on top ctx.drawImage(img1, 0, 0, img1.width*.5, img1.height*.5); // change composition mode ctx.globalCompositeOperation = "destination-in"; // draw to cut-out sofa ctx.drawImage(img1, 0, 0, img1.width*.5, img1.height*.5); } &lt;canvas id="canvas" width=600 height=400&gt;&lt;/canvas&gt; You can also reverse the order of which image is drawn etc., if you prefer. This is just an example of one way. If you need accurate texture then there is no way around to either take photos or use a 3D software, or hand-drawn the textures. NOTE: IE does not support multiply - For this you need to manually iterate through the pixels and multiply each component with each other. You can test for support this way: ctx.globalCompositeOperation = "…
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28545747

http://stackoverflow.com/comment/45620299
comment on: http://stackoverflow.com/a/28615500
score: 0
has text: Can you please see `Working with JSTL` here: [link](https://netbeans.org/kb/docs/javaee/ecommerce/connect-db.html)
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28498021
has title: How to hide body with Javascript
tagged with: javascript
has comment: http://stackoverflow.com/comment/45315401
has answer: http://stackoverflow.com/a/28498912
has comment: http://stackoverflow.com/comment/45316121
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28498912
has comment: http://stackoverflow.com/comment/45315586
has comment: http://stackoverflow.com/comment/45315479
score: -1
favorite count: 0
has comment: http://stackoverflow.com/comment/45315684
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/45315543
has comment: http://stackoverflow.com/comment/45316698
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28498218
has answer: http://stackoverflow.com/a/28498218
type: Question
has body: I want to hide all content and show some text like 'Test Over' in my webpage after a particular date. I have created a function but it doesn't work properly. Please help me to sort this issue. &lt;script type="text/javascript"&gt; var myDate=new Date(); myDate.setFullYear(2015,2,14); var today = new Date(); if (myDate&gt;today) { document.body.style.display = "none"; } &lt;/script&gt;
answer count: 2

http://stackoverflow.com/comment/45277271
comment on: http://stackoverflow.com/q/28476598
type: Comment
type: QuestionComment
score: 0
has text: If you have no other option than using javascript, you can always "hash" the password that the user enters and compare it to the stored password that is already hashed using the same method. See [here](http://www.movable-type.co.uk/scripts/sha1.html) for example.

http://stackoverflow.com/q/28494817
type: AnsweredQuestion
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45309592
tagged with: angularjs
has title: change class of element onkeyup
tagged with: css
has answer: http://stackoverflow.com/a/28495147
has body: I am working on angularjs app. It is a chat app for mobile. It has two templates userlist.html message.html In message.html template everything works fine until when i press lets say (&lt;input&gt; tag) "enter" to type something. keyboard shows up and It doesnt slide up the view. It shows old message when keyboard is visible. So in order to slide the view up. I was thinking of binding an event on keyup of tag and change the css class for updated view. So, I created the directive. But the problem is when i add the directive the on &lt;input&gt; tag .I am only able to access the elements of input tag. I want access the complete DOM element of template inside the directive. How to do that? message.html &lt;div class="chat-sidebar-content"&gt; element &lt;div class="chat-sidebar-chat chat-sidebar-panel2" id="chat-sidebar-user-1"&gt; //I want to change class of this &lt;/div&gt; &lt;footer class="chat-sidebar-footer form-group"&gt; &lt;input class="form-control input-dark fs-mini" my-directive type="text" placeholder="Type your message"&gt; //added the directive here &lt;/footer&gt; &lt;/div&gt; directive.js angular.module('testApp').directive('myDirective', function() { return function(scope, element, attr){ console.log(element); element.bind("keyup", function(){ console.log('keyup'); //this works }); }; });
has comment: http://stackoverflow.com/comment/45309812
tagged with: onkeyup
accepted answer: http://stackoverflow.com/a/28495147
type: Question

http://stackoverflow.com/q/28555363
score: 2
has answer: http://stackoverflow.com/a/28555846
downvote count: 0
has title: Jquery validation
has answer: http://stackoverflow.com/a/28555644
has body: I am new In jquery created validation and calculation using formula.I have created six input fields.created validation all fields.but when empty all fields click calculation red star symbol showing first two fields not showing remain four fields please help me friends here my code: Whats your effective rate? Month 1 Total Sales, Including Amex * Total Fees, less any terminal or rental fees * Month 2 Total Sales, Including Amex * Total Fees, less any terminal or rental fees * Month 3 Total Sales, Including Amex * Total Fees, less any terminal or rental fees * calculation all working good.when leave fields empty click calculation show red star required first two column remain not showing help me friends
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/28555647
has answer: http://stackoverflow.com/a/28556351
tagged with: javascript
tagged with: jquery
tagged with: validation
has answer: http://stackoverflow.com/a/28556017
favorite count: 0
answer count: 5
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/45424445

http://stackoverflow.com/comment/98627848
score: 0
type: Comment
type: QuestionComment
has text: I come to the same problem as you did, and still no solutions...Do you think it might relate to lifecycle?
comment on: http://stackoverflow.com/q/28583897

http://stackoverflow.com/a/28539607
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28539165
accepted answer of: http://stackoverflow.com/q/28539165
type: AcceptedAnswer
downvote count: 0
has body: your code seems correct, make sure that 'deal' is indeed populated with the correct data. here's a working example: - var list = [{x: 123, y: 234}, {x: 123, y: 234}]; each item in list .col-sm-6.col-md-4 .thumbnail img(alt='100%x200', src='#{item.x}', style='height: 250px; width: 100%;') .caption h3 | #{item.y} output: 234 234
type: Answer

http://stackoverflow.com/comment/45238501
type: AnswerComment
comment on: http://stackoverflow.com/a/28453616
type: Comment
has text: To summarize: The file in the javascript source attrribute can be a form of url rewriting. The url converts to a php file which outputs javascript. In the case of Google Ads, AJAX is used. Ok, now it looks simple. Never knew why someone would use clean url's for a javascript attribute. Is this for SEO reasons or security ?
score: 0

http://stackoverflow.com/comment/45283030
comment on: http://stackoverflow.com/a/28478714
type: AnswerComment
score: 0
has text: @lukasgeiter Hmm I always thought service providers are like classes. In this case all the user wants is a tiny method? Is there some way to make the method static? *confused*
type: Comment

http://stackoverflow.com/a/28560896
has body: Try this: arr.sort(function(a, b){ var titleA = a.title; var titleB = b.title; var arrA = titleA.split(' - '); var arrB = titleB.split(' - '); var keyA1 = parseInt(arrA[0]), keyA2 = parseInt(arrA[1]) keyB1 = parseInt(arrB[0]), keyB2 = parseInt(arrB[1]); // Compare the 2 keys if (keyA1 &lt; keyB1) return -1; if (keyA1 &gt; keyB1) return 1; if (keyA2 &lt; keyB2) return -1; if (keyA2 &gt; keyB2) return 1; return 0; });
accepted answer of: http://stackoverflow.com/q/28560801
score: 20
upvote count: 21
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28560801
downvote count: 1
has comment: http://stackoverflow.com/comment/45435869
has comment: http://stackoverflow.com/comment/132232632
type: Answer
has comment: http://stackoverflow.com/comment/86210374

http://stackoverflow.com/comment/45270448
score: 0
type: AnswerComment
type: Comment
has text: Yes, MongooseIM does support both WebSockets and BOSH. We (disclaimer: I work on MongooseIM) have experience with using Strophe.js with BOSH, so it's definitely possible and should not require any changes in the client library or the server. I don't know whether with the WebSocket transport it's the same, but I have no reason to assume that it does not work.
comment on: http://stackoverflow.com/a/28464557

http://stackoverflow.com/a/28574705
has comment: http://stackoverflow.com/comment/45460829
has comment: http://stackoverflow.com/comment/45458888
accepted answer of: http://stackoverflow.com/q/28574307
has body: You can do it this way: var myLinks = [ 'http://bing.com/search?q=Sniffer', 'http://bing.com/search?q=is', 'http://bing.com/search?q=good', 'http://bing.com/search?q=programmer']; window.onload = function() { for (var i = 0, len = myLinks.length; i &lt; len; i++) { document.getElementById("l" + i).addEventListener("click", (function (idx) { return function () { window.location.href = myLinks[idx]; return false; // cancel href }; })(i)); } };
type: Answer
has comment: http://stackoverflow.com/comment/45459717
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28574307
score: 0

http://stackoverflow.com/q/28526962
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28527081
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I'm trying to use the Tendina jQuery Plugin. It works great, but I'd like the menus to be laid out horizontally, like this: I've been messing around with the CSS ( inline-block and other stuff ) but haven't been able to make it work. I'm not gonna post the JS because it's a whole lot of code... I think too much to paste here, but feel free to check the JSFiddle. Any help would be highly appreciated. Thanks. HTML Menu 1 Submenu 1 Menu 2 Submenu 2 Submenu 2 Submenu w/ children Subsubmenu 2 Subsubmenu 2 Menu 3 Submenu 3 Submenu 3 CSS .dropdown { position: absolute; left: 0; top: 0; height: 100%; width: 100%; background-color: #f7f7f7; font-family: Arial, Helvetica, sans-serif; padding-top: 20px; font-size: 12px; } .dropdown li { padding: 0 10px; } .dropdown li.selected { background-color: #f2f2f2; } .dropdown li a { display: block; width: 100%; padding: 10px; text-decoration: none; text-transform: uppercase; color: black; } .dropdown li > ul li { padding: 0 20px; } .dropdown li > ul li a { color: gray; } .dropdown li > ul li > ul li { padding: 10px 30px; }
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/28527081
score: 0
answer count: 1
has title: jQuery - Change vertical menu to horizontal

callback
tags question: http://stackoverflow.com/q/28503061
tags question: http://stackoverflow.com/q/28497000
tag name: callback
tags question: http://stackoverflow.com/q/28543114
tags question: http://stackoverflow.com/q/28542385
tags question: http://stackoverflow.com/q/28528353
tags question: http://stackoverflow.com/q/28482645
tags question: http://stackoverflow.com/q/28533636
tags question: http://stackoverflow.com/q/28478342
tags question: http://stackoverflow.com/q/28465564
tags question: http://stackoverflow.com/q/28519093
tags question: http://stackoverflow.com/q/28571434
tags question: http://stackoverflow.com/q/28487529
tags question: http://stackoverflow.com/q/28462395
tags question: http://stackoverflow.com/q/28564776
tags question: http://stackoverflow.com/q/28584504
tags question: http://stackoverflow.com/q/28460365
tags question: http://stackoverflow.com/q/28581117
tags question: http://stackoverflow.com/q/28530083
tags question: http://stackoverflow.com/q/28497874
tags question: http://stackoverflow.com/q/28449869
type: Tag
tags question: http://stackoverflow.com/q/28547192

http://stackoverflow.com/q/28573129
linked to: http://stackoverflow.com/q/24103748
upvote count: 2
has title: Why won't the client receive new versions of this script in the public folder?
answer count: 3
possible better answer: http://stackoverflow.com/a/28574381
has answer: http://stackoverflow.com/a/28574381
accepted answer: http://stackoverflow.com/a/28580296
tagged with: javascript
tagged with: caching
tagged with: web-worker
score: 2
has body: In my project there is a public folder and a script inside it: public/worker.js, which contains a piece of code: alert('foo'); I call this script using a Worker: new Worker('worker.js'); I launch Meteor and connect to my app. foo is alerted. If I change the public/worker.js code to anything else: alert('bar'); The server refreshes the clients, the client refreshes the page but won't get the new code, instead using the old one (alerting foo instead of the new shiny bar). Clearing the cache then refreshing fixes the issue. CTRL+F5 does not fix this cache issue, it does not seem to work for this kind of script call (at least not on the version of Firefox I tested it with). Why is this happening, exactly? How can I prevent it?
type: AnsweredQuestion
downvote count: 0
tagged with: meteor
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/28580296
has answer: http://stackoverflow.com/a/32710844

http://stackoverflow.com/comment/45468902
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28578291
has text: @ImranBughio You're a champion!! Thank you so much. Answer accepted with pleasure.
score: 0

http://stackoverflow.com/comment/45341818
type: AnswerComment
comment on: http://stackoverflow.com/a/28511482
score: 0
type: Comment
has text: Thanks, I will definitely watch this video.

http://stackoverflow.com/comment/45446552
score: 0
comment on: http://stackoverflow.com/q/28568174
type: QuestionComment
type: Comment
has text: This could be helpful http://www.thesoftwaresimpleton.com/blog/2014/01/11/custome-link-to/

ruby-on-rails
tags question: http://stackoverflow.com/q/28503961
type: Tag
tags question: http://stackoverflow.com/q/28529918
tags question: http://stackoverflow.com/q/28518030
tags question: http://stackoverflow.com/q/28552199
tags question: http://stackoverflow.com/q/28584395
tags question: http://stackoverflow.com/q/28567630
tags question: http://stackoverflow.com/q/28551240
tags question: http://stackoverflow.com/q/28485324
tags question: http://stackoverflow.com/q/28474911
tags question: http://stackoverflow.com/q/28560257
tags question: http://stackoverflow.com/q/28570707
tags question: http://stackoverflow.com/q/28446544
tags question: http://stackoverflow.com/q/28577751
tags question: http://stackoverflow.com/q/28532350
tags question: http://stackoverflow.com/q/28530526
tags question: http://stackoverflow.com/q/28579686
tags question: http://stackoverflow.com/q/28538244
tags question: http://stackoverflow.com/q/28574032
tags question: http://stackoverflow.com/q/28570938
tags question: http://stackoverflow.com/q/28506319
tags question: http://stackoverflow.com/q/28475315
tags question: http://stackoverflow.com/q/28574865
tags question: http://stackoverflow.com/q/28458288
tag name: ruby-on-rails
tags question: http://stackoverflow.com/q/28555875
tags question: http://stackoverflow.com/q/28446111
tags question: http://stackoverflow.com/q/28533718
tags question: http://stackoverflow.com/q/28480742
tags question: http://stackoverflow.com/q/28480578
tags question: http://stackoverflow.com/q/28496661
tags question: http://stackoverflow.com/q/28452250
tags question: http://stackoverflow.com/q/28469438
tags question: http://stackoverflow.com/q/28545636
tags question: http://stackoverflow.com/q/28478521
tags question: http://stackoverflow.com/q/28445120
tags question: http://stackoverflow.com/q/28537760
tags question: http://stackoverflow.com/q/28570387
tags question: http://stackoverflow.com/q/28585392
tags question: http://stackoverflow.com/q/28566417
tags question: http://stackoverflow.com/q/28443827
tags question: http://stackoverflow.com/q/28479663
tags question: http://stackoverflow.com/q/28503307
tags question: http://stackoverflow.com/q/28582025
tags question: http://stackoverflow.com/q/28551644
tags question: http://stackoverflow.com/q/28588242
tags question: http://stackoverflow.com/q/28442560
tags question: http://stackoverflow.com/q/28494015
tags question: http://stackoverflow.com/q/28588666
tags question: http://stackoverflow.com/q/28530212
tags question: http://stackoverflow.com/q/28484487

http://stackoverflow.com/comment/45632460
comment on: http://stackoverflow.com/q/28572141
has text: 50kps took a total of 601ms to download, 250kps took 300.6, 750 took 200ms., and so on. in fact, each time the network speed went up, your network time went down, just like anyone would expect. just because something buffers small gzip results before starting the download doesn't mean it defies physics...
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/comment/45218337
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28444264
has text: Can you show your routes and controller code?

magento
tags question: http://stackoverflow.com/q/28472456
tags question: http://stackoverflow.com/q/28572937
tags question: http://stackoverflow.com/q/28556757
tags question: http://stackoverflow.com/q/28525232
tags question: http://stackoverflow.com/q/28590260
tag name: magento
type: Tag
tags question: http://stackoverflow.com/q/28442057
tags question: http://stackoverflow.com/q/28555285

http://stackoverflow.com/a/28510126
type: Answer
has body: Here is a working version: var button = document.getElementById('funbutton'); button.addEventListener('click', SeeWhatHappens); function SeeWhatHappens() { var startTime = new Date(); var divsize = 50; var posx = (Math.random() * window.innerWidth - divsize).toFixed(); var posy = (Math.random() * window.innerHeight - divsize).toFixed(); var div = document.getElementById('newdiv'); div.style.left = posx + 'px'; div.style.top = posy + 'px'; div.style.display = 'block'; button.style.visibility = "hidden"; var something = document.getElementById('newdiv'); something.style.cursor = 'pointer'; something.onclick = function() {GetTime(startTime);}; } function GetTime(startTime){ var endTime = new Date(); var timeDiff = endTime - startTime; var timeDiff = timeDiff / 1000; document.getElementById('TotalTime').innerHTML = timeDiff; } http://jsfiddle.net/6x4ho4ga/1/
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28509850
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28509850

http://stackoverflow.com/q/28487086
type: AnsweredQuestion
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/45296228
type: Question
has body: So I was doing my regular browsing, when I saw FullCalendar, for the ones who don't know it, it's a drag and drop jQuery calendar. Now, I want to make it work with my database using AJAX, but it wont really work.. Here's the JS for updating an event (changing dates etc) eventDrop: function(event, delta) { var start = $.fullCalendar.formatDate(event.start, "yyyy-MM-dd"); var end = $.fullCalendar.formatDate(event.end, "yyyy-MM-dd"); $.ajax({ url: 'http://127.0.0.1/public/assets/scripts/update_event.php', data: 'title=' + event.title + '&amp;start=' + start + '&amp;end=' + end + '&amp;user=' + '&lt;?php echo $_SESSION[' id '];?&gt;', type: "POST", success: function(json) { alert("Updated Successfully"); } }); } So this piece of JS's sees if a event is moved or anything and posts the new details to the following PHP scriptt: include($_SERVER['DOCUMENT_ROOT'] . '/application/bootstrap.php'); global $conn; $title = $_POST['title']; $start = $_POST['start']; $end = $_POST['end']; $user = $_POST['user']; $query = $conn-&gt;prepare('SELECT * FROM calendar WHERE title = :name AND start = :start'); $query-&gt;execute(array(':name' =&gt; $title, ':start' =&gt; $start)); while($result = $query-&gt;fetch(PDO::FETCH_ASSOC)) { $ids = explode(',', $result['user']); if (in_array($user, $ids)) { $update = $conn-&gt;prepare('UPDATE calendar SET title = :title, start = :start, end = :end'); $update-&gt;execute(array(':title' =&gt; $title, ':start' =&gt; $start,':end' =&gt; $end)); exit; } } Since I'm using this in a user based envoriment, I needed to integrate something that'll work with userID's. The DB connection is in the bootstrap.php file, which is being included at the top. How is it possible that I get the 'updated successfully' alert, but my database isn't being updated? Thanks.
score: 1
tagged with: mysql
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28487228
accepted answer: http://stackoverflow.com/a/28487228
has title: FullCalendar PHP and MySQL integration, events don't update

http://stackoverflow.com/comment/45229488
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28449446
type: AnswerComment
has text: Hi Spike, I can see the JSON using console.log() and the filter you specified also works fine. The problem is that '$scope.rem' doesn't have the JSON required.

http://stackoverflow.com/comment/45464117
type: Comment
has text: increase radius - make size = 20
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28573267

http://stackoverflow.com/comment/45894395
type: Comment
score: 1
has text: Hello John V, I am not sure where you are saying to add the code you provided, but I only did what Jon Black suggested and it works flawlessly.
comment on: http://stackoverflow.com/a/28793475
type: AnswerComment

blogger
tags question: http://stackoverflow.com/q/28550416
tag name: blogger
tags question: http://stackoverflow.com/q/28492354
type: Tag
tags question: http://stackoverflow.com/q/28511483

http://stackoverflow.com/a/28771504
has body: If the F12 tool is not of your interest, then what about the Event Viewer? Open Event Viewer from Control Panel -> System and Security -> Administrative Tools -> Event Viewer.‌ Then select the log Applications and Services Logs\Internet Explorer. By default no events are being logged for Internet Explorer, to enable them create a new DWORD registry value named Feature_Enable_Compat_Logging under the following registry key: HKCU\SOFTWARE\Microsoft\Windows\Internet Explorer\Main \FeatureControl and set the registry value to 1. Check the logs you get to see if it's what you're looking for.
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28591905
score: 1
upvote count: 1

http://stackoverflow.com/comment/45489454
type: AnswerComment
score: 1
type: Comment
has text: I got it working now. My fault was to use `urldecode` in PHP instead of keeping it as encoded string. Now using your code I only add `decodeURIComponent(object.regexp).split("/")` and everything worked accordingly.
comment on: http://stackoverflow.com/a/28587487

http://stackoverflow.com/q/28590803
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/28591260
upvote count: 3
possible better answer: http://stackoverflow.com/a/28591260
has answer: http://stackoverflow.com/a/28591164
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45488277
answer count: 2
downvote count: 0
has title: Pass parameter to animate callback function
accepted answer: http://stackoverflow.com/a/28591164
favorite count: 0
has body: I have the following jQuery snippet and I'm trying to pass a parameter to the function of animate method but can't get it right. function move() { var points = [13, 8, 5]; for(var pointIdx=0; pointIdx &lt; points.length-1; pointIdx++) { .. .. // animate move. $('#my_id', gameWindow.document).animate({ left: "50px" ,top: "50px" }, 1500, 'linear', function(pointIdx) { console.log("Animation: Iteration=" + pointIdx); // pointIdx is undefined at this point, why? ... ... } ) } } How to do it right? Thanks!
has comment: http://stackoverflow.com/comment/45489156
has comment: http://stackoverflow.com/comment/45488480

http://stackoverflow.com/comment/45241758
type: Comment
has text: Take a look at this [`link`](http://stackoverflow.com/questions/171251/how-can-i-merge-properties-of-two-javascript-objects-dynamically)
type: QuestionComment
comment on: http://stackoverflow.com/q/28456974
score: 0

http://stackoverflow.com/q/28439109
has answer: http://stackoverflow.com/a/28439332
has answer: http://stackoverflow.com/a/28439435
has title: Vertically responsive background image
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I have a full-page background image with a thin margin (10px) that I want to maintain around the image on every side regardless of browser size. So far, every side is fine except the bottom. Is there a way I can have a vertically responsive background image using only css? I prefer to not use Javascript but if that's the only solution, I'm open. .background-image { display: inline-block; height: 100%; width: 98%; margin: 1%; background: url('/wp-content/themes/woodsy/images/background-walnut-test.jpg') no-repeat center center fixed; background-size: cover; -moz-background-size: cover; -o-background-size: cover; -webkit-background-size: cover; }
type: UnansweredQuestion
tagged with: responsive-design
tagged with: javascript
type: Question
score: 0
answer count: 2

http://stackoverflow.com/comment/45374870
type: QuestionComment
has text: It's just the same for these - each request gets its own callbacks.
comment on: http://stackoverflow.com/q/28529636
score: 1
type: Comment

http://stackoverflow.com/q/28497157
has body: I want to bind a script to a click answer to tell user when there is no internet connection. Example is when the user is on page1.html and clicks on a link that should take him to page2.html and there is no internet connection an alert should pop up and stop the url action for opening page2.html. i have this script but it works only when the page loads var online = window.navigator.onLine; if (!online){ alert('You are not currently connected to the internet. Please try again later.'); }
has comment: http://stackoverflow.com/comment/45314049
has comment: http://stackoverflow.com/comment/45316381
type: Question
tagged with: url
tagged with: javascript
has title: Stop url action when if no connection
has answer: http://stackoverflow.com/a/28497457
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28497908
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28497484

http://stackoverflow.com/a/28486133
has body: If you want to access a variable from a private scope within the global scope you'll need to bind it to the global scope or a child of it. (function() { var s = document.createElement('script'); window.s = s; ... }); Then later, somewhere in your code, in a completely different scope, you can access it using either window.s or just s if there are no local variables of that name.
answers question: http://stackoverflow.com/q/28486062
score: 0
type: Answer

http://stackoverflow.com/a/28492265
score: 2
accepted answer of: http://stackoverflow.com/q/28450179
type: AcceptedAnswer
downvote count: 0
has body: Finally i found the solution just leave the Intent as empty will get the desired result. var intent =''; //leave this empty for sending sms automatically var message='Test message'; sms.send(number, message, intent, success, error)
answers question: http://stackoverflow.com/q/28450179
type: Answer
upvote count: 2

http://stackoverflow.com/a/28491917
upvote count: 0
has comment: http://stackoverflow.com/comment/45304723
type: Answer
score: -1
downvote count: 1
answers question: http://stackoverflow.com/q/28491815
has body: You need to include jQuery inside the HTML code. jQuery won't work for you because your script is loaded before jQuery is loaded.

http://stackoverflow.com/a/28516241
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28515981
type: Answer
has body: Its not recommended to use JSP Scriptlets, Set User Id in session and access that in JSP using EL expression

http://stackoverflow.com/q/28579103
has answer: http://stackoverflow.com/a/28579239
tagged with: javascript
tagged with: jquery
score: 0
tagged with: jquery-events
answer count: 1
type: UnansweredQuestion
has body: In the below code I have exported the canvas image and need to set that image in the web page. However the execution stops once it is exported that is execution stops after calling pom.dispatchEvent(e); the following line is not executed. $("#Digital").attr("src", 'C:\Users\labuser\Downloads' + img + '.PNG'); Please help me... blob = new Blob([buffer], { type: "image/png" }); var pom = document.createElement('a'); var url = URL.createObjectURL(blob); pom.href = url; pom.setAttribute('download', img + '.png'); if (document.createEvent) { e = document.createEvent("MouseEvents"); e.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); pom.dispatchEvent(e); } $("#Digital").attr("src", 'C:\Users\labuser\Downloads' + img + '.PNG');
type: Question
tagged with: export
has title: Execution stop after dispatchevents called

http://stackoverflow.com/q/28473283
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I'm having troubles configuring CKEDITOR to have a custom toolbar with custom styles. This is the config for the custom styles that i added to config.js CKEDITOR.stylesSet.add('custom_styles', [ { name: 'Text Bolder', element: 'p', attributes: { 'class': 'validate' }} ]); This is the code i use configure the toolbar and the styles and initialize the toolbar var cfg = { toolbar: [ [ 'Source', '-', 'Bold', 'Italic',{ name: 'Styles'}] ], stylesSet: 'custom_styles' }; /* Inline */ CKEDITOR.inline('derecha',cfg); The problem it's with the styles and i don't know why they show empty
has title: CKEDITOR with custom toolbar and custom styles
tagged with: css
score: 2
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28495235
type: Question
tagged with: ckeditor
answer count: 1

http://stackoverflow.com/comment/45375808
comment on: http://stackoverflow.com/a/28530391
score: 0
type: Comment
has text: I know. But why repeat this every time we want to call a function when DOM is ready (supposed that there's more code on the page - If not, then it doesn't matter) ?
type: AnswerComment

http://stackoverflow.com/q/28502643
has title: Copy Link CSS to Non-Link Button
type: Question
tagged with: c#
has answer: http://stackoverflow.com/a/28502724
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28502724
answer count: 1
has comment: http://stackoverflow.com/comment/45326411
has comment: http://stackoverflow.com/comment/45326493
has comment: http://stackoverflow.com/comment/45326152
has comment: http://stackoverflow.com/comment/45326212
has comment: http://stackoverflow.com/comment/45326310
tagged with: css
has body: I'm working on a site where most of its content is generated automatically, and I'm simply creating extensions for it. One extension I'm working on is creating a button. The buttons on the site have two distinct styles, their regular button css , and their a.button css, as they're link buttons. The buttons are created server-side through asp.net. I'm able to create the button via Javascript that's inserted into the HTML via a C# StringBuilder, and I can copy the regular css button class through the JS as well with the following command: StringBuilder sb = new StringBuilder(); sb.AppendLine(@"&lt;script type=""text/javascript""&gt;"); sb.AppendLine(@"orderInfoTbl.innerHTML = ""&lt;input type='button' id='sameAsShippingButton' onclick='SameAs()' value='Same As Shipping' name='btnSameAsShipping'&gt;"" + orderInfoTbl.innerHTML;"); sb.AppendLine(@"var foo = document.getElementById(""divOfButton""); "); sb.AppendLine(@"document.getElementById(""sameAsShippingButton"").style.cssText = document.defaultView.getComputedStyle(foo, """").cssText"); sb.AppendLine("&lt;/script&gt;"); My problem is that I can't copy the a.divOfButton css to add to the button to make it match. Is there some Javascript, or another way to steal a whole css id or class and copy it.
type: AnsweredQuestion

firefox
tags question: http://stackoverflow.com/q/28492042
tags question: http://stackoverflow.com/q/28506278
tags question: http://stackoverflow.com/q/28545727
tags question: http://stackoverflow.com/q/28575628
tags question: http://stackoverflow.com/q/28536763
tags question: http://stackoverflow.com/q/28571590
tags question: http://stackoverflow.com/q/28564092
tags question: http://stackoverflow.com/q/28535421
tags question: http://stackoverflow.com/q/28490041
tags question: http://stackoverflow.com/q/28530859
tags question: http://stackoverflow.com/q/28530130
tag name: firefox
tags question: http://stackoverflow.com/q/28456543
tags question: http://stackoverflow.com/q/28441539
tags question: http://stackoverflow.com/q/28550228
type: Tag
tags question: http://stackoverflow.com/q/28490148
tags question: http://stackoverflow.com/q/28550580
tags question: http://stackoverflow.com/q/28511248
tags question: http://stackoverflow.com/q/28440321
tags question: http://stackoverflow.com/q/28438202
tags question: http://stackoverflow.com/q/28567068
tags question: http://stackoverflow.com/q/28465528
tags question: http://stackoverflow.com/q/28544259
tags question: http://stackoverflow.com/q/28447987
tags question: http://stackoverflow.com/q/28450673
tags question: http://stackoverflow.com/q/28516842
tags question: http://stackoverflow.com/q/28452935
tags question: http://stackoverflow.com/q/28467117
tags question: http://stackoverflow.com/q/28437566
tags question: http://stackoverflow.com/q/28469873
tags question: http://stackoverflow.com/q/28539147
tags question: http://stackoverflow.com/q/28537679
tags question: http://stackoverflow.com/q/28539934
tags question: http://stackoverflow.com/q/28503686
tags question: http://stackoverflow.com/q/28473305
tags question: http://stackoverflow.com/q/28572292
tags question: http://stackoverflow.com/q/28466622

http://stackoverflow.com/comment/45247484
comment on: http://stackoverflow.com/q/28460286
score: 0
type: QuestionComment
has text: @Mouser what if want to remove old cloned content and new content with fadeIn?
type: Comment

http://stackoverflow.com/comment/45327347
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28503653
has text: Something along the lines of `var arr = []; $('li').each(function(){ arr.push($(this).text()) });` and then `arr.join(',')`

http://stackoverflow.com/comment/45376103
comment on: http://stackoverflow.com/q/28530556
has text: in NaviBarCtrl change to $modal.open
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45433417
type: Comment
comment on: http://stackoverflow.com/a/28560575
score: 1
has text: No, your understanding is wrong. Function calls don't make copies of functions. If your function returns "this", its return value depends on how you call it.
type: AnswerComment

http://stackoverflow.com/comment/45254365
score: 0
type: Comment
type: QuestionComment
has text: @zerkms are you saying that I should pull it out into a separate function? In the react tutorial they place the ajax call in the componentDidMount section
comment on: http://stackoverflow.com/q/28463807

http://stackoverflow.com/q/28556119
has answer: http://stackoverflow.com/a/28556209
has answer: http://stackoverflow.com/a/28556264
has comment: http://stackoverflow.com/comment/45424492
has comment: http://stackoverflow.com/comment/45424373
type: Question
answer count: 2
has body: I want to disable all the Sunday,Monday and Wednesday from my jquery date-picker. I am trying to do this using the following code sample - jQuery(document).ready(function($) { $(".datepicker").datepicker({ beforeShowDay: function(date) { var day = date.getDay(); return [(day != 1), '']; } }) }); This code disable all Mondays from the calender. How can i disable all Sunday and Wednesdays too?
linked to: http://stackoverflow.com/q/25344382
has comment: http://stackoverflow.com/comment/45424390
tagged with: javascript
tagged with: jquery
has title: how to disable specific days in JQuery datepicker?
score: 0
has comment: http://stackoverflow.com/comment/45424520
tagged with: datepicker
type: UnansweredQuestion

http://stackoverflow.com/q/28577558
has answer: http://stackoverflow.com/a/28577659
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45463934
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/28578812
type: Question
has body: I created a web page, there color changing background of a div with three different color. I have following code. its works but when background change i need simple animation when they change the color.I don't about animation please help. #autocolor{ width: 1000px; height: 700px; padding: 0.75em 0.5em 0; background:#3399cc; border: 1px solid black; margin: 3em auto 0; font: bold 90% sans-serif; }
tagged with: javascript
has answer: http://stackoverflow.com/a/28604314
has answer: http://stackoverflow.com/a/28578002
downvote count: 0
has comment: http://stackoverflow.com/comment/45463882
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28577659
tagged with: css
has title: Need animation when background color change
answer count: 4
accepted answer: http://stackoverflow.com/a/28604314

http://stackoverflow.com/a/28455841
answers question: http://stackoverflow.com/q/28455409
type: Answer
has body: It would be better approach to put link texts and symbols in separate spans. This way it will be easy for styling in case you want to provide separate styling for link texts and link symbols. Also this way you can manipulate only the text of the link through javascript. So html can be Menu & And javascript $("#testul").on("click", "li a", function (event) { event.preventDefault(); $('#testa').find('.link-text').text($(this).text()); });
score: 0

http://stackoverflow.com/q/28553543
score: 0
downvote count: 2
has answer: http://stackoverflow.com/a/28553617
type: Question
has comment: http://stackoverflow.com/comment/45419908
possible better answer: http://stackoverflow.com/a/28553607
has comment: http://stackoverflow.com/comment/45420185
has answer: http://stackoverflow.com/a/28553607
answer count: 2
accepted answer: http://stackoverflow.com/a/28553617
tagged with: javascript
tagged with: jquery
has title: Apply colored circle on top of the clicked image
favorite count: 0
has comment: http://stackoverflow.com/comment/45420299
tagged with: http://stackoverflow.com/tag/html
has body: I have a page that when loaded displays this: The HTML for this is as follows (the below is built within a foreach statement in the view as I'm using MVC 5) What I'm trying to do is when one of those images are clicked I need to place the following css circle on top of it to show its been selected the CSS for the circle is like this #circle1 { background: none repeat scroll 0 0 green; height: 80px; width: 80px; opacity: 0.4; } .circle { border-radius: 50%; display: inline-block; margin-right: 20px; } Which gets rendered like this: My current jQuery is like this: $("#panel1 row img").click(function () { var id = $(this).attr("data-id").val(); alert(id); }); 2 Things: The jQuery does not fire, I'm unsure why. Can someone explain this? How would I add the above CSS Circle to the clicked image?
tagged with: css
type: AnsweredQuestion
upvote count: 2

http://stackoverflow.com/comment/66860950
type: Comment
comment on: http://stackoverflow.com/a/28599300
score: 0
type: AnswerComment
has text: @gabodevv Haven't tried it yet. Also skimmed through the jqplot docs, didn't find any option to set the axes(y1, y2, y3). If you want to draw a horizontal line on the y2 axis, just do some mathematics. Say your `y1 axes range is : 0 - 100` and `y2 axes is : 0 - 200` And you want to plot a horizontal line on` y2 axes at 60` So do : `(y1 max / y2 max) * value` Which is `(100/200) * 60 = 30` If y1's max is greater than y2's max, the formula will change.

http://stackoverflow.com/comment/45219243
comment on: http://stackoverflow.com/q/28444603
score: 0
type: Comment
type: QuestionComment
has text: Hi, I think you are trying to use this http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm, please follow the documentation for fadeslideshow.js

http://stackoverflow.com/a/28494897
answers question: http://stackoverflow.com/q/28494511
type: Answer
score: 2
upvote count: 2
has body: Here is an answer to a similar question: In JavaScript, the document keyword is a handle on the object that contains the HTMLDocument. So they are not the same, document is an object , which also contains html for the page. Now when you get the width from the html and document. console.log($("html").width()); gives you the width of the html. and console.log($(document).width()); gives you the width of visible part of the document, so apperently width of itself, but there is a difference , if you have applied a margin to html, then the width of document is a sum of width of html and the margin applied to it. See this example http://jsfiddle.net/bbke9n59/ html{ margin:20px; } here, in my browser i get, console.log('html='+$("html").width()); // width 630 console.log('document='+$(document).width());// width 670 Exactly, 40px difference in the width, thats only the margin applied to the html Now this was all about chrome and firefox, About IE IE-9 when I run the same page on IE-9 console.log('html='+$("html").width()); // width 570 console.log('document='+$(document).width());// width 570 No difference in width of html and document( there should have been really) IE-11 when I run the same page on IE-11 console.log('html='+$("html").width()); // width 517 console.log('document='+$(document).width());// width 557 Exact difference of 40. just as chrome and firefox showed. So I am no longer able to reproduce the problem of rounding( in any of the browsers), so for me, I guess the problem is not with the rounding up using jquery(if that was the problem then jquery would have rounded up the width for document and html both, and still make them same width)
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28494511

http://stackoverflow.com/comment/45351227
score: 0
type: Comment
type: QuestionComment
has text: @Tyblitz Thanks for the suggestion. I have tried with the Knockout-jqueryUI library but it still makes a mock of it. It seems the observables (selected.isBold() ) works great, but the way I am using the jQuery Bottonset will not cause it to update properly.
comment on: http://stackoverflow.com/q/28506951

http://stackoverflow.com/comment/45292036
type: Comment
has text: You are right, the tilde was missing, but it didn't cause any issue, I've tried it. In terms of the 2nd point that wasn't problem as well but the whole last part should be inside the `sizes` section like @rasmusfl0e suggested. Also the real problem was the path definition was wrong at first `cssPath`.
comment on: http://stackoverflow.com/a/28483104
score: 0
type: AnswerComment

http://stackoverflow.com/a/28481906
has body: Try using this function: function getParameters(){ var url = window.location.href; //get the current url var urlSegment = url.substr(url.indexOf('proceso/')); //copy the last part var params = urlSegment.split('/'); //get an array return {registro: params[1], solicitud: params[2]}; //return an object with registro and solicitud } Then you can call the function and use the values: var params = getParameters(); console.log(params.registro); console.log(params.solicitud);
score: 1
accepted answer of: http://stackoverflow.com/q/28481154
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28481154
upvote count: 1
has comment: http://stackoverflow.com/comment/45286370
has comment: http://stackoverflow.com/comment/45286733
type: Answer
has comment: http://stackoverflow.com/comment/45286548
downvote count: 0

http://stackoverflow.com/comment/45339677
score: 2
comment on: http://stackoverflow.com/q/28510310
has text: css's background-size is worth looking into once you get a suitable overlay container defined.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28575934
has answer: http://stackoverflow.com/a/28576142
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: http://stackoverflow.com/tag/svg
accepted answer: http://stackoverflow.com/a/28576142
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28576480
has title: How to load local html in div from svg click
has answer: http://stackoverflow.com/a/28592735
answer count: 3
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28576480
has body: I am trying to load a new local html page within a specific div when I click on an object within svg. Here is the code I have. My Div Div Placement I've fiddled with this for a few days with no avail. I do not want to use the div hide/show method if at all possible. Many thanks! ~ Leo EDIT okie I've tried doing what you did on the fiddle but it still will not change the div. here is what I have now. Yes an index exists within the pages folder. My Div Div Placement EDIT Third iteration of code, still not working Float Test My Div Div Placement

http://stackoverflow.com/comment/45246234
type: AnswerComment
comment on: http://stackoverflow.com/a/28460084
score: 0
type: Comment
has text: If instead this question should be closed or the title amended to better reflect the action problem, have at it.

http://stackoverflow.com/comment/45320451
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28500425
has text: Here is fiddle for what I have: http://jsfiddle.net/kug0q35j/11/ but I can't get it to work. Take in consideration that I need to have all of this in separate files.

http://stackoverflow.com/comment/45310069
type: Comment
comment on: http://stackoverflow.com/q/28494522
has text: @enguerranws Apologies, that's an error in my questions, will update. Will chuck in the `$scope.submit()` function, but as mentioned above I'm trying to change the `input`'s value via jQuery (which is being called from within a Google Chrome extension), which I in turn want to force the `ng-model` to update.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45421217
has text: you got to include only the required css files for the particular page,dont include the unintended css files. check updated answer
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28484005

http://stackoverflow.com/comment/45450407
comment on: http://stackoverflow.com/q/28569961
score: 1
has text: No need to be so aggressive, @tadman is trying to help you. I concur that ImageMagick would be an excellent tool for this. It has a montage option that does exactly what you want to do: http://www.imagemagick.org/Usage/montage/ Many servers have ImageMagick installed, is there no way you could go this route?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45379796
type: Comment
has text: Okay, I think I got it. The duplicate question here http://stackoverflow.com/questions/4012998/what-it-the-significance-of-the-javascript-constructor-property says "The constructor property makes absolutely no practical difference to anything internally. It's only any use if your code explicitly uses it. "
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28532382

http://stackoverflow.com/comment/45331355
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28505781
type: Comment
has text: German characters like ä, ü, ö are displayed as Ä, Ü, Ö they are always in capital letters.

http://stackoverflow.com/q/28500737
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45320947
type: Question
tagged with: arrays
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28500814
tagged with: jquery
has answer: http://stackoverflow.com/a/28500754
accepted answer: http://stackoverflow.com/a/28500754
has answer: http://stackoverflow.com/a/28500814
score: 0
has body: My sample array is below, I want to remove key 1 which is having "" value. var a=[ 0: "349,602,317,805,887,810,863,657,665,865,102,624,659,636", 1: "" ] When i was browsing i found solution like use $.each() and keep condition. But i want to filter in single shot using jquery. Any function is there !!!!
answer count: 3
has title: Jquery: Remove " " value from array without using each
has comment: http://stackoverflow.com/comment/45321144
has answer: http://stackoverflow.com/a/28500843

http://stackoverflow.com/comment/45244172
has text: Just as a side note, if you don't want to check for ID values, you could also stop the event from bubbling up to the container by calling 'event.stopPropagation()' at the end of the 'hideDiv()' function. This approach can be seen here: http://jsfiddle.net/fmz2h6kj/1/
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28458808

http://stackoverflow.com/comment/45440666
type: Comment
comment on: http://stackoverflow.com/a/28565012
type: AnswerComment
has text: Thanks, but I'm not aware of jQuery yet, plus it interferes with the mixing of the JavaScript.
score: 0

http://stackoverflow.com/comment/45275663
has text: i did include bootstrap.min.js and i have all my script files at the bottom. but still not working. i have icludede it this way:
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28475597

http://stackoverflow.com/a/28442084
has comment: http://stackoverflow.com/comment/45214654
has comment: http://stackoverflow.com/comment/45215284
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45576768
type: Answer
accepted answer of: http://stackoverflow.com/q/28441093
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28441093
has body: You can use 'destination-out` compositing to "erase" pixels on a canvas. By default, the erasure will be completely through to the background. ctx.drawImage(img,0,0); ctx.globalCompositeOperation='destination-out'; ctx.fillRect(100,50,50,50); But you can also control how much alpha is erased by setting the globalAlpha to less than 1.00. This causes the erasure to reduce the alpha of the existing pixels--similar to color blending. ctx.drawImage(img,0,0); ctx.globalCompositeOperation='destination-out'; ctx.globalAlpha=0.50; ctx.fillRect(200,50,50,50);
upvote count: 2

http://stackoverflow.com/a/28514299
score: 4
has body: Angular already gives you the tool to prevent this: ngCloak: https://docs.angularjs.org/api/ng/directive/ngCloak Just put the directive on your body like &lt;body ng-cloak&gt; and it should work. EDIT The Docs also advice you to actually not put it on the body, but on smaller portions of your page - wherever you see the need. Depending on the size of your page, that is a good idea. For smaller Pages I put it on the body and never had problems.
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45346397
answers question: http://stackoverflow.com/q/28514241
upvote count: 4

http://stackoverflow.com/comment/45542986
score: 0
type: AnswerComment
has text: Other than general JavaScript and CSS, Qualtrics uses the Prototype JavaScript Framework, which very useful for things like this. You can learn more about it here: [http://api.prototypejs.org](http://api.prototypejs.org).
type: Comment
comment on: http://stackoverflow.com/a/28533112

http://stackoverflow.com/comment/45314391
has text: I'm voting to close this as the question is too broad. If you have a specific problem, please edit your post.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28497324

http://stackoverflow.com/q/28567281
tagged with: acrobat
accepted answer: http://stackoverflow.com/a/28579702
upvote count: 1
tagged with: php
type: AnsweredQuestion
has title: Submitted a PDF form to a PHP script only works in Adobe Reader XI
score: 1
type: Question
has answer: http://stackoverflow.com/a/28579702
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45445157
tagged with: http://stackoverflow.com/tag/pdf
answer count: 1
tagged with: adobe
has body: I have a PDF form that I want to submit to a remote php script. I thought I had it working but it seems only to be working when viewing the form in Adobe Reader XI. The submit button just doesn't seem to do anything in Adobe Reader 10 or in the Previewer on Mac. This is the javascript I have the button execute when it is clicked. It submits the entire PDF and also passes the email address and name for validation against a record in the database that the php script communicates with. var email = getField("Your email").valueAsString; var name = getField("Your name").valueAsString; // get name field name = name.replace(/(^[\s]+|[\s]+$)/g, ''); // trim spaces name = name.replace("'", "\\'"); // change O'Neil to O\'Neil name = "'"+name+"'"; email = email.replace(/(^[\s]+|[\s]+$)/g, ''); console.println("Your Plan is Being sent"); this.submitForm({ cURL: "http://example.com/thescript.php?name="+name+"&amp;email="+email, cSubmitAs: "PDF"}); Is there some syntax here that just isn't compatible with certain pdf readers? Any advice would be greatly appreciated.

http://stackoverflow.com/a/60253819
type: Answer
upvote count: 0
has body: Make sure your form only has inputs that are what AWS expects. Do not add extra form fields of your own. Or if you do, remove them with JS before the AWS upload begins.
answers question: http://stackoverflow.com/q/28453242
score: -1
downvote count: 1

http://stackoverflow.com/comment/45449248
has text: no but the page refreshes and the images are bent sent
comment on: http://stackoverflow.com/q/28569117
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45483053
has text: It generally deals quite well with automatically scaling your axes, so no. You might want to include things in your scale-x like min-value, max-value, step.
comment on: http://stackoverflow.com/a/28502978
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45401143
type: Comment
has text: Thanks! I already saw that method, but your example clarified everything.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28543796

http://stackoverflow.com/a/28626451
answers question: http://stackoverflow.com/q/28583330
type: Answer
score: 3
upvote count: 3
has body: This can be done with a simple RPC call. Add a RPC in your page, in this example I will consider myRPC as the service name. Define a function for this RPC that takes as input the array of values. The function just set this array in a sessionScope variable. In this example I name the function setScopeVariable; After your client side code that build the values for your listbox, just call this RPC function. Here listBoxValues is an array containing the list of values : myRPC.setScopeVariable(listBoxValues); The sessionScope is now set to the right value. By doing so you will need no hidden input, and no refresh on your page in order to set the sessionScope.
downvote count: 0

http://stackoverflow.com/q/28545636
accepted answer: http://stackoverflow.com/a/28584126
type: AnsweredQuestion
has body: Hi I have a simple jquery click listener that inserts a signin box that works on all pages except the landing page. We're using devise for authentication and I've tried redirecting the homepage to a different path but I'm guessing the devise magic is preventing that from happening. The root is set to welcome#indexand that controller/function is blank. The homepage defaults to users/sign_in if not signed in, but if I click on any other link that isn't "guarded" by devise, the listener will work form those pages. Any ideas? HTML &lt;div class="dropdown-signin"&gt; &lt;div class="dropdown-signin-carrot"&gt; &lt;/div&gt; &lt;%= form_for(:user, :url =&gt; session_path(:user)) do |f| %&gt; &lt;%= f.text_field :email, autofocus: true, placeholder: "Email" %&gt; &lt;br&gt; &lt;%= f.password_field :password, autocomplete: "off", placeholder: "Password"%&gt; &lt;div class="checkbox"&gt; &lt;%= f.check_box :remember_me %&gt; &lt;%= f.label :remember_me %&gt; &lt;/div&gt; &lt;div&gt; &lt;%= f.submit 'Sign in', :class =&gt; 'btn btn-lg btn-primary' %&gt;&lt;/div&gt; &lt;%= link_to "Forgot your password?", new_password_path(:user) %&gt; &lt;% end %&gt; &lt;/div&gt; JS var ready; ready = function() { $("#login").click(function(){ $(".dropdown-signin").toggleClass("open") }); }; $(document).ready(ready); $(document).on('page:load', ready);
has answer: http://stackoverflow.com/a/28584126
has comment: http://stackoverflow.com/comment/45405070
tagged with: ruby-on-rails
type: Question
tagged with: devise
has title: Jquery click listener not firing on root path Rails/Devise
tagged with: javascript
has comment: http://stackoverflow.com/comment/45458065
score: 0
has comment: http://stackoverflow.com/comment/45406102
answer count: 1
has comment: http://stackoverflow.com/comment/45405881
tagged with: jquery

http://stackoverflow.com/q/28539853
score: 0
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/45444441
has answer: http://stackoverflow.com/a/69400792
favorite count: 0
has comment: http://stackoverflow.com/comment/45449393
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28573150
has comment: http://stackoverflow.com/comment/45402447
has title: Performant matrix-matrix multiplication in Javascript
has comment: http://stackoverflow.com/comment/45401615
has answer: http://stackoverflow.com/a/35343514
downvote count: 1
tagged with: matrix-multiplication
type: Question
has body: I'm trying to port some basic MATLAB to Javascript and have been a little disappointed by the performance in JS, be it Chrome or Firefox. I've optimized slightly by tranposing one of the matrices, unrolled the inner loop and used Float64Arrays: function vvdot_body(rollsize) { var body = ''; body += ' var acc, ni, nj, nr, rs, lo, i;\n'; body += ' acc = 0.0;\n'; body += ' rs = ' + rollsize + ';\n'; body += ' nr = Math.floor(n / rs);\n'; body += ' lo = n - (nr * rs);\n'; body += ' for (i=0; i&lt;nr; i++) {\n'; body += ' ni = aos + i * rs;\n'; body += ' nj = bos + i * rs;\n'; /* begin unroll */ body += ' acc += a[ni] * b[nj] '; for (var i=1; i&lt;rollsize; i++) body += ' + a[ni + ' + i + '] * b[nj + ' + i + ']'; body += ';\n }\n' /* done unroll */ /* handle leftover */ body += ' ni = aos + nr * rs;\n'; body += ' nj = bos + nr * rs;\n'; body += ' for (i=0; i&lt;lo; i++)\n'; body += ' acc += a[ni + i] * b[nj + i];\n\n'; body += ' return acc;'; return body; } function mkvvdot(rollsize) { var args = 'a,b,n,aos,bos' , body = vvdot_body(rollsize); return new Function(args, body); } /* transpose */ function T(b, n, bT) { for (var i = 0; i &lt; n; i++) { for (var j = 0; j &lt; n; j++) { bT[i * n + j] = b[j * n + i]; } } } function mkmmm(unroll) { var vvdot = mkvvdot(unroll); return function(a, b, c, n) { var bT = new Float64Array(n*n); T(b, n, bT); for (var i = 0; i &lt; n; i++) { for (var j = 0; j &lt; n; j++) { c[i * n + j] = vvdot(a, bT, n, i * n, j * n); } } } } The following JS Fiddle runs a benchmark http://jsfiddle.net/42nmw4yx/2/ On my machine (E5-1650), variation over unrolling in the vector dot inner loop shows peaks performance of ~2.6 Gflops in Chrome 40, ~1.0 in Firefox 35, while MATLAB, single core, runs 15-20 Gflops. It may seem unfair to compare a naive algorithm in JS to a vendor's linear algebra library (MKL), and I could accept 50% performance loss but an order of magnitude seems unreasonable in 2015. What can I do here besides (ab)using WebGL to do the compu…
tagged with: javascript

http://stackoverflow.com/comment/74626399
comment on: http://stackoverflow.com/a/28888503
type: Comment
type: AnswerComment
has text: syntax error/typo: last **)** in the example code above must be omitted
score: 0

http://stackoverflow.com/q/28573244
has comment: http://stackoverflow.com/comment/45654287
tagged with: javascript
has comment: http://stackoverflow.com/comment/45463687
tagged with: extjs
score: 0
has title: ExtJS--changing proxy URL then loading store does not update grid
answer count: 1
has comment: http://stackoverflow.com/comment/45481576
has comment: http://stackoverflow.com/comment/45502911
type: UnansweredQuestion
has body: I have a grid with a store which is loaded when app is launched. I have a form also to which the grid is bound to. Initially, the grid shows all records. The search form allows user to filter records. The initial load and search URLs are different. When search is clicked, I dynamically change the URL configured on the store proxy to the filter URL, pass in the form values as extraParams, and load the store. I see the request is made and a response is returned. However, my grid records dont refresh. //grid store inside initComponent this.store = Ext.create("Ext.data.Store",{ fields:["rptid", "text", "value", "date_created", "created_by", "active], autoLoad:true, proxy:{ type:"ajax", url:"./getRpts.html", reader:{ type:"json", root:"data" } } }); //handler for search form button this.getRPTGrid().getStore().getProxy().url = "./getFilteredReports.html"; this.getRPTGrid().getStore().getProxy().extraParams = this.getSearchForm().getValues(); this.getRPTGrid().getStore().load(); thats it. I confirm the request is being made to load the store and confirm the response being received in debugger. The JSON response also contains the "data" root so thats not the issue and the fields dont change either. I have done this 10,000 times before but have never experienced this. Anyone have any ideas? I even compared the Request and Response Headers from both requests and their exactly the same minus the url and params..
has comment: http://stackoverflow.com/comment/45464331
type: Question
has answer: http://stackoverflow.com/a/28573954

http://stackoverflow.com/a/28541031
answers question: http://stackoverflow.com/q/28539450
has comment: http://stackoverflow.com/comment/45395844
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45395889
type: Answer
score: 1
upvote count: 1
has body: If you want to detect a click falling outside of a particular element, you can do that by attaching a click handler to a top-level element (commonly document) and look at event.target. To reinsert elements you've previously removed from the DOM you have to use .detach() instead of .remove(). However, a better way to get the same visual effect is to simply use hide and show which toggle the css property diplay:, since you don't have to care about where you need to reinsert the detached elements. It would look like: $(document).click(function(e) { // matches all children of droppable, change selector as needed if( $(e.target).is("#droppable *") ) { $(e.target).find(".ui-resizable-handle").show(); } else { $("#droppable").find(".ui-resizable-handle").hide(); } });
accepted answer of: http://stackoverflow.com/q/28539450

http://stackoverflow.com/a/47082260
score: 1
has body: Easiest and the optimistic way of doing this in one single line is using Underscore/Lodash let a = _.map(b, _.clone)
answers question: http://stackoverflow.com/q/28482593
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/comment/45472661
comment on: http://stackoverflow.com/a/28582012
has text: @vks: Hope it doesn't become a long commenting session but [you can see MATCH INFORMATION of your regex here](https://regex101.com/r/uC8uO6/2) and note what is the main difference.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45223642
comment on: http://stackoverflow.com/q/28447052
score: 0
type: Comment
type: QuestionComment
has text: Answer yourself here then, it may be useful for someone else.

http://stackoverflow.com/q/28520150
has answer: http://stackoverflow.com/a/28785173
has title: Why does chromecast take so long between animation frames
has body: I have a game I'm developing, that runs quite smoothly on chrome on my Mac, but very slowly on my chromecast. I've optimized the JS quite a bit already. I assumed it was just the low powered hardware in the chromecast, combined with the slowish JS. But investigating, using the performance object in JS it seems that the delay between the animation frames being called is much longer than my code takes. Court.prototype.update = function () { if (!window.court.paused) { if (window.debug) { console.log('time since last update ' + (performance.now() - window.start) + ' ms'); } window.start = performance.now(); window.court.draw(); // my drawing routing var end = performance.now(); if (window.debug) { console.log('to exit court.draw() took ' + (end - window.start) + ' ms'); } // reschedule next animation update window.requestAnimationFrame(window.court.update); } }; When I run that code and follow the console output from the chromecast I get this: time since last update 89.75099999998201 ms court.draw() took 0.984999999665888 ms time since last update 89.35899999960384 ms court.draw() took 29.77499999997235 ms time since last update 106.37199999973382 ms court.draw() took 1.5410000000920263 ms time since last update 93.46499999992375 ms court.draw() took 0.3149999997767736 ms time since last update 91.99499999977706 ms court.draw() took 0.31399999988934724 ms time since last update 126.3730000000578 ms court.draw() took 9.191000000100757 ms time since last update 104.55799999999726 ms court.draw() took 0.3160000001080334 ms time since last update 99.06599999976606 ms court.draw() took 0.3130000000091968 ms time since last update 94.06499999977677 ms court.draw() took 0.3140000003404566 ms time since last update 88.65700000023935 ms So, my drawing routine takes between 1 and 30ms, but the Animation Frame is only called about every 100ms, to give a maximum refresh rate of 10fps. Is there any way to get chromecast to reduce the refresh rate?
answer count: 3
tagged with: chromecast
has answer: http://stackoverflow.com/a/28554000
type: UnansweredQuestion
upvote count: 4
has answer: http://stackoverflow.com/a/28787663
tagged with: requestanimationframe
has comment: http://stackoverflow.com/comment/45368075
downvote count: 0
tagged with: javascript
favorite count: 0
type: Question
score: 4

http://stackoverflow.com/a/28548514
has comment: http://stackoverflow.com/comment/45410591
accepted answer of: http://stackoverflow.com/q/28547971
has comment: http://stackoverflow.com/comment/45410268
upvote count: 2
answers question: http://stackoverflow.com/q/28547971
has comment: http://stackoverflow.com/comment/45410154
type: AcceptedAnswer
has body: Done, I guess... Changes in HTML MENU CSS changes #dimmer { background: none repeat scroll 0 0 rgba(0, 0, 0, 0.5); display: none; height: 100%; left: 0; position: fixed; top: 0; width: 100%; z-index: 1000; } JavaScript jQuery(document).ready( function(){ jQuery('.nav-animate nav').hide('slide', {direction:'left'}, 500); jQuery(".x-btn-navbar").click(function(){ jQuery('#dimmer').fadeIn(250, function(){ jQuery('#dimmer').fadeOut(250); }) jQuery('.nav-animate').fadeIn(500); jQuery('.nav-animate nav').toggle('slide', {direction:'left'}, 500); }); }); Working Fiddle
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45410319
downvote count: 0
has comment: http://stackoverflow.com/comment/45410695

http://stackoverflow.com/comment/45467777
type: QuestionComment
type: Comment
has text: Please add code or a fiddle. If we suggest fixes to your site, the link wont help anyone else with the same issues (as the link will be fixed). I fyou add code here then it will help others
score: 1
comment on: http://stackoverflow.com/q/28579749

http://stackoverflow.com/q/28565396
has body: I want to make my text area handle onCut, onPaste, onKeydown and onKeyup the same. I.e. they all affect the textArea the same. I am creating the javascript as a string and using it within Codeigniter. Currently, in my code below, none of the functions are working when all together, How can I fix this? Note: when the code is only: $javascript= 'onKeyDown || onKeyUp="exampleFunction()"'; It works fine, but doesn't work with: $javascript= 'onKeyDown || onKeyUp || onPaste || onCut="exampleFunction()"'; Where javascript being called: echo form_textarea('text',0,$javascript);
type: Question
tagged with: javascript
has title: How to make textArea handle multiple events the same?
score: 0
answer count: 0
type: UnansweredQuestion
tagged with: codeigniter
tagged with: php
has comment: http://stackoverflow.com/comment/45441456
has comment: http://stackoverflow.com/comment/45441366

mongoose-im
tag name: mongoose-im
type: Tag
tags question: http://stackoverflow.com/q/28462816

http://stackoverflow.com/comment/45390096
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28515638
type: Comment
has text: Could you post a complete example that demonstrates the problem please?

http://stackoverflow.com/q/28592127
answer count: 3
tagged with: function
downvote count: 0
favorite count: 0
tagged with: scope
possible better answer: http://stackoverflow.com/a/28592169
has answer: http://stackoverflow.com/a/28592169
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45490828
upvote count: 3
tagged with: referenceerror
type: Question
score: 3
has answer: http://stackoverflow.com/a/70604698
has answer: http://stackoverflow.com/a/28592153
has title: JavaScript new Function scope ReferenceError
tagged with: javascript
has body: is there any way to make the code below working? (function(){ var n = "abc"; (new Function("return alert(n);"))(); })(); If I run the code in browser result is: "Uncaught ReferenceError: n is not defined". Also, I need to some other variables like "n" make accessible inside the "new Function" too. Please help, Thank you
accepted answer: http://stackoverflow.com/a/28592153

http://stackoverflow.com/q/28458439
has answer: http://stackoverflow.com/a/28458766
tagged with: forms
has comment: http://stackoverflow.com/comment/45243591
upvote count: 1
has answer: http://stackoverflow.com/a/28458604
tagged with: javascript
favorite count: 0
tagged with: ajax
answer count: 3
downvote count: 0
type: UnansweredQuestion
tagged with: php
has answer: http://stackoverflow.com/a/28459373
has title: Javascript posting to form - won't work if field is hidden
type: Question
has body: I read the advice on a similar question and I followed it. I am posting a value from javascript to a form to be passed to a PHP. Thing is it all works perfectly if I pass the value to a textarea field but not a hidden field. HTML Biography: JS function loadbio () { $("#bio").load('randomperson.html #biobox p') setTimeout (function () { var biotopass = $("#bio").val(); $.post("biochange.html", { oldbio: biotopass }); }, 200); } PHP Old Bio: <?php echo $_POST["oldbio"]; ?> New Bio: <?php echo $_POST["newbio"]; ?> So loadbio() goes out and pulls up the old biography out of a file and posts it to biochange.html. The HTML displays the old biography in the text area where the person changes it. This is where the problem lies, I need to store the value of the old value before it changes. If I change the hidden input to a textarea, it will get echoed in the PHP. If I leave it hidden it does not get echoed.
score: 1

http://stackoverflow.com/comment/45714667
type: Comment
type: AnswerComment
has text: I think his intentions is to listen to subdomain.domain.com not subdomain.domain.com:8081, what he is trying to do is direct subdomain.domain.com => localhost:8081, and if thats the case he should not change the listen.
score: 0
comment on: http://stackoverflow.com/a/28708576

http://stackoverflow.com/comment/45357408
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28520284
has text: Shouldn't `$scope.phone = data;` be `$scope.phones = data;` ?

http://stackoverflow.com/comment/45398411
comment on: http://stackoverflow.com/q/28542133
has text: `haversine` is not defined
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28561854
accepted answer: http://stackoverflow.com/a/28586215
upvote count: 1
tagged with: model-view-controller
type: AnsweredQuestion
has body: I'm looking to set up a two pane splitter view with openUI5 / SAPUI5 My code is as follows: index.html meta http-equiv='X-UA-Compatible' content='IE=edge' /> Hello World Splitter.controller.js: sap.ui.controller("Splitter", { onInit: function () { } }); Splitter.view.xml: <mvc:View controllerName="Splitter" xmlns:l="sap.ui.layout" xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.ui.commons"> <l:Splitter height="500px"> <l:SplitterLayoutData size="30%" resizable="false"/> <l:SplitterLayoutData size="auto" /> </l:Splitter> </mvc:View> However, I have nothing displaying on the page and in my Chrome Dev tools I have the following error: 'Uncaught TypeError: undefined is not a function' on index.html line 13, the set up on my view. The library is set up correctly and is linking.
score: 1
tagged with: sapui5
has title: Basic openUI5 Split View App
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28586215
has answer: http://stackoverflow.com/a/28587960
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45473365
possible better answer: http://stackoverflow.com/a/28587960

twitter-bootstrap-3
tags question: http://stackoverflow.com/q/28590176
tags question: http://stackoverflow.com/q/28563244
tag name: twitter-bootstrap-3
tags question: http://stackoverflow.com/q/28490322
tags question: http://stackoverflow.com/q/28492380
tags question: http://stackoverflow.com/q/28570354
tags question: http://stackoverflow.com/q/28488235
tags question: http://stackoverflow.com/q/28438223
type: Tag
tags question: http://stackoverflow.com/q/28566786
tags question: http://stackoverflow.com/q/28554238
tags question: http://stackoverflow.com/q/28449801
tags question: http://stackoverflow.com/q/28503908
tags question: http://stackoverflow.com/q/28457528
tags question: http://stackoverflow.com/q/28474857
tags question: http://stackoverflow.com/q/28455539
tags question: http://stackoverflow.com/q/28449265

http://stackoverflow.com/q/28527086
has answer: http://stackoverflow.com/a/28528958
type: UnansweredQuestion
downvote count: 0
score: 1
type: Question
has title: Linking option in angularjs
tagged with: window-resize
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/45372822
has comment: http://stackoverflow.com/comment/45370396
tagged with: javascript
upvote count: 1
answer count: 1
has body: I want to update a some expression whenever the window gets resized. Below is my directive show what i tried. SCRIPT var app = angular.module("myApp", []); app.controller("validate", function($scope, $window) { $scope.outp = "hello"; }); app.directive("responsive", function($window) { return { resterict: "AE", link: function cLink(scope, element, attrs) { console.log(element); scope.widthe = ($window).outerWidth; //scope.$watch("widthe",function(newValue, oldValue){ //scope.chnage = newValue; //}); element.bind("resize", function() { console.log("called"); scope.$apply(); }); } } }); HTML present width is {{width}} {{chnage}} click me Using above Code, I'm not able to bind resize event with element. I want to update the width whenever the window is resized. Could you help me to find out solution on it with code refactoring suggestions. Help would appreciated. Thanks in advance!!
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/comment/45246244
comment on: http://stackoverflow.com/q/28459672
type: Comment
type: QuestionComment
has text: Just updated, in the real time problem. I was looking for more help on seeing the values of map() as they are being evaluated so you can delete the list before having to filter them at the end. What variable shows the array in the map?
score: 0

http://stackoverflow.com/comment/45288471
score: 0
has text: Well, I have find another solution using Jquery. Any one who is looking for similar answer can look for JQuery based Data Grid with Drop Down. This will lead them to a possible solution.
comment on: http://stackoverflow.com/q/28466694
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45376510
comment on: http://stackoverflow.com/q/28530761
has text: Try accessing `localhost:1337/`
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45326926
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28484005
type: Comment
has text: This basically is the issue. We have shared containers across all pages, on some specific pages there are CSS overrides. Those overrides are being applied to the current page before the next page is actually visible. The result is that for a second or two while the loading animation runs the current page layout looks broken. Is there a way to fix this or is it just an issue with what we're doing or perhaps how jQuery mobile handles page navigation?

http://stackoverflow.com/comment/45312198
comment on: http://stackoverflow.com/q/28496246
type: Comment
type: QuestionComment
score: 0
has text: Look up : [Submitting a form on 'Enter' with jQuery?][1] [1]: http://stackoverflow.com/questions/699065/submitting-a-form-on-enter-with-jquery?rq=1

http://stackoverflow.com/comment/45235578
has text: I would suggest you to paste a jsfiddle link .. Yor error might be related to CORS if yes follow http://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28453532

http://stackoverflow.com/comment/45260129
type: Comment
type: AnswerComment
has text: Thanks so much. That seemed to do the trick when i tested in the brower. but once i opened the site on my phone the parallax was still being implemented and borken
comment on: http://stackoverflow.com/a/28467160
score: 0

http://stackoverflow.com/comment/45235982
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28451244
score: 0
has text: Could you perhaps make a fiddle of your project? Maybe I'm doing something wrong here.

http://stackoverflow.com/comment/45686359
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28641530
has text: @cbarlow123, I think the above will work OK in a page, but if I click on a link it shows wrong tooltip in the linked page's issue links...

http://stackoverflow.com/comment/45324995
type: QuestionComment
has text: I've added some more info.
comment on: http://stackoverflow.com/q/28458750
score: 0
type: Comment

http://stackoverflow.com/comment/45221539
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28446160
has text: yes, but this way it wouldn't be needed to do the `call()` part because it would set the `a` variable globally and alert it anyway
score: 1

http://stackoverflow.com/comment/45305175
has text: can you create a fiddle to play with.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28469853
score: 0

http://stackoverflow.com/comment/45393595
has text: I got this error , TypeError: marker.appendChild is not a function
comment on: http://stackoverflow.com/a/28539683
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/74627023
score: 0
has text: A bug in the code: it must be ".....function(**a**) { console.log(a.text) });" to show the picked item
comment on: http://stackoverflow.com/a/28888503
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45397766
type: AnswerComment
comment on: http://stackoverflow.com/a/28540849
score: 0
type: Comment
has text: @DannyVickers you're welcome. Well, it's not the most efficient code somewhere, but not far from it.

http://stackoverflow.com/a/28519510
upvote count: 3
score: 3
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45356366
downvote count: 0
answers question: http://stackoverflow.com/q/28519492
has comment: http://stackoverflow.com/comment/45356442
accepted answer of: http://stackoverflow.com/q/28519492
type: Answer
has body: Use var weekday = []; Instead of var weekday;
has comment: http://stackoverflow.com/comment/45356245
has comment: http://stackoverflow.com/comment/45356268

http://stackoverflow.com/a/28530907
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28530405
answers question: http://stackoverflow.com/q/28530405
upvote count: 2
type: AcceptedAnswer
type: Answer
has body: DATA is the array of columns with the actual data so for now just ignore COLUMNS. $.each(jsonSource.DATA, function( COLUMNS, DATA ) { console.log( jsonSource ); }); Now looking at jQuery.each documentation you can see the callback method gets indexInArray and value as parameters so lets update the callback. Keep in mind that indexInArray is related to how many rows exist in DATA, not the position of NAME, etc in COLUMNS. $.each(jsonSource.DATA, function( indexInArray, value ) { console.log( jsonSource ); }); Now instead of outputting the entire JSON tree, lets use the specific iteration of each. And since we know that NAME is the third item in the row we'll just hardcode that for now. $.each(jsonSource.DATA, function( indexInArray, value ) { console.log( value[2] ); }); Now lets say that the ordering of COLUMNS isn't guaranteed. We always want NAME but it could be any column. $.each(jsonSource.DATA, function( indexInArray, value ) { console.log( value[jsonSource.COLUMNS.indexOf('NAME')] ); }); Of course that's a complex line so in a real program you would probably want something like this. function getColumnIndex(columns, key) { return columns.indexOf(key) } var nameIndex = getColumnIndex(jsonSource.COLUMNS, 'NAME'); $.each(jsonSource.DATA, function( indexInArray, value ) { console.log( value[nameIndex] ); });
score: 2

http://stackoverflow.com/a/28460328
accepted answer of: http://stackoverflow.com/q/28459672
answers question: http://stackoverflow.com/q/28459672
has comment: http://stackoverflow.com/comment/45260420
has comment: http://stackoverflow.com/comment/45247069
score: 2
has body: Let's look at the first function: function f1(x) { var bool = false; if (x == 4){ bool = true; } return x; } This function changes the variable bool locally, and returns x. So, no matter what happens to bool, this function is equivalent to the identity function: function(x) { return x; } Because .map(f) returns an array with f applied to all elements, we have that a.map(f1) is equivalent to a.map(identity function) which is equivalent to a. The second function is inside the filter: if( (x == 1) &amp;&amp; ( bool = true)) return null; We have some issues here: There's no function(x) signature You are trying to access the bool variable, that was declared on the first function. I suggest whenever you use map and filter, that you use pure functions, which means your function just process the parameter passed to them, and return the result. I'm not sure what you are trying to accomplish in the first problem; please give more details and I'll try to help you with a solution. Look for tutorials in map, filter and reduce on Google. For example, this egghead video.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45375489
type: Answer
upvote count: 2

http://stackoverflow.com/a/28513124
has comment: http://stackoverflow.com/comment/45345282
accepted answer of: http://stackoverflow.com/q/28512966
has comment: http://stackoverflow.com/comment/45344563
has comment: http://stackoverflow.com/comment/45345873
upvote count: 1
has comment: http://stackoverflow.com/comment/45345594
has comment: http://stackoverflow.com/comment/45345508
score: 1
has comment: http://stackoverflow.com/comment/45344860
has body: Use anchors in page1 links: page2.html#lewishamilton and add to your JS code var hash = location.hash; if (hash) { var el = $(hash); el.parent().slideDown(); el.parent().prev().find('a').addClass('active'); } http://jsfiddle.net/7k9s1pg7/2/
answers question: http://stackoverflow.com/q/28512966
has comment: http://stackoverflow.com/comment/45344491
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45344449
type: Answer

http://stackoverflow.com/comment/45357670
score: 0
has text: Do you mean `PhoneListCtrl`? In this case that is where `phones` is declared.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28520438

http://stackoverflow.com/a/28579871
answers question: http://stackoverflow.com/q/28579763
has comment: http://stackoverflow.com/comment/45468145
score: 0
has body: You can do like this : &lt;input type='button' id='add_"+div.id+"' value='Add to cart' onClick='add_to_cart(" + product + ")'/&gt;
has comment: http://stackoverflow.com/comment/45468094
type: Answer

http://stackoverflow.com/a/28478549
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28478521
has comment: http://stackoverflow.com/comment/45283379
type: Answer
has comment: http://stackoverflow.com/comment/45282049
upvote count: 1
has body: $(".btn").click(function(){ $(this).css({"background-color":"#00f"}); });

http://stackoverflow.com/q/28446583
answer count: 1
has body: I need to parse JSON value. I can get 'name' value but I am unable to retrieve json value if the property has colon(:). PFB the code &lt;script&gt; var text = '{"name": "james","age": "30","re:moto" : "Hi"}' var obj = JSON.parse(text); document.getElementById("demo").innerHTML = obj.name + "&lt;br&gt;" + obj.age ; &lt;/script&gt; Here I am getting name value as 'james'. Giving error while retrieving 're:moto'. Can any one tell me how to retrieve property if it has colon?
has answer: http://stackoverflow.com/a/28446613
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: javascript
score: 0
has title: Issue while parsing JSON response

http://stackoverflow.com/a/28543687
accepted answer of: http://stackoverflow.com/q/28530623
has body: You only have to tell jstree once where to load the root (core.data) . On refresh the tree will re-populate based on this content. I would do this: var treeJSON = 'originaltree'; input.onchange = function (e) { // something treeJSON = $.parseJSON(newtree); // if newtree is json var tree = $('#tree').jstree(true); tree.refresh(); } $('#tree').jstree({ 'core': { 'check_callback': true, 'data': treeJSON } }); Or if you want to be even more specific based on which node: $('#tree').jstree({ 'core': { 'check_callback': true, 'data': function (node, cb) { if (node.id === '#') { //Load root, will fire on first load as well as on refresh cb.call(this, treeJSON); } } } });
answers question: http://stackoverflow.com/q/28530623
score: 1
has comment: http://stackoverflow.com/comment/45464554
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45434431
has comment: http://stackoverflow.com/comment/45430646
type: Answer
has comment: http://stackoverflow.com/comment/45434086

http://stackoverflow.com/comment/45422586
type: AnswerComment
has text: i think concatenate use it " "... "
type: Comment
comment on: http://stackoverflow.com/a/28541650
score: 0

autocomplete
tags question: http://stackoverflow.com/q/28462105
tags question: http://stackoverflow.com/q/28485115
tags question: http://stackoverflow.com/q/28524794
tags question: http://stackoverflow.com/q/28551350
tags question: http://stackoverflow.com/q/28584417
type: Tag
tags question: http://stackoverflow.com/q/28517062
tags question: http://stackoverflow.com/q/28532210
tags question: http://stackoverflow.com/q/28553744
tag name: autocomplete
tags question: http://stackoverflow.com/q/28546664
tags question: http://stackoverflow.com/q/28566488
tags question: http://stackoverflow.com/q/28442367
tags question: http://stackoverflow.com/q/28572558
tags question: http://stackoverflow.com/q/28567525

http://stackoverflow.com/a/28546175
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28546112
type: AcceptedAnswer
downvote count: 0
has body: Use . for class and # for id. $('.link').hide(); $('#checkbox').change(function () { if (!this.checked) // ^ $('.links').fadeOut('slow'); else $('.links').fadeIn('slow'); });
accepted answer of: http://stackoverflow.com/q/28546112
has comment: http://stackoverflow.com/comment/45454037
type: Answer

http://stackoverflow.com/q/28557245
tagged with: javascript
type: UnansweredQuestion
tagged with: post
tagged with: canvas
has title: How do I send image canvas data to Transloadit?
downvote count: 0
has comment: http://stackoverflow.com/comment/45772968
score: 1
tagged with: transloadit
favorite count: 0
tagged with: ajax
has body: Transloadit appears to have only a Upload Form API. I wish to send the contents of my canvas to Transloadit like so: data = canvas.toDataURL(); // POST this data to Transloadit $.ajax({ type: 'POST', url: 'http://api2.transloadit.com/assemblies', // what goes here? }).done(function() { console.log('Done uploading!'); }); Is this possible?
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/45432425
upvote count: 1
has answer: http://stackoverflow.com/a/31128793

http://stackoverflow.com/comment/45296335
comment on: http://stackoverflow.com/q/28487266
type: QuestionComment
type: Comment
has text: `<%=desciptionPanel.ClientID%>` - it is asp.net instruction, not js one, it can work only in aspx file
score: 0

http://stackoverflow.com/q/28548654
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45410380
has comment: http://stackoverflow.com/comment/45410668
has title: jquery ajax post sends me to action page and wont show result data
has answer: http://stackoverflow.com/a/28548940
has body: I have the following script for making Ajax/Jquery post request. The script works (I get correct response on back-end). But I cant seem to make any alerts, so I think there is some problem with the success function. Do you guys see any obvious mistakes? The browser gets the correct responses (Inspect webpage in chrome). &lt;script&gt; $(document).ready(function() { var frm = $('#registerform'); frm.submit(function(x) { x.preventDefault(); $.ajax({ type: 'POST', url: 'http://localhost:8080/api/v1/register', data: frm.serialize(), crossDomain: true, success: function(data){ if(data == 200){ alert("successfully registered"); $('#alert').append("successfully registered"); } if (data == 400){ alert("email or password empty"); } if(data == 403){ alert("passwords do not match"); } } }); }); }); &lt;/script&gt;
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
tagged with: node.js
has comment: http://stackoverflow.com/comment/45410805
has answer: http://stackoverflow.com/a/28548951

http://stackoverflow.com/q/28576391
type: Question
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/45462394
tagged with: javascript
favorite count: 0
has body: I am trying to return value from function inside function in a nodejs app. Its always coming out to be undefined. var geo = { list: function(callback){ var returnval; gapi.getcodes(function(error, data) { if (error) { console.log(error); } else { returnval = data; console.log(returnval); } }); callback(returnval); } } var geocodes = geo.list(function(){}); console.log("Value of geocodes: "+geocodes); I know gapi.getcodes is asynchronous function and i read on another thread that I should be passing callback function to get the return value. But still the value of geocodes is still coming out to be undefined. When the code runs i see the value returned in console.log(returnval) . How do I get this value to be stored in a var? I am not sure what is wrong. Please help I am trying to learn javascript and object style pattern.
score: 0
linked to: http://stackoverflow.com/q/5596026
possible better answer: http://stackoverflow.com/a/28576450
downvote count: 1
has answer: http://stackoverflow.com/a/28576450
has comment: http://stackoverflow.com/comment/45462084
has title: Returning value of a nested function in NodeJS
has comment: http://stackoverflow.com/comment/45462155
has answer: http://stackoverflow.com/a/28576433
accepted answer: http://stackoverflow.com/a/28576433
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/a/28546002
has comment: http://stackoverflow.com/comment/69700112
upvote count: 13
has body: This is how: // Watch for file updates gulp.task('watch', function () { livereload.listen(); // Javascript change + prints log in console gulp.watch('js/*.js').on('change', function(file) { livereload.changed(file.path); gutil.log(gutil.colors.yellow('JS changed' + ' (' + file.path + ')')); }); // SASS/CSS change + prints log in console // On SASS change, call and run task 'sass' gulp.watch('sass/*.scss', ['sass']).on('change', function(file) { livereload.changed(file.path); gutil.log(gutil.colors.yellow('CSS changed' + ' (' + file.path + ')')); }); }); Also great to use gulp-livereload with it, you need to install the Chrome plugin for it to work btw.
has comment: http://stackoverflow.com/comment/62428882
answers question: http://stackoverflow.com/q/28545843
score: 13
downvote count: 0
type: Answer

http://stackoverflow.com/comment/45478017
comment on: http://stackoverflow.com/a/28584939
type: AnswerComment
score: 0
type: Comment
has text: This answer might be more robust (I don't know), but I try to avoid accessing arrays whenever possible... there's no particular speed hit this time because it gets executed only once, but it feels logically messy to get something from an array if I can get it directly.

http://stackoverflow.com/comment/45997767
comment on: http://stackoverflow.com/q/28437913
has text: m8 if i'm right you need this http://gulpjs.com/
score: 0
type: QuestionComment
type: Comment

replace
tags question: http://stackoverflow.com/q/28449349
tags question: http://stackoverflow.com/q/28563979
tags question: http://stackoverflow.com/q/28449425
tags question: http://stackoverflow.com/q/28485298
tags question: http://stackoverflow.com/q/28576971
tags question: http://stackoverflow.com/q/28573893
tags question: http://stackoverflow.com/q/28489975
tags question: http://stackoverflow.com/q/28577779
tags question: http://stackoverflow.com/q/28547713
tags question: http://stackoverflow.com/q/28518307
type: Tag
tags question: http://stackoverflow.com/q/28586201
tag name: replace
tags question: http://stackoverflow.com/q/28504463
tags question: http://stackoverflow.com/q/28554378

http://stackoverflow.com/a/28451661
type: Answer
has body: you could toggle a class for this: $('#fade').click(function(){ $('.fadeable').toggleClass("fade"); }); .fadeable{ opacity:1; transition:all 0.5s; } .fade{ opacity:0; } I am going to fade Toggle Fade
score: 0
answers question: http://stackoverflow.com/q/28451245

http://stackoverflow.com/q/28510994
has answer: http://stackoverflow.com/a/28511689
upvote count: 6
tagged with: node.js
tagged with: socket.io
has body: Whenever I disconnect using socket.disconnect(); and then reconnect using socket.connect();, the server runs my handshake code twice. The strange thing is, even though the server connection code runs twice, there is only one connection in my array after reconnecting. This happens on an accidental disconnection, intentional, or even if the server restarts. Bit of code: io.on('connection', OnConnect); function OnConnect(socket) { var connection = { socket: socket, realIp: ip, token: GenerateConnToken() }; connections.push(connection); console.log('Connected'); // Client will respond to this by emitting "client-send-info". // This is emitted once on initial connect, but twice on reconnect. socket.emit('acknowledge', connection.token); socket.on('client-send-info', function() { console.log('Client Sent Info'); }); socket.on('disconnect', function() { console.log('Disconnected'); }); } The above code, when a client connects, disconnects, and then reconnects once, will produce the following log: Connected Client Sent Info Disconnected Connected Client Sent Info Client Sent Info Why is it that, when reconnecting, the connection code will run twice, but only create one connection object? EDIT: Upon further inspection, it seems that a different piece of my connection code is being performed twice when the client reconnects. The above code is updated to reflect the relevant information.
type: Question
tagged with: javascript
downvote count: 0
answer count: 1
favorite count: 0
has title: Socket.IO: Reconnect Causes Server Connect Code to Run Twice
type: UnansweredQuestion
tagged with: sockets
score: 6

http://stackoverflow.com/q/28437932
type: Question
tagged with: yql
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has title: Yahoo Query Language - RSS
has answer: http://stackoverflow.com/a/32895311
tagged with: rss
has body: var site = 'www.mysite.com/news.aspx?rss=1'; var yql = 'http://query.yahooapis.com/v1/public/yql?q=' + encodeURIComponent('select * from xml where url="' + site + '"') + '&amp;format=xml'; $.get(yql).done(function (rss) { //do the Things } Currently I have this function trying to load external site RSS feed. Unfortunately it is not loading the feed correctly so I cannot do the Things. This feed was loading correctly using the Google Feeds Api, but as that is being depracated soon I am trying to move to a different method of RSS loading in Javascript (Cross-Domain). Is there something I am doing incorrectly with the YQL url? error="Redirected to a robots.txt restricted URL: http(s)://www.mySite.com/news.aspx?rss=1"
type: UnansweredQuestion
upvote count: 1
score: 1

http://stackoverflow.com/comment/45698046
has text: can use third party service like Yahoo YQL then
comment on: http://stackoverflow.com/q/28570560
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/q/28451322
has title: Convert xml to json in javascript or d3.js
favorite count: 0
linked to: http://stackoverflow.com/q/1773550
duplicate of: http://stackoverflow.com/q/1773550
has comment: http://stackoverflow.com/comment/45230266
answer count: 0
upvote count: 2
tagged with: d3.js
type: UnansweredQuestion
type: Question
score: 2
has comment: http://stackoverflow.com/comment/45230457
tagged with: xml-parsing
has body: I am using d3.xml to parse xml data but it returns document object. So how do I convert xml data to json using javascript or d3.js.
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/28593908
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28592717
has body: In this case you'd better use Page Methods. Update Panels are fine and all but they are better option when you need to return HTML rendered on the server. For a simple true/false type of request you'd better use something more lightweight. Page methods are basically a static method in your page class with an easy to use JavaScript proxy function generated by ASP.NET for you.
downvote count: 0

http://stackoverflow.com/comment/45456342
has text: Downvote for using css properties where the DOM property `childNodes` would have been more appropriate, and for not correctly introducing the value of `i` to the interpreter. Even if this code worked I would never use it.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28558445

package.json
tag name: package.json
tags question: http://stackoverflow.com/q/28506225
type: Tag

http://stackoverflow.com/q/28519651
tagged with: cordova
has comment: http://stackoverflow.com/comment/45358335
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: intel-xdk
type: Question
has title: Using intel xdk with meteor js
score: 1
has comment: http://stackoverflow.com/comment/45667879
downvote count: 0
has body: I am trying to create mobile apps using intel xdk using meteor js. I have tried using the meteor commands through the terminal but i keep getting "Fetching plugin "org.apache.cordova.console@0.2.10" via plugin registry" but it never completes and I cannot move on. I would also like to use intel xdk to access cordova and intel apis.
tagged with: javascript
favorite count: 0
tagged with: intel
tagged with: meteor

http://stackoverflow.com/comment/45321163
type: Comment
comment on: http://stackoverflow.com/a/28500754
score: 0
type: AnswerComment
has text: It works on arrays, not objects (the OP's notation is invalid in the original post). +1 for the very elegant solution.

http://stackoverflow.com/a/46633407
score: 0
type: Answer
has body: I'm consuming Product Hunt API in Python, I guess the request is pretty much the same. You are missing an header with your access token headers = {'Accept':'application/json', 'Content-Type':'application/json', 'Authorization': 'Bearer '+acess_token, 'Host':'api.producthunt.com'} try to add this to your get request, it should return a valid JSON
answers question: http://stackoverflow.com/q/28494109

http://stackoverflow.com/q/28455854
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I have a google CSE embedded that searches the entire web. Say, a user searches for "stackoverflow" he is displayed the results page still ON MY SITE, where "www.stackoverflow.com" is the first result and then there are some moew results, but when he clicks on any of the results the page is opened in a new tab. What I would like to know is, how I could make it so that when any of the results are clicked the page it points to will instead of opening in new tab, be loaded in an iframe still within my site. Also, could this be a legal issue? Looking forward to your replies.
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28456612
tagged with: google-custom-search
has title: Google CSE - instead of redirecting to a page from the results view can I display the page itself embedded on my site?
type: Question

http://stackoverflow.com/q/28556462
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28559799
downvote count: 0
tagged with: drop-down-menu
score: 1
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/28541298
has body: I have dynamic table, in that table every row has a dynamic dropdown list. So every dynamic dropdown list have a unique id, I have to pass this id to the onChange function. And from this onChange function I have get the value of selected dropdown list. Please see this question for more info. ByDefault every job is New Job. If I change the dropdrown list from new Job to close job, then I have to change the status of job new to close job in data base and refresh table, that row will be not in table which change from new to close job, So How I will do using even delegation I am able to get the id of dropdown list But when I use var value=$('#id').va; It gives undefined. So how to get the value of selected drop down list. , Java Script HTML Code Carpenter Services ID Customer Name Customer Mobile Customer Email Status Refresh Server code <?php header('Access-Control-Allow-Origin: *');//Should work in Cross Domaim ajax Calling request mysql_connect("localhost","root","1245"); mysql_select_db("services"); $response = array(); if(isset($_POST['type'])) { $status = $_POST ['status']; $id=$_POST ['id']; $result = mysql_query("UPDATE booking SET sps_id = '$status' WHERE b_id = $id"); if($result){ $response["success"]=1; $response["message"]="Product successfully updated."; echo json_encode($response); } else{ $response["success"]=0; $response["message"]="Product unsuccessfully updated."; echo json_encode($response); } } else{ $response["success"]=0; $response["message"]="Required fields is missing."; echo json_encode($response); } ?>
type: Question
has answer: http://stackoverflow.com/a/28556550
tagged with: http://stackoverflow.com/tag/html
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/45425649
accepted answer: http://stackoverflow.com/a/28556550
has title: How to get value of dropdown list from dynamic array?
possible better answer: http://stackoverflow.com/a/28556694
tagged with: javascript
has answer: http://stackoverflow.com/a/28556694

http://stackoverflow.com/comment/60796589
type: Comment
has text: Isn't there a jsfiddle or jsbin to these steps of Option#1?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28439008

http://stackoverflow.com/comment/45497901
comment on: http://stackoverflow.com/q/28590416
score: 0
has text: Thanks I removed margin-top altogether, and ensured was at the top. The result hasn't changed, IE8/9 still won't show the photos here: http://jasoncampbell.net46.net/details2.html
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28464449
type: Question
has comment: http://stackoverflow.com/comment/45255410
has answer: http://stackoverflow.com/a/28464611
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has comment: http://stackoverflow.com/comment/45256447
has answer: http://stackoverflow.com/a/28464535
answer count: 2
has comment: http://stackoverflow.com/comment/45255770
downvote count: 0
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/1465573
upvote count: 8
type: UnansweredQuestion
score: 8
has body: I am using the following link to create a tree like structure: LINK This is my code : Tree Context Menu - jQuery EasyUI Demo Tree Context Menu and Drag Drop Tree Nodes Right click on a node to display context menu. Press mouse down and drag a node to another position. Save Append Remove Expand Collapse When I am running this, nothing is getting saved. I have added a save button to this structure's code. I want that whenever the user clicks this save button then he could store this tree structure produced as JSON data on his/her local machine. I want this as this tree is editable. How can I do this? I used the following link for the same: link I want that whatever changes that happens to the id = "tt" could be retrieved in the form of JSON and store on my local machine.
tagged with: save
has title: How to save JSON data locally (on the machine)?

http://stackoverflow.com/a/28503303
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28503269
has comment: http://stackoverflow.com/comment/45325679
score: 1
answers question: http://stackoverflow.com/q/28503269
has comment: http://stackoverflow.com/comment/45326227
has comment: http://stackoverflow.com/comment/45326155
has comment: http://stackoverflow.com/comment/45325668
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45327248
has body: You don't need interpolation. Directly use ng-disabled="sroFieldStatus != 1" Read ngDisabled docs If the expression is truthy, then special attribute "disabled" will be set on the element
has comment: http://stackoverflow.com/comment/45325721

http://stackoverflow.com/q/28472584
answer count: 2
has comment: http://stackoverflow.com/comment/45269780
possible better answer: http://stackoverflow.com/a/28472647
has answer: http://stackoverflow.com/a/28473612
accepted answer: http://stackoverflow.com/a/28473612
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has body: When I paste text into my iFrame in IE11 it ignores the /n and instead turns it into whitespace. As I would like to maintain format of pasted text, I wish to keep new lines. Since IE automatically handles new lines as new paragraphs, I would prefer to keep it that way when pasting text. Here is my code //Html is the text obtained from the clipboard. New lines are stored as /n html = html.replace(/\n\n/g, '&lt;/p&gt;&lt;p&gt;&lt;br&gt;'); html = html.replace(/\n/g, '&lt;/p&gt;&lt;p&gt;'); html = '&lt;p&gt;'+html+'&lt;/p&gt;' This works fine for the most part, although the browser for some reasons adds an extra p tag at the start of the pasted text (but no closing tag) This has resulted in quite a few annoying bugs. Is there any better way to go about this?
tagged with: iframe
has answer: http://stackoverflow.com/a/28472647
type: Question
tagged with: internet-explorer
tagged with: javascript
has title: Change new line to wrap in iFrame?
score: 0

http://stackoverflow.com/q/28582516
has comment: http://stackoverflow.com/comment/74967381
has body: I have to run a JavaScript file as an executable to show a dialog with standard buttons from command prompt. I am new to command line programming with java script.
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45472786
score: 2
tagged with: command-prompt
upvote count: 3
has comment: http://stackoverflow.com/comment/45473175
downvote count: 1
has answer: http://stackoverflow.com/a/28582693
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28582587
tagged with: javascript
has title: how to run a js file in command prompt

http://stackoverflow.com/q/28490532
tagged with: audio
type: AnsweredQuestion
has body: Javascript CountDown Timer: When the timer reaches zero, I want an audio recording to play. I've gotten my audio to play, but seconds after it starts, the same audio plays again with the original audio and it never stops. Here is my code: //Javascript Countdown Timer. //set the amount of time click //start timer and the clock will //count down until it reaches zero var message = "Complete."; var parselimit = 0; var st = 0; var limit, curhour, curmin, cursec; function set_limit(strtstop) { //prevent multiple settimeouts if (st) { clearTimeout(st); } if (document.getElementById("pause").value == 1) { limit = document.getElementById("show_timer").innerHTML; } else { limit = document.getElementById("hours").value + ":" + document.getElementById("min").value + ":" + document.getElementById("sec").value; } parselimit = limit.split(":"); // take the minutes x 60 add it to the seconds; parselimit = parselimit[0] * 3600 + parselimit[1] * 60 + parselimit[2] * 1; //exit if timer wasn't set. // if (parselimit <= 0) { return; } if (strtstop == 1) { clearTimeout(st); } else { st = setTimeout("begintimer()", 1000); } } function begintimer() { if (parselimit == 1) { //ding ding ding ///////////////////////////////////ISSUE STATEMENT////// var audio = new Audio('alarmbuzzer.mp3'); audio.play(); alert("starting audio"); /////////////////////////Audio Playing/////////////////// } else { parselimit -= 1; curhour = Math.floor(parselimit / 3600); //alert(parselimit) /* greater than an hour divide by 60 but subtract the hours. */ if (parselimit > 3600) { //first convert hours back into seconds curmin = curhour * 3600; //subtract that from total to get minutes left. curmin = parselimit - curmin; curmin = Math.floor(curmin / 60); //alert(curmin); } else { curmin = Math.floor(parselimit / 60); } cursec = parselimit % 60; } curmin += ""; if (curmin.length == 1 || curmin == 9) { curmin = "0" + curmin; } cursec += ""; //alert(cursec); if (cursec.length == 1 || cursec == 9) { cursec = "0" + curs…
tagged with: http://stackoverflow.com/tag/mp3
type: Question
has comment: http://stackoverflow.com/comment/45302353
accepted answer: http://stackoverflow.com/a/28490778
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28490778
answer count: 1
tagged with: timer
has title: Why Does Javascript Alarm Audio Keep Replaying?

http://stackoverflow.com/a/28482350
has body: Put in console.log($self); and it should appear in your browser's console. Alternatively you could put a watch on $self and a breakpoint in the browser's debug tool (F12 menu)
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28479474
upvote count: 1
answers question: http://stackoverflow.com/q/28479474
type: AcceptedAnswer

http://stackoverflow.com/comment/45313770
has text: If you have license for Highstock, then yes, you can use Highcharts for your charts.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28470898
score: 0

http://stackoverflow.com/comment/45409789
has text: I don't even know where to begin with this, there are 78 errors according to the debugger. Your HTML attribute values are not in quotes, your passing undefined variables into functions as parameters, I think you are trying to pass strings into the functions but they are unquoted. Im not sure where you got this code but it looks like you copy and pasted some template and then tried to make changes to it without a real understanding of how it works. It would probably be easier for me to start from scratch and achieve your goals rather than fix the ridiculous number of errors.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28545826
type: Comment

http://stackoverflow.com/comment/45209331
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28439807
has text: If you'd like, I wrote a script that generates HTML from js objects: https://github.com/ndugger/HTMLBuilder.js you can at the very least, get an understanding of how I generate elements.

http://stackoverflow.com/comment/45312456
score: 0
type: QuestionComment
type: Comment
has text: Should be easy to test?
comment on: http://stackoverflow.com/q/28496336

http://stackoverflow.com/a/28504756
score: 0
has body: Yes. Synchronous calls will block the UI thread.
type: Answer
answers question: http://stackoverflow.com/q/28503839

dc.js
tag name: dc.js
tags question: http://stackoverflow.com/q/28459108
tags question: http://stackoverflow.com/q/28520353
type: Tag

http://stackoverflow.com/a/28566542
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28566492
has body: In Java use lookahead based regex: "abcdefg".split( "(?=[bc])|(?&lt;=[bc])" ); Code: String[] toks = "abcdefg".split( "(?=[bc])|(?&lt;=[bc])" ); for (String tok: toks) System.out.printf("&lt;%s&gt;%n", tok); Output: &lt;a&gt; &lt;b&gt; &lt;c&gt; &lt;defg&gt;
type: Answer

http://stackoverflow.com/comment/45204978
comment on: http://stackoverflow.com/q/28437468
has text: yes that would work, or `onclick=null`
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28450471
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/53441013
has answer: http://stackoverflow.com/a/57473981
has answer: http://stackoverflow.com/a/28451353
has comment: http://stackoverflow.com/comment/68783457
upvote count: 66
has body: I want to send an inline SVG image to a PHP script to Convert it to PNG with Imagick. For that I have to know how to get a base64 String out on an inline SVG. For canvas objects its a simple ".toDataURL()" but that doesn't work with inline SVGs, because its not a global function of elements. test = function(){ var b64 = document.getElementById("svg").toDataURL(); alert(b64); } http://jsfiddle.net/nikolang/ccx195qj/1/ But how to do it for inline SVGs?
downvote count: 0
answer count: 7
score: 66
has comment: http://stackoverflow.com/comment/45228864
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
has answer: http://stackoverflow.com/a/37647909
linked to: http://stackoverflow.com/q/5495952
accepted answer: http://stackoverflow.com/a/28450879
has title: Convert inline SVG to Base64 string
possible better answer: http://stackoverflow.com/a/57473981
has answer: http://stackoverflow.com/a/74885579
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/78430012
has answer: http://stackoverflow.com/a/28450879
linked to: http://stackoverflow.com/q/12592417

http://stackoverflow.com/comment/45329597
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28504487
has text: Forget it, it appears, that I assumed totally different kind of code ; ).
score: 0

http://stackoverflow.com/comment/45295937
has text: Modifying your code: http://jsfiddle.net/j3dbowve/10/ (sorry for the comments barage)
comment on: http://stackoverflow.com/a/28464122
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28462167
score: 0
has comment: http://stackoverflow.com/comment/45250155
answers question: http://stackoverflow.com/q/28462120
type: Answer
has body: Why can't you just do this: &lt;input type ="password" id= "abc" value ="" onblur="change2()" onkeyup="changer();" &gt;

http://stackoverflow.com/comment/45250397
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28461778
has text: Will all the pages that you use be local?

http://stackoverflow.com/q/28467899
type: AnsweredQuestion
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28467929
has comment: http://stackoverflow.com/comment/45261364
has comment: http://stackoverflow.com/comment/45261320
type: Question
has body: $(document).off("click", "#main").on("click", "#main", function () { that = $(this); $('loading').show(); Delay = setInterval(function () { getMenu(that.attr("menu_id")); }, 1000); }); How can I temporary switch off the event event for #main? because if not #main is clickable during the loading, and caused my function to execute multiple times.
score: 0
answer count: 1
has title: off() in jquery to temporary off event
tagged with: javascript
has comment: http://stackoverflow.com/comment/45261330
has answer: http://stackoverflow.com/a/28467929

http://stackoverflow.com/comment/45237052
type: Comment
comment on: http://stackoverflow.com/a/28451398
score: 0
type: AnswerComment
has text: @None Must be something you're doing because I've created a [test HTML document](http://pastebin.com/bNmG5kkv) and it's working fine.

http://stackoverflow.com/q/28456194
linked to: http://stackoverflow.com/q/14220321
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45238920
linked to: http://stackoverflow.com/q/4935632
has body: how to parse data from json file using java script? how to parse data from json file using java script i Got only empty alert box in json file.how to retreive full content of json file data Peter Zara one
type: Question
has comment: http://stackoverflow.com/comment/45238932
answer count: 1
tagged with: javascript
has title: how to parse data from json file using java script
score: 0
has answer: http://stackoverflow.com/a/28456259
has comment: http://stackoverflow.com/comment/45238878

http://stackoverflow.com/q/28505518
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28509750
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28505781
has body: I use GWT i18n Messages to translate messages: @DefaultLocale("en") public interface Messages extends com.google.gwt.i18n.client.Messages { @DefaultMessage("Size") String size(); } For German I have the Messages_de.properties file. size=Größe äüö ÄÖÜ In one of my UIBinder templates I use &lt;ui:text with="{messages.size}"/&gt; When the user's browser is deI get Grösse ÄÖÜ ÄÖÜinstead of Größe äüö ÄÖÜbeing displayed. My workspace as well as my .properties file is set to UTF8. How can I get the special character ß in German being displayed correctly or is there a way to include ASCII code? Solution: When you set CSS text-transform: uppercase; then ß is transformed to SS.
has answer: http://stackoverflow.com/a/28505781
has title: GWT i18n Message Properties does not Display special Character like ß
upvote count: 1
tagged with: internationalization
tagged with: gwt
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28509750
score: 1
tagged with: java
type: Question
answer count: 2
downvote count: 0

http://stackoverflow.com/comment/45365720
type: QuestionComment
has text: Instead of separate functions for up and down, use a single function for all directions. It can check a variable that says which way it should go, and this would be set by the keyboard handler.
type: Comment
comment on: http://stackoverflow.com/q/28524481
score: 0

http://stackoverflow.com/a/28520245
type: Answer
downvote count: 1
has body: Use $http.post in AngularJS, then pass in the JSON-data with a post, then just use the $_POST variable in PHP with json_decode, then you will have an associative array in PHP.
score: -1
has comment: http://stackoverflow.com/comment/45357416
answers question: http://stackoverflow.com/q/28520221
upvote count: 0
has comment: http://stackoverflow.com/comment/45357398

http://stackoverflow.com/comment/45274453
comment on: http://stackoverflow.com/q/28475532
has text: I don't understand why you think `JSON.stringify` would convert it in that way either.
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28449311
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45227559
has comment: http://stackoverflow.com/comment/45227633
upvote count: 1
has body: Normally, you would not be able to do so due to the default Content Security Policy. However, extensions are allowed to relax this policy as long as you serve your file over HTTPS (this is a security requirement to try and prevent MITM). Have a read of CSP documentation. Specifically, say your JS file is served as https://example.com/awesome.js. You can't get away with "I don't need to load an entire .js - just some functions", Chrome needs to evaluate your piece of code if it contains functions. You need to add that to your CSP in the manifest: "content_security_policy": "script-src 'self' https://example.com; object-src 'self'" I don't think you can include an external script through manifest (but you're welcome to try, it'll be interesting); in case of an HTML page like a popup, you can just include a &lt;script&gt; tag in it. Otherwise, you can avoid using eval by creating &lt;script&gt; tag programmatically and adding it to the page. For content scripts you should probably use AJAX/eval (or sort-of-eval with the {code: "..."} form of tabs.executeScript)
answers question: http://stackoverflow.com/q/28444337
type: Answer
has comment: http://stackoverflow.com/comment/45227502
has comment: http://stackoverflow.com/comment/45227482

http://stackoverflow.com/a/28585884
score: 0
answers question: http://stackoverflow.com/q/28585538
type: Answer
has comment: http://stackoverflow.com/comment/45479585
has body: Have you tried it without the DateOfBirth value? Perhaps it isn't able to bind your value 01012001 to the nullable DateTime? I have a feeling it has to be either NULL or a bindable value, else the binding will actually fail.

http://stackoverflow.com/a/28625249
type: Answer
upvote count: 1
downvote count: 1
has body: Minification in AngularJS causes problem if you don't declare the service dependencies list (in an array) followed by the function itself. However, I looked through your code and looks like you got it covered. I could be missing something here, so it's a good idea to go over one more time just in case. On another hand, it could be false negative. I also got some errors in Chrome when I refresh the page before all the dependency js files are fully loaded. Since you have Firebug Persist mode, some requests are not canceled and causes an overflow exception like the 3rd one in your attached image. So for this error, if you turn off the watches, they should go away.
answers question: http://stackoverflow.com/q/28437566
score: 0
has comment: http://stackoverflow.com/comment/47450022

http://stackoverflow.com/a/28490067
downvote count: 0
answers question: http://stackoverflow.com/q/28490029
type: Answer
has body: add flag=true directly after document ready, check for it in your if if (distance&lt;... &amp;&amp; flag===true) and set it to false in the if clause flag = false
upvote count: 1
score: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28490029

http://stackoverflow.com/q/28515619
upvote count: 2
type: UnansweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/45349198
has title: MeteorJS camera preview with picture in transparency
type: Question
tagged with: mobile
has comment: http://stackoverflow.com/comment/45348762
tagged with: javascript
has comment: http://stackoverflow.com/comment/45349242
downvote count: 0
tagged with: meteor
has comment: http://stackoverflow.com/comment/45349157
favorite count: 0
has body: I have to develop a mobile app, that shows the camera preview and an image in transparency at the same time, something like a very simple augmented reality. I would like to use MeteorJS. Is it possible to accomplish the goal with this framework? Thanks a lot.
answer count: 0

http://stackoverflow.com/comment/45458834
comment on: http://stackoverflow.com/q/28574749
score: 0
type: Comment
type: QuestionComment
has text: Have you tried adding another line after your `toggleClass` call? It will work just fine :-)

http://stackoverflow.com/comment/45418652
has text: I am not using express as it is supposed to be a Vanilla node server. Here is the code: https://gist.github.com/rahul1346/ee1d5511d67c054a00f2 I really appreciate the help
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28551177

http://stackoverflow.com/comment/45385449
has text: Simply do not perform logout action until and unless the save or discard their changes.
comment on: http://stackoverflow.com/q/28535592
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/a/32127126
downvote count: 0
type: Answer
upvote count: 1
score: 1
has body: If you $compileProvider.imgSrcSanitizationWhitelist() without the regexp parameter it returns the currently defined regexp . Running this code on an empty angular 1.3.0: app.config(function ($compileProvider) { console.log($compileProvider.imgSrcSanitizationWhitelist()); // }); I got this result - /^\s*((https?|ftp|file|blob):|data:image\/)/ And the base64 encoded JPEG using the basic &lt;img ng-src="{{main.src}}"&gt; actually works as you can see here, and another one with a png. Also look at the console to see the regexp. Another test I've run is to move the data:image/jpeg;base64, out of the scope binded string and put it the ng-src: &lt;img ng-src="data:image/jpeg;base64,{{main.src}}"&gt; As you can see it worked as well. To make a long story short - you don't need to define a regexp in 1.3.0 and above for data:image/*, as it's defined by default. I can't be sure what's the problem, but maybe you've got another definition of imgSrcSanitizationWhitelist somewhere in your code or the data uri is broken somehow.
answers question: http://stackoverflow.com/q/28573169

http://stackoverflow.com/q/28457290
has comment: http://stackoverflow.com/comment/45241073
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
tagged with: orientation
type: UnansweredQuestion
has body: I'm using a code that scale images to fit the parent div, it's called "aspectcorrect". The problem happens on the mobile version: my parent div has 100% width, and when the user changes the orientation of the screen to landscape, the image doesn't resize to fit the new div's width. There is a way to rerun the onload event (which scales the image), when the user changes the orientation of the screen? Here is my website: www.mcsoftware.com.br/sitemc I'm still working on it. (To understand what I'm saying, open it on your cellphone, and when you change the screen orientation just click on "Continuar mesmo assim" to navigate) Thanks! aspectcorrect.js function ScaleImage(srcwidth, srcheight, targetwidth, targetheight, fLetterBox) { var result = { width: 0, height: 0, fScaleToTargetWidth: true }; if ((srcwidth &lt;= 0) || (srcheight &lt;= 0) || (targetwidth &lt;= 0) || (targetheight &lt;= 0)) { return result; } // scale to the target width var scaleX1 = targetwidth; var scaleY1 = (srcheight * targetwidth) / srcwidth; // scale to the target height var scaleX2 = (srcwidth * targetheight) / srcheight; var scaleY2 = targetheight; // now figure out which one we should use var fScaleOnWidth = (scaleX2 &gt; targetwidth); if (fScaleOnWidth) { fScaleOnWidth = fLetterBox; } else { fScaleOnWidth = !fLetterBox; } if (fScaleOnWidth) { result.width = Math.floor(scaleX1); result.height = Math.floor(scaleY1); result.fScaleToTargetWidth = true; } else { result.width = Math.floor(scaleX2); result.height = Math.floor(scaleY2); result.fScaleToTargetWidth = false; } result.targetleft = Math.floor((targetwidth - result.width) / 2); result.targettop = Math.floor((targetheight - result.height) / 2); return result; } onimageload.js function OnImageLoad(evt) { var img = evt.currentTarget; // what's the size of this image and it's parent var w = $(img).width(); var h = $(img).height(); var tw = $(img).parent().width(); var th = $(img).parent().height(); // compute the new size and offsets var resul…
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28457542
tagged with: mobile
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45282226
has title: Rerun javascript function when screen orientation changes

http://stackoverflow.com/a/28472599
score: 1
has comment: http://stackoverflow.com/comment/45292116
upvote count: 1
type: Answer
has body: A solution to your problem here lies in appending properties of one object to another is useful here. First, the append function I use - var appendObject = function(obj, toAppend) { Object.keys(toAppend).forEach(function(el) { Object.defineProperty(obj, el, Object.getOwnPropertyDescriptor(toAppend,el)); }); return obj; } What this does is pretty simple - it walks through toAppend's properties and uses their property descriptors to define new properties on obj. It is mutating obj, but returns it as well so you can chain it if you needed to. With this function, you can them have the frontEndDevFactory be implemented like this - function frontEndDevFactory (name, age, pullupCount, rockStar){ var programmer = programmerFactory(name, age); var newDev = Object.create(frontEndProto, { pullupCount: {writable: true, enumerable: true, value: pullupCount}, rockStar: {writable: false, enumerable: true, value: rockStar} }); appendObject(newDev, programmer); return newDev; } Here's a fiddle modifying your code that demonstrates this.
answers question: http://stackoverflow.com/q/28471877
downvote count: 0

http://stackoverflow.com/comment/63356844
score: 3
has text: that code only works on some strings. e.g. decode36(encode36("FooBarW000t")) -> foobarw000w
type: Comment
comment on: http://stackoverflow.com/a/28512522
type: AnswerComment

http://stackoverflow.com/a/28438246
type: Answer
has body: From Digigizmo's comment, the answer was to escape the escaped characters: if (loopCache.indexOf('&lt;ul class=\\"bullet-list-round\\"&gt;') &gt; -1){ }
upvote count: 1
downvote count: 1
score: 0
answers question: http://stackoverflow.com/q/28438029

http://stackoverflow.com/comment/45435765
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28562372
has text: 16 ms is very short, you can have a lot of logic, and various browsers have different speeds of execution.
type: AnswerComment

http://stackoverflow.com/a/28520970
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45358747
has comment: http://stackoverflow.com/comment/45358786
has comment: http://stackoverflow.com/comment/45358683
upvote count: 1
answers question: http://stackoverflow.com/q/28520724
has body: a link then: $('#actualLink').click(function(e){ $('.toggler')[0].click(); // click the toggler.. location.hash = e.target.href; }); That should work. JSFiddle: http://jsfiddle.net/9fkcbqvh/
has comment: http://stackoverflow.com/comment/45358716
score: 1
has comment: http://stackoverflow.com/comment/45358763

http://stackoverflow.com/q/28537478
tagged with: php
has answer: http://stackoverflow.com/a/28537693
has comment: http://stackoverflow.com/comment/45389266
type: AnsweredQuestion
tagged with: url-parameters
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45389355
type: Question
linked to: http://stackoverflow.com/q/11582512
has answer: http://stackoverflow.com/a/28537685
accepted answer: http://stackoverflow.com/a/28537685
has body: How can I have my dropdown selected with an url parameter? I found this: Dropdown selected based on URL parameter - PHP or jQuery? But it does not work for me. What am I doing wrong? My url would be: kontakt.php?Betreff=3 script: var val = location.href.match(/[?&]Betreff=(.*?)[$&]/)[1]; // get params from URL $('#Betreff').val(val); // assign URL param to select field and: First Second Third
linked to: http://stackoverflow.com/q/23591754
has comment: http://stackoverflow.com/comment/45389173
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28537693
answer count: 3
upvote count: 1
has title: Dropdown selected with URL parameter
has answer: http://stackoverflow.com/a/28537885
favorite count: 0

http://stackoverflow.com/comment/45451319
has text: Sure does... but the tooltips don't work even if I include _only_ the Bokeh JS.
comment on: http://stackoverflow.com/q/28570586
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28587866
has comment: http://stackoverflow.com/comment/45485466
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28587145
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45486126
has comment: http://stackoverflow.com/comment/45485206
has comment: http://stackoverflow.com/comment/45485518
type: Answer
has comment: http://stackoverflow.com/comment/45485708
has comment: http://stackoverflow.com/comment/45495507
has comment: http://stackoverflow.com/comment/45486891
has comment: http://stackoverflow.com/comment/45486776
has body: First of all about doProcessing promisify it: process = Promise.promisify(doProcessing); There is no sense in working with callbacks in this case if you already have bluebird included. Now it returns a promise and you can easily work with it. As for the other part of the question you need all pairs - you can refactor that to an async nested for loop: return Promise.each(array1, function(val1){ return Promise.each(array2, function(val2){ return process(val1, val2); }); }).then(function(){ // all done }); Note that if the arrays contain just numbers do a normal loop rather than promises - each is useful here in case the values are themselves obtained from an async source. Alternatively - here is a more functional way with Ramda: var all = Promise.all.bind(Promise); var wait = R.compose(all, R.map(all), R.xprod); wait(arr1, arr2).map(R.apply(process));
has comment: http://stackoverflow.com/comment/45485676
answers question: http://stackoverflow.com/q/28587145
score: 3

http://stackoverflow.com/comment/45408059
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28547297
has text: http://stackoverflow.com/questions/16344354/how-to-make-blinking-flashing-text-with-css3

http://stackoverflow.com/comment/45253352
comment on: http://stackoverflow.com/a/28463292
type: AnswerComment
has text: This will fail where the *lang* attribute is an empty string, e.g. ` `. Better to use [*hasAttribute*](http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElHasAttr).
score: 0
type: Comment

http://stackoverflow.com/q/28508226
has answer: http://stackoverflow.com/a/28508264
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has title: HTML code not working the line
favorite count: 0
has answer: http://stackoverflow.com/a/28508272
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45335481
has answer: http://stackoverflow.com/a/28508477
has body: This seems to work for everyone but me; no matter what I try it says there is a line break error on test.innerHTML += "&lt;input type='radio' name='choices' value='A'&gt;"+chA"&lt;br&gt;"; that line i've tried all the options but I don't see it working at all. Any help would be great; thanks.
upvote count: 0
has comment: http://stackoverflow.com/comment/45335506
has comment: http://stackoverflow.com/comment/45376993
has comment: http://stackoverflow.com/comment/45335526
type: Question
downvote count: 2
score: -2
has comment: http://stackoverflow.com/comment/45335614
tagged with: javascript

http://stackoverflow.com/comment/45383593
has text: check my answer [here](http://stackoverflow.com/a/26882739/1139099)
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28534491

http://stackoverflow.com/a/29404777
downvote count: 0
type: Answer
upvote count: 6
has body: I know this is a bit late, but I was busy with the same problem for a day now, and I investigated the issue. I assume, that what you want to achieve is a dynamic loading and switching of a template at runtime. The reason you get the error in the replaceWith() call lies in the internal use of the .find() method and in principle you (just like me) are doing it wrong, with wrong meaning, not the Angular way. You are trying to replace the element, that defines the directive. You can imagine the element BEING the directive (if you put water into a teapot...). This can be done at the link function, but after the directive is set up and a part of the DOM, you would kind of remove the directive itself from the DOM by replacing it, which does not play well with how Angular's selectors work. So what you can do instead, and what I am doing now is... just replace its contents! var renderTemplate = function (scope, element, template) { var loader = Pages.getTemplate(template, false); var promise = loader .success(function(html) { var rendered = $compile(html)(scope); element.empty(); element.append(rendered); }); }; So your directive either has a wrapping element you replace it with in the standard template, or you do not replace the element it all. Either way, replace the content of your directive and not the directive itself and it should work correctly! Become like the water, my friend.
has comment: http://stackoverflow.com/comment/49961356
answers question: http://stackoverflow.com/q/28502576
score: 6

http://stackoverflow.com/q/28517910
tagged with: javascript
has answer: http://stackoverflow.com/a/30224770
tagged with: tdd
tagged with: reactjs
answer count: 2
downvote count: 0
favorite count: 0
upvote count: 2
type: UnansweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/53242225
has title: Unit testing on "react + react-route" stack
has answer: http://stackoverflow.com/a/45836599
tagged with: unit-testing
type: Question
has body: I've read many recommendations of how it's possible to render routed via react-router components, but I still can't to make it work. I tried to find it using github codebase search, still no luck. And at this point all I need is one working example. Here is my boilerplate project, but maybe it's not important. I just want to see some react-route unit-testing working example.
tagged with: testing
has comment: http://stackoverflow.com/comment/46525495

http://stackoverflow.com/a/74035619
type: Answer
has body: Use addEventListener function iframe.addEventListener("readystatechange", () => { if (iframe.readyState == "complete") { alert("Iframe is now loaded."); } });
answers question: http://stackoverflow.com/q/28530144
score: 0

http://stackoverflow.com/comment/45310306
score: 0
type: QuestionComment
has text: please share your html code also
comment on: http://stackoverflow.com/q/28495206
type: Comment

http://stackoverflow.com/a/28537182
answers question: http://stackoverflow.com/q/28537100
score: 0
has comment: http://stackoverflow.com/comment/45388524
type: Answer
has body: The animate()-function supports a complete-callback: $(".navigation-bar1").click(function() { $('html').animate({ scrollTop: $(".navigation-bar2").offset().top }, 'slow', function(){ $("body").toggleClass("navbar-down"); // OR $(".trigger-navbar").click(); }); }); .animate() Demo
has comment: http://stackoverflow.com/comment/45389231

http://stackoverflow.com/q/28474366
has answer: http://stackoverflow.com/a/28474481
type: Question
tagged with: local
tagged with: target
tagged with: hyperlink
tagged with: javascript
score: 0
answer count: 1
has title: Link to local folder in mobile application
type: UnansweredQuestion
has body: I have a question. Is it possible to link from START.HTML. to specified folders /Aanpas project/assets/www/View/no_records.html (Woman section) /Aanpas project/assets/www/View men/no_records.html (Men section) My project folder is structured like : +SCR - Main activity +Gen -Assets -WWW --View ---About html ---Birth control_single.html ---No_records.html ---start.html --View men ---About html ---Birth control_single.html ---No_records.html I have tried it with the following code but it didn't work. &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script&gt; function newDoc() { window.location.assign("../Aanpas project/assets/www/View/no_records.html") } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="button" value="Load" onclick="newDoc()"&gt; &lt;/body&gt; &lt;/html&gt; Pictures of Idea and Project structure Link to project stucture Link to idea of application

http://stackoverflow.com/comment/45249562
type: QuestionComment
comment on: http://stackoverflow.com/q/28461579
score: 0
has text: If you go directly to http://localhost:63342/views/modal.html in your browser, it pulls the template up?
type: Comment

http://stackoverflow.com/q/28536527
answer count: 1
has title: How to create request with SOAP message with JavaScript?
type: UnansweredQuestion
tagged with: soap
tagged with: web-services
has comment: http://stackoverflow.com/comment/45462606
score: 0
type: Question
has answer: http://stackoverflow.com/a/28576587
tagged with: javascript
has body: I have a Web Service and I want to call some method. For this I create: But every time I have error parseerror with "Cannot read property 'documentElement' of null". But when I call my service from Google Chrome application "Postman", I haven't error. How to create SOAP request to my Web Service using Java Script?

http://stackoverflow.com/comment/45432520
score: 0
type: AnswerComment
type: Comment
has text: @Alex can you explain why I dont need cloning? thanks
comment on: http://stackoverflow.com/a/28560310

http://stackoverflow.com/q/28491667
tagged with: stack-trace
upvote count: 1
type: AnsweredQuestion
has body: I working on a framework. I want to define a CompositeError class which means that it can contain other related errors... var err1 = new Error("msg1"); var err2 = new TypeError("msg2"); var err3 = new Error("msg3"); var err = new CompositeError({ errors: [err1, err2, err3] }); Now by v8 I have a stack something like this by a simple error: var stackString = [ "Error", " at module.exports.extend.init (http://example.com/example.js:75:31)", " at new Descendant (http://example.com/example.js:11:27)", " at custom (http://example.com/spec/example.spec.js:222:23)", " at Object.&lt;anonymous&gt; (http://example.com/spec/example.spec.js:224:13)", " at http://example.com/spec/example.spec.js:10:20" ].join("\n"); There are several Stack parser libraries, for example: https://github.com/stacktracejs/stacktrace.js Now what do you think, how can I merge the stacks of the 4 Error instances into one and stay parser compatible? (Note that we are talking about asynchronous code, so unlike synchronous code, the 4 errors can have completely different stacks.) conclusion I decided not to be stack parser compatible by composite errors. I simply write the path of the property e.g. x.y.z and the stack of the sub Error. try { try { throw new df.UserError("Something really bad happened."); } catch (cause) { throw new df.CompositeError({ message: "Something really bad caused this.", myCause: cause }); } catch (err) { console.log(err.toString()); // CompositeError Something really bad caused this. console.log(err.stack); // prints the stack, something like: /* CompositeError Something really bad caused this. at null.&lt;anonymous&gt; (/README.md:71:11) ... caused by &lt;myCause&gt; UserError Something really bad happened. at null.&lt;anonymous&gt; (/README.md:68:9) ... */ } This is somewhat similar to java and other languages which support nested Errors. It can be easily nested like this: new df.CompositeError({ message: "A complex composite error.", x: new df.CompositeError({ message: "Neste…
possible better answer: http://stackoverflow.com/a/71548006
has answer: http://stackoverflow.com/a/28511916
has answer: http://stackoverflow.com/a/71548006
type: Question
answer count: 2
has title: Javascript V8 composite Error stack format
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28511916
score: 1
tagged with: error-handling

http://stackoverflow.com/q/28506654
answer count: 3
has comment: http://stackoverflow.com/comment/45332477
tagged with: getelementbyid
tagged with: http://stackoverflow.com/tag/xml
has title: read from XML in java
has comment: http://stackoverflow.com/comment/45332945
has comment: http://stackoverflow.com/comment/45332579
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28507311
has comment: http://stackoverflow.com/comment/45332577
has body: I'm trying to read from xml by this code and its not working .. I need to read from id in the specific tag (getelementbyid) what I need to change in my java code THIS is my xml code <first id=1 name="Kiran"/> <first id=2 name="Pai"/> 22 <first id=1 name="Bill"/> <first id=2 name="Gates"/> 46 <first id=1 name="Steve"/> <first id=2 name="Jobs"/> 40 and this is my java code import java.io.File; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class XMLReader { public static void main(String argv[]) { try { File file = new File("c:\\MyXMLFile.xml"); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(file); doc.getDocumentElement().normalize(); System.out.println("Root element " + doc.getDocumentElement().getNodeName()); NodeList nodeLst = doc.getElementsByTagName("employee"); System.out.println("Information of all employees"); for (int s = 0; s < nodeLst.getLength(); s++) { Node fstNode = nodeLst.item(s); if (fstNode.getNodeType() == Node.ELEMENT_NODE) { Element fstElmnt = (Element) fstNode; NodeList fstNmElmntLst = fstElmnt.getElementsByTagName("firstname"); Element fstNmElmnt = (Element) fstNmElmntLst.item(0); NodeList fstNm = fstNmElmnt.getChildNodes(); System.out.println("First Name : " + ((Node) fstNm.item(0)).getNodeValue()); NodeList lstNmElmntLst = fstElmnt.getElementsByTagName("lastname"); Element lstNmElmnt = (Element) lstNmElmntLst.item(0); NodeList lstNm = lstNmElmnt.getChildNodes(); System.out.println("Last Name : " + ((Node) lstNm.item(0)).getNodeValue()); } } } catch (Exception e) { e.printStackTrace(); } } }
tagged with: java
has comment: http://stackoverflow.com/comment/45332657
type: Question
has answer: http://stackoverflow.com/a/28508598
has answer: http://stackoverflow.com/a/28508512
has comment: http://stackoverflow.com/comment/45332739
tagged with: javascript
has comment: http://stackoverflow.com/comment/45333780
has comment: http://stackoverflow.com/comment/45332755
score: 0

http://stackoverflow.com/a/28658806
has body: Based on your question, I'd say that you're probably running into this general problem for two related reasons - You're using backbone exclusively, rather than a framework like Marionette or Chaplin. Your views are "too big" and trying to incorporate too much material into a single view. I almost never include logic into templates and that's because I almost never need to. That's because I write a lot of very small views, and piece them together to make large views. Marionette's view classes make this very easy to do, by subclassing the backbone view into different view types, adding additional utilities and drastically cutting down on boilerplate. Marionette is also very good at handling nested views, which really allow you to drill down and create the exact view tool you need for a specific use case. It's not at all uncommon to be able to define a useful view using Marionette in 1-2 lines of code, which gives you a lot of flexibility to make very small, efficient views. The disadvantage to making lots of small views is that it's a lot of code to write, and could become difficult to maintain, but Marionette makes that disadvantage relatively insignificant. Marionette only took me a couple of days to get the hang of, and I highly recommend integrating it into your Backbone apps for exactly this problem. When your views are big, and try to do too much, you wind up with the problem you're describing - you have to modify them too much to fit your specific needs and your code gets ugly and hard to read. When you have a lot of small views, they're very responsive and need little if any customization. The example from your question is, I think, a border line case. My gut instinct would be to create two entirely separate views and run them under the following pseudo code: editableView = { //definition }} disabledView = { //definition }} if (newModel) editableView.render() else disabledView.render() This is my gut instinct because my bet is that there are other differences …
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28591004
upvote count: 1

http://stackoverflow.com/comment/45504466
comment on: http://stackoverflow.com/q/28534473
type: Comment
type: QuestionComment
has text: @Bergi Perhaps not - I haven't looked much at the fundamental idea behind a trie, but it is structured like one, and follows the same idea, minus, perhaps, the compression you're talking about. And `count` represents the number of times that the combination has been recorded, thus recording probability.
score: 0

http://stackoverflow.com/comment/45419567
has text: Is `_Rf_pf` OK? https://github.com/wch/r-source/blob/07ac1e21db175ac877530a5d0105906911e56c18/src/include/Rmath.h0.in#L272
score: 1
comment on: http://stackoverflow.com/a/28535994
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45447975
type: QuestionComment
type: Comment
has text: didnt seem to work, I ended up moving the overlay below the span and used css and its working now
comment on: http://stackoverflow.com/q/28568560
score: 0

http://stackoverflow.com/q/28458812
has comment: http://stackoverflow.com/comment/45249075
tagged with: grunt-spritesmith
type: UnansweredQuestion
answer count: 0
tagged with: sprite
type: Question
tagged with: javascript
has body: When I run task: grunt sprite I receive this error: jit-grunt: Plugin for the "sprite" task not found. If you have installed the plugin already, please setting the static mapping. See https://github.com/shootaroo/jit-grunt#static-mappings Warning: Task "sprite" failed. Use --force to continue. Aborted due to warnings. Grunfile.js &amp; --config-debug here: https://gist.github.com/JosephWM/c43530246cc0ba5d060a All tasks works fine, but I cannot run grunt-spritesmith. Please help. update: problem solved. U can see code of changed files here (link in comment)
tagged with: gruntjs
has comment: http://stackoverflow.com/comment/45287097
score: 0
has title: grunt-spritesmith and load-grunt-config doesn't work

http://stackoverflow.com/a/28545930
has comment: http://stackoverflow.com/comment/45435930
has comment: http://stackoverflow.com/comment/45437501
has comment: http://stackoverflow.com/comment/45437297
has comment: http://stackoverflow.com/comment/45433353
has comment: http://stackoverflow.com/comment/45438084
accepted answer of: http://stackoverflow.com/q/28544444
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28544444
has comment: http://stackoverflow.com/comment/45436841
has comment: http://stackoverflow.com/comment/45437569
score: 0
has comment: http://stackoverflow.com/comment/45436065
has comment: http://stackoverflow.com/comment/45436494
type: Answer
has body: You can select the div parent instead : $('a.Hide').click(function () { $(this).parent().hide(); $(this).parent().fadeIn(2000); }); OR, you can add the attribute rel to your like following : echo "Edit"; echo "Hide"; And then : $('a.Hide').click(function () { var id = $(this).attr('rel'); $('#message' + id).hide(); $('#message' + id).fadeIn(2000); }); For the edit button, change id="pmessage" to class="pmessage", the ID must be unique : $('a.Edit').click(function () { if ($(this).text() == "Edit") { $(this).parent().find('.pmessage').css("color", "red"); $(this).text("Unedit"); // <-- HERE, use $(this) instead } else { $(this).parent().find('.pmessage').css("color", "black"); $(this).text("Edit"); // <-- HERE, use $(this) instead } }); About the save part : $('a.Save').click(function (e) { e.preventDefault(); var $form = $(this).parent().find('form'), $this = $(this); $.ajax({ type: $form.attr('method'), url: $form.attr('action'), data: $form.serialize(), beforeSend : function(){ $this.text("Saving..."); }, success: function(data) { $this.text("Saved"); }, error: function(){ $this.text("Unsaved"); } }); }); /* $("#1234").submit(function(e) { e.preventDefault(); var $this = $(this); $.ajax({ type: $this.attr('method'), url: $this.attr('action'), data: $this.serialize(), beforeSend : function(){ $("a.Save").text("Saving..."); }, success: function(data) { $("a.Save").text("Saved"); }, error: function(){ $("a.Save").text("Unsaved"); } }); }); */ Create one form for each comment : function displayMsg($id, $comment){ echo ' '; echo ' '.$comment.' '; echo 'Save'; echo 'Edit'; echo 'Hide'; echo ' '; echo ' '; echo ' ' echo ' '; } NB : You need to change the a.save click statement.
has comment: http://stackoverflow.com/comment/45424088
has comment: http://stackoverflow.com/comment/45435371

http://stackoverflow.com/a/28474341
has comment: http://stackoverflow.com/comment/45272376
has comment: http://stackoverflow.com/comment/45272438
has body: You can achieve this with a combination of CSS attribute selectors and re-using your existing functions, but making them more generic. DEMO JavaScript: function getKey(element) { return element.href; } function sameGroupAs(element) { var key = getKey(element); return function () { return getKey(this) === key; } } $(document).on("mouseenter", "a", function () { $("a").filter(sameGroupAs(this)).addClass("active"); }).on("mouseleave", "a", function () { $("a").filter(sameGroupAs(this)).removeClass("active"); }); Then the CSS: a[href*="wikipedia"].active { background:red; } a:not([href*="wikipedia"]).active { background:green; }
downvote count: 0
answers question: http://stackoverflow.com/q/28474077
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28474077
type: AcceptedAnswer
type: Answer
score: 3

http://stackoverflow.com/a/28481049
downvote count: 0
answers question: http://stackoverflow.com/q/28480982
score: 5
has body: var listeners = []; //add listeners in whatever order you want them executed document.addEventListener("DOMContentLoaded", function(event) { for (var i = 0; i &lt; listeners.length; i++) { listeners[i](); } });
upvote count: 5
type: Answer

http://stackoverflow.com/q/28438642
tagged with: javascript
has comment: http://stackoverflow.com/comment/45207046
has comment: http://stackoverflow.com/comment/45207145
downvote count: 4
has title: HTML - Reducing html code redundancy
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45207118
favorite count: 0
has comment: http://stackoverflow.com/comment/45207169
score: -3
tagged with: http://stackoverflow.com/tag/html
has body: I was wondering if there is a way to shorten my HTML code. I'm currently using bootstrap for laying out this webpages. The menu on my page is repeated throughout the pages and if it gets updated, you update page by page. Is there perhaps any way to shorten the whole HTML code... &lt;div class="navbar navbar-fixed-top" role="navigation" &lt;div class="container"&gt; ... &lt;/div&gt; &lt;div&gt; ... by using javascript or any in any kind of way.
accepted answer: http://stackoverflow.com/a/28438910
has comment: http://stackoverflow.com/comment/45207212
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45207051
has answer: http://stackoverflow.com/a/28438910
type: Question

http://stackoverflow.com/a/28513589
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45345219
answers question: http://stackoverflow.com/q/28513531
score: 0
accepted answer of: http://stackoverflow.com/q/28513531
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/45345237
has body: Try this :- var obj = $.parseJSON('["simmakkal madurai","goripalayam madurai"]'); If you alert(obj[0]), you will get answer as simmakkal madurai
has comment: http://stackoverflow.com/comment/45345264

http://stackoverflow.com/comment/45489538
score: 0
type: Comment
has text: I posted the line of code that refers to my image tag. I also checked the sources tab in chrome and I do see the ok zoom in my assets folder (with the typical asset pipeline stuff appended to the name).
type: AnswerComment
comment on: http://stackoverflow.com/a/28589523

http://stackoverflow.com/a/28580967
type: AcceptedAnswer
upvote count: 6
type: Answer
has body: It's a scope thing but you don't want to use $rootScope; putting the following in your link function should be enough: scope.$state = $state;
answers question: http://stackoverflow.com/q/28580827
has comment: http://stackoverflow.com/comment/72746293
score: 6
accepted answer of: http://stackoverflow.com/q/28580827
downvote count: 0
has comment: http://stackoverflow.com/comment/64993663

http://stackoverflow.com/q/28487545
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28487902
has body: In my application I am taking the locale value and then trying to replace shorter month names to full ones. Below is the code snippet var localeCookie = $.cookie("org.springframework.web.servlet.i18n.CookieLocaleResolver.LOCALE"); if(localeCookie === null || localeCookie === undefined || localeCookie === "en") { localeCookie = ""; } $.datepicker.setDefaults( $.datepicker.regional[ localeCookie ] ); var completeMonthNames = $.datepicker.regional[ localeCookie ].monthNames; How to make the above code work? I have looked up the variable "localeCookie" through firebug and it does take the language parameter like "fr", "de" etc. It works well for "en" default locale, but for other locales even when the debugger says that it has correct values, still the javascript says it cannot find definition. I have tried wrapping localeCookie around string like $.datepicker.regional[String(localeCookie)] but it still refuses to work? What type constraint am I not reading in the jQuery documentation?
has comment: http://stackoverflow.com/comment/45296898
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45297406
has comment: http://stackoverflow.com/comment/45297339
type: Question
has answer: http://stackoverflow.com/a/28487902
has comment: http://stackoverflow.com/comment/45297229
tagged with: jquery-ui
has title: How to properly set jQuery calendar widget regional setting?
tagged with: javascript
tagged with: jquery-ui-datepicker
score: 0
answer count: 1

http://stackoverflow.com/comment/45528336
score: 0
type: QuestionComment
has text: I think your proposed model for service-location-price is a good one. Can you explain why you'd need aggregation or map-reduce for your queries? As I understand the model and your queries, you just need regular `find`s.
type: Comment
comment on: http://stackoverflow.com/q/28581034

http://stackoverflow.com/comment/45274349
has text: Thats what I wrote 45 mins ago and got -1 for it :\ Instead duplicating my answer you can just support my answer.
type: AnswerComment
comment on: http://stackoverflow.com/a/28475460
score: 0
type: Comment

http://stackoverflow.com/a/28569722
answers question: http://stackoverflow.com/q/28569485
has body: You need to create a multidimensional array before you can use it. matrix = []; matrix[nb1] = []; matrix[nb1][nb2] = myValue; Reference: http://www.stephanimoroni.com/how-to-create-a-2d-array-in-javascript/
has comment: http://stackoverflow.com/comment/45449567
score: 0
type: Answer

http://stackoverflow.com/q/28536559
has title: angular js text to speech conversion api
has body: Have anybody used an angular js API to convert text to speech (that is browser independent too? I'm currently using google chromes functionality to implement my text to speech functionality, i need to replace it with angular js. My intention is that my app speaks out "three" "two" "one" for a particular functionality based on a timer.
tagged with: angularjs
type: UnansweredQuestion
tagged with: text-to-speech
type: Question
has answer: http://stackoverflow.com/a/30040621
tagged with: javascript
score: 0
answer count: 1
tagged with: angular-ui

http://stackoverflow.com/a/28481112
has comment: http://stackoverflow.com/comment/45285577
type: Answer
answers question: http://stackoverflow.com/q/28480151
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has body: You can set the name attribute of the select to a blank string. $(document).ready(function(){ $('#option_selector').change(refresh_inputs); refresh_inputs(); }); function refresh_inputs() { var name = $('#option_selector').attr('name'); var val = $('#option_selector').val(); $('#' + name + ' div').hide(); $('#' + name + ' div select').attr('name', ''); $('#' + val).show(); $('#' + val + ' select').attr('name', 'varintBusinessTypeID'); } Also you probably don't want 2 elements in the DOM with the same ID (varintBusinessTypeID).
accepted answer of: http://stackoverflow.com/q/28480151

http://stackoverflow.com/a/28518739
answers question: http://stackoverflow.com/q/28517500
has body: I used something similar to track number of requests sent, which are waiting for response. Add an http-interceptor on app level: .config(['$httpProvider', function($httpProvider) { $httpProvider.interceptors.push('RequestCounterInterceptor'); } ]) The code of interceptor (you can modify it to handle just requests to your API's url): .factory('RequestCounterInterceptor', ['RequestCounterService', '$q', function(RequestCounterService, $q) { return { 'request': function(request) { RequestCounterService.increase(); return request; }, 'requestError': function(request) { RequestCounterService.increase(); return $q.reject(request); }, 'response': function(response) { RequestCounterService.decrease(); return response; }, 'responseError': function(response) { RequestCounterService.decrease(); return $q.reject(response); } }; } ]) The service: .service('RequestCounterService', ['$log', function($log) { var currentRequestCount = 0; // init return { increase: function() { currentRequestCount++; $log.log("currentRequestCount ", currentRequestCount); }, decrease: function() { currentRequestCount--; $log.log("currentRequestCount ", currentRequestCount); }, getCount: function() { return currentRequestCount; } }; } ]) Then anywhere in you controller, directive... you can use RequestCounterService.getCount() to see how many requests have been sent and did not received response yet. You could display a message to user like There are currently XY requests being processed by the server or similar. But in case the processing takes too much time, you should solve your issue server-side as James Gaunt proposed in comments.
score: 0
type: Answer

http://stackoverflow.com/q/28518958
linked to: http://stackoverflow.com/q/11988415
answer count: 1
accepted answer: http://stackoverflow.com/a/28767937
has comment: http://stackoverflow.com/comment/45355086
tagged with: uirepeat
tagged with: javascript
tagged with: jquery
has body: I'm working on a datatables JQuery in a JSF page, but the issue is that the pagination doesn't work in spite of it is shown. This is my page: <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://java.sun.com/jsf/passthrough" xmlns:c="http://java.sun.com/jsp/jstl/core"> <h:head> Test-Page </h:head> <h:body class="dt-example"> <h:form> <ui:repeat var="ee" value="#{controller.address}" varStatus="row"> <ui:repeat value="#{ee.entrySet().toArray()}" var="entete1"> <h:outputLabel value="#{entete1.key}" rendered="#{row.index == 0}" /> </ui:repeat> <ui:repeat value="#{ee.entrySet().toArray()}" var="entete"> <h:outputLabel value="#{entete.value}" /> </ui:repeat> </ui:repeat> </h:form> </h:body> </ui:composition> As long as bPaginate is true i believe that the pagination has to work with no problem at all except that my page it is not the case. Any idea ? NB: i khnow that there is datatable and extendtables in jsf and richfaces but i have to work juste with With the code above.
has comment: http://stackoverflow.com/comment/45355407
has comment: http://stackoverflow.com/comment/45355472
type: AnsweredQuestion
tagged with: datatables
type: Question
has answer: http://stackoverflow.com/a/28767937
has title: Why the pagination datatables JQuery doesn't work with JSF ui:repeat?
has comment: http://stackoverflow.com/comment/45355213
tagged with: jsf
score: 0

http://stackoverflow.com/a/28444234
has body: I think need to figure out the logic better - perhaps this can be condensed but here is a full if block containing all possible conditions that you'd need to flesh out. if(todayDate.isAfter(firstPayment)) { if (todayDate.isBefore(secondPayment)) { lastInterestPaymentDate.text(firstPayment.add(-1,'years').format('DD MMM YYYY')); nextInterestPaymentDate.text(secondPayment.format('DD MMM YYYY')); } else if (todayDate.isAfter(secondPayment)) { // ?? } else { // todayDate equals secondPayment // ?? } } else if (todayDate.isBefore(firstPayment)) { if (todayDate.isBefore(secondPayment)) { // ?? } else if (todayDate.isAfter(secondPayment)) { // ?? } else { // todayDate equals secondPayment // ?? } } else { // todayDate is equal to firstPayment if (todayDate.isBefore(secondPayment)) { // ?? } else if (todayDate.isAfter(secondPayment)) { // ?? } else { // todayDate equals secondPayment // ?? } } As you can see my comment above is wrong, there are nine conditions not six.
accepted answer of: http://stackoverflow.com/q/28443725
answers question: http://stackoverflow.com/q/28443725
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45246946

http://stackoverflow.com/comment/45255346
type: Comment
comment on: http://stackoverflow.com/a/28447231
has text: not having any luck getting that running there must be an easier way
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45391822
type: AnswerComment
type: Comment
has text: Ooops @rsb, I wanted to say "for turbolinks"
comment on: http://stackoverflow.com/a/28538347
score: 1

http://stackoverflow.com/a/56014403
has comment: http://stackoverflow.com/comment/136047739
has body: PauseAnimation when used in a SequentialAnimation can be used to implement a delay and can be done completely declaratively, e.g. Button { text: "Run" onClicked: SequentialAnimation { ScriptAction { script: result.setText(1) } PauseAnimation { duration: 1000 } ScriptAction { script: result.setText(2) } PauseAnimation { duration: 1000 } ScriptAction { script: result.setText(3) } PauseAnimation { duration: 1000 } ScriptAction { script: result.setText(4) } PauseAnimation { duration: 1000 } ScriptAction { script: result.setText(5) } } } Label { id: result y: 50 text: "Results" function setText(t) { text = t } } You can Try it Online! If you want a Javascript solution, we can implement a setTimeout look-a-like function using Component to instantiate a Timer object. When the Timer triggers, it will execute the supplied function and clean up by destroying the Timer object. Button { text: "Run" onClicked: { for (let i = 0; i < 5; i++) setTimeout(results.setText, i * 1000, i+1); } } Text { id: results y: 50 text: "Results" function setText(t) { text = t } } function setTimeout(func, interval, ...params) { return setTimeoutComponent.createObject(null, { func, interval, params, running: true } ); } Component { id: setTimeoutComponent Timer { property var func property var params onTriggered: { func(...params); destroy(); } } } You can <a href="https://stephenquan.github.io/qmlonline/?zcode=AAAC83icdVJLbsJADN3nFBarpKAoLNiEdlMO0FJxgTSYaGjwRI4HFaHcvR5IQz6tF/Oxn988e2xOlWWBrWydyb8CM7jGG0vCtqyD4D0rEK4BqL06EUvtxZvgt6Qw+3A063yWNqUy4D7tAb0dLENYooCBF0jWuj3DSrf5PBrgvNUoO3NC6yRkrF0pdexd+txC855gmSSJnubLaN3lNsFjvS0e3tNgVFFL1vkuKaySSTl30KOkg6NcjFbeagglgusNrZXI9OFgktTW4n0qmwT5nJULiOO4yjg71VFPJ6M47qdtrP4NIUmcM2aCb59HzCUkVyrFFcakd8YFsCMyVKQg7BAaaFvV09kRj7r0x9Nd3Ad49LMV2wpZLnDO+Cbn/+hd3CBuacemKJCnI/Pbx/DRqPUEsMdaR/USjkLNZDCaHy4Xy0Y=" rel="nofollow noreferrer">Try it Online! We can wrap the setTimeout in a Promise creating a delay function, i.e. function delay(ms) { return new Promise(resolve => …
answers question: http://stackoverflow.com/q/28507619
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/138955709
downvote count: 0
has comment: http://stackoverflow.com/comment/110721917
type: Answer

http://stackoverflow.com/a/28443896
answers question: http://stackoverflow.com/q/28443814
has body: This should work, remove semicolon after center: $('#example').css({ "background": "url('img/gold1.gif')", "background-repeat": "repeat-x", "background-position": "center" });
has comment: http://stackoverflow.com/comment/45217453
has comment: http://stackoverflow.com/comment/45217434
type: Answer
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45217582
has comment: http://stackoverflow.com/comment/45231851

http://stackoverflow.com/comment/45215622
comment on: http://stackoverflow.com/q/28442598
has text: Ah, right. Thanks everyone. I'm working "offline" while designing this website, I guess it's time to load it to the FTP server.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28670500
type: Answer
score: 0
has body: You can try below code in javascript try { var total_ship_tax = parseFloat(parseFloat(cart.shipping_amount) + parseFloat(cart.tax_amount)).toFixed(2); } catch(er) { var total_ship_tax = 0; } var total_amount = parseFloat(parseFloat(cart.total_amount)+total_ship_tax).toFixed(2);
answers question: http://stackoverflow.com/q/28572937
has comment: http://stackoverflow.com/comment/46039341

http://stackoverflow.com/comment/45327730
has text: Or in reverse order: take total and subtract random(0, total) from it as many times as you need.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28504157
type: Comment

http://stackoverflow.com/a/28452640
answers question: http://stackoverflow.com/q/28449265
type: Answer
downvote count: 0
score: 1
upvote count: 1
has body: The problem is that you have a button inside an a, which is not valid HTML5. Try to remove the button element and attach the button-classes to the link instead: + Add event

http://stackoverflow.com/a/28549834
type: Answer
score: 0
has comment: http://stackoverflow.com/comment/45412722
answers question: http://stackoverflow.com/q/28549759
has body: $ is fine : $myFunction = function(){ alert("hello"); } $myFunction(); // alerts "hello"

http://stackoverflow.com/comment/45423420
has text: I am getting an error with your array push... `Warning: array_push() expects parameter 1 to be array, null given in /var/www/crestdale/new/write.php on line 14`
type: AnswerComment
comment on: http://stackoverflow.com/a/28554403
type: Comment
score: 0

http://stackoverflow.com/a/28572673
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/45456171
score: 1
has body: Angular posts the data in JSON format that php does not natively consumes. You will have to read and json decode the input like so: // get the raw POST data $inputData = file_get_contents("php://input"); // this returns null if not valid json $inputData = json_decode($inputData);
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28572520
has comment: http://stackoverflow.com/comment/45455260
answers question: http://stackoverflow.com/q/28572520

http://stackoverflow.com/comment/45371005
type: Comment
has text: @Vohuman Thx but not sure why this has been downvoted, i must be missing something obvious, maybe...?!
comment on: http://stackoverflow.com/a/28527705
score: 0
type: AnswerComment

http://stackoverflow.com/comment/52474176
type: AnswerComment
comment on: http://stackoverflow.com/a/28552696
score: 0
has text: @mlorini: Which specific approach are you talking about? This answer touches on several options.
type: Comment

http://stackoverflow.com/comment/45390035
has text: You need to use js in this case unless you are checking with value obtained from controller.
comment on: http://stackoverflow.com/q/28537760
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28564874
score: 1
upvote count: 1
type: Answer
has body: You have a list of actions, these actions are stored in an array or into the html I suppose? Create an index, starting at 0. Then in your function you add 1 each time you start the function, select the new action and make your ajax call. I met your scenario once and will detail the method I used if this doesn't help you.
answers question: http://stackoverflow.com/q/28564776
downvote count: 0

http://stackoverflow.com/q/28539491
has comment: http://stackoverflow.com/comment/45422255
tagged with: frameworks
has comment: http://stackoverflow.com/comment/45422449
has comment: http://stackoverflow.com/comment/45395160
tagged with: javascript
has comment: http://stackoverflow.com/comment/45394369
has comment: http://stackoverflow.com/comment/45392910
has body: I am developing a website on Codeigniter Framework i am facing an issue while making forgot password feature. When i submit my email address it sends an email to that address and that email has a link that has a token in it. eg: http://www.myegsite.com/user/forgotyourpassword/2991c14654e1ed41aab1565dcf815b0f On click that link, if that token is not expired then, website asks for your new password and confirm password. The issue is : When i provide new password and confirm password and click submit button it gives me following error: An Error Was Encountered The action you have requested is not allowed. After reloading that same link, the page i get works absolutely fine, it updates my password again. What could be the reason that link doesn't work first time? Controller: public function forgotyourpassword($token) { if($this->session->userdata('user_data') != NULL) { redirect(base_url() . 'User'); }else { //check if token exist in table or not , if not exist return false; $this->load->model("data_access/extradataaccess","ExtraDataAccess"); $dbToken =$this->ExtraDataAccess->getToken($token); if($dbToken == FALSE) { $this->session->set_flashdata("invalid_token",'This token is invalid!'); redirect(base_url() . 'welcome/forgotPassword'); } else { //check if current date is smaller than expiry data , it means token is still valid return true; if($this->ExtraDataAccess->GetTokenInfo($token) == FALSE) { //set flash data session for token expired redirect(base_url() . 'welcome/forgotPassword'); //if token is expired return false } //if ($currDate <= $expiryDate) else { // load form libraries $this->load->helper(array('form', 'url')); $this->load->library('form_validation'); $this->form_validation->set_rules('password', 'Password', 'required|min_length[6]|max_length[20]'); $this->form_validation->set_rules('confpassword', 'Password Confirmation', 'required|min_length[6]|max_length[20]|matches[password]'); if($this->form_validation->run() == FALSE) { $this->data['page_name'] =…
has comment: http://stackoverflow.com/comment/45392877
has comment: http://stackoverflow.com/comment/45394627
has comment: http://stackoverflow.com/comment/45424333
downvote count: 0
has comment: http://stackoverflow.com/comment/45466462
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45424364
tagged with: php
has comment: http://stackoverflow.com/comment/45394438
answer count: 0
has comment: http://stackoverflow.com/comment/45393581
score: 1
has comment: http://stackoverflow.com/comment/45394737
tagged with: codeigniter
upvote count: 1
has comment: http://stackoverflow.com/comment/45424496
has comment: http://stackoverflow.com/comment/45425567
type: Question
has comment: http://stackoverflow.com/comment/45397427
has comment: http://stackoverflow.com/comment/45466475
has comment: http://stackoverflow.com/comment/45394169
has comment: http://stackoverflow.com/comment/45395273
has title: a link in my codeigniter website only works on reload

http://stackoverflow.com/a/60074032
upvote count: 0
has comment: http://stackoverflow.com/comment/129809292
has comment: http://stackoverflow.com/comment/106247912
downvote count: 2
score: -2
type: Answer
answers question: http://stackoverflow.com/q/28527561
has body: maillist.forEach(function (to, i , array) { (function(i,to){ msg.to = to; smtpTransport.sendMail(msg, function (err) { if (err) { console.log('Sending to ' + to + ' failed: ' + err); return; } else { console.log('Sent to ' + to); } if (i === maillist.length - 1) { msg.transport.close(); } }); })(i,to) });

http://stackoverflow.com/q/28516306
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28516455
answer count: 4
type: AnsweredQuestion
has title: Add Values in Form
tagged with: addition
upvote count: 1
has body: I've made a form with a few items. Each item has a value. Now my question is, how can I add the values from these items (when you check them) to the total value? See JSFiddle Add Values Cheesecake Banana Pie Chocolate Muffin Total: Note: without the use of jQuery.
type: Question
possible better answer: http://stackoverflow.com/a/28516367
score: 1
has answer: http://stackoverflow.com/a/28516367
tagged with: forms
has answer: http://stackoverflow.com/a/28516455
has answer: http://stackoverflow.com/a/28516471
has answer: http://stackoverflow.com/a/28516464

http://stackoverflow.com/a/28468605
type: Answer
has comment: http://stackoverflow.com/comment/45262661
has comment: http://stackoverflow.com/comment/59901115
has comment: http://stackoverflow.com/comment/60059944
answers question: http://stackoverflow.com/q/28468449
upvote count: 5
downvote count: 0
has body: window.parent.document.getElementsByTagName('iframe') will reference every iframe in the parent's window. From there you can find your specific iframe by looping through and checking the src attribute. Once you have your iframe, you can get it's dimensions and locations with the properties from element.getBoundingRect(). var iframes = window.parent.document.getElementsByTagName('iframe'); var yourURL = 'test.com'; var iframe; for (var i = 0; i &lt; iframes.length; i++) { if (iframes[i].src == 'test.com') { iframe = iframes[i]; break; } } var rect = iframe.getBoundingClientRect();
score: 5

http://stackoverflow.com/a/28564216
score: 0
has body: Check out the docs for foundations inclusion of the reveal.js modal plugin here From that page Previous versions of the reveal plugin emitted un-namespaced open, opened, close and closed events, however, these have been replaced by the namespaced open.fndtn.reveal, opened.fndtn.reveal, close.fndtn.reveal and closed.fndtn.reveal events. The un-namespaced events will be fully deprecated when Foundation 5.4 is released. So depending on which version of reveal.js you're using, it looks like there are events you can hook into. From that page, here's the snippet for hooking into the opened event: $(document).on('opened.fndtn.reveal', '[data-reveal]', function () { var newText = $('.myText').text().replace("Change me", "I have been changed"); $('.myText').text(newText ); }); Edited to add--for older versions, i believe this is the way to hook into the event: $('#myModal').bind('reveal:open', function () { var newText = $('.myText').text().replace("Change me", "I have been changed"); $('.myText').text(newText ); });
type: Answer
answers question: http://stackoverflow.com/q/28563979

http://stackoverflow.com/a/28443105
type: Answer
has body: For now, my solution is to wrap the focus() call in a setTimeout matching the CSS animation duration, to ensure the focus won't happen until the field reaches the end of the transition. Not ideal, since it mixes CSS and JS values independently, but it works for now.
answers question: http://stackoverflow.com/q/28443104
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/comment/45453674
comment on: http://stackoverflow.com/a/28523682
type: Comment
has text: So what is happening, if you look at the CSS, the has different styling than the tag. Basically the point of the whole exercise was to have the text change in content AND have the styling change. This is why adding the tag when editing the inner HTML helped, it changed the styling. However, I am wondering if there is a cleaner way of doing this that doesn't use invalid HTML. You could go in and doc.getElementById('norm').id = "blank" to change the styles without bad HTML, but them you have an issue reseting the content as you've lost the "norm" handle.
type: AnswerComment
score: 0

http://stackoverflow.com/q/28492300
favorite count: 0
tagged with: fs
has answer: http://stackoverflow.com/a/28497693
upvote count: 0
type: UnansweredQuestion
downvote count: 2
tagged with: stream
tagged with: node.js
type: Question
score: -2
answer count: 1
tagged with: javascript
has body: how i can send file for that the server read it with fs.createwriteStream(); var http = require('http'); var fs = require('fs'); http.createServer(function(req, res) { // This opens up the writeable stream to `output` var writeStream = fs.createWriteStream('./output'); // This pipes the POST data to the file req.pipe(writeStream); req.on('end', function () { res.end('ok upload file'); }); // This is here incase any errors occur writeStream.on('error', function (err) { console.log(err); }); }).listen(8080); i use this command with console linux: curl --upload-file hello.txt 127.0.0.1:3000 and work ok but i don't know how send file with url somebody know?
has title: how use createwriteStream with javascript
has comment: http://stackoverflow.com/comment/45305277

http://stackoverflow.com/q/28525576
has answer: http://stackoverflow.com/a/28525828
has answer: http://stackoverflow.com/a/28525923
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 2
type: AnsweredQuestion
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45367103
has body: I want to highlight currently opening page using css styles.here is my html code Home item1 item2 item3 Skill Research Link It should be only change the font and background color of menu list ,witch page is loading in the iframe.
has title: Change the color of selected menu item using css
upvote count: 3
answer count: 2
accepted answer: http://stackoverflow.com/a/28525828
has comment: http://stackoverflow.com/comment/45366994
downvote count: 1
favorite count: 0
possible better answer: http://stackoverflow.com/a/28525923

http://stackoverflow.com/a/28493714
has comment: http://stackoverflow.com/comment/45354574
answers question: http://stackoverflow.com/q/28493459
has comment: http://stackoverflow.com/comment/45351157
score: 0
has body: Try this:- $(function() { $(".smoothScroll").click(function(){ $(".hide").css( "visibility", "visible" ); }); }); Fiddle
type: Answer

http://stackoverflow.com/comment/45464665
type: QuestionComment
has text: The description of your problem is unclear. The name of days already shows in the date/time picker, doesn't it? In the popup.
comment on: http://stackoverflow.com/q/28575972
score: 0
type: Comment

http://stackoverflow.com/q/28495425
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28495883
has title: How do I append a value to formData on event? (blueimp/jQuery-File-Upload)
score: 0
answer count: 2
tagged with: form-data
has body: I have this code for the moment -> $('#file').fileupload({ formData: { valueThatChangesOverTime: value, staticValue: 0 }, maxNumberOfFiles: 1, autoUpload: false, dataType: 'json', add: function (e, data) { $('#importFilesBtn').on("click", function () { // Set value to formData.valueThatChangesOverTime data.submit(); }) }, done: function (e, data) { } }); As you see in my comment I want to append a value to the formData object on a click event but I can't figure out how to do it. It always stays with the initial value. Has someone done this before and how did you solve it? Thanks.
possible better answer: http://stackoverflow.com/a/28495721
tagged with: jquery-file-upload
has answer: http://stackoverflow.com/a/28495721
accepted answer: http://stackoverflow.com/a/28495883
type: AnsweredQuestion

http://stackoverflow.com/q/28453824
favorite count: 0
score: 16
upvote count: 16
has answer: http://stackoverflow.com/a/28454229
type: AnsweredQuestion
has body: I have a data structure like this: { name: 'test', config: { ... }, prev: { name: 'test1.1', config: { ... }, prev: { name: 'test1.1.1', config: { ... }, prev: { name: 'test1.1.1.1', config: { ... }, prev: undefined } } } } The structure can contain any number of recursive but identical structures inside the 'prev' object. I want to extract the 'name' property of each child. How can I flatten this using underscore to produce a resultset like so: ['test', 'test1.1', 'test1.1.1', 'test1.1.1.1'] It would be even greater if the flattening process could return something like [ {name: 'test', config: { ... }}, {name: 'test1.1', config: { ... }}, {name: 'test1.1.1', config: { ... }}, {name: 'test1.1.1.1', config: { ... }} ] My current solution is this (which is not optimal. I would like to use one _.chain to produce this): var _self = { flatten: function (obj) { var map = []; return _self.flattenRecurse(obj, map); }, flattenRecurse: function (obj, map) { map.push({name: obj.name, config: obj.config}); if (obj.prev) { _self.flattenRecurse(obj.prev, map); } } } var flattened = _self.flatten(data);
tagged with: underscore.js
possible better answer: http://stackoverflow.com/a/28454229
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has title: Flatten hierarchical data
has answer: http://stackoverflow.com/a/28454002
accepted answer: http://stackoverflow.com/a/28454002

http://stackoverflow.com/q/28563598
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28563771
score: 0
tagged with: custom-events
has body: In JQueryMobile you can do this: $(document).on("pagebeforehide","#pagetwo",function(){ alert("pagebeforehide event fired - pagetwo is about to be hidden"); }); Is this possible with custom events? Something like so: document.addEventListener("someevent", "sometrigger", function () {});
answer count: 1
has comment: http://stackoverflow.com/comment/45437822
tagged with: jquery
has comment: http://stackoverflow.com/comment/45438228
has comment: http://stackoverflow.com/comment/45438367
tagged with: events
has comment: http://stackoverflow.com/comment/45437979
has answer: http://stackoverflow.com/a/28563771
type: Question
type: AnsweredQuestion
has title: Custom event with custom trigger in javascript
tagged with: jquery-mobile

http://stackoverflow.com/a/28466086
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28465067
has body: An Express application is essentially a series of middleware calls. Middleware is a function with access to the request object (req), the response object (res), and the next middleware in line in the request-response cycle of an Express application, commonly denoted by a variable named next. As written above, Expressjs provides the next callback function. Next is just a way of calling the next middleware in the flow. For many examples see Express's Using middleware
answers question: http://stackoverflow.com/q/28465067
upvote count: 2

http://stackoverflow.com/q/28455669
possible better answer: http://stackoverflow.com/a/28455784
favorite count: 0
has answer: http://stackoverflow.com/a/28455878
score: -3
tagged with: css
type: AnsweredQuestion
has title: Menu error caused by HTML or JS?
downvote count: 3
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/28455878
upvote count: 0
tagged with: javascript
has body: Im trying to get the menu to be horizontal and then the flags to be shown below the menu when you press the flag-name. When doing changes to the menu in my code, which of my files should I be editing? The flags location is correct right now, but the menu is missplaced. What can be done to get the menu to be horizontal instead of a list? JSFiddle: http://jsfiddle.net/528k9z8m/ HTML: Kmom03 sandboxen Elfenbenskusten Sverige Maruritius Japan CSS body { } h1 { text-align: center; } h3 { color: green; } #menu { width: 500px; height: 50px; border: 1px solid black; } #content { border: 1px solid black; background-color: #eee; padding: 4em; margin: 0 auto; height: 800px; width: 800px; border-radius: 30px; } .flagga1 { position: relative; width: 800px; height: 500px; } .sverige { background-color: #FECC00; } .sverige .box1 { position: absolute; width: 250px; height: 200px; background-color: #006AA7; } .sverige .box2 { position: absolute; bottom: 0; left: 0; width: 250px; height: 200px; background-color: #006AA7; } .sverige .box3 { position: absolute; top: 0; right: 0; width: 425px; height: 200px; background-color: #006AA7; } .sverige .box4 { position: absolute; bottom: 0; right: 0; width: 425px; height: 200px; background-color: #006AA7; } .flag { position: relative; width: 300px; height: 200px; } .elfenbenskusten { background-color: #fff; } .elfenbenskusten .part1 { width: 100px; height: 200px; background-color: #F77F00; } .elfenbenskusten .part2 { position: absolute; top: 0; left: 200px; width: 100px; height: 200px; background-color: #009e60; } .flagga2 { position: relative; width: 300px; height: 200px; } .maruritius { background-color: #EEE; } .maruritius .box1 { position: absolute; top: 0; width: 300px; height: 50px; background-color: #EA2839; } .maruritius .box2 { position: absolute; top: 50px; left: 0; width: 300px; height: 50px; background-color: #1A206D; } .maruritius .box3 { position: absolute; top: 100px; width: 300px; height: 50px; background-color: #FFD500; } .mar…
has answer: http://stackoverflow.com/a/28455784
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/28476618
has comment: http://stackoverflow.com/comment/45278015
answers question: http://stackoverflow.com/q/28476450
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45277630
has body: Why use javascript to change the value? Just set the format in django. class MyForm(Form): # the default format is %Y-%m-%d estd = forms.DateField( widget=forms.widgets.DateInput(format="%m/%Y") ) Docs for the DateInput widget; https://docs.djangoproject.com/en/1.7/ref/forms/widgets/#dateinput Date/Time input format settings are detailed here; https://docs.djangoproject.com/en/1.7/ref/settings/#date-input-formats

http://stackoverflow.com/comment/45421443
type: QuestionComment
score: 1
has text: First, window.onload is redundant. Second, you're doing a lot of jQuery stuff inside that `for` loop you really shouldn't. Don't append anything anywhere until outside the for. Just push it all into a temporary array, then join into a string, then append it all at once. You also don't need this to be inside of your table HTML since you're doing it onDOMReady (aka `$(document).ready()`) Also no reason to even have `json` at all since you don't do anything to `raw` differently.
comment on: http://stackoverflow.com/q/28554275
type: Comment

http://stackoverflow.com/a/28547526
type: Answer
has comment: http://stackoverflow.com/comment/45411447
has body: The explicit return in your service overrides the default constructor behavior. function factory () { return { foo: 'bar' }; } console.log(factory().foo); // bar function service () { this.foo = 'foo'; return { foo: 'bar' }; } console.log(new service().foo); // bar Fiddle
upvote count: 3
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/45411142
answers question: http://stackoverflow.com/q/28545420
has comment: http://stackoverflow.com/comment/45408631

http://stackoverflow.com/a/28462714
has comment: http://stackoverflow.com/comment/45252449
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45252287
has comment: http://stackoverflow.com/comment/45251681
has comment: http://stackoverflow.com/comment/45252327
accepted answer of: http://stackoverflow.com/q/28462675
type: Answer
answers question: http://stackoverflow.com/q/28462675
has body: function fetcher() { if (messageQueue.length &gt; 0) { //get the next message on the queue var msg = messageQueue.shift(); handleMessage(msg); } setTimeout(fetcher); }
has comment: http://stackoverflow.com/comment/45259445
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45251740
has comment: http://stackoverflow.com/comment/45252438
has comment: http://stackoverflow.com/comment/45251631
downvote count: 0

http://stackoverflow.com/a/28491764
downvote count: 0
has comment: http://stackoverflow.com/comment/45306494
answers question: http://stackoverflow.com/q/28491640
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45307826
type: Answer
score: 1
upvote count: 1
has body: Transaction.findPublic({}).then(function(transactions) { combined = combined.concat(transactions); return JoinEvent.find().exec(); }).then(function(joins) { combined = combined.concat(joins); return NewCategoryEvent.find().exec(); }).catch(function(err) { res.status(503).send(err); }); Explanation: When you chain promises and a reject(error) occurs, it'll skip all following fullfill(success) callbacks till a rejection(error) callback is found, it calls the first found rejection callback( then continues on to the next promise), if none is found, it throws an error. also catch(func) is equivalent to then(undefined, func) but more readable. for more info : promise error handling.
accepted answer of: http://stackoverflow.com/q/28491640
has comment: http://stackoverflow.com/comment/45305010

http://stackoverflow.com/q/28590972
has comment: http://stackoverflow.com/comment/45489724
type: Question
has title: Fire an event even if browser is closed
has comment: http://stackoverflow.com/comment/45488562
has answer: http://stackoverflow.com/a/28592301
tagged with: javascript
tagged with: jquery
has body: I am currently programming with PHP/HTML/CSS/MYSQL/JAVASCRIPT and i want to perform the following scenario: Send an email to someone but not by clicking a button "SEND". I want to build something called "Future Send" that will enable the user to schedule when the email will be send. (for example 5 minutes from now). This is easy to be accomplished with a Javascript counter that will fire an event when countdown == 0; But this requires that the browser/website must be open. But what happens in the event that the user writes the email, schedule it for 5 minutes later, and closes the browser or even the computer? The counter will stop and the event will never be fired.. Is there a way to bypass this using the technologies referred above? Do i have to switch to a different programming language? Any suggestions? Thanks in advance.
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/45499798
tagged with: mysql

http://stackoverflow.com/comment/45228633
type: QuestionComment
comment on: http://stackoverflow.com/q/28450290
has text: I am getting just 'undefined' in
score: 0
type: Comment

http://stackoverflow.com/q/28503209
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
has title: Create A Centralised Angular Template Project
tagged with: modularity
type: Question
tagged with: scaffolding
tagged with: version-control
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45326466
has comment: http://stackoverflow.com/comment/45326127
has body: So we have a project that we worked on (Angular JS Mobile Project Basically). So basically we had new requirements were we had to skin the same app for different customers. Now that we have many customers, we are thinking of a way where we can modularise each angular module we create as a separate project with its own unit tests. This way each feature can be separately developed as an angular module. This way when we want to create a new project, we use BOWER or NPM to just pull all we need and bang we have a new skinned app. Basically we want the template skin to be isolated so that we can update each module independently and have it updated in each project. Any Ideas how we can achieve this goal anyone?

http://stackoverflow.com/q/28513457
answer count: 2
has body: I am getting undefined for $routeParams. Here is my code: var ngAddressBook = angular.module('ngAddressBook', ['ngRoute']); ngAddressBook.config(['$routeProvider', function($routeProvider) { $routeProvider. when('/', { templateUrl: 'views/list.html', controller: 'ngAddressListController' }). when('/add', { templateUrl: 'views/add.html', controller: 'ngAddressListController' }). when('/details/:id', { templateUrl: 'views/details.html', controller: 'ngAddressDetailsController' }); }]); // add a controller to it ngAddressBook.controller('ngAddressListController', ['$scope', function ($scope) { $scope.contacts = [ {id:1,first_name:'Jane', last_name:'Doe','Phone':'123-456789','Email':'jane@example.com'}, {id:2,first_name:'Jhon', last_name:'Doe','Phone':'123-456789','Email':'jhon@example.com'} ]; $scope.getTotalContacts = function () { return $scope.contacts.length; }; }]); ngAddressBook.controller('ngAddressDetailsController', ['$scope', function ($scope,$routeParams) { alert($routeParams); $scope.id = $routeParams.id; }]); index.html Ng Addressbook Ng Address Book
upvote count: 6
tagged with: javascript
has title: AngularJS $routeParams undefined
favorite count: 0
possible better answer: http://stackoverflow.com/a/34966583
has answer: http://stackoverflow.com/a/34966583
downvote count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45345042
has comment: http://stackoverflow.com/comment/45345074
score: 6
has answer: http://stackoverflow.com/a/28513512
accepted answer: http://stackoverflow.com/a/28513512
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/28590511
answer count: 1
has answer: http://stackoverflow.com/a/28590743
type: UnansweredQuestion
score: 0
tagged with: requirejs
type: Question
has title: Requirejs order not respected
has body: i have a structure of a lot of files, for example a take only 3. File1 : require(["plugin1","plugin2","jquery","jquery-ui"],function(){ console.log('File1'); }); plugin1 : require(["plugin1dependency"],function(){ console.log('Plugin1'); //Some code that require plugin1dependency }); plugin1dependency: require(["jquery"],function(){ console.log('Plugin1dependency'); }); In the console i found a error in plugin1 cause the code of plugin1dependency is executed after the code of plugin1. The console.logs are executed in this way : Plugin1 - Plugin1dependency - File1
tagged with: javascript

http://stackoverflow.com/comment/45369853
has text: Why `window.stop()` is not working?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28527149

http://stackoverflow.com/q/28507315
has comment: http://stackoverflow.com/comment/47304244
downvote count: 0
has body: I have two subsequent forms on my website with POST method. The first page of my website first.php contains this code: a.php can be accessed only via this POST request (otherwise user will get method not allowed 405 error) Once submitted, this form opens a.php with an AJAX modal window. a.php contains another form: When a user clicks Submit in the second form, it will open b.php, which can also be accessed only via POST request (otherwise - 405 error). The only difference I can think about between these forms is that the second one contains a tracking js class (opening an iframe). this is the js code: $(document).ready(function() { $(".tracking").click(function(){ var iframe = document.createElement('iframe'); iframe.style.width = '0px'; iframe.style.height = '0px'; iframe.style.display = 'block'; document.body.appendChild(iframe); iframe.src = '/track.htm'; }); This is done in order to track a conversion using a third party script which is being execuated from track.htm I noticed that I am having a problem with about 5% of my iPad visitors. they open a.php properly with a POST request, but when they go ahead to continue and open b.php as well, about 5% sends out a GET request instead of the desired POST request, causing them to get an 405 error and leave the website. I know that these are real human users as I can see some of them trying several times to open b.php and keep getting these 405 errors. Could this be caused because simultaneously their device is using a GET request to obtain track.htm? and this is some glitch? How can this be solved? EDIT 4.4.2015: Since there's a chance that firing the tracking script is causing this, I would like to know if there's another fire to fire it (or track that adwords conversion), without causing these iPad user to use "GET" requests for the form as well. EDIT 10.4.2015: This is the jquery code of the ajax class, that effects both first.php and perhaps a.php, as first.php is the parent frame: $(document).ready(function() { …
linked to: http://stackoverflow.com/q/19815673
tagged with: javascript
score: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/29604619
has answer: http://stackoverflow.com/a/29577202
favorite count: 0
has comment: http://stackoverflow.com/comment/47249466
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29552367
has title: Clients using `GET` requests for a form, even though `POST` is defined. is javascript iframe the cause?
has comment: http://stackoverflow.com/comment/47294568
has comment: http://stackoverflow.com/comment/47271720
upvote count: 1
has answer: http://stackoverflow.com/a/29483071
type: Question
has comment: http://stackoverflow.com/comment/47268454
has comment: http://stackoverflow.com/comment/47240879
tagged with: http-headers
has answer: http://stackoverflow.com/a/29550296
answer count: 6
tagged with: httprequest
tagged with: post
has answer: http://stackoverflow.com/a/28507353

http://stackoverflow.com/comment/45320154
type: QuestionComment
comment on: http://stackoverflow.com/q/28500258
type: Comment
has text: @Rebornix Yeah, every tab has a different ID,
score: 0

http://stackoverflow.com/q/28551582
tagged with: ecmascript-6
has comment: http://stackoverflow.com/comment/72159516
has answer: http://stackoverflow.com/a/28552037
upvote count: 12
tagged with: javascript
has comment: http://stackoverflow.com/comment/66083212
has comment: http://stackoverflow.com/comment/66083295
has comment: http://stackoverflow.com/comment/66083038
score: 12
has title: Traceur runtime: Super expression must either be null or a function, not undefined
has answer: http://stackoverflow.com/a/34496024
answer count: 3
has comment: http://stackoverflow.com/comment/66083184
downvote count: 0
has answer: http://stackoverflow.com/a/37698152
has comment: http://stackoverflow.com/comment/53481199
favorite count: 0
type: UnansweredQuestion
has body: Learning ES6 and have run in to the following error straight off Super expression must either be null or a function, not undefined. Really unsure where my problem is, if anyone could help that would be great. main.js 'use strict' import Backbone from 'exoskeleton'; import App from './views/App'; var onDOMReady = () =&gt; { console.log('inside dom ready'); window.app = new App(); } if(document.readyState === 'complete' || document.readyState === 'interactive' || document.readyState === 'loaded' ) { onDOMReady(); } else { document.addEventListener('DOMContentLoaded', onDOMReady); } App.js 'use strict' import Backbone from 'exoskeleton'; class App extends Backbone.View { initialize () { console.log('App: Init'); } render () { console.log('App: Render'); } } export default App;
has comment: http://stackoverflow.com/comment/54764523
has comment: http://stackoverflow.com/comment/66083257
type: Question

http://stackoverflow.com/a/28495328
has body: Define a function to find what you asked for function firstToStartWith(letter, array) { for (var i = 0; i &lt; array.length; i++) { if (array[i].charAt(0) == letter) { // If first letter in ith element in the array matches the provided letter return i; } } return -1; } Then call it on your array var nameCollection = ['Andre', 'Ann', 'Bob', 'Bill', 'Cindy', 'Camille', ...]; firstToStartWith("C", nameCollection); // Returns 4 Thanks to @Aadit M Shah for the explanation of why to use str.charAt(0) instead of str[0]
accepted answer of: http://stackoverflow.com/q/28495287
answers question: http://stackoverflow.com/q/28495287
has comment: http://stackoverflow.com/comment/45310984
score: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45310605
upvote count: 2

m2e
type: Tag
tag name: m2e
tags question: http://stackoverflow.com/q/28443966

http://stackoverflow.com/a/28547032
type: Answer
has comment: http://stackoverflow.com/comment/45414682
score: 2
has body: Aside from z-ordering that is a very valid point made by Teemu, another major consideration in JS frameworks is speed of execution / speed of lookup. The DOM in JS terms is one large object. The deeper into an object javascript needs to go to get what it's being asked for, the less performant the script gets, take a look at this answer. Therefore it makes sense to keep everything that is probably going to be cloned or deep copied at a sensible nesting level and in the correct z-order. That happens to be toward the end of the body and usually wrapped by at most one containing element. There may be other reasons but the depth / nesting sprung to mind as a consideration I'd take into account.
answers question: http://stackoverflow.com/q/28546624
downvote count: 0
has comment: http://stackoverflow.com/comment/45410742
upvote count: 2
has comment: http://stackoverflow.com/comment/45408124

http://stackoverflow.com/comment/45280375
has text: Agreed, he now has both answers
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28478764
type: Comment

http://stackoverflow.com/q/28475699
answer count: 2
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28476788
has answer: http://stackoverflow.com/a/28476788
has title: Header changes opacity when scrolled down
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/16653543
tagged with: css
favorite count: 0
linked to: http://stackoverflow.com/q/6687580
has answer: http://stackoverflow.com/a/28959395
downvote count: 2
upvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28959395
has body: I'm trying to have my header change opacity when you scroll down say aproximatly 500px down. I'm making a single page with a header infront of a bxslider so when I scroll down the opacity should increase for the header because the text still needs to be readable. http://ironsummitmedia.github.io/startbootstrap-scrolling-nav/ I'd like something like this but I find it very hard to edit I already tried to look for answers here but only thing close to this is: Header changes as you scroll down (jQuery) or Fade opacity when scrolling but the one doesn't work for me and the other is to hard to understand and change Platenbeurs Voorstelling Planning Grondplan Praktische Info Bestel EDIT Here is the css code to see that the header is actualy not opacity 1. .main-header{ position: fixed; max-width: 1024px; width: 100%; height: 100px; padding: 1%; text-align: right; background: rgba(255,255,255,0.2); border-top: 5px solid black; border-bottom: 5px solid black; } .main-header nav a{ color: white; text-decoration: none; opacity: 1; }
score: -1
type: Question

http://stackoverflow.com/q/28490154
has title: Take highest property value and return it in an array in Javascript
has answer: http://stackoverflow.com/a/28490387
type: Question
possible better answer: http://stackoverflow.com/a/28490225
has body: I want to loop through this object and return the keys with the highest property values into an array. Object {clear-spring: 3, deep-autumn: 2, warm-spring: 1, light-summer: 2, light-spring: 2, clear-summer: 3} In this case, I want an array like this: ["clear-summer", "clear-spring"] Is there an efficient way to do this with jQuery or pure javascript?
tagged with: javascript
has answer: http://stackoverflow.com/a/28490253
accepted answer: http://stackoverflow.com/a/28490253
score: 0
upvote count: 1
downvote count: 1
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/28490225
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28490261

http://stackoverflow.com/q/28543691
has title: What's the difference between $scope.myScope = function () and function () in AngularJS
has body: I've recently gone into developing with AngularJS. It's confusing to me the different between these two: $scope.myScope = function () { var x = 'do something with variable here'; $scope.anotherScope = x; }; and function myFunction () { var x = 'do something with variable here'; $scope.anotherScope = x; } They both seem to be able to do the same thing (I use them a lot inside controllers). Is there a best practice for when and where to use these two?
type: Question
tagged with: javascript
tagged with: scope
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28543962
has comment: http://stackoverflow.com/comment/45400824
has answer: http://stackoverflow.com/a/28879082
has answer: http://stackoverflow.com/a/28543873
tagged with: angularjs
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/336859
duplicate of: http://stackoverflow.com/q/336859

http://stackoverflow.com/q/28520227
answer count: 3
possible better answer: http://stackoverflow.com/a/28520278
has answer: http://stackoverflow.com/a/28520278
has title: Use variable outside of ajax success function
linked to: http://stackoverflow.com/q/14220321
has body: I have a set of time out functions inside one function function myFunction() { var data; setTimeout(function(){ $.ajax({ //My Ajax Junk success: function(data) { var data = data.trim(); // I want to be able to use this later on. } }): }, 6000); setTimeout(function(){ var shipping = 'f_name='+f_name+data; // Append data from previous call to shipping }, 12000); } I'm wanting to retrieve the data from the ajax success function and then use it inside the next timeout function by appending it to the shipping variable. I have declared the variable data outside of all the functions and then tried to add the success data to it. When I alert out the shipping variable it doesn't show anything extra (what the data should be adding). The data is returning because I can see it in Google Chromes Network Tab. How can I set a variable to be used throughout the entire function!?!?!?!? Thank you in advance. Also, the success function is returning prior to the call for the data to be added because of the timeout functions. I played with them to be set right for this instance.
has answer: http://stackoverflow.com/a/28520286
tagged with: php
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28520281
type: Question
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28520281
tagged with: ajax
has comment: http://stackoverflow.com/comment/45357570
score: 0

http://stackoverflow.com/comment/45362814
type: Comment
has text: well we do always clean it up just after its executed. why to keep it there until your scope destroys.
type: AnswerComment
comment on: http://stackoverflow.com/a/28523068
score: 0

http://stackoverflow.com/comment/45383866
comment on: http://stackoverflow.com/a/28534331
score: 0
type: Comment
has text: Duly noted @Qantas94Heavy. I had no idea, because many new users don't.
type: AnswerComment

http://stackoverflow.com/q/28519123
accepted answer: http://stackoverflow.com/a/28519197
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/28519175
type: Question
possible better answer: http://stackoverflow.com/a/28519175
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28519197
tagged with: jquery
tagged with: ajax
type: AnsweredQuestion
has title: Delay actions in Jquery
has body: I have a function that will be processing the checkout for an order on my website. Right now I haven't added in any of the ajax and what not but I'm trying to make a type of "loading screen" using javascript and bootstraps modal. This is what I have: Javascript function printCheckout() { // Show the progress Modal $('#myModal').modal({ keyboard: false, backdrop: 'static', }); $('#myModal').modal('show'); // Billing Information $(".stepText").delay(800).html('Processing Billing Information'); // I want this ^ to delay the process and make it seem longer. var name = $("input[name='bill_name']").val(); var address = $("input[name='bill_address_1']").val() + $( "input[name='bill_address_2']").val(); var city = $("input[name='bill_city']").val(); var state = $("input[name='bill_state']").val(); var zip = $("input[name='bill_zip']").val(); var email = $("input[name='bill_email']").val(); var phone = $("input[name='bill_phone']").val(); var billing = 'name=' + name + '&amp;address=' + address + '&amp;city=' + city + '&amp;state=' + state + '&amp;zip=' + zip + '&amp;email=' + email + '&amp;phone=' + phone; // Shipping Informaiton $(".stepText").delay(800).html('Processing Shipping Information'); var name = $("input[name='ship_name']").val(); var address = $("input[name='ship_address_1']").val() + $( "input[name='ship_address_2']").val(); var city = $("input[name='ship_city']").val(); var state = $("input[name='ship_state']").val(); var zip = $("input[name='ship_zip']").val(); var email = $("input[name='ship_email']").val(); var phone = $("input[name='ship_phone']").val(); var shipping = 'name=' + name + '&amp;address=' + address + '&amp;city=' + city + '&amp;state=' + state + '&amp;zip=' + zip + '&amp;email=' + email + '&amp;phone=' + phone; // Payment Information $(".stepText").delay(800).html('Processing Payment Information'); var number = $("input[name='number']").val(); var expiry_month = $("input[name='expiry_month']").val(); var expiry_year = $("input[name='expiry_yea…

http://stackoverflow.com/comment/45396862
type: AnswerComment
has text: @DannyVickers Does the latest iteration(s) help?
type: Comment
comment on: http://stackoverflow.com/a/28540849
score: 0

http://stackoverflow.com/comment/45304744
type: QuestionComment
comment on: http://stackoverflow.com/q/28491967
score: 0
type: Comment
has text: use toggle feature by adding some flag and convert `string.toUpperCase()` or `lowerCase()` basis of flag

http://stackoverflow.com/comment/45335645
comment on: http://stackoverflow.com/a/28508272
type: Comment
has text: @CodeGodie That link is to a page 'javascript tutorials' website, we call that learning the basics.
score: 0
type: AnswerComment

http://stackoverflow.com/a/28455184
accepted answer of: http://stackoverflow.com/q/28455052
score: -1
type: AcceptedAnswer
downvote count: 1
has comment: http://stackoverflow.com/comment/45237150
type: Answer
upvote count: 0
has body: You can iterate through them using for loop like so: var text=''; for(var i in obj.response.data) { text += obj.response.data[i].AccountNote.note; } Variable i is index of element in the array obj.response.data so you don't have to worry about random indexes anymore.
has comment: http://stackoverflow.com/comment/45237396
answers question: http://stackoverflow.com/q/28455052

http://stackoverflow.com/comment/45345963
comment on: http://stackoverflow.com/q/28513901
has text: yes i can, the code i just posted is not working
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45385669
comment on: http://stackoverflow.com/a/28534302
score: 0
type: AnswerComment
type: Comment
has text: @MarcusTan my mistake, it should be `type: 'post'` not `method: 'post'` - http://jsfiddle.net/arunpjohny/3zvm2ovd/6/

http://stackoverflow.com/q/28449114
score: 0
has comment: http://stackoverflow.com/comment/45226396
has comment: http://stackoverflow.com/comment/45226445
has comment: http://stackoverflow.com/comment/45226359
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45226401
answer count: 2
has title: Negative number if else condition check in javascript
has comment: http://stackoverflow.com/comment/45226352
has comment: http://stackoverflow.com/comment/45226655
has comment: http://stackoverflow.com/comment/45226326
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28449199
has body: For the positive number the if confdition is working fine but its nor executing the negative number condition what be the possible cause of error. //"date is taken as mm/dd/yyyy in input box" var startDateString = document.getElementById('startDate').value; var dateToday = new Date(); alert(dateToday); var myNewDate = process(startDateString); alert(myNewDate); var diff = myNewDate - dateToday; alert(diff); alert(typeof(diff)); if(diff &gt;= 0){ alert("selected date is greater than today"); } else { alert("selected date is smaller than today"); } process function function process(date){ var parts = date.split("/"); return new Date(parts[2], parts[0] - 1, parts[1]); }
has answer: http://stackoverflow.com/a/28449232

http://stackoverflow.com/comment/45493165
has text: Does it allow for creating watch _faces_ though, not just watch _apps_?
comment on: http://stackoverflow.com/a/28593270
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/45459479
comment on: http://stackoverflow.com/a/28574942
has text: thanks for this - but the request isn't even being logged from within router.put(..) - before it runs through the Model.findOneAndRemove()
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28480366
tagged with: jquery
score: 0
has body: I'm having an issues using the Drag and Drop in jQuery. I have multiple 'buttons' that i want to effect other divs visible properties. (so drag something onto an area to un hide things) I cant seem to get it working, anyone got any pointers? $(document).ready(function () { $('#btn_IncCat').draggable({ containment: '#content', cursor: 'move', snap: '#content', revert: true, revertDuration: 900, opacity: 0.35, }); $('#MobSelection').droppable({ accept: '.btn', drop: function (ev, ui) { ui.draggable.hide(1000); ui.draggable.addClass('dropped'); drop: $('#btn_IncCat').on("drop", function (event, ui) { $('#IncidentCatSearch').removeClass('hidden'); }) } }) }); Above is the jQuery i'm trying to get working. Here is a Jsfiddle of an example. Any pointers would be appreciated. I know that they cant be 'buttons' to work with drag and drop so i will change the HTML to normal divs but styled to looked differently.
accepted answer: http://stackoverflow.com/a/28480851
has title: Drag a and on drop unhide a hidden
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28480851
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/28456100
score: 2
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28450297
answers question: http://stackoverflow.com/q/28450297
type: Answer
downvote count: 0
has body: The simplest path forward is to write a service in your server-side language of choice (sounds like PHP in this case) that produces JSON output based on the data in your MySQL database. Depending on the potential size of your data, you can potentially design your data to work with one of two out-of-the-box stores in dstore: Request (and Rest if write operations are also involved), or RequestMemory. The simpler of the two is RequestMemory, which simply combines the features of the Memory store with an up-front server request (via Request). This store will expect the service to respond with one complete data payload: an array of objects where each object is a record in your database. Something like this: [ { "id": 1, "foo": "bar" }, { "id": 2, "foo": "baz" } ] The Rest store expects data in the same format, but also expects the service to handle filtering, sorting, and ranges. Filtering and sorting are represented via query string parameters (e.g. foo=bar&amp;baz=bim in the simplest case for filter, and sort(+foo) or sort(-foo) for sort), while ranges are typically represented via the HTTP Range header (e.g. Range: Items 0-9 for the first 10 items). Implementing a service for the Rest store is obviously more work, but would be preferable if you're expecting your data source to potentially have thousands of items, since RequestMemory would have no choice but to request all of the items up-front. With either of these stores, once you have a service that outputs JSON as appropriate, you can create an instance of the store with its target pointing to the service endpoint, then pass it to a grid via the collection property. If your data is intended to represent a hierarchical structure, it should still be possible to mix dstore/Tree into dstore/RequestMemory or dstore/Request, provided that your hierarchy is represented via parent ID references. By default, Tree filters children via a parent property on each item, and reports mayHaveChildren results by inspecting a hasChil…

http://stackoverflow.com/a/28496666
type: Answer
score: 0
has body: Native emacScript should be written addEvenListener and for iE attachtEvent
answers question: http://stackoverflow.com/q/28496607

http://stackoverflow.com/q/28506776
has comment: http://stackoverflow.com/comment/45332874
has title: Changing text in several table cells with external javascript
has comment: http://stackoverflow.com/comment/45333115
has comment: http://stackoverflow.com/comment/45332774
has comment: http://stackoverflow.com/comment/45333083
has body: I have a calender type deal that I am trying to create and I am hung up on selecting and changing several elements in one go. I plan on using a for loop to accomplish this by traversing each node and modifying its text each iteration, but I am confused on how to actually access the text. If I have, in my external: var daysInWeek = document.getElementsByTagName("td"); And in HTML: w1d1 w1d2 w1d3 w1d4 w1d5 w1d6 w1d7 Five of them How do I go about accessing the node next to the previous and changing its text? It would appear that the dot operator does not give me the same options as .getElementById() does. I understand there is also .item(index: int) as well but it would appear I get the same options as elements by tag name. Suggestions for a noob Javascripter?
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28506993
accepted answer: http://stackoverflow.com/a/28506993
tagged with: getelementsbytagname
tagged with: for-loop
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45332839
score: 0

http://stackoverflow.com/comment/45235380
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28453532
has text: Well... window.location.href = "views/home.html" works. But then I don't even need $location. I guess it was my bad.
type: Comment

http://stackoverflow.com/q/28486669
favorite count: 0
has answer: http://stackoverflow.com/a/28486722
has comment: http://stackoverflow.com/comment/45295004
downvote count: 0
has answer: http://stackoverflow.com/a/28486791
type: UnansweredQuestion
tagged with: each
score: 1
has answer: http://stackoverflow.com/a/28486756
type: Question
has answer: http://stackoverflow.com/a/28486805
tagged with: arrays
tagged with: javascript
tagged with: jquery
tagged with: image
has body: I'm trying to load an array filled with the src attribute from a series of img tags in my HTML document. HTML: JQuery Slider 2014 Salt Lake Comic Con FanX JQuery: $(document).ready(function() { var source = new Array(); $('img').each(function(attr) { source.push($('img').attr('src')) }); console.log(source) });//end document.ready The output to the console is an array of 10 elements, but only using the first img attribute. I'm not sure how to get the each function to go through all elements and push them to the array.
has title: JQuery each function to fill array with attributes from HTML images
upvote count: 1
answer count: 4

http://stackoverflow.com/comment/45309297
comment on: http://stackoverflow.com/q/28494613
type: Comment
has text: Clearly `a` and `b` are not the same because if they were the `==` test would pass. If you want a comparison that treats two different things as the same, then you will have to understand what exactly they do contain and adjust your comparison to allow for that. You will not be able to use `a == b` to do that.
score: 0
type: QuestionComment

http://stackoverflow.com/q/28475090
has answer: http://stackoverflow.com/a/28475115
accepted answer: http://stackoverflow.com/a/28475115
tagged with: javascript
tagged with: jquery
upvote count: 1
answer count: 1
tagged with: menu
has body: I have a header with a dropdown menu, now I want to edit the padding of the header when you scroll, but I DONT want to change the padding of the dropdown menu... HTML: Menu Dropdown Dropdown Dropdown Jquery: $(".navigator li").animate({ paddingTop : '15px', paddingBottom : '15px' }, {duration: 200, queue:false}); Now how can I keep the padding of the children at 0?
favorite count: 0
has title: animate padding of parent only
type: AnsweredQuestion
tagged with: list
downvote count: 0
score: 1
type: Question

http://stackoverflow.com/comment/45473882
has text: Check this link for Your answer http://stackoverflow.com/questions/1312236/how-do-i-create-an-html-table-with-fixed-frozen-left-column-and-scrollable-body
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28583173

http://stackoverflow.com/q/28452224
tagged with: handsontable
has answer: http://stackoverflow.com/a/28459491
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45231816
answer count: 1
tagged with: jquery
type: UnansweredQuestion
has title: How to get jQuery .change() to reference cell on a Handsontable?
has body: Trying to do: I want to save user changes on a Handsontable to the database. One way that I think I could do is to have a hidden html form where form inputs are referenced to specific cells inside the Handsontable. Problem: I can't reference a specific cell inside the Handsontable in my .change function. What I have tried below: Trying to get any changes that user does to cell row(2)column(2) and change html form id row2col2formInput to that value. &lt;script&gt; //fetch handsontable input for row 2 colum 2 and change corresponding hidden form input $("#example").handsontable.(data[2][2]).change(function() { $("#row2col2formInput").val($(this).val()); }); $(document).ready(function () { var data = [ ['', 'Kia', 'Nissan', 'Toyota', 'Honda'], ['2008', 10, 11, 12, 13], ['2009', 20, 11, 14, 13], ['2010', 30, 15, 12, 13] ], container = document.getElementById('example'), hot; hot = new Handsontable(container, { data: data, minSpareRows: 1, colHeaders: true, contextMenu: true }); }); &lt;/script&gt;

http://stackoverflow.com/q/28534003
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28534124
accepted answer: http://stackoverflow.com/a/28534124
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: In a page that I'm designing, have created a small-circular NAV, on which I want to show a picture! But of course, the picture is quite big and when I'm using it's going outside of the border and goes haywire! How do i enter that bigger picture in that small space? the circle's dimensions is 97-97 Thank you in advance! HTML Register Now Sign in CSs .wrap { margin:0px; padding:0px; width:100%; text-align:center; } body { margin:0px; padding:0px; font-family:Arial, Helvetica, sans-serif; font-size:12px; text-align:center; } .main_layout { padding:0px; margin-left:40px; width:1280px; height:1024px; } #container1 { alignment-adjust:central; margin-left:auto; margin-right:auto; margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; width:275px; height:1024px; float:left; background:#333333 no-repeat fixed; background-attachment:fixed; } #logo { width:255px; height:245px; margin-left:28px; margin-top:15px; background:url(../Icons%20n%20pics/logo4.png) no-repeat; } #horizontal_line { width:90%; height:1px; background:#FFF no-repeat; margin-left:13px; margin-top:0px; box-shadow:0px 0px 5px #999; } #jewellery1 { border-radius:50%; background:#FFF; width:97px; height:97px; margin-left:auto; margin-right:auto; margin-top:60px; box-shadow:0px 6px 3px #000; -ms-box-shadow:0px 6px 3px #000; -o-box-shadow:0px 6px 3px #000; -moz-box-shadow:0px 6px 3px #000; -webkit-box-shadow:0px 6px 3px #000; } #jewellery1_pic { background:"http://www.ansjewelry.com/images/NEC211_des.jpg"; background-size:cover; width:inherit; height:inherit; } #jewellery2 { border-radius:50%; background:#FFF; width:97px; height:97px; margin-left:auto; margin-right:auto; margin-top:7px; box-shadow:0px 6px 3px #000; -ms-box-shadow:0px 6px 3px #000; -o-box-shadow:0px 6px 3px #000; -moz-box-shadow:0px 6px 3px #000; -webkit-box-shadow:0px 6px 3px #000; } #jewellery3 { border-radius:50%; background:#FFF; width:97px; height:97px; margin-left:auto; margin-right:auto; margin-top:7px; box-shadow:0px 6px 3p…
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28534046
has answer: http://stackoverflow.com/a/28534067
has answer: http://stackoverflow.com/a/28534046
has comment: http://stackoverflow.com/comment/45382687
has comment: http://stackoverflow.com/comment/45382888
type: Question
has title: How to fit a big picture in a smaller space
has comment: http://stackoverflow.com/comment/45382653
tagged with: javascript
has comment: http://stackoverflow.com/comment/45382762
has comment: http://stackoverflow.com/comment/45382679

http://stackoverflow.com/comment/45326146
comment on: http://stackoverflow.com/a/28499403
has text: @UIDesigner Be aware that input event not supported for all browsers http://goo.gl/JBd9v6
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28534399
possible better answer: http://stackoverflow.com/a/28534443
has comment: http://stackoverflow.com/comment/45383878
has comment: http://stackoverflow.com/comment/45383963
has body: I've got a collection of directory-like objects, each of which has as a property an array of the same kind of object. This structure begins with a single root and the implementation has no theoretical constraints on length. Here's the collection of objects: var filesystemObjects = [ { path: '/', children: [ { path: '/users', children: [ { path: '/users/firstuser', children: [ { path: '/users/firstuser/documents', children: [ ] }, ] }, { path: '/users/seconduser', children: [ { path: '/users/seconduser/documents', children: [ ] } ] }, ] }, { path: '/programFiles', children: [ ] }, { path: '/kurfleOS', children: [ { path: '/kurfleOS/passwd', children: [ ] }, ] }, ] }, ]; This seems like it should be fairly trivial, albeit not especially efficient, to visit every node (and, by extension, return the object that matches a path query string). The code does not fail to compile because of semicolons or brackets. Here's the test method I'm using: function directoryRecurse(dir) { console.log(dir); for (ii = 0; ii &lt; dir.children.length; ii++) { directoryRecurse(dir.children[ii]); } } But every time, the method searches (and prints) only until it reaches the first leaf node (/users/firstuser/documents, in this case), the output ceases entirely. There are no errors at all, and the method works as expected up to that point. I'm really not sure why, particularly because the same algorithm, superficially modified, works exactly as expected for arrays containing arrays containing etc. What exactly am I missing as far as allowing this method to actually traverse the entirety of the root?
tagged with: recursion
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28534753
has comment: http://stackoverflow.com/comment/45383842
has title: Recursing through nested collections of objects always terminates at first leaf node
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28534443
tagged with: javascript
has answer: http://stackoverflow.com/a/28534753
score: 0

http://stackoverflow.com/comment/45413520
has text: This type of thing has already been accomplished with third-party libraries like jQuery... I would suggest checking that out... unless, of course you want to go through the learning process
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28550221

google-play
tags question: http://stackoverflow.com/q/28481604
type: Tag
tag name: google-play

http://stackoverflow.com/comment/45482369
score: 0
has text: thanks i fixed spaces but still it is not working sliding up and down
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28587609

http://stackoverflow.com/q/28552302
tagged with: jquery-deferred
tagged with: javascript
tagged with: google-maps
answer count: 1
downvote count: 0
has title: jquery deferred in for loop
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28552580
favorite count: 0
has body: So I have been working on jquery deferred but am having trouble when retrieving data in a loop. The deferred portion seems to only process the data from the final iteration. If there is only one item in the array, it fails as well, so I am not sure what is going on. I have various city names, and I am trying to get central coordinates for each city from the google maps reverse geocoded Here is my function that gets the central coordinates: function getGroupLatLng(groupname){ var deferred = new $.Deferred(); geocoder.geocode( { 'address': groupname}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { deferred.resolve(results); alert(results[0].geometry.location.lat()); } else { } }); return deferred.promise(); } This is where the function is called, and a div is appended once the result is returned: var newGroupsLength = newGroups.length; for (i = 0; i &lt; newGroupsLength; i++) { newGroups[i]['counter']=counter; var locationName = newGroups[i]['name']; counter++; alert(locationName); $.when(getGroupLatLng(locationName)).then(function(results){ alert("lat = "+results[0].geometry.location.lat()); var lat=results[0].geometry.location.lat(); var lng=results[0].geometry.location.lng(); console.log(newGroups[i]); //this is running the proper number of times, but it logs the results from the final looped item, 'n' number of times. newGroups[i]['lat']=lat; newGroups[i]['lng']=lng; var jsonArray=[]; jsonArray = newGroups[i]; var template = $('#groupsTemplate').html(); var html = Mustache.to_html(template, jsonArray); $('#groups-container').append(html); }); } The problem I am having is that the deferred loop seems to process the last item in the for loop 'n' number of times, with 'n' being the number of items in the newGroupsLength array. Of course it should process each item one time. If the deferred action is removed, it all works fine. Sincere thanks for any help. It is greatly appreciated
score: 2
type: AnsweredQuestion
upvote count: 2
type: Question
has answer: http://stackoverflow.com/a/28552580

http://stackoverflow.com/a/28465403
type: Answer
answers question: http://stackoverflow.com/q/28465330
upvote count: 1
has comment: http://stackoverflow.com/comment/45259557
has body: Add $scope.refinements = {}; at the top of your controller.
downvote count: 0
score: 1

http://stackoverflow.com/q/28507750
has answer: http://stackoverflow.com/a/28507884
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28507861
favorite count: 0
has body: I am trying to integrate a list that I have written in html/css into the java string for displaying a button. Click here for a list of other Engineering majors! I cannot figure out how to display my list, Computer Engineer Computer Science Electrical Engineering Mechanical Engineering Chemical Engineering Bio Engineering through the user clicking the button. Any ideas?
type: Question
has answer: http://stackoverflow.com/a/28507880
downvote count: 3
has title: Is there a way of implementing a list into a button function while using html script?
has answer: http://stackoverflow.com/a/28508031
upvote count: 0
has comment: http://stackoverflow.com/comment/45334500
tagged with: javascript
answer count: 5
type: UnansweredQuestion
score: -3
tagged with: html-lists
has answer: http://stackoverflow.com/a/28507925

http://stackoverflow.com/q/28454605
type: AnsweredQuestion
score: 1
type: Question
accepted answer: http://stackoverflow.com/a/28454933
answer count: 1
has title: jQuery click() on checkbox is not checking checkbox before running click handler
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I was calling jQuery.click() on all my checkboxes when a global checkbox is checked. I want to disable a button if none of the normal checkboxes are checked. Hence, I was counting number of checked checkboxes using the code below. But when we manually click on .chkLst happens $(this) comes already checked and when I call click() function, $(this) comes unchecked. $(".grid").on("click", ".chkLst", function() { if($(this).is(":checked")){ deleteBtnDisableCheck++; } else { deleteBtnDisableCheck--; } if (deleteBtnDisableCheck == 0) { $('#btnDeleteLst').addClass("btnDisable"); } else { $('#btnDeleteLst').removeClass("btnDisable"); } }); $(".grid").on("click", ".chkLstAll", function() { $(".chkLst").each(function() { $(this).click(); }); });
has answer: http://stackoverflow.com/a/28454933
has comment: http://stackoverflow.com/comment/45236091
upvote count: 1
tagged with: checkbox

http://stackoverflow.com/q/28476770
type: Question
linked to: http://stackoverflow.com/q/19516771
has body: I set the $stateParam by getting a cell value from a table: $scope.tableClick = function() { var tr = $('#Table_1').find('tr'); var id = $(event.target).parent().find("td:first").text(); $stateParams.engineId == id; $state.go('engineselection'); } When I stop the debug at this point. It gives me the engineId value. This is the router part that I use: $stateProvider.state('engineselection', { url : '/engineselection:engineId', templateUrl : 'assets/views/engineselection.html', controller : 'EngineSelectionCtrl' }) This is what happens in the controller: controllers.controller("EngineSelectionCtrl", ["$scope", "$rootScope", "directiveBinder", '$timeout', '$stateParams', '$resource', '$location', 'rtmService', '$state', function($scope, $rootScope, directiveBinder, $timeout, $stateParams, $resource, $location, myService, $state) { myService.loadViewWithEngine(function(id, data) { $scope.views = data; $scope.$apply(); $('#loadingViews').spin(false); }); When I stop here before the function and type console $stateParams, it tells me that I have a state parameter named 'engineId' but it is undefined. What should I do to pass the parameter to the controller with its value?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45276595
has title: $stateParams become 'undefined' after passing to the controller
has comment: http://stackoverflow.com/comment/45277819
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45277359
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45276647
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28477540
has comment: http://stackoverflow.com/comment/45277854

http://stackoverflow.com/comment/45424951
comment on: http://stackoverflow.com/q/28556372
type: Comment
type: QuestionComment
has text: break must be inside a loop or switch, so it's throwing javascrip error
score: 0

http://stackoverflow.com/a/28461648
upvote count: 4
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28461290
accepted answer of: http://stackoverflow.com/q/28461290
has body: toString is a special function (in object's prototype), which is called when a stringified mode of the object is required. In your cases, the addition operator calls the toString method of the object. From the specs: If Type(lprim) is String or Type(rprim) is String, then a. Return the String that is the result of concatenating ToString(lprim) followed by ToString(rprim). However, this native method can be overridden, which you've done* in the first snippet. Addition operator just calls the custom method, which produces the result you've got. In the latter snippet toString just returns a default value for objects. You can see this happening in many situations, for example alert({}) calls internal toString method from object's prototype, since alert requires a string as an argument. (* More accurate: you haven't re-written the native property, rather you've created an own property to the object with the same name, which is used instead of searching the native property from the prototype chain.
score: 4

http://stackoverflow.com/a/28757853
has body: Use click touchstart: $('.sidr nav ul').on('click touchstart', 'li a[href^="#"]', function(){ //rest of your code }
answers question: http://stackoverflow.com/q/28484194
score: 1
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/comment/45492121
has text: Check my code below.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28592588

http://stackoverflow.com/comment/45339728
has text: Try it on a proper phone. the plugins don't work in-browser but I never use the emulator so I don't know about them working in it or not.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28503943
type: QuestionComment

http://stackoverflow.com/comment/45433544
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28561260
score: 0
has text: What do you want to print? And where?

http://stackoverflow.com/q/28482894
favorite count: 0
tagged with: d3.js
type: UnansweredQuestion
score: 2
answer count: 0
downvote count: 0
type: Question
has title: Speed up image load when using particle effect, d3
tagged with: javascript
has body: I am trying to make a particle effect that follows the user's mouse around. It works perfectly if I don't include the image, but it's tremendously slow once I add in the image. I tried working out how to define the image differently, or using a def, but could not make anything else work. JSFiddle, http://jsfiddle.net/jqkuf5os/ The image is hosted in the same path as the app, and is 1.2kb &lt;svg id="mySvg" width="40" height="40"&gt; &lt;defs id="mdef"&gt; &lt;pattern id="image" x="0" y="0" height="40" width="40"&gt; &lt;image x="0" y="0" width="40" height="40" xlink:href="image.png"&gt;&lt;/image&gt; &lt;/pattern&gt; &lt;/defs&gt; &lt;/svg&gt; And the js var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height); svg.append("rect") .attr("width", width) .attr("height", height) .on("ontouchstart" in document ? "touchmove" : "mousemove", particle); function particle() { var m = d3.mouse(this); svg.append("circle") .attr("cx", m[0]) .attr("cy", m[1]) .attr("r", 1e-6) .style("stroke", d3.hsl((i = (i + 1) % 360), 1, .5)) .style("stroke-opacity", 1) .style("fill", "url(#image)") .transition() .duration(2000) .ease(Math.sqrt) .attr("r", 40) .style("stroke-opacity", 1e-6) .remove(); d3.event.preventDefault(); } How do I handle the image loading so it's faster?
upvote count: 2
has comment: http://stackoverflow.com/comment/45290947

http://stackoverflow.com/comment/45326864
comment on: http://stackoverflow.com/a/28503901
type: Comment
has text: TypeScript is apparently fully integrated into VS 2013 so it seems strange that an issue like this appears. Thanks for the link
type: AnswerComment
score: 0

http://stackoverflow.com/comment/60439795
comment on: http://stackoverflow.com/a/28559777
score: 0
has text: Some crazy optimized Firefox messed up my results for browser comparison. This one is better http://jsperf.com/bracket-v-dot-2
type: Comment
type: AnswerComment

http://stackoverflow.com/a/29955501
answers question: http://stackoverflow.com/q/28536871
type: Answer
upvote count: 2
has body: I don't know how to convert your json to js function but if you want to create object from json schema, you could use json-schema-defaults. After creating one object with json-schema-defaults you can create anothers with Object.create and you can add first level properties to new objects which is created by Object.create function. var a = require('json-schema-defaults')({ "type":"object", "properties": { "name": { "type": "string" }, "age": { "type": "integer", "default":12 }, } }); var b = Object.create(a,{ id:{ value:1 }, f:{ value:function() { console.log('run lola run'); } } } );
score: 2
downvote count: 0

http://stackoverflow.com/a/28578953
accepted answer of: http://stackoverflow.com/q/28499177
type: Answer
downvote count: 0
score: 1
has body: I would suggest you to use angular ui-router: AngularUI Router is a routing framework for AngularJS, which allows you to organize the parts of your interface into a state machine. Unlike the $route service in the Angular ngRoute module, which is organized around URL routes, UI-Router is organized around states, which may optionally have routes, as well as other behavior, attached.
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28499177

http://stackoverflow.com/q/28503179
answer count: 1
downvote count: 0
tagged with: meteor
tagged with: html5-filesystem
favorite count: 0
tagged with: cordova
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/30629471
has comment: http://stackoverflow.com/comment/45994055
score: 2
has body: I'm working on a Meteor Cordova app which needs to work offline. I'm using ground:db to cache my data offline, which works fine, except for images. I have an image collection using collectionFS. Since these images need to be available when offline, I developed some kind of local sync which observes the image collection, and when some image gets added or changed, downloads the image to the local storage using cordova filesystem and filetransfer. I keep track of the downloaded images in a client-side collection. When using an image in the a template, I check if the image exists locally. If so, I pass the local filepath to the template, else I pass the url. (android:http://meteor.local/:0) Not allowed to load local resource: file:///storage/emulated/0/brachot/AbsoluteBlackGepolijst.jpg Is there some kind of problem for a Meteor mobile app to access the local filesystem? Here is some of my relevant code: Images.find().observe({ added: function(doc){ console.log('added: ' + doc.original.name); var localImage = LocalImages.findOne(doc._id); if (!localImage &amp;&amp; window.fileSystem &amp;&amp; window.fileSystem.root){ // create filepath for new file var dir = window.fileSystem.root.getDirectory("brachot", {create: true, exclusive: false}, function(dirEntry){ var file = dirEntry.getFile(doc.original.name, {create: true, exclusive: false}, function(fileEntry){ var filePath = fileEntry.toURL(); // download the file to the filepath var fileTransfer = new FileTransfer(); console.log('starting file download: ' + doc.url() + ' to ' + filePath); fileTransfer.download( doc.url(), filePath, function(){ // download image and save locally LocalImages.insert({ _id: doc._id, name: doc.original.name, url: filePath }); console.log('save'); }, function(error){ console.log('failed to save image: ' + filePath + ' (error: ' + error.http_status + ')'); } ); }); }, function(error){ console.log(JSON.stringify(error)); }); Template.materials.helpers({ imageUrl: function(){ var image = LocalIma…
has comment: http://stackoverflow.com/comment/45326917
type: Question
has title: Cordova Meteor app not allowed to load local resource
tagged with: mobile
tagged with: javascript

http://stackoverflow.com/comment/45366913
comment on: http://stackoverflow.com/q/28525315
score: 0
type: Comment
type: QuestionComment
has text: No.. Nothing... just blank page. No template is loaded in ng-view

http://stackoverflow.com/comment/45295644
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28461278
type: Comment
has text: Seeing that doesn't really give any indication of what's wrong or how I or anyone else can help. I think it may be best to go back to the start and replace your question with something more specific including details about what's going wrong compared to your expected result.

http://stackoverflow.com/comment/45307284
score: 0
type: Comment
type: QuestionComment
has text: `+` or `-` operand in front of a string converts it to number. so here `+"2"` will become `2` and then `1 + 2` which will be `3`.
comment on: http://stackoverflow.com/q/28493464

http://stackoverflow.com/a/28630419
downvote count: 1
accepted answer of: http://stackoverflow.com/q/28556309
score: -1
upvote count: 0
type: AcceptedAnswer
has body: No. You have captured the security issues completely and accurately.
answers question: http://stackoverflow.com/q/28556309
type: Answer

http://stackoverflow.com/comment/45396215
score: 0
type: Comment
type: QuestionComment
has text: I don't understand. The layout.phtml file has few javascript files called, and I copy the `->prependFile($this->basePath() . '/js/lightbox.min.js')` but it simply doesn't work.
comment on: http://stackoverflow.com/q/28527027

http://stackoverflow.com/q/28504023
has body: I have a select box populated from a JSON file, I want to reload the URL but pass the value from the select box. Here is a cut down version of my index.html file Timetables <!--[if lt IE 9]> <![endif]--> and here is a sample of the JSON [ { "StationName":"Abbey Wood", "Code":"ABW" }, { "StationName":"Aber", "Code":"ABE" } ] The select box generates fine and is 'injected(?) into the navbar div, but the on change event wont register Basically if someone was to select Aber, the onchange event will reload index.html?crs=ABE automatically. Dev tools is not throwing up any errors, its just not doing anything when I change the select box. I suspect I need to run the on change event as a function that is called exclusively when needed as putting it in at the bottom of the index.html file means its loading before the DOM is ready? Thanks in advance for any assistance.
upvote count: 1
has answer: http://stackoverflow.com/a/28504160
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28504091
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28504301
answer count: 5
tagged with: http://stackoverflow.com/tag/html
has title: Change URL based on change of dynamic select box
has answer: http://stackoverflow.com/a/28504091
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28504330
accepted answer: http://stackoverflow.com/a/28504330
has answer: http://stackoverflow.com/a/28504081
type: Question

http://stackoverflow.com/comment/45237552
comment on: http://stackoverflow.com/a/28454329
has text: I did, it says `Uncaught TypeError: undefined is not a function`. The same error is for `$( 'body' ).myPlugin().sayHello();`.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45289024
comment on: http://stackoverflow.com/a/28483227
has text: I tried this and the comment above and I still receive the same error message. Not sure If I am doing anything wrong.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28461256
has title: wrapping jQuery collection and appending to class
has comment: http://stackoverflow.com/comment/45248627
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28461327
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28461615
score: 1
upvote count: 1
type: Question
has body: I have this collection of 21 jQuery elements div.article-preview.js-articles-new div.article-preview.js-articles-new div.article-preview.js-articles-new ... Using this code I'm appending them to a page. I'm wondering how I can wrap every 3rd element in a , and every element in a . I tried using the jQuery.wrap() function but it didn't do anything to the html that was appended. var newArticles = $('<%= j render partial: "articles/article", collection: @articles %>'); var arts = newArticles.filter('.article-preview'); arts.addClass('js-articles-new'); arts.appendTo($('.js-articles-preview'));
tagged with: javascript
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28461615
tagged with: jquery
has answer: http://stackoverflow.com/a/28461327
favorite count: 0
has comment: http://stackoverflow.com/comment/45248524

http://stackoverflow.com/a/28453915
has comment: http://stackoverflow.com/comment/45236616
answers question: http://stackoverflow.com/q/28453677
has body: a table with 40000 rows is not the best for a webpage.... like pradipgarala say you should do it from server side. or at list use "divs" to separate multiple tables with less rows.. &lt;div id="table_1_1000"&gt; &lt;table&gt; ...rows from 1 to 1000 &lt;/table&gt; &lt;/div&gt; like this you can show-hide only the divs you need... and the loop would be faster... but still not the best solution....
score: 0
has comment: http://stackoverflow.com/comment/45235547
has comment: http://stackoverflow.com/comment/45235820
type: Answer

http://stackoverflow.com/q/28481888
has title: Resource use on a webpage
has body: I have a webpage that uses javascript and ajax to call another page that processes one database record. The javascript uses a timer to "rest" prior to making another ajax request to the page. My network team insists that this is causing a huge load on the system even though the page that is called takes less then a second to load if you load it directly. I fail to see how I am loading the servers. I am not sure if it is the web server or the database server takes the hit in performance. Is this possible or are they smoking good stuff? The network team thinks that since it makes calls every so often then that it has to be the culprit for the loss in performance. As a work around I have thought about just adjusting the page that process the record to just refresh every 30 seconds to a minute which in theory would be the same thing that I am doing with the ajax request. The only reason I set it up like this was to be able to have an on/off switch. Question: Are they right and how can I ensure that my pages do not hog resources. Thanks Here is the javascript $(document).ready(function(){ $("#btn-go").click(Start); $("#test").click(Stop); }); var timer; var counter = 0; var timeOut = 30000; var pause = 10000; var bit = 0; var data = null; //stops the process function Stop(){ bit = 1; $("#response").append(' ***Stopped at - '+ getTime() + ' ***'); $("#response").append(' ***Records Processed - '+ counter + ' ***'); } //Starts the process function Start(){ bit = 0; $("#response").append(' ***Started at - '+ getTime()+ ' ***'); Step1(); } function Step1(){ counter++; $.post('Step1.cfm', setTimeout(finalStep, timeOut));//, setTimeout(Step2, timeOut)); return false; } //Final Step function finalStep(){ //alert(getTime()); $("#response").append(' record updated at - '+ getTime()); if(bit != 1) { Step1(); } } function getTime() { var now = new Date(); var hours = now.getHours(); var minutes = now.getMinutes(); var seconds = now.getSeconds(); var time = hours+":"+minutes+":"+sec…
type: Question
has comment: http://stackoverflow.com/comment/45291568
has comment: http://stackoverflow.com/comment/45296532
tagged with: performance
has comment: http://stackoverflow.com/comment/45293479
accepted answer: http://stackoverflow.com/a/32132088
score: 1
has comment: http://stackoverflow.com/comment/45296310
tagged with: javascript
has comment: http://stackoverflow.com/comment/45286775
has comment: http://stackoverflow.com/comment/45294219
upvote count: 1
has answer: http://stackoverflow.com/a/32132088
has comment: http://stackoverflow.com/comment/45820938
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45293642
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/45290335
has comment: http://stackoverflow.com/comment/45297361
tagged with: coldfusion
has comment: http://stackoverflow.com/comment/45294405
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45291689
has comment: http://stackoverflow.com/comment/45286628
has comment: http://stackoverflow.com/comment/45297640
has comment: http://stackoverflow.com/comment/45293318

http://stackoverflow.com/a/28530073
answers question: http://stackoverflow.com/q/28529919
downvote count: 0
type: Answer
has body: You can calculate hours, minutes and seconds simply using division and modulo: // total seconds var seconds = 344234; // calculate seconds var s = seconds % 60; // add leading zero to seconds if needed s = s &lt; 10 ? "0" + s : s; // calculate minutes var m = Math.floor(seconds / 60) % 60; // add leading zero to minutes if needed m = m &lt; 10 ? "0" + m : m; // calculate hours var h = Math.floor(seconds / 60 / 60); var time = h + ":" + m + ":" + s JSFiddle here: http://jsfiddle.net/dcfxnmxc/
score: 1
upvote count: 1

http://stackoverflow.com/comment/45291963
score: 0
has text: Interesting idea, thanks a lot! Let's see whether I get this done...
comment on: http://stackoverflow.com/q/28484641
type: Comment
type: QuestionComment

rxjs
tags question: http://stackoverflow.com/q/28489044
tags question: http://stackoverflow.com/q/28518676
tags question: http://stackoverflow.com/q/28477146
type: Tag
tag name: rxjs
tags question: http://stackoverflow.com/q/28490700

http://stackoverflow.com/comment/45311536
type: Comment
comment on: http://stackoverflow.com/q/28495814
type: QuestionComment
has text: I have the code for Masonry in assets/javascripts/application.js and the delete call in views/projects/destroy.js.erb. I'm calling it with remote: true from index.html.erb..
score: 0

http://stackoverflow.com/q/28536789
has comment: http://stackoverflow.com/comment/45390219
has title: Using clientWidth/clientHeight Javascript with webgl returns problems
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45390966
has answer: http://stackoverflow.com/a/28574950
tagged with: javascript
tagged with: webgl
accepted answer: http://stackoverflow.com/a/28574950
has body: I am using document.getElementById('myid').clientWidth (.clientHeight for height) to get the width and the height of a div element to set the width and height of a container variable where I want my Webgl graphics to be done. Adding the value to a label for testing I was able to get correct values for the width and height of the element and then adding those values to the width and height, I was able to get everything working fine. The problem comes when I directly add the statement document.getElementById('myid').clientWidth to the width variable. When I do that I get the wrong result. Any help? Here is some of the code: var clientWidth = document.getElementById('webgl').clientWidth; var clientHeight = document.getElementById('webgl').clientHeight; var container = document.getElementById('webgl'); var width = clientWidth, height =clientHeight; var renderer = new THREE.WebGLRenderer({alpha: (option.bgcolor === undefined)}); renderer.setSize(width, height); renderer.setClearColor(option.bgcolor || 0, (option.bgcolor === undefined) ? 0 : 1); // camera and controls var camera = new THREE.PerspectiveCamera(45, width / height, 0.1, 1000); camera.position.set(0, 0, 50);
downvote count: 0
answer count: 1
favorite count: 0

http://stackoverflow.com/a/36949380
answers question: http://stackoverflow.com/q/28517417
type: Answer
upvote count: 3
score: 3
has body: This isn't related to the shadow dom, but it is related to encapsulating components entirely using javascript: https://benfrain.com/sandbox-local-htmlcss-code-snippets-inside-iframe-style-guidespattern-libraries/ Basically you create an iframe node and inject css and javascript into it: var newIframe = document.createElement('iframe') newIframe.contentWindow.document.open('text/html', 'replace') var content = '&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;'+CSS+'&lt;/head&gt;&lt;body&gt;'+HTML+JS+'&lt;/body&gt;&lt;/html&gt;' newIframe.contentWindow.document.write(content) newIframe.contentWindow.document.close() To completely isolate the javascript from accessing its parent page, I believe you can modify the parent page's document.domain with some kind of randomly generated domain so that, to the new iframe, the parent page will look like its in a different domain and has no way of changing its domain to match. This would come with all the usual security constraints. Then you can safely talk to the child iframe via postmessage. Theoretically you could also implement some communication to automatically resize the iframe element depending on its content, simulating a non-iframe element in-flow. This is something I want to experiment with in the future, but haven't tried out yet.
downvote count: 0

http://stackoverflow.com/q/28499938
tagged with: javascript
has comment: http://stackoverflow.com/comment/45319150
score: 0
answer count: 2
tagged with: jquery
has comment: http://stackoverflow.com/comment/45319271
has answer: http://stackoverflow.com/a/28500072
possible better answer: http://stackoverflow.com/a/28500002
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28500002
type: AnsweredQuestion
has title: Get content of tag including html tags and store it in a variable
has body: Consider the following stripped down part of some html code: This is a header Some stuff in here Some more stuff here How do I get the and elements from the section and store it in a variable? E.g. var result = " This is a header Some stuff in here Some more stuff here " Also is it possible to get linebreaks etc as well? I've tried using jquery .val() and JS document.getElementByID(..), but they both return the section element altogether.
accepted answer: http://stackoverflow.com/a/28500072
type: Question

http://stackoverflow.com/comment/45302080
has text: Thanks, That work great. And thank you charlietfl for pointing out that you retrieve the variables as POST & not GET when using .load.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28486489

http://stackoverflow.com/comment/45294326
type: AnswerComment
comment on: http://stackoverflow.com/a/28483822
type: Comment
has text: OK thank you, I'll look into this further. it seems awfully complicated and a real workaround when I have the HTML ready to go. I appreciate your taking the time to explain this. - Bill
score: 0

http://stackoverflow.com/a/28537525
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/46603155
score: 3
has body: I had this error a while a ago. It is caused by Ext.Loader which loads the Ext classes dynamically. I could solve it by adding the required classes in the Ext.require([...]) statement in the main js file of my application (i.e. app.js). The docs for Ext.Loader explain when and why asynchronous and synchronous loading happens.
has comment: http://stackoverflow.com/comment/46501786
upvote count: 3
answers question: http://stackoverflow.com/q/28524757
has comment: http://stackoverflow.com/comment/46599916

http://stackoverflow.com/comment/45292355
score: 0
comment on: http://stackoverflow.com/q/28484979
has text: @AugustoBarreto Sorry, fixed in the post.
type: Comment
type: QuestionComment

typeerror
tags question: http://stackoverflow.com/q/28517481
tag name: typeerror
tags question: http://stackoverflow.com/q/28505187
tags question: http://stackoverflow.com/q/28489790
tags question: http://stackoverflow.com/q/28482489
tags question: http://stackoverflow.com/q/28469873
tags question: http://stackoverflow.com/q/28444025
type: Tag
tags question: http://stackoverflow.com/q/28442138

http://stackoverflow.com/comment/45415690
type: Comment
score: 0
type: AnswerComment
has text: You could try generating JSON with it (i.e `echo json_encode(array("date" => date("Y-m-d H:i", strtotime($str))));`). The in JavaScript you would access it like so `result.date` where `result` is the returned payload from the AJAX call.function as shown above.
comment on: http://stackoverflow.com/a/28551208

http://stackoverflow.com/comment/45458760
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28574605
type: AnswerComment
has text: The for loop cannot be circumvented, this is an assignment in an HTML5 class so unfortunately my options are limited. I have also never encountered: var index = Array.prototype.indexOf.call(list.children, event.target.parentNode); And hence, cannot use it as a solution. It must be similar to my current solution. I am doing something wrong in that solution and that is what I need to know.

http://stackoverflow.com/comment/45514798
type: Comment
comment on: http://stackoverflow.com/a/28583354
type: AnswerComment
has text: Thank you everyone for being patient with a noob. I'm still learning about this whole Javascript thing.
score: 0

http://stackoverflow.com/q/28473055
type: Question
has comment: http://stackoverflow.com/comment/45270957
score: 1
tagged with: http://stackoverflow.com/tag/json
has title: JSON error on using jquery datatable
has comment: http://stackoverflow.com/comment/45270639
has comment: http://stackoverflow.com/comment/45270142
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has body: [{"name":"aaa","firstname":"bbb","lastname":"ccc"}, {"name":"qqq","firstname":"eee","lastname":"mmm"}, {"name":"www","firstname":"ooo","lastname":"lll"}] I am making ajax request to server, its returning the above json data.But i >am getting the json parse error $(document).ready(function() { $('#example').dataTable( { "processing": true, "serverSide": true, "ajax": { "url": "http://example", "dataType": "jsonp", "columns": [ { "data": "name"}, { "data": "firstname" }, { "data": "lastname" } ] } } ); });
has comment: http://stackoverflow.com/comment/45272284
linked to: http://stackoverflow.com/q/2067472
tagged with: datatables
has comment: http://stackoverflow.com/comment/45340792
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45270112
downvote count: 0
has answer: http://stackoverflow.com/a/28473164
accepted answer: http://stackoverflow.com/a/28473164
has comment: http://stackoverflow.com/comment/45350966

http://stackoverflow.com/comment/45478133
type: Comment
comment on: http://stackoverflow.com/a/28584842
type: AnswerComment
has text: @JhonDree Event is not like functions ,button Click is an event .so there is nothing like onclcik2 event onclick3 event . Are you trying to open different function in each button click event ??
score: 0

http://stackoverflow.com/comment/45345644
comment on: http://stackoverflow.com/q/28513827
has text: function createTable() { $("#footer").append(" "); __ Forgot to delete
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45392446
type: Comment
has text: ah shame :( then I don't think there's a way to do this clientside for those browsers
comment on: http://stackoverflow.com/a/28539096
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45266236
type: Comment
type: QuestionComment
has text: If your fizzbuzz logic is in the scripts.js file, you would need to load that after the jquery script. Otherwise jquery will be undefined when you try to reference it.
score: 0
comment on: http://stackoverflow.com/q/28470646

http://stackoverflow.com/comment/45436978
type: QuestionComment
comment on: http://stackoverflow.com/q/28562808
has text: I know about the WebGL buffer existing (`gl.ARRAY_BUFFER` and `gl.ELEMENT_ARRAY_BUFFER`), but it will discovered in the next chapter of book. I still learn the codes of previous chapters.
score: 0
type: Comment

http://stackoverflow.com/comment/45446372
has text: Are you sure there are not any typo errors? and this line in your code should be url: "@Html.Toyota().Page.GetActionUrl('onGetBisa')",
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28567071
score: 0

http://stackoverflow.com/a/28535181
answers question: http://stackoverflow.com/q/28534840
has body: Asynchronous functions do not return the result immediately, they usually work by emitting events, passing a callback as argument, or returning a promise object. In your example, you are passing a callback that returns its argument into the void. Also you wouldn't want to call the geocoder API twice for the same address. A better function to declare would be : function getGeoLocation(address, onDoneCallback) { ... } ... var homes = []; getGeoLocation(some_address, function(loc) { homes.push({lat : loc.lat, lng : loc.lng}); }); Hope this helps.
type: Answer
has comment: http://stackoverflow.com/comment/45384942
score: 0
has comment: http://stackoverflow.com/comment/45385226

http://stackoverflow.com/a/28588375
has comment: http://stackoverflow.com/comment/45490159
has comment: http://stackoverflow.com/comment/45484364
has comment: http://stackoverflow.com/comment/45488491
has comment: http://stackoverflow.com/comment/45487775
has comment: http://stackoverflow.com/comment/45488837
accepted answer of: http://stackoverflow.com/q/28588081
upvote count: 1
answers question: http://stackoverflow.com/q/28588081
type: AcceptedAnswer
has body: The issue is where you call db.collection('games'), because db in this scope refers to db = new Db('gamedb', server) rather than the actual db connection as defined by the callback of db.open(function(err, db) EDIT: Start the server only after you've established a database connection var http = require("http"); var url = require("url"); var path = require("path"); var mongo = require("mongodb"); var Server = mongo.Server, Db = mongo.Db, BSON = mongo.BSONPure; var server = new Server('localhost', 27017, { auto_reconnect: true }); db = new Db('gamedb', server); db.open(function(err, db) { if (!err) { console.log("Connected to gameapp database"); db.collection('games', { strict: true }, function(err, collection) { if (err) { console.log("cant connect to db"); } }); } var findAll = function(req, res) { db.collection('games', function(err, collection) { collection.find().limit(10).toArray(function(err, items) { res.send(items); }); }); }; http.createServer(function(req, res) { if (req.url == "/games" &amp; req.method == "GET") { res.writeHead(200, { 'Content-Type': 'text/plain' }); findAll(req, res); // comment this out // res.end('end request\n'); } else { res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end('HI\n'); } }).listen(3000, '127.0.0.1'); console.log('Server running at http://127.0.0.1:3000/'); });
has comment: http://stackoverflow.com/comment/45485237
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/45489282
score: 1

http://stackoverflow.com/q/28442671
tagged with: php
score: -1
has comment: http://stackoverflow.com/comment/45214839
has title: Run jQuery script before php
downvote count: 1
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I have a php page which loads a bit slow (SOAP client connection). In the php page I have a jquery page loader, but the loader is running only after the SOAP client retrives the data (after 30-40 sec). Is there a way to load the loader script before php script so the end user can view page is loading until the SOAP client retrives all the data ? php page is strating with below lines <?php session_start(); ?> <?php include 'includes/includes_hotel-rezultate.php';?> Loader script is
has answer: http://stackoverflow.com/a/28442692
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/28501699
has body: the foundation validator declaration need to be situated after the load not outside : $(".appel-rdv").click(function() { $('#afficheFormRdv').load('form-login.html', function(response, status, xhr){ if (status=='success'){ if (response ==2) { document.location.href = 'utilisateur.html'; } else { $(document).foundation({ abide : { ....
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28450265
answers question: http://stackoverflow.com/q/28450265

http://stackoverflow.com/comment/45341835
comment on: http://stackoverflow.com/q/28511328
score: 0
has text: var index = this.hashFunc(key, this.limit); HashTable.prototype.hashFunc = function(str, max) { var hash = 0; for (var i = 0; i < str.length; i++) { var letter = str[i]; hash = (hash << 5) + letter.charCodeAt(0); hash = (hash & hash) % max; } return hash; };
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28570938
tagged with: ruby
has comment: http://stackoverflow.com/comment/45454500
has comment: http://stackoverflow.com/comment/45452372
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/18632644
tagged with: ruby-on-rails
type: Question
tagged with: google-analytics
has answer: http://stackoverflow.com/a/28574071
has title: Rails 4 Turbolinks and Google Analytics
tagged with: javascript
has comment: http://stackoverflow.com/comment/45452032
score: 0
has body: I'm looking to add Google Analytics to my Rails 4 application and have read about the issue with Turbolinks. I have used the following answer to produce a workaround: Google analytics with rails 4 The following code is from the new analytics.js.coffee file I created under assets>javascripts app/assets/javascripts/analytics.js // Coffee $(document).on 'page:change', -&gt; if window._gaq? _gaq.push ['_trackPageview'] else if window.pageTracker? pageTracker._trackPageview() // Javascript $(document).on('page:change', function() { if (window._gaq != null) { return _gaq.push(['_trackPageview']); } else if (window.pageTracker != null) { return pageTracker._trackPageview(); } }); Views > Layouts > _footer.html.erb (the file I setup for to load the 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-837283948-1', 'myapplication.com'); ga('send', 'pageview'); &lt;/script&gt; Then I placed the following code in my application.html.erb file under Views > Layouts &lt;%= render 'layouts/footer' %&gt; The render code in the application.html.erb file causes the application to crash, so I'm guessing I have done something wrong. I have followed the guide and can't get it to work. Thank you for your time and efforts.
answer count: 1

http://stackoverflow.com/a/28546087
type: Answer
accepted answer of: http://stackoverflow.com/q/28545879
upvote count: 0
has body: If you want to make synchronous call inside your code. Then you need to do call your methods inside the success of it, You're scaring to make synchrous call, That means you haven't maintain your call stack properly. Sample Code service.whichReturningPromise1.then( //success callback function(data) { service.whichReturningPromise2.then(function() { service.whichReturningPromise3.then(function() { }) }) }, //error callback function(error) { //error handling }); In above example the service call is going after success of each. NOTE Even jQuery has deprecated async option from jQuery 1.8 Thanks.
score: -1
type: AcceptedAnswer
downvote count: 1
answers question: http://stackoverflow.com/q/28545879

http://stackoverflow.com/comment/45478538
comment on: http://stackoverflow.com/q/28585542
type: QuestionComment
type: Comment
score: 0
has text: Did you try anything? `direction:rtl` ? Any googling? Did you read stuff like http://css-tricks.com/almanac/properties/d/direction/ ?

http://stackoverflow.com/comment/45307055
score: 1
has text: Thanks for spend your suspicious time.I think no need to put watch, direct use `$timeout` inside directive is working.here is plunkr http://plnkr.co/edit/DFdS7zsnlEPefpWEC3zG?p=preview ..but i don't understand why we need to put `$templateCache.get('snippet1.html')[1]`?
type: AnswerComment
comment on: http://stackoverflow.com/a/28488710
type: Comment

http://stackoverflow.com/a/28489198
score: 3
has comment: http://stackoverflow.com/comment/45300072
answers question: http://stackoverflow.com/q/28489018
has body: It looks like the property this.active was actually a self reference to the setter method. The corrected code is the following: class DateTime { constructor() { this._active = null } set active( date ) { this._active = new Date( date || Date.now() ) } get active() { return this._active } toString() { return this._active.toString() } } new DateTime() Basically, assigning this.active inside the setter in the ES6 context will call the setter again before the property can be assigned. When the setter is called again, this becomes a recursive event.
downvote count: 0
has comment: http://stackoverflow.com/comment/45299941
type: Answer
has comment: http://stackoverflow.com/comment/45300224
upvote count: 3
has comment: http://stackoverflow.com/comment/45300833

http://stackoverflow.com/a/28549245
answers question: http://stackoverflow.com/q/28546865
score: 1
upvote count: 1
has body: But since I cannot view the native code, I am having difficulty understanding the actual function that is getting created. You have native code inside the script tag. It just looks unusual as it is referencing the ASCII key codes; octagonal to be exact (OCT). Here is a link ASCII Key Codes First we have an executable tag that starts things off. Here is a link explaining what it does. HTML tags Inside the tag we have two functions or function constructors. If your were to type Function() into your console you would get function anonymous() {} For more information check out this link. Funciton JS link Let's start with the nested function first. Function( 'return \'\\141\\75\\160\\162\\157\\155\\160\\164\\50\\47\\105\\156\\164\\162\\145\\172\\40\\154\\145\\40\\155\\157\\164\\40\\144\\145\\40\\160\\141\\163\\163\\145\\47\\51\\73\\151\\146\\50\\141\\75\\75\\47\\164\\157\\164\\157\\61\\62\\63\\154\\157\\154\\47\\51\\173\\141\\154\\145\\162\\164\\50\\47\\142\\162\\141\\166\\157\\47\\51\\73\\175\\145\\154\\163\\145\\173\\141\\154\\145\\162\\164\\50\\47\\146\\141\\151\\154\\56\\56\\56\\47\\51\\73\\175\'')() By using the JS Function constructor, we can pass in arguments to our new function as well as the function body. new Function ([arg1[, arg2[, ...argN]],] functionBody) In the nested function we just create an anonumous funciton and pass it a function body in the form of a string like this 'return \'\\141\\75\\160\\162\\157\\155\\160\\164\\50\\47\\105\\156\\164\\162\\145\\172\\40\\154\\145\\40\\155\\157\\164\\40\\144\\145\\40\\160\\141\\163\\163\\145\\47\\51\\73\\151\\146\\50\\141\\75\\75\\47\\164\\157\\164\\157\\61\\62\\63\\154\\157\\154\\47\\51\\173\\141\\154\\145\\162\\164\\50\\47\\142\\162\\141\\166\\157\\47\\51\\73\\175\\145\\154\\163\\145\\173\\141\\154\\145\\162\\164\\50\\47\\146\\141\\151\\154\\56\\56\\56\\47\\51\\73\\175\'' When the function runs the first string '' (quotes) are removed and this statement is run return \'\\141\\75...' The return, of course execute…
has comment: http://stackoverflow.com/comment/45590672
has comment: http://stackoverflow.com/comment/45442082
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45420095

http://stackoverflow.com/a/28442886
answers question: http://stackoverflow.com/q/28442835
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28442835
upvote count: 1
type: AcceptedAnswer
has body: you can try $timeout(function() { $location.path('test'); }); Take present that all the angular actions must be run on the digest cycle of the app. If you are making this call using a function that is not handle it using some of the angular services, the context is not notified of the change.
has comment: http://stackoverflow.com/comment/45217092
type: Answer

http://stackoverflow.com/a/28507212
has body: Figured it out. I was missing var declarations, so it wasn't resetting the variables. Here's the correct js code: function addCategories($list, cats) { _.each(cats, function(cat) { var $item = $('&lt;li&gt;&lt;a href="#"&gt;' + cat.name + '&lt;/a&gt;&lt;/li&gt;'); if(cat.children.length) { var $subList = $('&lt;ul&gt;&lt;/ul&gt;'); $item.append($subList); addCategories($subList, cat.children); } $list.append($item); }); }
downvote count: 0
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28507074

http://stackoverflow.com/a/28640620
upvote count: 0
downvote count: 1
score: -1
has body: This theme is using Superfish, a jQuery menu plugin by Joel Birch. It is open source / free software, dual licensed under the MIT and GPL licenses: http://www.opensource.org/licenses/mit-license.php http://www.gnu.org/licenses/gpl.html See: http://users.tpg.com.au/j_birch/plugins/superfish/ https://github.com/joeldbirch/superfish for code to download and documentation on how to use it.
type: Answer
answers question: http://stackoverflow.com/q/28542203

http://stackoverflow.com/a/28475164
has comment: http://stackoverflow.com/comment/45274907
has comment: http://stackoverflow.com/comment/45276974
score: 0
has body: you should use the serializer. Try something like this: App.EventSerializer = DS.RESTSerializer.extend({ normalizePayload: function(payload) { return { "event": payload }; } }); That should help Ember to understand where your event model is in the response. The paths that Ember assumes by default will be: GET /events for `store.find('event') POST /events for store.createRecord('event', params) Then, if you want to change that, you should implement the adapter: App.EventAdapter = DS.RESTAdapter.extend({ namespace: '/api', pathForType: function(type) { return 'Events'; } }); Let me know if it worked :)
type: Answer
has comment: http://stackoverflow.com/comment/45275115
has comment: http://stackoverflow.com/comment/45277486
answers question: http://stackoverflow.com/q/28474387
has comment: http://stackoverflow.com/comment/45277837
has comment: http://stackoverflow.com/comment/45277933

http://stackoverflow.com/comment/45271981
has text: This worked and it answered the question. Which was 'what event attribute to use to know when user enters text?'. I used 'onKey'Press and voila. Im interested to know why it was down voted though?
comment on: http://stackoverflow.com/a/28474036
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28558973
has comment: http://stackoverflow.com/comment/45433527
score: 0
has comment: http://stackoverflow.com/comment/45430847
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/45431860
has title: For Loop doesn't work in highcharts?
has body: Sorry for my question, but i don't understand if i did a mistake, or for loop doesn't work in highcharts... http://jsfiddle.net/dpev61ug/1/ if i write var myarray= [[1,1,1], [2,2,2], [3,3,3] ]; function toalert(){ for (var s = 0; s &lt; myarray.length; s++) { var arr = (myarray[s]); alert(myarray); } } in for loop, alert works only for first (index [0]) value of array... Please see the code jsfiddle Sorry :(
type: Question
has comment: http://stackoverflow.com/comment/45432389
tagged with: javascript

http://stackoverflow.com/q/28585139
has comment: http://stackoverflow.com/comment/45478288
upvote count: 1
has answer: http://stackoverflow.com/a/28585364
type: AnsweredQuestion
has title: jQuery on drop is not firing?
score: 1
type: Question
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28585364
has body: I'm trying to do something on drop using jQuery ui. However, no matter what I do, the on drop is not firing at all. the code that I using to make divs dragable and dropable is this: $(document).ready(function () { var x = null; //Make element draggable $(".drag").draggable({ helper: 'clone', cursor: 'move', tolerance: 'fit', stack: '.drag', revert: "invalid" }); $("#droppable").droppable({ drop: function (e, ui) { if ($(ui.draggable)[0].id != "") { x = ui.helper.clone(); ui.helper.remove(); x.draggable({ //helper: 'original', containment: '#droppable', tolerance: 'fit', stack: '.drag' }); x.resizable({ animate: true, //aspectRatio: 16 / 9, helper: "ui-resizable-helper", handles: "n, e, s, w, nw, ne, sw,se" }); x.appendTo('#droppable'); } } }); }); And the code for doing something on drop is this: $(".drag").on("drop", function(e, ui) { //alert('selected'); var srcc=$(this).find('img').attr('src'); $('#droppable #thumbs #drag_trans img').attr('src',srcc); }); I can change the on drop function to normal click or mouseover events and the code works fine but when I use on drop, it won't work. Could someone please let me know why the on drop is not firing?
downvote count: 0
answer count: 1
favorite count: 0

titanium
type: Tag
tags question: http://stackoverflow.com/q/28587298
tag name: titanium
tags question: http://stackoverflow.com/q/28471913
tags question: http://stackoverflow.com/q/28569789
tags question: http://stackoverflow.com/q/28445847

http://stackoverflow.com/comment/45384204
score: 0
comment on: http://stackoverflow.com/q/28534866
has text: Have you tried just cloning the canvas element then appending it back to the page?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45286175
has text: By "non-active", I assume it's still okay to create the tab and it can be visible just that it can't steal the focus, is that correct?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28466654

http://stackoverflow.com/q/28568370
has answer: http://stackoverflow.com/a/39996394
has body: I'm working with an API based on json requests, all the requests are workining but one. The problematic request does not allow cross-domain by default, but using 'Cors' it works. The problem is that when I'm testing the request with javascript using the cors server it works, but when I'm using it with node.js it doesnt. error: 'Missing required request header. Must specify one of: origin,x-requested-with' The code that does'nt work: //Active Match router.get('/activematchbyid/:server/:sid', function(req, res, next) { var serverList = {br: 'BR1', na: 'NA1', eune: 'EUNE1', euw: 'EUW1', kr: 'KR1', lan: 'LAN1', las: 'LAS1', oce: 'OCE1', tr: 'TR1', ru: 'RU'}; var url = 'https://cors-anywhere.herokuapp.com/https://' + req.params.server + '.api.pvp.net/observer-mode/rest/consumer/getSpectatorGameInfo/' + serverList[req.params.server] + '/' + req.params.sid + '?api_key=' + apiKey; console.log(url); res.header("Access-Control-Allow-Origin", "*"); res.header("Access-Control-Allow-Headers", "X-Requested-With"); request(url, function(err, resp, body){ String.prototype.beginsWith = function (string) { return(this.indexOf(string) === 0); } if (body.beginsWith('&lt;html&gt;') || body.beginsWith('Missing')){ res.send('error', 200); }else{ console.log(body); body = JSON.parse(body); res.send(body); }; }); }); This is the code that works: var serverList = {br: 'BR1', na: 'NA1', eune: 'EUNE1', euw: 'EUW1', kr: 'KR1', lan: 'LAN1', las: 'LAS1', oce: 'OCE1', tr: 'TR1', ru: 'RU'}; $.ajax({ url: 'https://cors-anywhere.herokuapp.com/https://' data.server + '.api.pvp.net/observer-mode/rest/consumer/getSpectatorGameInfo/' + serverList[data.server] + '/' + data.sid + '?api_key=' + apiKey;, success: function(result){ //code stuff } }); My website does the request to this url: http://gankei-backend.herokuapp.com/activematchbyid/parameters-here
answer count: 2
tagged with: cors
tagged with: api
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28570216
linked to: http://stackoverflow.com/q/25291840
tagged with: node.js
score: 2
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/45448241
has comment: http://stackoverflow.com/comment/45450043
type: Question
has title: Cross domain Missing required request header error with node.js
tagged with: heroku
accepted answer: http://stackoverflow.com/a/28570216
possible better answer: http://stackoverflow.com/a/39996394

http://stackoverflow.com/q/28450520
tagged with: javascript
upvote count: 1
answer count: 1
favorite count: 0
has title: Kendo Grid: Can we run example with Angular using jsfiddle?
tagged with: kendo-ui
tagged with: angularjs
has body: I wanted to be able to make available some examples of the Kendo grid when asking questions here. I have put the most basic one here, but nothing shows up. The code is: (function () { angular.module("app", ["kendo.directives"]) .controller("Grid", Grid); function Grid() { var vm = this; var gridData = [{ col1: 'data1', col2: 'data2' }, { col1: 'data1', col2: 'data2' }]; vm.options = { dataSource: gridData, editable: true }; } })(); Should this be possible, have I missed something? (The sample runs locally).
has answer: http://stackoverflow.com/a/28450650
accepted answer: http://stackoverflow.com/a/28450650
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
tagged with: kendo-grid

http://stackoverflow.com/comment/45444870
type: AnswerComment
has text: Very nice answer, I have created my own, where I refer to your idea, but with some further tweaking.
type: Comment
comment on: http://stackoverflow.com/a/28565882
score: 1

http://stackoverflow.com/q/28590809
tagged with: asp.net-mvc
tagged with: javascript
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45488138
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/28590969
has comment: http://stackoverflow.com/comment/45488309
has comment: http://stackoverflow.com/comment/45488148
type: Question
has body: In trying to cleanup my code base, I moved all of my javascript from script tags to their own javascript file. After doing that, all of my ajax calls are failing. Here's the javascript, this is EXACTLY how it was in the *.cshtml file, excluding the script tags: $(function () { $("#weightList").change(function () { var weight = $("#weightList").val(); var conference = $("#conference").val(); $("#wrestlerAList").prop('disabled', true); $("#wrestlerBList").prop('disabled', true); $.ajax({ url: '@Url.Action("GetByWeight", "Wrestler")', data: { weight: weight }, type: 'POST', success: function (data) { var wrestlers = "&lt;option&gt;&lt;/option&gt;"; $.each(data, function (i, wrestler) { wrestlers += "&lt;option value='" + wrestler.Value + "'&gt;" + wrestler.Text + "&lt;/option&gt;"; }); $("#wrestlerAList").html(wrestlers); $("#wrestlerBList").html(wrestlers); $("#wrestlerAList").prop('disabled', false); $("#wrestlerBList").prop('disabled', false); }, error: function (error) { alert("An error occurred retrieving the wrestlers for this weight."); } }); }); }); I've tried removing the "$(function () {...});" but that didn't work. Is there other syntax required when the javascript is not directly on the cshtml page? Edit: I'm loading my javascript file at the very end of the cshtml file, right before the closing tag. Also, I'm getting a 404 back. If the code stayed the same, why would it now be getting a 404?
possible better answer: http://stackoverflow.com/a/28591244
has answer: http://stackoverflow.com/a/28591244
score: 0
answer count: 2
has title: Moved javascript to separate file, ajax calls are giving error
accepted answer: http://stackoverflow.com/a/28590969
tagged with: c#

http://stackoverflow.com/q/28497327
answer count: 2
has comment: http://stackoverflow.com/comment/45314192
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45314287
tagged with: onclick
has body: Im trying to create an interactive story in which one can chose between two options, once pushing yes or no, an image would appear with a story line. I am tryig to create a function that would make the image appear when one of the buttons are pushed. I dont know where i have gone wrong. Thank you for your help :). interactive dragon story Would you like to read a story?
has comment: http://stackoverflow.com/comment/45314248
has title: Trying to create a Java script function that when button is pushed an image would appear
type: Question
tagged with: if-statement
has answer: http://stackoverflow.com/a/28497422
has answer: http://stackoverflow.com/a/28497424
tagged with: javascript
tagged with: image
score: 0

theory
tags question: http://stackoverflow.com/q/28533078
tag name: theory
type: Tag

http://stackoverflow.com/a/28559128
has comment: http://stackoverflow.com/comment/45430636
has comment: http://stackoverflow.com/comment/45430826
has comment: http://stackoverflow.com/comment/45433113
has body: It's not clear what you're trying to achieve from your question, but the following does work without issue: function TreeNode (x ,y, obj) { this.x = x; this.y = y; this.data = [obj]; } var aTreeNode = new TreeNode(1, 2, 'hello world'); console.log(aTreeNode.data); //['hello world'] From your code above, it looks like you're creating 2 TreeNode constructors - one inside the other. Is this intentional?
answers question: http://stackoverflow.com/q/28558817
score: 0
type: Answer

http://stackoverflow.com/comment/45252391
type: Comment
has text: Changed to ```hasDuplicates()```
score: 1
comment on: http://stackoverflow.com/a/28461122
type: AnswerComment

http://stackoverflow.com/comment/45434333
has text: I found that already, but I can't see how "sometimes getting status 0, but a valid responseText" matches "always getting status 0 and empty responseText". The problem Michael Potter has may be the same that I have, but there is no solution given in that post.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28559463

http://stackoverflow.com/q/28554532
tagged with: casperjs
has title: Casperjs Shows Phantomjs Crash
type: UnansweredQuestion
type: Question
tagged with: phantomjs
has body: I got a little bit serious problem with casperjs. I try to pull 640 rows of data from website. The first step is found total data found (which is 640), and after that I iterate all found data and store to database fia sendAJAX (synchronously) Here is my code try{ casper.then(function(){ if(total_page &gt; 0){ var total_hotel = 0; //this.echo("Hit here"); for(var j=0; j&lt;listHotelPage.length; j++){ total_hotel += listHotelPage[j].listHotelObj.length; } //save hotels amount on related city var save = this.evaluate(function(total_hotel, city_code){ var wsurl = "http://localhost:9000/Cities/saveHotelNum"; var data = new Object(); data.cityCode = city_code; data.hotelNum = total_hotel; __utils__.sendAJAX(wsurl, "POST" , data, false, { contentType: "application/x-www-form-urlencoded" }); }, total_hotel, city_code); this.echo("Saved Hotel With Amount = "+total_hotel); //save all hotels found on related city //this.echo("Insert 1"); this.evaluate(function(listHotelPage, city_code){ var save_hotel_url = "http://localhost:9000/Hotels/saveHotelRest"; var data = new Object(); window.__utils__.echo("List Hotel Page Length :"+listHotelPage.length); window.__utils__.echo("City Code :"+city_code); for(var i=0; i&lt;listHotelPage.length; i++){ window.__utils__.echo("Iteration #"+i); for(var j=0; j&lt;listHotelPage[i].listHotelObj.length; j++){ data = new Object(); data.hotelCode = listHotelPage[i].listHotelObj[j].hotel_code; data.hotelName = listHotelPage[i].listHotelObj[j].hotel_name; data.hotelAddress = listHotelPage[i].listHotelObj[j].hotel_address; data.photo = listHotelPage[i].listHotelObj[j].base64img; data.hotelStar = listHotelPage[i].listHotelObj[j].star_score; data.cityCode = city_code; __utils__.sendAJAX(save_hotel_url, "POST" , data, false, { contentType: "application/x-www-form-urlencoded" }); var room_length = listHotelPage[i].listHotelObj[j].listDescriptionObj.length; var room_data = new Object(); var save_room_url = "http://localhost:9000/Rooms/saveRoomRest"; //wind…
score: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28559016

http://stackoverflow.com/comment/45320144
comment on: http://stackoverflow.com/a/28500072
type: Comment
score: 0
type: AnswerComment
has text: @Arunprasanth: it works for me, once your typo (`getElementByID` is changed to `getElementById`) is corrected: http://jsfiddle.net/davidThomas/o05wo8k4/2/ although I'd typically use an alternate approach to bind the click event-handler: http://jsfiddle.net/davidThomas/o05wo8k4/1/

http://stackoverflow.com/a/28553837
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45422251
has comment: http://stackoverflow.com/comment/45498083
score: 1
accepted answer of: http://stackoverflow.com/q/28553749
has comment: http://stackoverflow.com/comment/45421960
has comment: http://stackoverflow.com/comment/45498815
answers question: http://stackoverflow.com/q/28553749
has comment: http://stackoverflow.com/comment/45498435
type: AcceptedAnswer
downvote count: 0
has body: As is the code is never waiting for anything. So even if it takes 3s to save your file, your code will be executed in an instant. I don't know the code of your function doc.save, but I assume it is asynchronous and it is the one that takes some time. So it should either return a promise, or take a callback in parameter that will be executed when the save is done (about 3s later). Your code would then become: function saveToPdf(){ toggleSavingPdf(); var doc = new jsPDF(); // Save the PDF doc.save('Kiosk.pdf', function() { // Now it is saved, execute the rest scope.docs.forEach(function(img, idx){ if (img.src) { console.log('index of page', idx); if(idx&gt;0) doc.addPage(); doc.addImage(img.src,'png',0, 0, 210, 290); } }); // No need to put that into the forEach, forEach is // synchroneous so that will be executed only after console.log('change saving', scope.savingPdf); toggleSavingPdf(); }); } Note that you may need to call scope.$apply after the last toggleSavingPdf() if the asynchronous doc.save is out of Angular context (i.e. not an $http call but a regular Ajax one) UPDATE: If the function save is synchronous and executed client side, then it will block the website while it is processing, which means the user probably cannot click on the button anyway. But what you want to do is disable the button, then render the HTML with that disabled button, and only then execute the save method, after which you can enable the button again. For that you need to use $timeout to be sure Angular has updated the DOM before you save the doc. See code: function saveToPdf(){ toggleSavingPdf(); // Let Angular some time to render the DOM with the disabled button $timeout(function() { // Now we can save the PDF var doc = new jsPDF(); doc.save('Kiosk.pdf'); scope.docs.forEach(function(img, idx){ if (img.src) { console.log('index of page', idx); if(idx&gt;0) doc.addPage(); doc.addImage(img.src,'png',0, 0, 210, 290); } }); console.log('change saving', scope.savingPdf); toggleSavingPdf();…

http://stackoverflow.com/a/28482872
upvote count: 1
has body: In the first case PassRcvr is located in global scope, while the locVar is within entryPoint function's local scope - that is why it cannot be accessed. In the second case both PassRcvr and locVar are in one local scope.
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28482792
score: 1

http://stackoverflow.com/q/28450290
has comment: http://stackoverflow.com/comment/45228673
type: UnansweredQuestion
upvote count: 1
score: 1
tagged with: java
has comment: http://stackoverflow.com/comment/45228899
tagged with: servlets
type: Question
has title: Unable to get value in Ajax response
answer count: 2
has comment: http://stackoverflow.com/comment/45228554
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/28471187
has body: The servlet which receives request -- Gson gson = new Gson(); JsonObject myObj = new JsonObject(); LoginBean loginInfo = getInfo(userId,userPwd); //System.out.println("00000000-----------"+loginInfo.userId); JsonElement loginObj = gson.toJsonTree(loginInfo); if(loginInfo.getUserId() == "GUEST!"){ myObj.addProperty("success", false); } else { myObj.addProperty("success", true); } myObj.add("login", loginObj); System.out.println(":::::"+myObj.get("success")); out.println(myObj.toString()); out.close(); Here is the js file ----- function loadScript(url, callback) { var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = url; script.onreadystatechange = callback; script.onload = callback; head.appendChild(script); } loadScript("js/json2.js", myJSCode); var myJSCode = $(document).ready(function() { $("#loginForm").submit(function(e){ e.preventDefault(); }); $("#login").click(function(e){ dataString = $("#loginForm").serialize(); var id = $("input#id").val(); var pwd = $("input#pwd").val(); dataString = "id=" + id + "&pwd="+pwd; $.ajax({ type: "POST", url: "login", data: { id : id, pwd : pwd }, dataType: "json", success: function( data, textStatus, jqXHR) { if(data.success){ $("#ajaxResponse").html(""); $("#ajaxResponse").append("Welcome " + data.login.id + " "); //alert("#ajaxResponse" + data.login.id); alert(data['id']); alert(data['pwd']); } else { $("#ajaxResponse").html(" Login Credentials are invalid! "); } } }); I am getting the ajaxResponse if I am going with 1 element i.e 'id' but when I tried to get both the response I am getting value as undefined. I have tried with data.login.id & data[id] but unable to get desired output. Any help will be appreciated. Even I have tried with JSON.Stringify().
has comment: http://stackoverflow.com/comment/45228633
has answer: http://stackoverflow.com/a/28450528
favorite count: 0

http://stackoverflow.com/comment/45468129
comment on: http://stackoverflow.com/a/28526960
score: 0
type: Comment
has text: like this? ` some text `
type: AnswerComment

http://stackoverflow.com/comment/45348277
comment on: http://stackoverflow.com/a/28515454
score: 0
type: AnswerComment
has text: Thanks Ravindra for your immediate response , but unfortunately it does nt work.
type: Comment

http://stackoverflow.com/comment/45271300
has text: You have added class to the image fade not id as you are referring to the id. Change that and then try.
comment on: http://stackoverflow.com/a/28473363
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/comment/45567118
score: 0
type: AnswerComment
has text: True... It's a fine way to store large amounts of static data, but partial updates require full downloads, so is not partial. You didn't mention partial updates, or any desire to update at all in your question.
type: Comment
comment on: http://stackoverflow.com/a/28459544

http://stackoverflow.com/comment/45274107
has text: JavaScript is not single-threaded. JavaScript *on browsers* has one *main UI thread* (and as many web worker threads as you like).
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28475382
score: 0

http://stackoverflow.com/a/28526418
has comment: http://stackoverflow.com/comment/45368634
accepted answer of: http://stackoverflow.com/q/28525622
answers question: http://stackoverflow.com/q/28525622
has comment: http://stackoverflow.com/comment/45368622
type: AcceptedAnswer
has body: &lt;script&gt; var score = 0; function validate(){ var rad = document.getElementById("quiz").getElementsByTagName('input'); attend = 0 for(var i = 0; i &lt; rad.length; i++){ if (rad[i].checked == true){ attend = attend +1} if (rad[i].checked == true &amp;&amp; rad[i].value == "right") { score++; } } var pcnt = ((score/10) * 100); alert("The score is " + score + " and percentage is " + pcnt + " %" + "\n"+ "not_attend: " + Math.floor((rad.length-(3*attend))/3) ); } &lt;/script&gt;
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45369282
has comment: http://stackoverflow.com/comment/45368797
has comment: http://stackoverflow.com/comment/45369434

getelementbyid
tags question: http://stackoverflow.com/q/28506654
tags question: http://stackoverflow.com/q/28532257
tags question: http://stackoverflow.com/q/28511670
type: Tag
tags question: http://stackoverflow.com/q/28513597
tags question: http://stackoverflow.com/q/28477592
tags question: http://stackoverflow.com/q/28581791
tag name: getelementbyid
tags question: http://stackoverflow.com/q/28527052
tags question: http://stackoverflow.com/q/28530144

http://stackoverflow.com/q/28444152
has comment: http://stackoverflow.com/comment/45223835
answer count: 2
tagged with: internet-explorer
has body: I am building a large table (3,000+ rows) with the ng-repeat directive from AngularJS (1.2.26). The data is a very simple array of arrays of time and temperature [[time, temperature], [time, temperature], ...]. This is how the data is displayed in a table (using Slim templating): table.table.table-bordered thead tr th.time.first-child= t('Time') th.temperature.sensor tbody tr[bindonce ng-repeat="item in readings"] td.datetime span.date bo-text="formatDate(item.time)" span.time bo-html="formatTime(item.time)" td bo-text="item.reading.temperature | number: 2" As you can see, we are using the bind once library to reduce the number of angular watchers. This is a report so we don't need to uphold data binding. Loading the data and rendering the report takes about ~4 seconds on Chrome or Firefox and ~8 seconds on Internet Explorer (11). However, after the table is built on internet explorer, the browser will take up to two minutes performing Garbage Collection (according to the UI Responsiveness tab). I need more "reputation" to post pictures, so I'll try to describe what is happening as best I can. The whole table rendering process occurs as a result of the xhr.onreadystatechange event listener (which has since been removed from angular in 1.3). Each row and span are added to the table with appendChild() -> insertBefore() functions from jQuery or the innerHTML function from the browser. These happen thousands of times and account for the ~8 seconds that I mentioned before. Once these are completed, these are immediately followed by a few lines of garbage collection that, in total, take well over 60 seconds. In absence of a picture of the output, this is a list of the time at which the execution started after the last appendChild(), followed by the total execution time (the length of the bar in the window). 0.24 s, 0.0065 ms 0.36 s, 13.83 ms 0.85 s, 0.31 ms 10 s, 0.0042 ms 57 s, 25.54 ms 60 s, 0.048 ms Then, there is another gap of about 10 s before the rest of the proces…
has comment: http://stackoverflow.com/comment/45219853
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Garbage collection takes a very long time in Internet Explorer after building a large table with ng-repeat AngularJS
has comment: http://stackoverflow.com/comment/45237737
has answer: http://stackoverflow.com/a/28466201
has comment: http://stackoverflow.com/comment/45237710
favorite count: 0
tagged with: angularjs
upvote count: 2
has comment: http://stackoverflow.com/comment/45220897
tagged with: garbage-collection
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/28466201
possible better answer: http://stackoverflow.com/a/28447262
has answer: http://stackoverflow.com/a/28447262
has comment: http://stackoverflow.com/comment/45218110
type: Question

http://stackoverflow.com/comment/45320619
type: Comment
has text: For example, I use it as:
type: AnswerComment
comment on: http://stackoverflow.com/a/28497996
score: 0

http://stackoverflow.com/q/28522091
tagged with: jquery
answer count: 2
has body: This is probably irrelevant for small and simple DOM elements, but assuming I have some large complicated DOM elements, is there a big performance difference between storing an element in a variable to use it vs constantly getting it with the jQuery selector? $('myDomElement').css('height', 500); $('myDomElement').css('width', 500); // do more stuff using $('myDomElement') vs var myDomElement = $('myDomElement'); $(myDomElement).css('height', 500); // do more stuff to myDomElement var
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has title: performance difference for getting DOM element
favorite count: 0
has answer: http://stackoverflow.com/a/28522134
has answer: http://stackoverflow.com/a/28522140
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28522134
score: 1
upvote count: 1
tagged with: dom
type: Question
accepted answer: http://stackoverflow.com/a/28522140
tagged with: javascript

http://stackoverflow.com/comment/45302076
score: 0
type: Comment
has text: So you mean there is no way to expire a session, say for a user who has been idle on the website for sometime? also, why does the session expire on and/or before the interval value of 2 when we navigate else where on the website?
type: AnswerComment
comment on: http://stackoverflow.com/a/28490417

http://stackoverflow.com/comment/45231108
type: Comment
comment on: http://stackoverflow.com/a/28451798
score: 0
type: AnswerComment
has text: @FrédéricHamidi isn't that **exactly** what OP is asking for?

http://stackoverflow.com/q/28438069
tagged with: jssor
type: AnsweredQuestion
has body: Is it possible to move arrow span outside of the div#slider1_container container to any other part of the page? Btw I tried to specify $ArrowNavigatorOptions: { $Class: 'myOwnCssClass', ... } and it doesn't work for me (( Upd from comment: In examples I've found arrows are in the slider container (like this). When I'm trying move it outside, e.g. to root of the 'body' buttons are shown but no reaction on click :( For my layout I must move it to root to implement my customization.
has comment: http://stackoverflow.com/comment/45228709
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28450461
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28450461
has title: Is it possible to move arrow span out of the default parent container in jssor?

http://stackoverflow.com/comment/45298805
type: QuestionComment
comment on: http://stackoverflow.com/q/28488546
score: 0
has text: Check out the `classList` API - http://html5doctor.com/the-classlist-api/. Also, why call `getElementById` so many times? Just call it once and save the element in a variable
type: Comment

http://stackoverflow.com/comment/45262542
type: QuestionComment
comment on: http://stackoverflow.com/q/28446536
score: 0
has text: After I set the ViewBag property in the GET to 0, I wasn't getting the "Cannot perform binding on a null reference". this obviously messed up the value of the property when assigned to the html variable. It now works as expected. Thanks!
type: Comment

http://stackoverflow.com/comment/45439871
type: QuestionComment
comment on: http://stackoverflow.com/q/28564561
has text: Exactly! You are concatenating these `"~/Scripts/i18n/jquery.ui.datepicker-" + LocaleConverter.convertLocale("fr-FR") + ".js"` in C#. And `LocaleConverter.convertLocale("fr-FR")` is not defined in C#.
score: 0
type: Comment

http://stackoverflow.com/comment/45294785
type: QuestionComment
has text: Set a timeout in a variable, on mouseover, cancel the timeout, on mouseout, set the timeout
comment on: http://stackoverflow.com/q/28486499
score: 0
type: Comment

http://stackoverflow.com/comment/45273728
has text: what I mean is that when I have `$("#idname").click(function(){` it doesnt work, when I have `$(".classname").click(function(){` it works.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28473363

infinite-scroll
tag name: infinite-scroll
type: Tag
tags question: http://stackoverflow.com/q/28458035

http://stackoverflow.com/a/47667882
has comment: http://stackoverflow.com/comment/85646749
has comment: http://stackoverflow.com/comment/106093809
has body: I tried a couple of these approaches before cobbling this one together. It is the simplest, most readable approach I've seen so far: View Filters Hide Filters Now you see me! The main purpose of this link is to toggle visibility of div#filters...but it takes advantage of multiple selectors in data_target to also toggle the visibility of the two versions of the link text. Just make sure you've got one text as ".collapse .in" and the other as ".collapse .out". Beyond its simplicity, I like that this is very reliable. Because the tag is never hidden or manipulated, you'll never accidentally lose the view/hide link while debugging.
answers question: http://stackoverflow.com/q/28500650
has comment: http://stackoverflow.com/comment/85541242
type: Answer
score: 6
upvote count: 7
downvote count: 1

http://stackoverflow.com/comment/45245593
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28459585
has text: My bad, in the last case it surely should be one, but not an object.
score: 0

http://stackoverflow.com/a/28504654
downvote count: 0
has body: Consider splitting the string on '.', then re-joining all but the last with '_': var test = "my.long.file.name.zip"; parts = test.split('.'); var plen = parts.length; if (plen &gt; 1) { test = parts.slice(0, plen - 1).join('_') + "." + parts[plen - 1]; } console.log(test);
answers question: http://stackoverflow.com/q/28504463
type: Answer
upvote count: 2
score: 2

http://stackoverflow.com/comment/45297076
has text: This makes a lot of sense. Thanks you @nilgun.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28474384
type: AnswerComment

http://stackoverflow.com/comment/45250815
type: Comment
has text: what was the issue? For debugging, before you past post variables in the ajax, just alert(your_variables) so you can see if you are actually getting something. Usually helps me.
type: AnswerComment
comment on: http://stackoverflow.com/a/28458451
score: 0

http://stackoverflow.com/comment/45261828
type: AnswerComment
has text: Last question :) (probably) how can I just select some of the buttons (I don't want my "submit" button for example having its text change)? I really appreciate all the help.
type: Comment
comment on: http://stackoverflow.com/a/28468044
score: 0

http://stackoverflow.com/q/28469903
has body: I am trying to copy the selected rows in the table, when I click the buttons for copy,csv, excel, print the entire table copying and downloading. How to get the selected rows in the table, and copied to clipboard, save as the file. Javascript: $(document).ready(function() { var table = $('#example').DataTable( { "dom": 'T&lt;"clear"&gt;&lt;"H"lfr&gt;t&lt;"F"ip&gt;', "tableTools": { "sSwfPath": "/swf/copy_csv_xls_pdf.swf" }, initComplete: function () { var api = this.api(); api.columns().indexes().flatten().each( function ( i ) { var column = api.column( i ); var select = $('&lt;select&gt;&lt;option value=""&gt;&lt;/option&gt;&lt;/select&gt;') .appendTo( $(column.footer()).empty() ) .on( 'change', function () { var val = $.fn.dataTable.util.escapeRegex( $(this).val() ); column .search( val ? '^'+val+'$' : '', true, false ) .draw(); } ); column.data().unique().sort().each( function ( d, j ) { select.append( '&lt;option value="'+d+'"&gt;'+d+'&lt;/option&gt;' ) } ); } ); } } ); $('#submitFrm').click( function() { var data = table.$('input, select').serialize(); alert( "The following data would have been submitted to the server: \n\n"+ data.substr( 0, 120 )+'...' ); return false; } ); } ); With copy, save, print, buttons and also the individual filter on the column.But the thing is selected rows are not copying in the clipboard and csv after downloading showing entire data not selected rows. How to copy,csv .. only the selected rows in the table. Thanks
answer count: 1
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28490158
has title: Data tables copy,save only selected rows on individual multi filter select
type: Question
tagged with: javascript
score: 0
tagged with: datatables

http://stackoverflow.com/a/53231434
has body: If you are using Charts.js for Angular 2+ (ng2-charts) you can use CurrencyPipe. Here is how I formatted the label: Inject the dependency within your page.ts file: import { CurrencyPipe } from '@angular/common'; Here is how I call it within my chart options: public chartOptions: any = { responsive: true, legend: { display: false, labels: { display: false } }, tooltips: { enabled: true, mode: 'single', callbacks: { label: function(tooltipItem, data) { let label = data.labels[tooltipItem.index]; let datasetLabel = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index]; let currencyPipe = new CurrencyPipe('en'); let formattedNumber = currencyPipe.transform(datasetLabel, 'USD', 'symbol'); return label + ': ' + formattedNumber; } } } }; UPDATE 2022-04-07: The syntax has changed for Chart.js version 3. Here is what the options object looks like if you are using v3: import { ChartConfiguration, ChartData, ChartType } from 'chart.js'; import { CurrencyPipe } from '@angular/common'; public chart_options: ChartConfiguration['options'] = { layout: { padding: 25, }, responsive: true, plugins: { legend: { display: false, }, tooltip: { enabled: true, callbacks: { label: function(context) { let currency_pipe = new CurrencyPipe('en'); return ' ' + context.label + ': ' + currency_pipe.transform(context.parsed, 'USD', 'symbol'); } } } } }; public chart_type: ChartType = 'doughnut'; public chart_labels: string[] = []; public chart_data: ChartData<'doughnut'> = { labels: this.chart_labels, datasets: [{ data: [], backgroundColor: [], }] }; Check out the Chart.js v3 Migration Guide for more info
downvote count: 0
answers question: http://stackoverflow.com/q/28523394
score: 6
type: Answer
upvote count: 6

http://stackoverflow.com/comment/49773056
type: Comment
has text: groupBy and negative sign are not related. They don't have any relationship
comment on: http://stackoverflow.com/a/28579605
type: AnswerComment
score: 0

http://stackoverflow.com/q/28482593
has answer: http://stackoverflow.com/a/72769665
has answer: http://stackoverflow.com/a/28482763
has answer: http://stackoverflow.com/a/53801538
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45300764
upvote count: 26
has body: Copying an array of objects into another array in javascript using slice(0) and concat() doesnt work. I have tried the following to test if i get the expected behaviour of deep copy using this. But the original array is also getting modified after i make changes in the copied array. var tags = []; for(var i=0; i&lt;3; i++) { tags.push({ sortOrder: i, type: 'miss' }) } for(var tag in tags) { if(tags[tag].sortOrder == 1) { tags[tag].type = 'done' } } console.dir(tags) var copy = tags.slice(0) console.dir(copy) copy[0].type = 'test' console.dir(tags) var another = tags.concat() another[0].type = 'miss' console.dir(tags) How can i do a deep copy of a array into another, so that the original array is not modified if i make a change in copy array.
answer count: 10
has answer: http://stackoverflow.com/a/50554860
tagged with: node.js
linked to: http://stackoverflow.com/q/122102
has comment: http://stackoverflow.com/comment/45311028
linked to: http://stackoverflow.com/q/597588
has answer: http://stackoverflow.com/a/47455993
has comment: http://stackoverflow.com/comment/45305163
downvote count: 0
has comment: http://stackoverflow.com/comment/45294913
tagged with: google-chrome
type: Question
has answer: http://stackoverflow.com/a/47082260
score: 26
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/45838155
has comment: http://stackoverflow.com/comment/45311053
has answer: http://stackoverflow.com/a/53193756
tagged with: deep-copy
has answer: http://stackoverflow.com/a/28482813
favorite count: 0
has answer: http://stackoverflow.com/a/28483098
has title: Copying an array of objects into another array in javascript (Deep Copy)

http://stackoverflow.com/q/28566368
favorite count: 0
type: UnansweredQuestion
tagged with: redactor
has body: I am using Impervi Redactor as a editor on my website where i set some html generated using xml and xslt. It is driving me round the bend though as it seems to want to change the code to how it sees fit whenever I press the source button. For example if I hit source and create a ... some content It then for no apparent reason strips the class from the , so when I hit source again it has been changed to... some content
score: 1
upvote count: 1
type: Question
has title: Redactor Editor automatically strips classes from div
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/29316887

http://stackoverflow.com/q/28458349
has answer: http://stackoverflow.com/a/28460178
type: AnsweredQuestion
score: 3
upvote count: 3
possible better answer: http://stackoverflow.com/a/28460178
has answer: http://stackoverflow.com/a/28460181
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: zurb-foundation
accepted answer: http://stackoverflow.com/a/28460181
has body: I hava a problem. Button 3 Button 1 Button 2 Button 3 I want to display all Button in a row but not worked.
has title: why does not work with Foundation widget?
tagged with: css

http://stackoverflow.com/comment/45383619
has text: ok..... do you have an example or solution or just a comment?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28534470
score: 0

forms
tags question: http://stackoverflow.com/q/28503288
tags question: http://stackoverflow.com/q/28458044
tags question: http://stackoverflow.com/q/28513498
tags question: http://stackoverflow.com/q/28549101
tags question: http://stackoverflow.com/q/28504620
tags question: http://stackoverflow.com/q/28472830
type: Tag
tags question: http://stackoverflow.com/q/28583223
tags question: http://stackoverflow.com/q/28445131
tags question: http://stackoverflow.com/q/28479239
tags question: http://stackoverflow.com/q/28548898
tags question: http://stackoverflow.com/q/28519078
tags question: http://stackoverflow.com/q/28562985
tags question: http://stackoverflow.com/q/28477108
tags question: http://stackoverflow.com/q/28549071
tags question: http://stackoverflow.com/q/28530447
tags question: http://stackoverflow.com/q/28559585
tags question: http://stackoverflow.com/q/28467550
tags question: http://stackoverflow.com/q/28477484
tags question: http://stackoverflow.com/q/28525063
tags question: http://stackoverflow.com/q/28514812
tags question: http://stackoverflow.com/q/28588937
tags question: http://stackoverflow.com/q/28504643
tags question: http://stackoverflow.com/q/28464874
tags question: http://stackoverflow.com/q/28564581
tags question: http://stackoverflow.com/q/28463839
tags question: http://stackoverflow.com/q/28509177
tags question: http://stackoverflow.com/q/28522216
tags question: http://stackoverflow.com/q/28515945
tags question: http://stackoverflow.com/q/28543325
tags question: http://stackoverflow.com/q/28573410
tags question: http://stackoverflow.com/q/28454527
tags question: http://stackoverflow.com/q/28476450
tags question: http://stackoverflow.com/q/28457966
tags question: http://stackoverflow.com/q/28555285
tags question: http://stackoverflow.com/q/28456165
tags question: http://stackoverflow.com/q/28539773
tags question: http://stackoverflow.com/q/28438009
tags question: http://stackoverflow.com/q/28494586
tags question: http://stackoverflow.com/q/28520316
tags question: http://stackoverflow.com/q/28542351
tags question: http://stackoverflow.com/q/28516306
tags question: http://stackoverflow.com/q/28446399
tags question: http://stackoverflow.com/q/28509695
tags question: http://stackoverflow.com/q/28509479
tags question: http://stackoverflow.com/q/28500617
tags question: http://stackoverflow.com/q/28586393
tags question: http://stackoverflow.com/q/28484074
tags question: http://stackoverflow.com/q/28468772
tags question: http://stackoverflow.com/q/28499529
tags question: http://stackoverflow.com/q/28448275
tags question: http://stackoverflow.com/q/28441123
tags question: http://stackoverflow.com/q/28541240
tags question: http://stackoverflow.com/q/28485547
tag name: forms
tags question: http://stackoverflow.com/q/28519711
tags question: http://stackoverflow.com/q/28459727
tags question: http://stackoverflow.com/q/28574024
tags question: http://stackoverflow.com/q/28552057
tags question: http://stackoverflow.com/q/28451449
tags question: http://stackoverflow.com/q/28543020
tags question: http://stackoverflow.com/q/28523087
tags question: http://stackoverflow.com/q/28558501
tags question: http://stackoverflow.com/q/28570707
tags question: http://stackoverflow.com/q/28577751
tags question: http://stackoverflow.com/q/28444264
tags question: http://stackoverflow.com/q/28440771
tags question: http://stackoverflow.com/q/28515167
tags question: http://stackoverflow.com/q/28587579
tags question: http://stackoverflow.com/q/28440850
tags question: http://stackoverflow.com/q/28568962
tags question: http://stackoverflow.com/q/28503431
tags question: http://stackoverflow.com/q/28496246
tags question: http://stackoverflow.com/q/28489222
tags question: http://stackoverflow.com/q/28591676
tags question: http://stackoverflow.com/q/28458439
tags question: http://stackoverflow.com/q/28531222
tags question: http://stackoverflow.com/q/28484787

http://stackoverflow.com/a/28563435
type: Answer
accepted answer of: http://stackoverflow.com/q/28562142
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28562142
has comment: http://stackoverflow.com/comment/45442010
has comment: http://stackoverflow.com/comment/45441165
has body: This should do the trick: var result = {}; result.bol = { length1: [ '45' ], length2: [ '42' ], length3: [ '21' ], weight1: [ '12' ], weight2: [ '34' ], weight3: [ '45' ] }; out = []; Object.keys(result.bol).forEach(function(key) { var m = key.match(/(\D+)(\d+)/), name = m[1], n = m[2] - 1; if(!out[n]) out[n] = {}; out[n][name] = Number(result.bol[key][0]); }); document.write("&lt;pre&gt;"+JSON.stringify(out,0,3)); On a general note, instead of fixing a broken data structure like this, it's cleaner to consider a better one from the beginning.
upvote count: 2
has comment: http://stackoverflow.com/comment/45441092
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45438240

http://stackoverflow.com/comment/45231339
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28443969
type: Comment
has text: Please try to explain better the meanings of the payments (first, second, last and next), with multiple scenarios.

http://stackoverflow.com/q/28540258
answer count: 1
downvote count: 0
linked to: http://stackoverflow.com/q/14324451
tagged with: javascript
linked to: http://stackoverflow.com/q/15666048
has answer: http://stackoverflow.com/a/28569794
favorite count: 0
tagged with: angularjs
tagged with: service
type: UnansweredQuestion
type: Question
has body: According to this question: angular.service vs angular.factory Services are created by angular with the new keyword, meaning a new instance of the returned object. For example: app.service('helloWorldService', function() { this.hello = function() { return "Hello World"; }; } ); However, with factories, they are not. Meaning a developer can, if they choose, to create new instances (by using the keyword new) - hence, why its called a factory I assume. My question is: Why is angular creating a new instance of a service to begin with? I agree that services should singletons, which they are, but whats the point of creating a new instance of the returned function? Wouldn't it be better, for services, if Angular just returned the declared function - just as they do with factories. Doesn't that make more sense for services? The reason I am asking is because I am, on an abstraction layer, creating services, but I am unsure if I should really use the services API over the factories API, just because creating a new instance of the declared function seems a bit pointless and overkill =\
tagged with: factories
score: 4
has title: Why are Angular.js Services created with 'new'?
upvote count: 4
linked to: http://stackoverflow.com/q/23074875
has comment: http://stackoverflow.com/comment/45409713

http://stackoverflow.com/comment/45446960
type: AnswerComment
type: Comment
has text: `['-webkit-column-count']` won't work either. Dashes transform to camelCase, correct property is for example `webkitColumnCount`.
comment on: http://stackoverflow.com/a/28568372
score: 1

http://stackoverflow.com/comment/45359112
type: AnswerComment
type: Comment
has text: Sry man but it's not going at the same pace... it takes it 100px to go back left whereas to get to the right it takes 800px
comment on: http://stackoverflow.com/a/28519799
score: 0

http://stackoverflow.com/comment/45477385
comment on: http://stackoverflow.com/a/28584977
type: Comment
score: 1
has text: It really did, Thanks for your answer, I'll put the XML code
type: AnswerComment

http://stackoverflow.com/comment/45428338
type: AnswerComment
has text: Thanks @Arkantos, is there a way of triggering this from the previous 'referring' page?
type: Comment
comment on: http://stackoverflow.com/a/28558117
score: 0

http://stackoverflow.com/a/28796373
type: Answer
downvote count: 0
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28511970
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28511970
has body: Yes, strings etc are immutable and maybe stay in memory for a long time until the next GC cycle. To overcome this, you store the secret in a mutable object. For example, in a basic array: var secret = ['s','e','c','r','e','t']; Now, you can simple erase the information my nulling out the array elements: var len = secret.length for (var i=0; i&lt;len; ++i) { secret[i] = '0' } That why many Java API which use deal with passwords and secrets expect a char[] / byte[] array, so that you can null them out afterwards.

http://stackoverflow.com/a/28534397
downvote count: 0
type: Answer
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28528290
answers question: http://stackoverflow.com/q/28528290
has body: do this var handler = function(){ if ($(window).width() == "1024") { if ($(window).scrollTop() == 400) { $('div.foo').addClass('red') ; //to change to red color } } }; $(window).on('scroll',handler).on('resize',handler);
score: 2
type: AcceptedAnswer

http://stackoverflow.com/q/28579298
accepted answer: http://stackoverflow.com/a/28579946
tagged with: http://stackoverflow.com/tag/html
tagged with: brush
type: AnsweredQuestion
score: 2
upvote count: 2
type: Question
has answer: http://stackoverflow.com/a/28596243
tagged with: javascript
has answer: http://stackoverflow.com/a/28579946
possible better answer: http://stackoverflow.com/a/28596243
answer count: 2
tagged with: canvas
tagged with: html5-canvas
downvote count: 0
has title: HTML5 canvas paint realistic simple pencil
favorite count: 0
has body: How i can create realistic simple pencil tool, not like in a ms windows paint program. I need result like this: if i try solid without transparent i get like in a ms windows paint programs not realistic pencil, if i try add opacity i see circles this is too not realistic: How i can get pencil tool like in first picture? my trying example: var canvas = document.getElementById("canvas"); var ctx = canvas.getContext("2d"); var previousMouseX = null; var previousMouse = null; var isDrawing = false; var lineWidth = 10; var brush = 1; var myColor = "#FF0000"; function getMousePosition(canvas, evt) { var rect = canvas.getBoundingClientRect(); if (evt.clientX !== undefined &amp;&amp; evt.clientY !== undefined) { return { x: evt.clientX - rect.left, y: evt.clientY - rect.top }; } } /* BUTTONS */ $("#btn1").on("click", function() { ctx.globalAlpha = "0.2"; }); $("#btn2").on("click", function() { ctx.globalAlpha = "1"; }); $("#change-color").on("click", function() { ctx.strokeStyle = "#009933"; }); $("#canvas").on("mousedown", function(e) { isDrawing = true; var pos = getMousePosition(canvas, e); move(pos.x, pos.y); }); $("#canvas").on("mousemove", function(e) { if(isDrawing) { var pos = getMousePosition(canvas, e); stroke(pos.x, pos.y); } }); $("#canvas").on("mouseup", function() { isDrawing = false; }); function stroke(mouseX, mouseY) { ctx.globalCompositeOperation = "source-over"; ctx.lineJoin = ctx.lineCap = "round"; ctx.lineWidth = 10; ctx.beginPath(); ctx.moveTo(previousMouseX, previousMouseY); ctx.lineTo(mouseX, mouseY); ctx.closePath(); ctx.stroke(); move(mouseX, mouseY); } function move(mouseX, mouseY) { previousMouseX = mouseX; previousMouseY = mouseY; } canvas { border: 1px solid #000; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;input type="button" id="btn1" value="Transparent"&gt; &lt;input type="button" id="btn2" value="Solid"&gt; &lt;input type="button" id="change-color" value="Green color"&gt;&lt;br…

http://stackoverflow.com/q/28560842
has comment: http://stackoverflow.com/comment/45433510
has answer: http://stackoverflow.com/a/28566543
tagged with: canvas
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/20866249
downvote count: 0
score: 1
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has title: Rotating multiple texts in canvas
accepted answer: http://stackoverflow.com/a/28566543
has comment: http://stackoverflow.com/comment/45433105
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45433302
has body: I am trying to create graph in a HTML5 canvas. But text in the x axis is overlapping. I am trying to rotate it so it looks neat. Example jsfiddle: http://jsfiddle.net/67tddgcj/1/ I tried to save, rotate, and restore like below c.save(); c.rotate(-Math.PI/2); c.fillText(data.values[i].X, getXPixel(i), graph.height() - yPadding + 20); c.restore(); But the text appears in a different place.
has comment: http://stackoverflow.com/comment/45435749
tagged with: javascript

http://stackoverflow.com/q/28483045
score: 0
tagged with: this
answer count: 1
has comment: http://stackoverflow.com/comment/45288322
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28483094
has body: Why does 'this' need a local reference? The first code segment works fine but the second code segment thows an error... you're creating a reference (not being passed by value) so you would be modifying the same object prototype which is what you're trying to do anyways... not sure where the error is coming from... Difference in code is the first few lines of each segment First Code Segment: Function.prototype.construct = function(aArgs) { var a = this; var fNewConstr = function() { a.apply(this, aArgs); }; fNewConstr.prototype = a.prototype; return new fNewConstr(); }; function MyConstructor() { for (var nProp = 0; nProp &lt; arguments.length; nProp++) { this['property' + nProp] = arguments[nProp]; } } var myArray = [4, 'Hello world!', false]; var myInstance = MyConstructor.construct(myArray); Second Code Segment: Function.prototype.construct = function(aArgs) { var fNewConstr = function() { this.apply(this, aArgs); }; fNewConstr.prototype = this.prototype; return new fNewConstr(); }; function MyConstructor() { for (var nProp = 0; nProp &lt; arguments.length; nProp++) { this['property' + nProp] = arguments[nProp]; } } var myArray = [4, 'Hello world!', false]; var myInstance = MyConstructor.construct(myArray);
type: AnsweredQuestion
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45289198
has title: local reference to this?
type: Question
has comment: http://stackoverflow.com/comment/45288668
has comment: http://stackoverflow.com/comment/45288766
has answer: http://stackoverflow.com/a/28483094

http://stackoverflow.com/comment/45598866
type: QuestionComment
comment on: http://stackoverflow.com/q/28539934
type: Comment
has text: @Noitidart Thanks Noitidart! I appreciate any help I can get with this, cause with this one I'm not entirely sure where to look.
score: 0

http://stackoverflow.com/comment/45213294
has text: This might be a valid use for a global variable.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28441821

http://stackoverflow.com/q/28541298
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/45396650
possible better answer: http://stackoverflow.com/a/28542063
has comment: http://stackoverflow.com/comment/45396183
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28541650
has answer: http://stackoverflow.com/a/28542063
score: 4
has comment: http://stackoverflow.com/comment/45396233
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28541650
tagged with: http://stackoverflow.com/tag/json
has body: I want to add static drop downlist to every row of dynamic table which fetch the data from server, How I will do this? I want to make same like this,(please check drop downlist type) but it will also fetch data from server and every row of column will have drop drownlist. Following is updated and working code, thanks to @angu Structure of drop down list. NewJob InProgress CloseJon Dynamic Table Carpenter Services ID Customer Name Customer Mobile Customer Email Refresh JavaScript
type: Question
upvote count: 4
answer count: 2
has title: How to add drop down list in every row of dynamic table which fetch data from server?
downvote count: 0
tagged with: javascript
tagged with: jquery

wifi
tag name: wifi
type: Tag
tags question: http://stackoverflow.com/q/28549337

http://stackoverflow.com/q/28559585
tagged with: buttonclick
tagged with: php
type: Question
score: 3
tagged with: forms
accepted answer: http://stackoverflow.com/a/28560075
upvote count: 3
has answer: http://stackoverflow.com/a/58076856
has body: I know this question has been asked a lot, but there doesn't seem to be an answer for me. I'm sorry if I'm just really dumb, but I've been stuck for a day now.. I want to select a table row(see below), and then delete that user. Since I want to have multiple form's to interact with the table I can't place them in one form. $("#clickMe").click(function () { $(".myForms").trigger('submit'); }); $('.myForms').submit(function () { console.log("SWAGGG"); return false; }); <?php $userQuery = "SELECT * FROM usr2"; $row_userQuery = $dbportal->query($userQuery); if(isset($row_userQuery) && !empty($row_userQuery)) { //row[0] = ID //row[1] = username(abbrevation) //row[2] = admin? 0=normale user 1=admin echo' User ID username Role '; foreach ($row_userQuery as $row) { echo' '. $row[0] .' '. $row[1] .' '. $row[2] .' '; } echo' '; } ?> user ID: gebruikersnaam: Delete user I'm sure that its just me overseeing something, but help would greatly be appriciated. Also, I have ajaxForm plugin installed.
answer count: 3
has answer: http://stackoverflow.com/a/28560428
has title: Submit multiple form with one button
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45432979
linked to: http://stackoverflow.com/q/17898330
has answer: http://stackoverflow.com/a/28560075
favorite count: 0
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/28560428
has comment: http://stackoverflow.com/comment/45433294

http://stackoverflow.com/comment/45227791
type: Comment
comment on: http://stackoverflow.com/q/28449801
score: 0
has text: what bootstrap datetimepicker script are you using? Can you post a link to its documentation?
type: QuestionComment

http://stackoverflow.com/comment/45490564
comment on: http://stackoverflow.com/a/28591836
score: 0
type: AnswerComment
type: Comment
has text: Okay, I understand! So `checkLogin(error)` would actually execute the function and return its value to whatever called it, and `checkLogin` refers to the function, to be given arguments by whatever called it?

http://stackoverflow.com/q/28524494
has comment: http://stackoverflow.com/comment/45365142
has title: CSS "border-width" (px) property bug?
tagged with: pixel
score: 0
has comment: http://stackoverflow.com/comment/45365200
type: Question
has comment: http://stackoverflow.com/comment/45365171
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45365075
has comment: http://stackoverflow.com/comment/45365119
tagged with: jquery
has comment: http://stackoverflow.com/comment/45365786
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45365176
tagged with: css
has body: Q: Is this a bug in Firefox 35? $(angSelect[0], angSelect[2]).css("border-right-width", (function() { var angW = $(angSelect[1]).css("border-right-width"); var boxW = selected[0].getBoundingClientRect().width; var res = boxW - parseFloat(angW); console.log("angW: " + angW + " boxW: " + boxW + " res: " + res); return (res / 2) + "px"; })()); console.log($(angSelect[0]).css("border-right-width")); The console logs twice throughout the code: angW: 199.833px boxW: 300 res: 100.167 49.5px This obviously isn't correct. The second log should read something like 50.0835. Code is executed sequentially within a window resize event. Results in IE11: angW: 200px boxW: 299.99993896484375 res: 99.99993896484375 49.99 [NEW] JSFiddle: Remember to open the result in a new tab so you can zoom in and out without JSFiddle interfering. Also, open your developer console for the results in floating point format. http://jsfiddle.net/nbsshu77/15/
has answer: http://stackoverflow.com/a/28525043

http://stackoverflow.com/comment/45429127
has text: When the `load` event fires, you read the height of the document, then `postMessage` it to the parent frame which will have an event listener waiting for the it.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28558677
type: Comment

http://stackoverflow.com/q/28585689
tagged with: http://stackoverflow.com/tag/html
answer count: 0
type: UnansweredQuestion
score: 1
upvote count: 1
tagged with: google-chrome
type: Question
has body: Is there a way I can use the chrome.downloads API to download the HTML content of a web page? Basically what I need to do is download a text/HTML file which contains all the content between the &lt;html&gt; &lt;/html&gt; tags, essentially uisng the following line of code: var HTMLContent = document.getElementsByTagName('html')[0].innerHTML; Ideally, I would create a text file which contains the rest of the HTML code and download that file. Can this be done with the chrome.downloads API? Or this there some better alternative? I excuse myself if this is a completely obvious question... This is the first chrome extension I am writing.
has comment: http://stackoverflow.com/comment/45488080
tagged with: javascript
has title: Downloading HTML Content from a Chrome extension
linked to: http://stackoverflow.com/q/24672190
downvote count: 0
favorite count: 0
tagged with: download
tagged with: google-chrome-extension

http://stackoverflow.com/a/28483574
has comment: http://stackoverflow.com/comment/45292975
has body: To have avoid the "." on classname you'll need to overwrite the default options.selector like this (in your config): selector: function (filename) { return "icon-" + filename; }, In your template there's a couple of things to change: @mixin background() {{prefix items ""}} { should probably just be: @mixin background() { And this bit: .svg &amp; { background-image: url("{{url ../svgPath ../cssPath}}"); } } probably needs to be inside the sizes brackets (just above {{~/sizes~}}). I don't know what else might be wrong - but try it out and see how that gets you :D
answers question: http://stackoverflow.com/q/28482662
accepted answer of: http://stackoverflow.com/q/28482662
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45293783

http://stackoverflow.com/comment/45279633
type: AnswerComment
type: Comment
has text: I think if you can pass in an array, you might also be able to use jquery merge(); I will check.
comment on: http://stackoverflow.com/a/28478452
score: 0

http://stackoverflow.com/comment/45219036
comment on: http://stackoverflow.com/q/28438976
type: Comment
type: QuestionComment
has text: Maybe the following answer can help: http://stackoverflow.com/questions/16063394/prototypical-inheritance-writing-up/16063711#16063711
score: 1

http://stackoverflow.com/comment/45316743
comment on: http://stackoverflow.com/a/28482242
score: 0
type: AnswerComment
type: Comment
has text: But there is still an issue when I resize the textarea, it has strange behavior, if you resize you can see the content of textarea will be half of size the border. how can I fix it? and what about draggable? @mcgrathg

http://stackoverflow.com/a/29793133
score: -1
upvote count: 0
has comment: http://stackoverflow.com/comment/48012242
has comment: http://stackoverflow.com/comment/48011932
has body: test is just the name of the variable used to store the layer. You can store that object in another variable just like ordinary javascript: var foo, test; test = new Layer ({ height:40, width:40 }); foo = test; console.log(foo.height) Update A common use of this in framer is when importing from Sketch or Photoshop. Then you map all the imported layers to new variables to make it easier to rename and re-import. Like this: Imports = Framer.Importer.load "imported/My Sketch File" TradeView = {} TradeView.Window = Imports.Trade_View TradeView.closeBtn = Imports.Close TradeView.Buy = Imports.Input_buy TradeView.Sell = Imports.Input_sell TradeView.sellDrop = Imports.Sell_dropdown TradeView.buyDrop = Imports.Buy_dropdown TradeView.calendarDrop = Imports.Calendar
type: Answer
answers question: http://stackoverflow.com/q/28489248
has comment: http://stackoverflow.com/comment/47714924
has comment: http://stackoverflow.com/comment/47939394
downvote count: 1
has comment: http://stackoverflow.com/comment/47722920

http://stackoverflow.com/q/28541648
upvote count: 0
tagged with: iframe
has title: Js check if the location is in my site with cross domain
type: Question
has answer: http://stackoverflow.com/a/28541685
accepted answer: http://stackoverflow.com/a/28541685
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45397193
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45397354
has comment: http://stackoverflow.com/comment/45397454
has comment: http://stackoverflow.com/comment/45397227
favorite count: 0
has body: I have an iframe that linked to other site and when the user press a button there is redirect to my site inside the iframe. I am checking now if the location is my address and base of this doing something. the problem is that when the location is still the other domain i get the cross domain error: Uncaught SecurityError: Blocked a frame with origin "http://localhost" from accessing a frame with origin "https://somesite.com". The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "https". Protocols must match. How i can pass this error? document.getElementById("paymentIframe").addEventListener('load', function() { var url = document.getElementById("paymentIframe").contentWindow.location.href; if( url.indexOf('status') &gt; -1 &amp;&amp; url.indexOf('success') &gt; -1 ) //i am in my domain });
has comment: http://stackoverflow.com/comment/45397389
type: AnsweredQuestion

http://stackoverflow.com/comment/45275233
comment on: http://stackoverflow.com/q/28475802
has text: @creativeartbd instead of using outdated discouraged inline JS take a look at event handlers, as A.Wolff has suggested.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45255917
comment on: http://stackoverflow.com/a/28464724
has text: This might be a quick solution for you then: http://www.jqueryrain.com/demo/jquery-lazy-load/
score: 0
type: AnswerComment
type: Comment

c#-5.0
tags question: http://stackoverflow.com/q/28551717
type: Tag
tag name: c#-5.0

http://stackoverflow.com/comment/45378586
type: QuestionComment
comment on: http://stackoverflow.com/q/28531770
score: 0
has text: Escuse me, I'm not understanding what you are saying ?
type: Comment

http://stackoverflow.com/a/28476578
answers question: http://stackoverflow.com/q/28476389
score: 0
has body: You could use jQuery .then() to load the script like so: $.when( $.getScript("/assets/libs/swal/sweet-alert.min.js"), $.getScript("/assets/js/jquery.form.js"), $.getScript("/assets/js/jquery.preloader.js") ).then(function() { return $.getScript("/assets/js/item_inventory.js") }).done(function() { console.log("done") }); Note that because $.then() returns it's own promise, it's chainable, and you can nest as many dependencies as you'd like.
type: Answer

http://stackoverflow.com/comment/49233491
comment on: http://stackoverflow.com/a/29610373
type: AnswerComment
score: 0
type: Comment
has text: Replacing with the above code gave me this error _Cannot read property 'replace' of undefined_ in the canvg.js in the following code `svg.compressSpaces = function(s) { return s.replace(/[\s\r\t\n]+/gm,' '); }`

http://stackoverflow.com/a/28454633
answers question: http://stackoverflow.com/q/28454097
type: Answer
has body: Your Html code IND US JP UK JQuery Code $(function(){ var d=localStorage.getItem("selectval"); if(d!=null){ console.log(d); $("#country_name").val(d); } $("#country_name").change(function(){ localStorage.setItem("selectval",$(this).val()); }); }); Demo Here
score: 0

http://stackoverflow.com/comment/45475678
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28584146
has text: Aren't You just trying to capitalize first letters in every textarea word?
score: 0

http://stackoverflow.com/q/28487229
tagged with: javascript
has title: Requirejs not processing call in errback on failed module load
has comment: http://stackoverflow.com/comment/45296544
score: 0
answer count: 0
tagged with: angularjs
type: UnansweredQuestion
tagged with: requirejs
has comment: http://stackoverflow.com/comment/45296384
has comment: http://stackoverflow.com/comment/45296921
has comment: http://stackoverflow.com/comment/45297109
type: Question
has body: I have a require call (angular app): require(['app','angular','jquery'] , function () { angular.bootstrap(document, ['MyApp']); }); There is a path in my require config file that is getting a 404 error, so my onError handler is as so: require.onError = function(modError) { //on error var failedModule = modError.requireModules &amp;&amp; modError.requireModules[0]; if (failedModule === 'testrender') { require.undef(failedModule); delete configJSON.paths.testrender; //remove testrender from paths require.config(configJSON); //re-initialize the config require(['app','angular','jquery'], function() { }); } }; I followed the instructions in the require documentation: http://requirejs.org/docs/api.html#errbacks, however the require call is not being called that second time. Am i missing something? Please help!

http://stackoverflow.com/a/30401383
score: 3
answers question: http://stackoverflow.com/q/28486891
upvote count: 3
type: Answer
downvote count: 0
has body: For me npm rebuild or npm update didn't work. I had to remove the node_modules folder and run npm install to install them again.

http://stackoverflow.com/q/28579749
answer count: 1
has comment: http://stackoverflow.com/comment/45467777
tagged with: asp.net
has comment: http://stackoverflow.com/comment/45475092
type: UnansweredQuestion
tagged with: css
type: Question
tagged with: javascript
tagged with: jquery
has title: Animation/s bugging before it finishes
score: 0
has body: Platform: ASP.Net Web Forms Application Tools: Visual Studio 2013 (Previously 2012) Database: SQL Server 2014 (Local) / SQL Server 2012 (Online) This is my personal website, which I'm working on. (Do not hesitate to enter, it's all blank almost and no harm guaranteed as I'm new to web publishing stuff.) The scenario I'm trying to achieve is similar to MAC OS X Finder implementation. Summary of work: I've implemented both CSS transitions animations with combos of addClass()/removeClass()/toggleClass() via jQuery methods aswell as implemented .animate() for a certain part of the project. The first ones are used to animate the interactions of books, e.g. selecting one distinguishes it from the rest of the books by transitioning several properties of the elements (border, color, opacity, etc.) even so applied on pseudo-classes like :hover. The latter (.animate) is tied on the idea to make a smooth horizontally scroll-able content. In practice, when selecting another book from the current one, it moves the whole container of the books left/right. I've added arrow keys functionality (&larr; and &rarr;) to navigate between books. PROBLEM: Everything is fine (not bragging!) written until the point of bugging(spamming inputs) to the site. If you were to navigate fast between books for which I've assigned the keys mentioned above, it will bug the animate left/right of the book container aswell as glitching few books from changing their respectful classes. P.s.: I haven't done any fiddle nor code snippet in here due to the fact that everything is visible from the web-page to the client-side via Inspect Element of your browser. In case one requests to provide the code I won't hesitate to Edit my question.
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28580119

http://stackoverflow.com/comment/45222777
type: Comment
has text: Do not use `FormCollection`. You should always bind to a model and let MVC take care of binding and validation for you. And is there a reason you need to use ajax to post rather than a standard form submit?
comment on: http://stackoverflow.com/q/28445867
score: 0
type: QuestionComment

http://stackoverflow.com/q/28591416
accepted answer: http://stackoverflow.com/a/29035385
has body: I am working on a app port for android but have run into a problem that I have spent roughly 8 hours trying to fix. I have these 2 songs Ptero_Lose_Music score that are loaded in through a variable with "Ptero_Lose_Music" : "audio/Ptero_Lose_Music" "score" : "audio/score" When I call these two songs in my gameover screen, I want to play the lose music first then the score. I call them like this Ptero.audio.play('Ptero_Lose_Music'); Ptero.audio.play('score'); which plays them both at the same time. So far I have tried Ptero.audio.play('Ptero_Lose_Music').addEventListener('ended', function(){ Ptero.audio.play('score');)} and more numerous if statements dealing with time. I have tried using .currentTime of the gameover scene as a parameter for an 'if' statement to mediate the time in between songs but it still plays them at the same time. I believe I do not understand how to properly sort these class audio's. So I updated the snippet with your answer and seems to freeze before entering the gameover screen or playing the audio function init() { Ptero.audio.addEventListener('ended', function _next() { // named so.. //this.removeEventListener('ended', _next); // .. we can stop infinite loop this.play('score'); }); Ptero.audio.play('Ptero_Lose_Music'); //Ptero.audio.play('drop_menu'); I am not necessarily trying to use an eventlistener, I just want the best way to play one sound after one has finished.
has comment: http://stackoverflow.com/comment/45490636
tagged with: audio
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/28591580
has answer: http://stackoverflow.com/a/28591580
has comment: http://stackoverflow.com/comment/45738039
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/29035385
downvote count: 0
has title: Playing a song after a song has finished Javascript
favorite count: 0

http://stackoverflow.com/q/28509821
linked to: http://stackoverflow.com/q/5192917
tagged with: javascript
has body: The following Javascript will bring up a pdf file in a new browser page: var url = "http://company.com/myfile.pdf"; window.location.href = url; How can I change this so that the script initiates a download of the file, given the url? While the HTML5 attribute 'download' doesn't work in IE, I'd like to use it, but I'm not sure how. The download attribute can be used like this: Download the pdf But I don't have a link like that on my page. Can I create a dummy tag and assign an href? But I'm not sure how to initiate the download programmatically.
score: 0
has answer: http://stackoverflow.com/a/28509899
answer count: 1
accepted answer: http://stackoverflow.com/a/28509899
tagged with: download
has comment: http://stackoverflow.com/comment/45339915
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45338814
type: AnsweredQuestion
has title: HTML5 and Javascript for Download
type: Question

http://stackoverflow.com/comment/45352342
score: 0
has text: Exactly as I mean. Set an opaque SVG shape with some holes over the video.
type: Comment
comment on: http://stackoverflow.com/q/28517056
type: QuestionComment

http://stackoverflow.com/a/28707704
has body: Many things are weird in your code. $scope.watch callback will be executed when the first function will return a result that is different than the last time it was executed. You will certainly not obtain the expected behavior with what you have: instead simply watch for model.key Another problem is the way you redefine getTemplateUrl: you should not redefine a function, but change what it returns, as pinted out by @New Dev in a comment. Fixed directive: link: function (scope, elem, attrs) { // Or simply bind templateUrl in your ng-include scope.getTemplateUrl = function() { return scope.templateUrl; } scope.$watch('model.key', function (newValue) { if (scope.model.someswitch) { switch (scope.model.someswitch) { case 'condition1': scope.templateUrl = 'condition1.html'; break; case 'condition2': case 'condition3': scope.templateUrl = 'condition23.html'; break; default: break; } } else { scope.templateUrl = 'default.html'; } }); } Now your scrolling issue has probably nothing to do with that. If the template is right but the scrolling wrong, you should investigate as to what is causing that specific issue. For us to help, we need a way to reproduce or understand the issue.
downvote count: 0
answers question: http://stackoverflow.com/q/28566814
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/45304301
has text: @Adam simple answer is "no", not if the anything holds a reference, including everything in the DOM.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28491717

http://stackoverflow.com/comment/45279520
has text: @ekans I belive in the accumulated experience shows that the constant dissemination of information may lead us to consider restructuring the desired rates. Otherwise you can use PDO to do this queries. I prefer use frameworks Like Zend PHP. What do you think?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28477555
score: 0

http://stackoverflow.com/a/28588125
type: Answer
has comment: http://stackoverflow.com/comment/45483368
downvote count: 0
score: 5
type: AcceptedAnswer
has body: MM:SS needs to be dropped to lowercase (HH:mm:ss). Here's the string formatting section of their documentation.
answers question: http://stackoverflow.com/q/28588015
upvote count: 5
accepted answer of: http://stackoverflow.com/q/28588015

http://stackoverflow.com/q/28440342
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45220788
has body: I have data stored in my Kinvey database. In the documentation, Kinvey mentions the following GET request: GET /appdata/:appKey/:collectionName/:id HTTP/1.1 Host: baas.kinvey.com Authorization: [user credentials] I do not know how to encode the GET request in the actual Backbone JS program. I am new to backend programming, hence the confusion.
tagged with: backbone.js
answer count: 0
type: UnansweredQuestion
has title: How do I fetch data from Kinvey using Backbone JS?
type: Question
has comment: http://stackoverflow.com/comment/45212527
tagged with: kinvey

http://stackoverflow.com/a/28438391
has comment: http://stackoverflow.com/comment/45209162
has comment: http://stackoverflow.com/comment/45207033
has comment: http://stackoverflow.com/comment/45218701
answers question: http://stackoverflow.com/q/28438265
score: 0
has body: From what I understood in your question,in the CSS you would add this : margin-bottom:25%; This specifies a margin in percent of the width of the containing element.
type: Answer

http://stackoverflow.com/comment/45477123
score: 0
has text: I actually did say that it's on an update panel from the start. But thank you for your comment, I wish I knew how to do this with Ajax. I've got more controls on the panel (omitted for being irrelevant), can I use them like you recommend for the scripts? Or should I try moving just the buttons outside the update panel? And should I ask a new question if that doesn't work?
comment on: http://stackoverflow.com/q/28571217
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28527069
answers question: http://stackoverflow.com/q/28523696
score: 0
type: Answer
has body: I suspect the problem with your original attempt is that you are not specifying a full path. I always provide a full path - even if it is just to a temporary location like '/c/temp/myfile.psd'.

http://stackoverflow.com/q/28577724
type: AnsweredQuestion
downvote count: 0
score: 1
has body: I have ajax call which returns table. In success method I use $("#tableID").dataTable(); It although shows paging and number of rows in dropdown, but it is just displaying all rows instead of only number of rows as selected in dropdown. In other words number of rows to be shown is not working. I tried using below in $(document).ready but it also didn't work $("#tbAccount").dataTable({ "iDisplayLength": 10 }); My code is below: function ShowNodeDetails(levelId, parentGroupID) { $.ajax( { type: "POST", url: "AccountsView.aspx/GetNodeDetails", data: "{'levelID':'" + levelId + "','ParentGroupId':'" + parentGroupID + "'}", contentType: "application/json;charset=utf-8", dataType: "json", async: true, cache: false, success: function (msg) { $("#dvAccountDetails").empty(); $("#dvAccountDetails").append(msg.d); $("#tbAccount").dataTable( { "iDisplayLength": 10 }); } }); } Am using jquery, javascript and ajax from last 5 days only. So maybe, I lack maybe debugging skills in the same.
has comment: http://stackoverflow.com/comment/45510433
has comment: http://stackoverflow.com/comment/45474505
type: Question
tagged with: javascript
tagged with: jquery
upvote count: 1
tagged with: datatables
answer count: 1
has comment: http://stackoverflow.com/comment/45469469
has title: Jquery Datatable not showing correct number of rows as per dropdown entries
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28642104
accepted answer: http://stackoverflow.com/a/28642104

http://stackoverflow.com/comment/45391874
has text: Updated the jsfiddle with closer to my example and neither this works http://jsfiddle.net/84b3rpxx/1/
comment on: http://stackoverflow.com/q/28538812
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45347202
type: QuestionComment
comment on: http://stackoverflow.com/q/28514518
score: 0
has text: you mean like emulate it via acceleration
type: Comment

http://stackoverflow.com/q/28516500
tagged with: javascript
has title: Dynamic arrays in javascript from json
has comment: http://stackoverflow.com/comment/45356762
tagged with: multidimensional-array
has body: i am trying to create javascript flot graphs. i am getting the data from json string, the problem that i am facing is how to parse the data in the correct format to build the arrays below is the code that i am using: jQuery(document).ready(function () { // initiate layout and plugins App.init(); var xdata = null; $.ajax({ type: "GET", contentType: 'application/json; charset=utf-8', dataType: 'json', url: '/Workshops/GetTestData/@Model.workshop.WorkshopId', error: function () { alert("An error occurred."); }, success: function (data) { xdata = data; //alert("Success."); } }); // this is the data that i am getting from the ajax call //{"trainees":[{"percentage":0.0,"name":"test user 1","WorkshopScoresId":0,"WorkshopID":12,"TraineeId":5,"PreSocre":0.0,"PostScore":0.0,"Status":1,"Trainee":null,"Workshop":null},{"percentage":0.0,"name":"test user the trainee2222","WorkshopScoresId":0,"WorkshopID":12,"TraineeId":6,"PreSocre":0.0,"PostScore":0.0,"Status":1,"Trainee":null,"Workshop":null}]} var arr = xdata.trainees.filter(function (x) { return x.hasOwnProperty('name'); }); var dynamic = []; dynamic.push = function (id, value) { if (!this[id]) { this[id] = []; } this[id].push(value); } var t = []; for (var i = 0; i &lt; arr.length; i++) { var minfo = (i, arr[i]['name']); dynamic.push(i, minfo); //alert(arr[i]['name']); } var dynamicData = []; for (var i = 0; i &lt; arr.length; i++) { dynamicData[i][arr[i]['name']]; } // this is the sample data that i am trying to make it dynamic // HERE IS WHERE I AM STUCK var d1 = []; for (var i = 0; i &lt;= 10; i += 1) d1.push([i, parseInt(Math.random() * 30)]); var d2 = []; for (var i = 0; i &lt;= 10; i += 1) d2.push([i, parseInt(Math.random() * 30)]); var stack = 0, bars = true, lines = false, steps = false; function plotWithOptions() { $.plot($("#chart_5"), [{ label: "sales", data: d1, lines: { lineWidth: 1, }, shadowSize: 0 }, { label: "tax", data: d2, lines: { lineWidth: 1, }, shadowSize: 0 }] , { series: { stack: stack, lines: { show…
has comment: http://stackoverflow.com/comment/45351143
has comment: http://stackoverflow.com/comment/45350733
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45350797
type: Question
has comment: http://stackoverflow.com/comment/45350329
has comment: http://stackoverflow.com/comment/45350284
score: 0
tagged with: flot
tagged with: arrays

http://stackoverflow.com/comment/45386148
score: 0
type: QuestionComment
type: Comment
has text: `"Invalid web service call, missing value for parameter: 'noSeat'."` when I cheng to `GET` it gives another error. and I check tab params on console it gives `{"noSeat":"4-2"}` I mean it's not null value @ManishParakhiya
comment on: http://stackoverflow.com/q/28535851

http://stackoverflow.com/comment/45453347
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28570756
has text: Thanks! It fails for me on my MBP on Safari 8.0.3 (10600.3.18)

http://stackoverflow.com/comment/45466054
has text: A service is useful for re-using logic. Logic in your controller isn't an issue
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28578769
score: 0

http://stackoverflow.com/q/28465535
has comment: http://stackoverflow.com/comment/45257411
has body: I have a piece of code that I mostly understand. The only piece that I don't understand is how the Array.prototype.slice.call works in this instance. var getElementsByClassName = function(className){ var elements = $('*').filter(function(index, node){ // this will basically iterate through all nodes on the // DOM and check to see which node matches the className passed in. return $(node).hasClass(className); }); // elements is an array of two elements. array[0] seems to be the non-enumerable // properties (but it has a length property?) and the other is the element on the dom. // the usage below slices out array[0] and returns array[1], but since both // have a length property and numeric indices, why doesn't this usage return // both items? return Array.prototype.slice.call(elements); }; I've left my comments/questions in-line. Any assistance would be greatly appreciated :). Thanks, B
has comment: http://stackoverflow.com/comment/45257404
type: UnansweredQuestion
upvote count: 1
has title: How does Array.prototype.slice.call work in this recreation of getElementsByClassName?
score: 1
type: Question
tagged with: arrays
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28465579

http://stackoverflow.com/comment/45491157
type: Comment
type: QuestionComment
has text: I recoment you to use class instead off id. class="current"
score: 1
comment on: http://stackoverflow.com/q/28592317

http://stackoverflow.com/comment/47722920
comment on: http://stackoverflow.com/a/29793133
type: AnswerComment
type: Comment
has text: No good reason except that the OP specifically wanted to change the name of the variable used for undisclosed reasons. I assumed that if he could have used another variable name to begin with, he would have done that.
score: 0

http://stackoverflow.com/a/28453434
accepted answer of: http://stackoverflow.com/q/28453340
upvote count: 1
has body: use window.location.search try this: UPDATE var autoLoad = setInterval( function () { var url = window.location.search; $('#example').load('index.php' + url + ' #example').fadeIn("slow"); }, 5000);
score: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28453340
type: Answer

http://stackoverflow.com/q/28444268
upvote count: 4
tagged with: token
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45219068
accepted answer: http://stackoverflow.com/a/28445137
has title: AngularJS "localStorage.getItem" is null in $resource
type: AnsweredQuestion
tagged with: local-storage
has comment: http://stackoverflow.com/comment/45219466
type: Question
has comment: http://stackoverflow.com/comment/45218985
has comment: http://stackoverflow.com/comment/45219406
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/45219239
has answer: http://stackoverflow.com/a/28445137
has body: I have an angular $resource for login and getting user's info. The login sends the username and password to server and gets a Bearer token. In the success function of User.login the token is stored in localStorage. In getEmail, I'm including the token in header to the user's email address. The problem is, the first time getEmail is called in controller, $window.localStorage.getItem('TK') evaluates to null but if I refresh the page then it works correctly. All of the subsequent requests to the server that have the token included work as expected. What could cause this? Not to mention, getEmail is called way after login and I have confirmed that the token is present in localStorage before the getEmail is called. angular.module('authentication') .factory('User', function ($resource, $window) { return $resource('/login', {}, { login: { method: 'POST' }, getEmail: { url: '/user', method: 'GET', headers: { 'Authorization': "Bearer " + $window.localStorage.getItem('TK') } } }); }) In response to @ comment: My controller looks like this: angular .module('app.mymodule', ['ngReource', 'authentication') .controller('myCtrl', mymodule); mymodule.$inject = ['User', '$window']; function mymodule(User, $window) { // THIS PRINTS THE TK IN CONSOLE CORRECTLY console.log($window.localStorage.getItem("CHTOKEN")); // THIS IS UNAUTHORIZED CUZ TK IS NULL User.getEmail({}, function(data){ console.log('set the email'); }); }

http://stackoverflow.com/comment/45239157
comment on: http://stackoverflow.com/q/28453913
score: 0
has text: Note that http://kenwheeler.github.io/slick/ was made to fix the problems in Owl.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28501253
type: Answer
answers question: http://stackoverflow.com/q/28501167
has comment: http://stackoverflow.com/comment/45322515
score: 2
has body: it is simple but you should Google for it var delay = 100; var button = document.getElementById("id o button"); button.onClick = function(){ setTimeout(function(){ window.location = "http://www.yoururl.com"; },delay) };
downvote count: 0
has comment: http://stackoverflow.com/comment/45322345
upvote count: 2
has comment: http://stackoverflow.com/comment/45322720

youtube
tags question: http://stackoverflow.com/q/28568248
tags question: http://stackoverflow.com/q/28504669
tags question: http://stackoverflow.com/q/28537020
tags question: http://stackoverflow.com/q/28510107
tags question: http://stackoverflow.com/q/28493182
type: Tag
tags question: http://stackoverflow.com/q/28464154
tag name: youtube
tags question: http://stackoverflow.com/q/28466924
tags question: http://stackoverflow.com/q/28593357
tags question: http://stackoverflow.com/q/28591788
tags question: http://stackoverflow.com/q/28558430
tags question: http://stackoverflow.com/q/28465767
tags question: http://stackoverflow.com/q/28582856

http://stackoverflow.com/q/28488497
type: Question
has body: What I am trying to do seems like it should be very simple. I have done lots of research on the internet and cannot find anywhere that tells me how to do this. All I want to do is route back to my main app page after a user submits a sign-up form. This function triggers when I submit the add user form. .controller('SignUpPageCtrl', [ '$scope', 'users', function($scope, users){ $scope.signUpUser = function(){ users.create({ username: $scope.username, password: $scope.password, email: $scope.email }); $scope.username = ''; $scope.password = ''; $scope.email = ''; //I want to add a function right here that routes back to #/home }; I want to route back to this /home state after that function creates a user for me. $stateProvider .state('home', { url: '/home', templateUrl: '/home.html', controller: 'MainCtrl', resolve: { postPromise: ['posts', function(posts){ return posts.getAll(); }] } }) This is the template code from the html view &lt;script type="text/ng-template" id="/home.html"&gt; This seems like it should be extremely simple. All I want to do is route back to the home state after the users.create function executes!
tagged with: javascript
has comment: http://stackoverflow.com/comment/45298752
score: 0
has comment: http://stackoverflow.com/comment/45298679
answer count: 0
tagged with: angularjs
type: UnansweredQuestion
has title: How to route to state in an angular function?
has comment: http://stackoverflow.com/comment/45298728

http://stackoverflow.com/comment/45463340
comment on: http://stackoverflow.com/a/28560323
score: 0
type: AnswerComment
type: Comment
has text: I'm in developer mode, i use **Load unpacked Extension** option, and previously it was working fine, but suddenly it stopped. For an Experimental purpose, i created another html page, on onload event of that page i open new tab using javascript ,gave url of popup,html. _Same Error_ . I'm not able understand what is going wrong

http://stackoverflow.com/comment/45445909
type: AnswerComment
comment on: http://stackoverflow.com/a/28561991
score: 0
type: Comment
has text: I'm with Jon on this - the question is poorly written. In particular, it only asks how to "interpret" the value. The given answer gives one way of *parsing* and *reformatting* the value. While the output of `date.toString()` in most browsers will show some time zone information, there are *many* more ways to format the output - hence why libraries like [moment.js](http://momentjs.com) exist. Also, parsing ISO8601 strings with the `Date` constructor is not necessarily supported in all browsers. (IE9+ should be ok)

http://stackoverflow.com/q/28438808
type: Question
has comment: http://stackoverflow.com/comment/45208603
has comment: http://stackoverflow.com/comment/45207829
answer count: 2
has comment: http://stackoverflow.com/comment/45208830
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45212578
has answer: http://stackoverflow.com/a/28481854
has title: Filling multiple input fields with a javascript string
has body: Is it possible create a javascript string that, when manually copied and pasted to another web page, will paste information across multiple input fields at the same time? For instance, suppose a webpage has two input fields. I cannot edit the webpage html, but I can type into the input fields. I can also paste information in, using Ctrl-V or the like. I have another webpage, which I can edit. The javascript for my webpage creates a string such as "Input for in1 here \t Input for in2 here". That string is presented through window.prompt(myString). I copy myString from the prompt (Ctrl-C), switch to the other webpage with input fields, and paste the string (Ctrl-V). How can I format my string so it pastes across both input fields? Is it possible to format the string (myString in the example here), so that it will do this? Obviously "\t" won't work for this. Same for "\n", etc. Basically, I'm trying to create a helper for data entry. One web page would have the helper javascript. The other page (not in the same domain) would have multiple data input fields. The data input page does not have an API hook.
has comment: http://stackoverflow.com/comment/45208850
has comment: http://stackoverflow.com/comment/45208095
favorite count: 0
has comment: http://stackoverflow.com/comment/45208710
has comment: http://stackoverflow.com/comment/45208353
has answer: http://stackoverflow.com/a/28439121
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45208564
score: -1
has comment: http://stackoverflow.com/comment/45207522
has comment: http://stackoverflow.com/comment/45209074
has comment: http://stackoverflow.com/comment/45207682
downvote count: 1

http://stackoverflow.com/q/28499223
has comment: http://stackoverflow.com/comment/45318110
has answer: http://stackoverflow.com/a/28526824
tagged with: javascript
downvote count: 0
has comment: http://stackoverflow.com/comment/45369180
favorite count: 0
has title: ngModel not updating in select
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45369302
accepted answer: http://stackoverflow.com/a/28526824
has body: I have a directive rendering inputs based on a configuration sent by the server. Everything is working great except for the 'select' input. No matter what I try, the ng-model does not update. I have trimmed my code a lot to isolate the problem : Javascript : var myApp = angular.module('example', []); myApp.factory('DynamicData', [function() { return { data: { backup_frequency: 604800 } }; }]) .directive('dynamicInput', ['$compile', 'DynamicData', function($compile, DynamicData) { /** * Render the input */ var render = function render() { var input = angular.element(' '); return input; }; var getInput = function () { var input = render(); return input ? input[0].outerHTML : ''; }; var getTemplate = function(){ var template = ' ' + 'Select input ' + ' ' + getInput() + ' ' + ' '; return template; }; return { restrict : 'E', scope: { content:'=content', }, link : function(scope, element, attrs) { var template = getTemplate(); scope.options = [ {title: "Daily", value: 86400}, {title: "Weekly", value: 604800}, {title: "Monthly", value: 2678400}, ]; scope.inner = DynamicData.data; console.info('inner data', scope.inner); element.html(template); element.replaceWith($compile(element.contents())(scope)); } }; }]) .controller('FormCtrl', ['DynamicData', '$scope', function (DynamicData, $scope){ $scope.app = {}; $scope.save = function save() { $scope.value = DynamicData.data.backup_frequency; console.info('DynamicData', DynamicData.data); }; }]); HTML : Dynamic Input : Save A working plunker is available : http://plnkr.co/edit/mNBTJzZXjX6mLyPz6NCI?p=preview Do you have any ideas why the ng-model in the select is not updated ? EDIT : What I want to achieve is updating the variable "inner.backup_frequency" (the reference to my data object returned by my factory DynamicData). As you can see in the plunker, whenever I change the option in the select, the variable contained in the ng-model is not updated. Thank you for your time.
linked to: http://stackoverflow.com/q/22854581
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/30001969
score: 9
type: Question
has answer: http://stackoverflow.com/a/30001969
answer count: 2
upvote count: 9

http://stackoverflow.com/comment/45226542
has text: Thanks, Adeneo. Your comment, in addition to Mike's below, are what I needed to understand how to implement this. Much appreciated.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28444230

http://stackoverflow.com/comment/45336335
score: 0
comment on: http://stackoverflow.com/q/28508376
type: Comment
has text: Ahh, I see. I had originally wrapped the calls in $(document).ready()
type: QuestionComment

http://stackoverflow.com/a/28520320
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/28520173
has body: When you assign your variables "first_number" and "second_number", you need to change "document.getElementsById" to the singular "document.getElementById".
score: 3
upvote count: 3

http://stackoverflow.com/comment/45290404
type: QuestionComment
comment on: http://stackoverflow.com/q/28483406
has text: Then again, the question is what do you actually want here? To make the data point large enough to fit the label means either making the chart much larger to spread the data, or setting a minimum size for the data point that distorts the data to a great extent, or not allowing values so small...
score: 0
type: Comment

http://stackoverflow.com/comment/45403827
has text: I'm using Chrome 41.0.2272.53 beta-m (64-bit), also happened on Chrome for Android (not sure of the version number) and Chrome 40
type: Comment
comment on: http://stackoverflow.com/a/28545278
type: AnswerComment
score: 0

http://stackoverflow.com/a/28550983
has comment: http://stackoverflow.com/comment/45415263
downvote count: 0
answers question: http://stackoverflow.com/q/28550772
has body: This should do the trick (I don't know which special characters you might allow, so I specified only the ones in your example): (?:password\s*=\s*)([A-Za-z0-9@$]+) Please see Regex 101 demo here.
has comment: http://stackoverflow.com/comment/45415204
has comment: http://stackoverflow.com/comment/45415386
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45416441
has comment: http://stackoverflow.com/comment/45415732
score: 1

http://stackoverflow.com/comment/45305283
has text: try `parsedJSONquery['definitions'][0]['text']`
comment on: http://stackoverflow.com/q/28492262
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45398932
type: Comment
has text: Try to include code you've tried so far to help us. Highlight what is giving you an error. If there is much code, try to "copy" the site to a http://jsfiddle.net/
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28542720

http://stackoverflow.com/comment/45331991
comment on: http://stackoverflow.com/q/28506406
type: Comment
type: QuestionComment
score: 2
has text: Nice to know, then what is your question? What went wrong when you tried?

ssl-certificate
tags question: http://stackoverflow.com/q/28562635
type: Tag
tag name: ssl-certificate

http://stackoverflow.com/comment/45312848
comment on: http://stackoverflow.com/a/28496533
score: 0
type: AnswerComment
has text: it works just searched for account instead of active.. and its not case sensitive ;)
type: Comment

http://stackoverflow.com/comment/45243225
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28458424
has text: Javascript has no concept of an integer type -- only of a "number" type. If your modulo operation would yield a fractional result on an arbitrary integer, it will do the same with the value of `length`.
score: 1

http://stackoverflow.com/a/28594595
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45523066
score: 0
has comment: http://stackoverflow.com/comment/45496378
has comment: http://stackoverflow.com/comment/45501035
type: Answer
has body: The simplest might be to just add the class initially, like so: $(function() { var header = $(".logo").addClass('lightLogo'); var about = $(".angle").offset().top;; $(window).scroll(function() { var scroll = $(window).scrollTop(); if (scroll &gt;= about) { header.removeClass('lightLogo').addClass('darkLogo'); } else { header.removeClass('darkLogo').addClass('lightLogo'); } }); }); Now the header will start out with .lightLogo at page load.
has comment: http://stackoverflow.com/comment/45497583
has comment: http://stackoverflow.com/comment/45499920
accepted answer of: http://stackoverflow.com/q/28591494
answers question: http://stackoverflow.com/q/28591494

http://stackoverflow.com/q/28506955
tagged with: drop-down-menu
has comment: http://stackoverflow.com/comment/45333021
type: UnansweredQuestion
tagged with: css
has body: I want to create a dropdown menu for the mobile version of my site, but it doesn't seem to be working. Basically when I click on the dropdown menu image, the dropdown menu should appear. JSFiddle: https://jsfiddle.net/xfvjv184/ Included files: HTML CSS .mobile_dropdown_menu_icon { display:none; } .mobile_dropdown_menu { display:none; } @media(max-device-width:500px) { .mobile_dropdown_menu_icon { display: block; float:right; } .mobilemenuicon { width:150px; height:150px; margin-top:10px; margin-right:20px; } .mobile_dropdown_menu { background-color: red; height:400px; width:100%; } } jQuery $(document).ready(function(){ $('.mobile_dropdown_menu_icon').on("click" function() { $('mobile_dropdown_menu').css("display", "block"); }); }); Any reason this is not working? I click the icon that should display the mobile_dropdown_menu but it does not work with this code.
type: Question
has comment: http://stackoverflow.com/comment/45333308
has answer: http://stackoverflow.com/a/28507439
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Mobile on click dropdown menu not working?

http://stackoverflow.com/comment/45322476
type: AnswerComment
has text: I have lodash installed, so that is not the limiting factor. Your answer does what i'd like it to do but the console.log and alert only bring me back one of the 7 arrays.
type: Comment
comment on: http://stackoverflow.com/a/28501296
score: 0

http://stackoverflow.com/q/28551960
tagged with: http://stackoverflow.com/tag/html
tagged with: lightbox2
has title: How to use lightbox plug-in instead of window.open?
favorite count: 0
upvote count: 2
type: UnansweredQuestion
downvote count: 1
score: 1
type: Question
has answer: http://stackoverflow.com/a/28862042
answer count: 1
tagged with: lightbox
tagged with: javascript
tagged with: jquery
has body: Somewhere in my JavaScript code, it opens a new window with open function/method. window.open("sample_link"); But I want open neither tab nor window. I found a lot of examples lightbox plug-in which act on element. May I use function/method of lightbox plug-in instead of open function in my JavaScript code? (not in html file)

http://stackoverflow.com/comment/45267427
score: 0
type: Comment
type: QuestionComment
has text: refer this http://stackoverflow.com/questions/2899699/uiwebview-open-links-in-safari
comment on: http://stackoverflow.com/q/28469852

http://stackoverflow.com/q/28480982
has answer: http://stackoverflow.com/a/28481113
answer count: 2
downvote count: 0
possible better answer: http://stackoverflow.com/a/28481049
favorite count: 0
has answer: http://stackoverflow.com/a/28481049
accepted answer: http://stackoverflow.com/a/28481113
has comment: http://stackoverflow.com/comment/137268260
score: 14
has body: I was searching for details regarding the order of execution of functions bound to a page event in javascript, for example via an EventListener. For example, if I bind three functions A(), B() and C(), to the same event (say DOMContentLoaded), what will be the order of execution of these three functions? One-by-one based on the order of addEventListener call in JS code? Or they are executed all simultaneously? Besides, can I modify this order? For example, to have a function, bound to DOMContentLoaded event listener, to be executed before any other function bound to the same event.
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/446892
upvote count: 14
has title: Order of execution of functions bound to an event in Javascript
tagged with: dom
has comment: http://stackoverflow.com/comment/45285570
type: Question
tagged with: browser
linked to: http://stackoverflow.com/q/2706109
has comment: http://stackoverflow.com/comment/123334514
tagged with: javascript

http://stackoverflow.com/q/28464154
answer count: 0
type: UnansweredQuestion
tagged with: youtube
has comment: http://stackoverflow.com/comment/45254220
has comment: http://stackoverflow.com/comment/45254704
tagged with: youtube-api
type: Question
has comment: http://stackoverflow.com/comment/45254643
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45255201
score: 0
has body: I'm new to jquery (and js), and I've got the following fiddle, which is working fine, but I'm apparently missing something about getting it working on the site. http://jsfiddle.net/aintnobody/70501ecr/2/ I think I'm missing something about how it's loaded on fiddle vs site. Here is what code looks like: // on initial load $( document ).ready(function() { onPlayaLoad(); }); // initiate API var player; function onYouTubeIframeAPIReady() { player = new YT.Player('player', { events: { 'onStateChange': onPlayerStateChange } }); } // read player state function onPlayerStateChange(event) { if (event.data == YT.PlayerState.PLAYING) { onPlaying(); } else if (event.data == YT.PlayerState.PAUSED) { onPaused(); } else if (event.data == YT.PlayerState.ENDED) { onEnded(); } else if (event.data == YT.PlayerState.BUFFERING) { onBuffering(); } else if (event.data == YT.PlayerState.CUED) { onCued(); } else if (event.data == YT.PlayerState.UNSTARTED) { onUnstarted(); } } Then the functions called from above are defined. It all works just fine on the fiddle. On my site, the first function fires fine when the document loads, but none of the player state functions do. I cut and pasted all the js from the fiddle, and have it loading at the end of the body sectiton. It depends on Jquery and TimelineMax. Jquery is loaded in the head, and TimelineMax is loaded just before it included in the same minification script. That must all be working because the first function (onPlayaLoad) is running fine and wouldn't if both jquery and TimelineMax weren't firing. So... Are the player state functions trying to run before the document is ready because they aren't wrapped in the on document ready function like the first fctn is? If so, I must be nesting it incorrectly in my tests to fix this. Any input greatly appreciated as I know I'm just a few clicks away from this functioning since it already does in fiddle. thx
has comment: http://stackoverflow.com/comment/45255250
has comment: http://stackoverflow.com/comment/45257465
has title: JS working in fiddle, but not on site
has comment: http://stackoverflow.com/comment/45254194

http://stackoverflow.com/comment/45411338
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28548178
has text: @Dre Sorry, guess I'm missing part of the rules/question somewhere, don't see where "C" was to be included and what i posted includes the "h"... at least it shows it does? I'll re-read post. thanks
type: Comment

http://stackoverflow.com/a/28559066
has body: You need to create a div with class playlist and using jQuery library. Your PlayList Here the JSFiddle
answers question: http://stackoverflow.com/q/28558900
type: Answer
score: 0

http://stackoverflow.com/a/28450528
type: Answer
answers question: http://stackoverflow.com/q/28450290
has body: $.ajax({ type: "POST", url: "login", data: { id : id, pwd : pwd }, ... This has data passed to ajax is not the same as the data in success: function( data, textStatus, jqXHR) { if(data.success){ ... In this success callback data is response from the server and it has a different (or same structure) based on data that server returns to you. if you want to print the value from ajax call, you need to use just id $("#ajaxResponse").append("Welcome " + id + " "); I see you are trying to use "data.login.id" can you check what is real structure of data in response? add console.log(data) or put breakpoint that callback, or simple add debugger; code, it will stop code in that line for you without adding breakpoint.
has comment: http://stackoverflow.com/comment/45265338
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/q/28525407
type: Question
upvote count: 9
has body: myDiagram.model = new go.GraphLinksModel( [ { key: "Alpha", color: "lightblue" }, { key: "Delta", color: "pink" } ], [ { from: "Alpha", to: "Alpha" }, { from: "Delta", to: "Alpha" } ]); I need to add more values dynamically, how should I do this?
tagged with: gojs
tagged with: javascript
score: 9
answer count: 2
downvote count: 0
favorite count: 0
has title: How to add Node data and Link data dynamically in GoJS?
tagged with: addition
possible better answer: http://stackoverflow.com/a/58739853
has answer: http://stackoverflow.com/a/28525463
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/58739853
has comment: http://stackoverflow.com/comment/45366698
accepted answer: http://stackoverflow.com/a/28525463

http://stackoverflow.com/comment/45413673
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28550185
type: Comment
has text: @BrentR Just keep in mind that javascript does not have any "out of the box" concept of an associative array or hash table, which is what it seems you were originally trying achieve.

http://stackoverflow.com/q/28443827
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45217750
score: 0
has comment: http://stackoverflow.com/comment/45217568
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/45217845
tagged with: dom
has title: Javascript works in console/not in file
type: Question
has answer: http://stackoverflow.com/a/28465658
has comment: http://stackoverflow.com/comment/45217694
has comment: http://stackoverflow.com/comment/45217366
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28465658
has comment: http://stackoverflow.com/comment/45217863
has body: I run this code in the console in Chrome and it works, when I push the code up to staging, it doesn't work. All other functions in the file work fine. Scoping issue? I'm learning JavaScript. Any insight appreciated! $('#excheck').change(function() { console.log('checked!'); exEnableContinue(); }); function exEnableContinue() { var button = $('.ex-button'); if ($('#excheck').prop('checked') === true) { button.removeAttr('disabled'); button.addClass('available'); } else { button.removeClass('available'); } button.on('click', function (e) { console.log('button clicked'); processLineItem(); }); } For more context, here's all the contents of the file cartbench.js: /** * The drawer page containing any functionality related to adding a license to * the cart object. This differs from mm.DrawerCartPage. * @public * @extends {mm.DrawerPage} * @return {Object} mm.DrawerCartbenchPage */ mm.DrawerCartbenchPage = function () { 'use strict'; var self = mm.DrawerPage($('.mm-drawer-wrap #cartbench')), form, $buckets, $licenses, _licenseID, _pendingTrackID, _remove = false, _pendingTrack; /** * Fetch the parsed template from the server showing the proper grouping of * licenses and options. * @private */ function fetchTemplate(callback) { mm.drawer.spin(true); $.get('/tracks/licenses/'+_pendingTrackID) .done(function (data) { self.$el.html(data); self.rebuild(); mm.drawer.spin(false); if (typeof callback === 'function') callback(); }); } /** * With both the license_id and track_id set, submit a POST request to the * server and hydrate the mm.cart object with the response. * @private */ function processLineItem() { var item = { line_item: { track_id: _pendingTrackID, license_id: _licenseID } }; mm.drawer.spin(true); if (_remove) { mm.drawer.trigger('cart:remove', function () { process(item); }); } else { process(item); } } function process(item) { $.post('/add-to-cart', item) .done(function () { mm.user.cart.hydrate(function () { mm.drawer.spin(false); mm.drawer.delay = false; mm.drawe…
answer count: 1
has comment: http://stackoverflow.com/comment/45217833
tagged with: jquery
has comment: http://stackoverflow.com/comment/45217490
linked to: http://stackoverflow.com/q/14028959
has comment: http://stackoverflow.com/comment/45219262
has comment: http://stackoverflow.com/comment/45217368
has comment: http://stackoverflow.com/comment/45218731
has comment: http://stackoverflow.com/comment/45217323

mapbox
tags question: http://stackoverflow.com/q/28466951
tags question: http://stackoverflow.com/q/28549923
tags question: http://stackoverflow.com/q/28447001
tags question: http://stackoverflow.com/q/28555901
tags question: http://stackoverflow.com/q/28453686
tags question: http://stackoverflow.com/q/28591400
tags question: http://stackoverflow.com/q/28591540
tags question: http://stackoverflow.com/q/28551603
tags question: http://stackoverflow.com/q/28547390
type: Tag
tags question: http://stackoverflow.com/q/28470476
tags question: http://stackoverflow.com/q/28507910
tags question: http://stackoverflow.com/q/28587555
tag name: mapbox

http://stackoverflow.com/comment/45308948
has text: The following code loads in javascirpt which would avoid your jquery loading problem. Not exactly sure what you want but maybe if you don't want to do that try: http://headjs.com/
type: AnswerComment
comment on: http://stackoverflow.com/a/28494345
type: Comment
score: 1

http://stackoverflow.com/comment/45257311
has text: As mentioned by DevPat, go to http://jsfiddle.net. Sounds like a inheritance issue of some sort.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28465755

http://stackoverflow.com/comment/45274617
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28475079
type: Comment
has text: Dynamic bundling idea looks good. Our idea is to change color of individual component.And we are not giving standard colors. We are giving color picker option to select colour for individual component. So once the user selects the custom color, the css file has to be updated and rendered on load. I am looking for a way to update css files dyamically.

xpages
tags question: http://stackoverflow.com/q/28481141
tag name: xpages
tags question: http://stackoverflow.com/q/28583330
type: Tag

http://stackoverflow.com/comment/45408009
comment on: http://stackoverflow.com/a/28547480
type: AnswerComment
score: 0
type: Comment
has text: And also look this Q/A for different approaches : http://stackoverflow.com/questions/4246980/how-to-create-a-simple-map-using-javascript-jquery

http://stackoverflow.com/comment/45332945
type: QuestionComment
comment on: http://stackoverflow.com/q/28506654
score: 0
type: Comment
has text: @Alexander... ya I understand that. I'm just asserting that at least some part of it should work even if it's not as expected ;)

http://stackoverflow.com/a/28553902
has body: If you have a messy project with a significant amount of redundant files and don't know what to delete, I'd try the other way around: Start a new project and only copy over the things you need, if you'll miss something, you'll notice it. I always get a fresh and stable feeling when I use this strategy. But it might be unsuitable if your system is too big or you have an unfavorable ratio of keep/throw.
answers question: http://stackoverflow.com/q/28553362
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28553362
score: 0
type: Answer

http://stackoverflow.com/comment/45487556
score: 0
type: Comment
has text: i just want to be sure that `{{thumb}}` helpers its actually a acceptable path
comment on: http://stackoverflow.com/a/28587886
type: AnswerComment

http://stackoverflow.com/q/28508423
tagged with: algorithm
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45336266
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45336867
has comment: http://stackoverflow.com/comment/45337009
answer count: 0
has comment: http://stackoverflow.com/comment/45338768
tagged with: java
has comment: http://stackoverflow.com/comment/45336562
has title: Vogel's approximation algorithm in javascript
type: Question
has body: I have very little experience with Java and am trying to use my little knowledge to interpret some java source code i found online here for Vogel's approximation algorithm into javascript with no luck. PS: There is also source code for python in the link. worker.js var scope = self; var thread = { sum: function ( items) { total = 0; for(var i = 0; i &lt; items.length; i++) { total = total+items[i]; } return total; }, min: function (costs) { return Math.min.apply(Math, costs); }, min2: function (costs, min) { j = [] for(var i = 0; i&lt;costs.length; i++) { if(costs[i] &gt; min) { j.push(costs[i]); } } return Math.min.apply(Math, j); }, vam: function (demand, supply, costs) { var nRows = supply.length; var ncols = demand.length; var supplyLeft = this.sum(supply); var totalCost = 0; //stuck here }, } self.onmessage = function(e) { thread.vam(e.data.demand, e.data.supply, e.data.costs); } This is section of java source i dont understand static int[] nextCell() throws Exception { Future&lt;int[]&gt; f1 = es.submit(() -&gt; maxPenalty(nRows, nCols, true)); Future&lt;int[]&gt; f2 = es.submit(() -&gt; maxPenalty(nCols, nRows, false)); int[] res1 = f1.get(); int[] res2 = f2.get(); if (res1[3] == res2[3]) return res1[2] &lt; res2[2] ? res1 : res2; return (res1[3] &gt; res2[3]) ? res2 : res1; } static int[] diff(int j, int len, boolean isRow) { int min1 = Integer.MAX_VALUE, min2 = Integer.MAX_VALUE; int minP = -1; for (int i = 0; i &lt; len; i++) { if (isRow ? colDone[i] : rowDone[i]) continue; int c = isRow ? costs[j][i] : costs[i][j]; if (c &lt; min1) { min2 = min1; min1 = c; minP = i; } else if (c &lt; min2) min2 = c; } return new int[]{min2 - min1, min1, minP}; } static int[] maxPenalty(int len1, int len2, boolean isRow) { int md = Integer.MIN_VALUE; int pc = -1, pm = -1, mc = -1; for (int i = 0; i &lt; len1; i++) { if (isRow ? rowDone[i] : colDone[i]) continue; int[] res = diff(i, len2, isRow); if (res[0] &gt; md) { md = res[0]; // max diff pm = i; // pos of max diff mc =…

http://stackoverflow.com/q/28502692
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
has title: rdflib.js with RDFa not returning any results
has answer: http://stackoverflow.com/a/31750691
type: UnansweredQuestion
tagged with: node.js
downvote count: 0
score: 1
type: Question
has body: What I use: Ubuntu 14.04 Node.js 0.10.36 rdflib.js 0.2.0 What I want to achieve: Parse a html file with RDFa information Print the found RDF triples What I have in my Node.js script: var rdflib = require('rdflib'); var kb = new rdflib.Formula(); rdflib.parse("http://ceur-ws.org/Vol-1085/", kb, "http://www.example.com/", "application/rdfa"); console.log(kb.statements); The code of rdflib.js calls the third parameter of the 'parse' method 'base', however, I don't know what they mean by that, so I just added dummy URI. What I get as a result: [] Hence, the there are no statements in the store. I would expect to see here the different triples that are present in the html file. Can anybody see what the problem is? P.S. Because there is no (recent) documentation on how to use rdflib.js, I might be using the above methods in the wrong way.

http://stackoverflow.com/comment/45282773
score: 0
type: QuestionComment
has text: @Qwerty No, so can you tell what it is?
type: Comment
comment on: http://stackoverflow.com/q/28480157

http://stackoverflow.com/comment/45422605
type: QuestionComment
comment on: http://stackoverflow.com/q/28554867
score: 0
has text: call a function, creating a separate activation frame for each iteration
type: Comment

http://stackoverflow.com/comment/45329586
score: 0
comment on: http://stackoverflow.com/q/28505187
type: Comment
type: QuestionComment
has text: @Mouser The error is happening on the line before that.

http://stackoverflow.com/a/28509039
answers question: http://stackoverflow.com/q/28507910
downvote count: 0
type: Answer
has body: Sorry to say, there is no easy way to do this. Not with the built-in marker. Those markers are just images which get loaded from the Mapbox server. They exist up to number 99. Number 100 does not exist, you can check for yourself: pin-m-99+AA0000.png: https://api.tiles.mapbox.com/v4/marker/pin-m-99+AA0000.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6IlhHVkZmaW8ifQ.hAMX5hSW-QnTeRCMAy9A8Q pin-m-100+AA0000.png: https://api.tiles.mapbox.com/v4/marker/pin-m-100+AA0000.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6IlhHVkZmaW8ifQ.hAMX5hSW-QnTeRCMAy9A8Q
score: 2
upvote count: 2

http://stackoverflow.com/comment/45373135
type: QuestionComment
has text: But if you try to access the images `/images/image@2x.png` and `/images/image.png` in your browser you will see the correct images? (the rewrite rule should internally rewrite the request e.g. from `/images/image@2x.png` to `Retina/images/image@2x.png` so the requested url will be `/images/image@2x.png` but the file will be stored in the path `/Retina/images/image@2x.png`
comment on: http://stackoverflow.com/q/28528249
score: 0
type: Comment

http://stackoverflow.com/a/28587207
has comment: http://stackoverflow.com/comment/45938790
has comment: http://stackoverflow.com/comment/45635291
has comment: http://stackoverflow.com/comment/45941714
answers question: http://stackoverflow.com/q/28540485
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45942671
has comment: http://stackoverflow.com/comment/45812586
has body: In a similar situation I did the following (now adapted to your model): models class Person(models.Model): name = models.CharField(max_length=20) def __unicode__(self): return self.name def get_name(self): return self.name class Contract(models.Model): person = models.ForeignKey(Person) #person hired contract_mod = models.OneToOneField('self', blank = True, null = True) contract_name = models.CharField(max_length=20) #just for testing def __unicode__(self): return self.get_name() + " " +self.contract_name def get_name(self): return self.person.get_name() #to make sure you get the person name in the admin def contract_mod_name(self): if self.contract_mod: return self.contract_mod.contract_name else: return "" admin class SelectField(forms.ChoiceField): def clean(self, value): return value class CForm(forms.ModelForm): contracts_from_selected = SelectField() class Meta: model = Contract widgets = { 'contract_mod' : forms.widgets.Select(attrs={'hidden' : 'true'}) } class CAdmin(admin.ModelAdmin): form = CForm list_display = ('contract_name','get_name','contract_mod_name')#what you like def save_model(self, request, obj, form, change): if request.POST.get('contracts_from_selected'): obj.contract_mod=Contract.objects.get(id=int(request.POST.get('contracts_from_selected'))) obj.save() Override the change_form.html template (by copying it from the django/contrib/admin/templates/admin into your yourapp/templates/admin/yourapp directory) and add the following Javascript: $(function () { $("#id_person").change(function () { var options = $("#id_contract_mod option").filter(function () { return $(this).html().split(" ")[0] === $("#id_person option:selected").html(); }).clone(); $("#id_contracts_from_selected").empty(); $("#id_contracts_from_selected").append(options); }); }); One shortcoming is, that this uses the visible html entry to store the person - contract relation. So the person is also visible in the dropdown. To avoid this you could add an attribute to the options in…
accepted answer of: http://stackoverflow.com/q/28540485
has comment: http://stackoverflow.com/comment/45642605
has comment: http://stackoverflow.com/comment/45809549
type: Answer
has comment: http://stackoverflow.com/comment/45950765
has comment: http://stackoverflow.com/comment/45639484

http://stackoverflow.com/a/28583463
upvote count: 1
has body: By the below code, you were not specifying the select element document.getElementsByTagName("option")[x].value You need to do like this so that you get the option of the correct select var x = document.getElementById("SurfaceFinishRequired"); surface_price = x.options[x.selectedIndex].value; var y = document.getElementById("CurrentSurfaceMaterial"); material_price = y.options[y.selectedIndex].value; Fiddle
answers question: http://stackoverflow.com/q/28582958
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/comment/45354206
has text: Where is `val` from `setValue(val)` defined ?
comment on: http://stackoverflow.com/q/28518503
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45351309
type: QuestionComment
has text: Thanks @kidA , I have used other onload properties, placed the script afterwards and they still work. Is the syntax of my Ajax request correct?
score: 0
comment on: http://stackoverflow.com/q/28516822
type: Comment

http://stackoverflow.com/q/28514192
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/45346485
has comment: http://stackoverflow.com/comment/45346396
has title: Dropdown - One option selected not more than one time
type: Question
has comment: http://stackoverflow.com/comment/45346341
has body: When i enter a value in Amount tendered input filed, then i chose one the of payment type for instance Cash as payment. it works perfectly. same thing if i chose Credit Card as payment. THE PROBLEM Now if i enter a new value in Amount tendered input filed and chose Cash payment or credit as payments which cash already exits.. it adds new payment as cash or credit... All i need, if cash payment was selected, then i could added it not more than one time same thing for Credit Card payment.. How to solve this out... either payment cash selected or credit was selected one time. for each payment Any help would be thankful. Code Snippet included down below as well jsfiddle http://jsfiddle.net/cy2zwxpL/ Grand total Amount Tendered: Payment Type: Cash Credit Card # Type Amount $(document).ready(function($) { $('#paymenttype').blur(function(event) { var Grandtotal = $('#Grandtotal').attr('value'); var paymentContents = $('#payment_contents'); var theading = $('#theading'); var amountPaid = $('#amount_tendered').val(); var removePaid = $("input[name='amount_tendered']"); var dataCash = $("input[name='cash']"); var dataCredit = $("input[name='credit']"); var option = $(this).children("option").filter(":selected").text(); if(!option.trim()){ } else { if(option === 'Cash' && dataCash.val() == '') { if(amountPaid == '' && dataCash !== '') return ; var output = ''; output +=' '; output +=' x '; output +=' Cash '; output +=' '+amountPaid+'.00'+' '; output +=' '; // appending output paymentContents.append(output); dataCash.val(amountPaid); removePaid.attr('value', '0.00'); // showing thead theading.show(); // showing tbody paymentContents.show(); return; } else { if(amountPaid == '' && dataCredit !== '') return ; var output = ''; output += ' '; output += ' x '; output += ' Credit '; output += ' '+amountPaid+'.00'+' '; output += ' '; paymentContents.append(output); dataCredit.val(amountPaid); removePaid.attr('value', '0.00'); paymentContents.show(); theading.show(); } } }); });
tagged with: javascript
has comment: http://stackoverflow.com/comment/45347066
score: 0
has comment: http://stackoverflow.com/comment/45346432
has comment: http://stackoverflow.com/comment/45346367

http://stackoverflow.com/a/28482717
has body: Not sure I understand your question clearly but here is an example map on which you can drag & drop a location item and use the Places Search box at the same time. HTML: New York, USA Shanghai, PRC London, UK Paris, France Sydney, Australia JavaScript (drag & drop): $("ul li").each(function () { $(this).draggable({ cursor: 'move', revert: true }); }); $('#map-canvas').droppable({ drop: function (event, ui) { var el = ui.draggable; codeAddress(el.text()); el.remove(); } }); JavaScript (place search): function codeAddress(address) { 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); } }); } Below is a working demo. JSFiddle demo
type: Answer
answers question: http://stackoverflow.com/q/28480348
accepted answer of: http://stackoverflow.com/q/28480348
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/45252942
type: QuestionComment
has text: of course but can you be more exact what you mean by that?
comment on: http://stackoverflow.com/q/28463471
score: 0
type: Comment

http://stackoverflow.com/comment/45297691
type: AnswerComment
has text: @Hauri I'm not clear on the ideal structure for your data, I'm just throwing out suggestions based on how I've seen others configure Highcharts. But I do think that it would be a good starting point for you to just copy & paste another chart's data definitions (like the one I linked to and partially-quoted above), and define the data points inline rather than passing in a `data` object. This gives you a chance to play with different configurations quickly and more quickly figure out the shape your data object needs to take. Does that make sense?
comment on: http://stackoverflow.com/a/28460667
score: 0
type: Comment

http://stackoverflow.com/a/28572744
upvote count: 1
answers question: http://stackoverflow.com/q/28572659
has comment: http://stackoverflow.com/comment/45455978
score: 1
has comment: http://stackoverflow.com/comment/45456621
has comment: http://stackoverflow.com/comment/45456857
has body: add this.ready() into the data:function data: function () { if(this.ready()){ return Charts.findOne({_id: this.params._id}); }else{ this.render('loading') } }, Something using data and waitOn could be a little bit tricky Template.chartEditPreview.rendered = function() { Meteor.setTimeout(function(){ drawChart(".chart-container", this.data); },1000) }
downvote count: 0
has comment: http://stackoverflow.com/comment/45456394
type: Answer
has comment: http://stackoverflow.com/comment/45456699
has comment: http://stackoverflow.com/comment/45455368

http://stackoverflow.com/q/28556116
tagged with: date-format
tagged with: datetime
answer count: 1
has comment: http://stackoverflow.com/comment/45424515
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45424477
has answer: http://stackoverflow.com/a/28563721
linked to: http://stackoverflow.com/q/726334
has comment: http://stackoverflow.com/comment/45463890
tagged with: date
type: Question
tagged with: javascript
has title: Date format unrecognized
has body: I'm writing a website that consumes a service, one of the fields returned from said service is a date / time field. However the value returning is in this format: /Date(1401663600000+0100)/ I've been battling to convert this format in JavaScript, can anyone assist?
score: 0

http://stackoverflow.com/a/28519175
type: Answer
has body: The simpliest way is to use a timeout https://developer.mozilla.org/fr/docs/Web/API/Window.setTimeout setTimeout(function(){ ... }, delayModal) // delayModal integer in ms If you are using Bootstrap 3 events are namespaces and the show event for modal is show.bs.modal See http://getbootstrap.com/javascript/#js-events for more details Your code should be like this : $('#myModal').on('show.bs.modal', function (e) { // your script }) Demo: http://jsfiddle.net/5960g3xt/1/ &lt;= How you should do http://jsfiddle.net/5960g3xt/2/ &lt;= I have added some delay on the second so you can see the change
answers question: http://stackoverflow.com/q/28519123
score: 0

http://stackoverflow.com/a/28561692
upvote count: 1
has body: What you're looking for is a for loop for (var i = FirstNumber ;i &lt; SecondNumber ; i++){ // do what ever you want in here // like adding i to the total } For the simple case of adding sequential number you dont need to loop at all: 1+2+3+4+5+...+n = n(n+1)/2
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28561626

http://stackoverflow.com/comment/53481199
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/28551582
has text: I think they don't mean literal `super`, but rather the extends clause.
type: Comment

http://stackoverflow.com/comment/45456426
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28573386
has text: There is one issue here in that you're deleting based on array position. Where as my getNode returns the object by a property called ID. Is there a way to get the object's array position without having to iterate through my data twice?
type: AnswerComment

http://stackoverflow.com/q/28521495
score: 1
has body: I want to include all of my directive templates within a single file to reduce the number of HTTP requests required to load a directive heavy page. I have this directive angular.module('bwDirectives', []) .directive('bwInfoCard', function () { return { restrict: 'E', transclude: false, replace: true, scope: { title: '=' }, templateUrl: "one-template", }; }) If I specify the templates in-line like this then it loads the directive template properly: Directive Test Fixture Base Info Card If I try to include the templates via NgInclude it however fails. I guess it tries to load the template for the directives before doing NgInclude (even though it is earlier in the file). The correct script tags are getting included on the page. Directive Test Fixture Base Info Card Is there something that I am missing or can you not NgInclude templates for use with directives? Thanks.
has title: Loading AngularJS combined directive templates with NgInclude
type: Question
tagged with: angularjs-directive
tagged with: javascript
downvote count: 0
answer count: 1
tagged with: templates
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28521556
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/q/28451245
accepted answer: http://stackoverflow.com/a/28451659
tagged with: css
has title: Fade toggle jquery elements
upvote count: 0
has answer: http://stackoverflow.com/a/28451661
has answer: http://stackoverflow.com/a/28451659
has comment: http://stackoverflow.com/comment/45230142
possible better answer: http://stackoverflow.com/a/28451327
type: Question
has answer: http://stackoverflow.com/a/28451327
type: AnsweredQuestion
score: -2
downvote count: 2
answer count: 3
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I need to use animation using jquery to toggle between fade in and fade out class called hidden. My jquery looks like this: function slide() { $('.additional-perspectives medium-picture shadow last').slideToggle("fast"); ($("#perNum").text() === "+2") ? $("#perNum").text("Changed") + $(".picture-hidd").removeClass('hidden') : $("#perNum").text("+2") + $(".picture-hidd").addClass('hidden'); } when class hidden removed elements will fade in 0.5 second, when class hidden added elements fade out 0.5 second.
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28489345
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45311775
tagged with: css
has body: I have created tables of items and need them to be moved to a separate floating box (follows website users scroll when clicking an 'add' button). At the moment I have created tables of items and managed to create the floating box: window.onload = function() { function getScrollTop() { if (typeof window.pageYOffset !== 'undefined') { return window.pageYOffset; } var d = document.documentElement; if (d.clientHeight) { return d.scrollTop; } return document.body.scrollTop; } window.onscroll = function() { var box = document.getElementById('box'), scroll = getScrollTop(); if (scroll <= 28) { box.style.top = "50px"; } else { box.style.top = (scroll + 2) + "px"; } }; }; #box { position: absolute; top: 100px; background-color: #dad9c7; margin-left: 200px; left: 70%; width: 200px; height: 50px; border: 5px solid #393c3d; text-align: center; } Batteries Battery Weight Capacity discharge Price List Turnigy nano-tech 1000mAh 99g 1000mAh 25~50C $10.15 Add Parts List Help will be appreciated, thank you.
has title: How to select item and put into a seperate box?
answer count: 0
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45300215
score: 0
tagged with: jquery
type: UnansweredQuestion

http://stackoverflow.com/q/28547142
tagged with: azure-active-directory
upvote count: 1
type: AnsweredQuestion
score: 1
has body: For a while now I had a .Net WPF application that uses Adal.Net to perform (what i believe is) an Authorization code grant flow against azure active directory to access a web API (which is looking for a bearer token in the request). For this purpose I'm using 2 AAD applications: MyServer (which represents the server) and MyClient (which represents the WPF client). In the azure portal I configued Myclient with permission to access MyServer. When calling AcquireToken from my WPF application i'm supplying MyClient.ClientId as the client ID and MyServer.ResourceUrl as the resource id, and everything works as expected. Now I have a website (that only serves static pages using IIS - it does not have asp.net nor node.js as web servers). I would like to my browser to perform the same flow the .Net native app performed. I've looked at adal.js but wasn't able to find an easy way to do it. Must I implement the entire flow by hand?
type: Question
accepted answer: http://stackoverflow.com/a/28550068
tagged with: adal
downvote count: 0
tagged with: javascript
has title: does adal.js support Authorization Code Grant Flow?
tagged with: azure
answer count: 1
favorite count: 0
tagged with: oauth
has answer: http://stackoverflow.com/a/28550068

http://stackoverflow.com/a/28480248
has comment: http://stackoverflow.com/comment/45283186
has comment: http://stackoverflow.com/comment/45283790
upvote count: 1
has comment: http://stackoverflow.com/comment/45284426
score: 1
has comment: http://stackoverflow.com/comment/45283135
downvote count: 0
type: Answer
has body: Yes, you can, but you'll need to change the name of your class to admin_editor_link because jQuery selector is trying to find elements with both admin_editor_link and html classes. (Unless, of course, you actually looking for elements with both those classes - your question has no HTML code to verify that - in which case you're fine). &lt;div data-loadedtext="1" class="admin_editor_link"&gt;&lt;/div&gt; &lt;div data-loadedtext="2" class="admin_editor_link"&gt;&lt;/div&gt; Just use a function to return the result var editorLinks = $(".admin_editor_link"); editorLinks.html(function () { return $(this).attr("data-loadedtext"); }); DEMO DEMO with both classes
answers question: http://stackoverflow.com/q/28479957

http://stackoverflow.com/comment/45342215
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28511760
score: 0
has text: I'm not especially familiar with jison - do you need to change `","` to `','`?

http://stackoverflow.com/q/28462542
tagged with: javascript
tagged with: jquery
has title: ajax is successful but PHP file can't run
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/45255345
has comment: http://stackoverflow.com/comment/45250905
has answer: http://stackoverflow.com/a/28462942
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45255118
answer count: 4
has answer: http://stackoverflow.com/a/28463163
has comment: http://stackoverflow.com/comment/45251007
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45254901
has answer: http://stackoverflow.com/a/28462795
has comment: http://stackoverflow.com/comment/45251089
tagged with: php
has comment: http://stackoverflow.com/comment/45252938
has comment: http://stackoverflow.com/comment/45251330
has comment: http://stackoverflow.com/comment/45251925
has answer: http://stackoverflow.com/a/28463000
has comment: http://stackoverflow.com/comment/45250995
type: Question
has body: In my ajax I can see the console message, which means my ajax is successful to send data to php file, but in php file it seams no echo or function runs.(both files are at same folder) index.php Script: function kk(){ $(document).ready(function(){ var id = document.getElementById('auto').value; var datastring = 'id1=' + id; $.ajax({ type: "POST", url: "getHint2.php", data: datastring, cache: false, success: function(data){ console.log(" ajax success"); // echo what the server sent back } }); }); } getHint2.php file: echo "this is from php file!"; if(isset($_POST['id1'])) { echo "hello " . $_POST['id1']; }; HTML: and kk is the JS function which is in above. &lt;div class="caret"&gt; &lt;form&gt; &lt;input type="text" value="97121243" id="auto"&gt; &lt;/form&gt; &lt;/div&gt; &lt;input type="button" value="click" onclick="kk();"/&gt;
has comment: http://stackoverflow.com/comment/45251105
has comment: http://stackoverflow.com/comment/45251590

http://stackoverflow.com/comment/45417884
has text: thanks for the info, highly appreciated. I managed to make it work with jQuery in the meanwhile.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28552307
type: Comment

http://stackoverflow.com/a/44195713
answers question: http://stackoverflow.com/q/28556398
downvote count: 0
score: 8
has comment: http://stackoverflow.com/comment/82211343
upvote count: 8
has body: var xhttp= new XMLHttpRequest(); xhttp.onreadystatechange = function() { console.log(xhttp); xhttp.onerror = function(e){ alert("Unknown Error Occured. Server response not received."); }; xhttp.open("POST", "http://localhost:8080/data", true); xhttp.send(); An alternative way of getting errors that might be easier to understand later is the onerror event handler. From what I have seen, it won't give you any more useful information than Kirans solution.
type: Answer

http://stackoverflow.com/comment/45447161
comment on: http://stackoverflow.com/a/28568066
has text: Question is, why do you even need to track a list of all open tabs this way?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28502290
type: Answer
has comment: http://stackoverflow.com/comment/45373167
upvote count: 1
has comment: http://stackoverflow.com/comment/45373554
has comment: http://stackoverflow.com/comment/45326012
accepted answer of: http://stackoverflow.com/q/28494826
type: AcceptedAnswer
has body: Well you can manage the errors like this (i take the code from Discover Meteor Erros Chapter.) First Create a new empty collection Errors = new Mongo.Collection(null); //we use the keyword null, when we don't want the data get stored on the database Second Create this function. throwError = function(message) { Errors.insert({message: message}); }; Third. Call the template name using the {{>}} yield helper &lt;template name="layoutExample"&gt; &lt;div class="container"&gt; {{&gt; header}} {{&gt; errors}} &lt;!-- Here or whatever you want to top the error messages --&gt; &lt;div id="main" class="row-fluid"&gt; {{&gt; yield}} &lt;/div&gt; &lt;/div&gt; &lt;/template&gt; Four Create the errors template with this data. &lt;template name="errors"&gt; &lt;div class="errors"&gt; {{#each errors}} {{&gt; error}} {{/each}} &lt;/div&gt; &lt;/template&gt; &lt;template name="error"&gt; &lt;div class="alert alert-danger" role="alert"&gt; &lt;button type="button" class="close" data-dismiss="alert"&gt;&amp;times;&lt;/button&gt; {{message}} &lt;/div&gt; &lt;/template&gt; And don't forget about the errors helper Template.errors.helpers({ errors: function() { return Errors.find(); } }); Five and Last Testing. throwError("I'm an error!"); No you can use it over the app on the callbacks or whatever you can throw erros. Example. Example.insert({dummyData:"im a dummy"},function(err,result){ if(err){ return throwError(err.reason); }else{ console.log("Well the insert was just fine") } })
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28494826
has comment: http://stackoverflow.com/comment/45326057
has comment: http://stackoverflow.com/comment/45326279

http://stackoverflow.com/q/28448149
has title: how to call multi function in single ng-init directice using angularjs
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28448272
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28448291
upvote count: 7
type: Question
score: 7
has body: I just try to call two function in single ng-init of angularjs.but it through error to me. My code: ng-init="function1();function2();" I don't know how to call those function correctly.anyone can give me some ideas to do it. Thanls advance..
answer count: 3
has answer: http://stackoverflow.com/a/28448329

http://stackoverflow.com/comment/45247737
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28460817
has text: @A.Wolff I need the ids because when the user submits the form, the formmail programs needs them to identify the values that have been submitted by each form control (text box, text area etc)
score: 0

http://stackoverflow.com/comment/45424520
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28556119
has text: i have dynamic days to disable. but i have mentioned 2 days as treatment for multiple days may b similar .

http://stackoverflow.com/a/28521896
score: 1
has body: Use your console: You have included the Google Maps API multiple times on this page. This may cause unexpected errors.
upvote count: 1
answers question: http://stackoverflow.com/q/28521852
type: Answer
has comment: http://stackoverflow.com/comment/45360662
downvote count: 0
has comment: http://stackoverflow.com/comment/45360525

http://stackoverflow.com/comment/45244239
comment on: http://stackoverflow.com/q/28457726
has text: What I mean is: your code have errors, but one can't find the errors only from the description of the code. One have to see the code itself. If you execute `$('#subgrid_id').trigger("reloadGrid")` then **only the subgrid should be reloaded. Probably you construct subgrid ids in a wrong way and you have id duplicates probably you have some other from thousand possible problems.
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/45251355
type: Comment
has text: That was the problem! Thank you!
comment on: http://stackoverflow.com/a/28461020
type: AnswerComment
score: 0

http://stackoverflow.com/comment/68214665
comment on: http://stackoverflow.com/a/28455084
type: AnswerComment
score: 0
type: Comment
has text: Works FF 47.0.1, but doesn't work in Chrome 54.0.2840.71

http://stackoverflow.com/q/28440529
score: 3
downvote count: 0
accepted answer: http://stackoverflow.com/a/28440570
type: Question
has title: How to display code block in AngularJS app
tagged with: javascript
has answer: http://stackoverflow.com/a/28440570
tagged with: pre
upvote count: 3
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has body: I'm trying to create some website about AngularJS in AngularJS ;-) I've added ng-app on body element, and now all my code snippets (which are all in &lt;pre&gt;&lt;code&gt; ... &lt;/code&gt;&lt;/pre&gt; tags) are parsed by angular (it adds ng-binding class for example). Is there a way to tell angular that given block is only code snippet and should't be parsed?
tagged with: angularjs
type: AnsweredQuestion

http://stackoverflow.com/q/28463807
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/45253508
score: 8
possible better answer: http://stackoverflow.com/a/45756988
has answer: http://stackoverflow.com/a/28463859
accepted answer: http://stackoverflow.com/a/28463859
downvote count: 0
has comment: http://stackoverflow.com/comment/45253542
has body: I am new to React and I am going a little crazy trying to figure out what I am doing wrong. I am trying to iterate through a json array that I get from an ajax call. When I mock the data it works perfectly, but when I make an ajax call to get the exact same data it gives me undefined is not a function (evaluating 'this.state.list.map()') the array: [ { "name": "drop1" }, { "name": "drop2" }, { "name": "drop3" } ] the function: var List = React.createClass({ getInitialState: function() { return {data: {}}; }, componentDidMount: function() { $.ajax({ url: ACTUAL_URL, dataType: 'json', success: function(data){ this.setState({data: data}); }.bind(this), error: function(xhr, status, err){ console.error(url, status, err.toString()); }.bind(this) }); }, render: function() { return ( &lt;ul className="droplist"&gt; {this.state.data.map(function(l){ return (&lt;li&gt;{l.name}&lt;/li&gt;) })} &lt;/ul&gt; ); } }); Any help is much appreciated.
upvote count: 8
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45254531
has comment: http://stackoverflow.com/comment/45254365
has title: React js map() undefined is not a function
has comment: http://stackoverflow.com/comment/45253576
has comment: http://stackoverflow.com/comment/45253442
has answer: http://stackoverflow.com/a/45756988
tagged with: reactjs
has comment: http://stackoverflow.com/comment/45253472
answer count: 2
tagged with: javascript

http://stackoverflow.com/comment/45429684
comment on: http://stackoverflow.com/a/28558552
score: 0
type: Comment
type: AnswerComment
has text: try this: da.setMonth(da.getMonth + 12) instead of "da.setFullYear(da.getFullYear()+1, da.getMonth());" This will automatically increase the year also

http://stackoverflow.com/q/28545736
tagged with: reactjs
has title: ReactJS not working on IE11
has comment: http://stackoverflow.com/comment/45478102
has comment: http://stackoverflow.com/comment/45442639
downvote count: 0
has comment: http://stackoverflow.com/comment/45404577
tagged with: javascript
has comment: http://stackoverflow.com/comment/45404654
score: 4
favorite count: 0
has body: I've got a fully functional site. It works in every browser, except IE. Here is my On Chrome/Firefox I get the site running, on IE11 I can see, that the app.js was downloaded twice. And apparently not started. There was nothing in IE11 console, but later found out, that I was missing some security update from http://www.microsoft.com/en-us/download/confirmation.aspx?id=44431 . After installing that I can see IE complaining about Newsfeed not defined. It is caused by React.render( <NewsFeed tagFilter={tagFilter}/>, document.getElementById('newsFeed') ); being translated into (visible in IE console) React.render( React.createElement(NewsFeed, {tagFilter: tagFilter}), document.getElementById('newsFeed') ); And the browser than complains about missing ; Any clues what might be wrong? It works in web browsers. Only IE does this.
answer count: 0
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45406608
has comment: http://stackoverflow.com/comment/45440353
upvote count: 4

http://stackoverflow.com/a/28559472
downvote count: 0
has body: Dont use .shift. It changes the array which makes your for loop do unexpected things. Use array index to get elements like below. var _string = 'div p ul.cl li span'; var _array = _string.split(' '); for (var i = 0; i &lt; _array.length; i++) { var el = _array[i] if ($(el).length) { alert(el) } } Updated JS-Fidlle
score: 1
accepted answer of: http://stackoverflow.com/q/28559276
answers question: http://stackoverflow.com/q/28559276
upvote count: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/28584118
has comment: http://stackoverflow.com/comment/45494480
has answer: http://stackoverflow.com/a/28585169
has title: Protractor: get element on the basis of innerhtml
type: Question
answer count: 2
tagged with: protractor
has answer: http://stackoverflow.com/a/28589160
tagged with: javascript
has body: I do e2e-tests with Protractor. There I need to get an element on the basis of the innerhtml content. But I don't know how to do this. In the html code it looks like that: English (USA) Now I need the element "input" on the basis of the innerhtml of "English (USA). What I have tested is that here: var languageOption = element(by.className('input div item-content ng-binding').getText()).toBe('English (USA)'); I always get the error "has no method 'getText'" What I do wrong?
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45476598

http://stackoverflow.com/comment/45330579
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28497990
has text: @Novark Having `$scope.myVariable = something` doesn't cause a slowdown when the digest cycle runs, as Angular doesn't check everything on the scope. It has to have some watchers associated with it, created either by calling `$watch` or by referencing them somehow in the template. (However, if not having the items in the template doesn't help, then this point is just for your reference, I don't think it helps your immediate problem...)

http://stackoverflow.com/comment/45282063
has text: @u_mulder yes it gets requested with js, and no there isn't a callback.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28479564

http://stackoverflow.com/a/64009030
answers question: http://stackoverflow.com/q/28448826
has body: I know it's very long since your question is posted ! But found an answer I changed ng-click with ng-focus and its showing in first click ng-focus is a nice solution since it works with keyboard events also var myApp = angular.module('myApp', []); myApp.controller('MyCtrl', function ($scope) { var countries = [{ 'name': 'India' }, { 'name': 'Pakistan' }, { 'name': 'Afganistan' }]; $scope.countries = []; $scope.my = { favorite: '' }; $scope.bindList = function() { $scope.countries = countries; } }); Select Country
type: Answer
score: 0

http://stackoverflow.com/comment/45415067
comment on: http://stackoverflow.com/q/28550966
type: Comment
type: QuestionComment
has text: Fiddles not working, WHen i select it does not fill the input
score: 0

http://stackoverflow.com/comment/45487498
type: AnswerComment
score: 0
type: Comment
has text: When I click on "Pause", I'd like to add the class `slideshow-pause` to these items: `#slideshow, #slider, figcaption, #timeline`
comment on: http://stackoverflow.com/a/28589304

http://stackoverflow.com/comment/45476297
type: Comment
comment on: http://stackoverflow.com/q/28584165
score: 0
has text: the example you are refering is working because it uses global variable,and your case you are making variable isolated.
type: QuestionComment

http://stackoverflow.com/a/28440887
score: 1
answers question: http://stackoverflow.com/q/28440693
downvote count: 0
has body: Use 'background-color' instead of 'background'. #myBall{ width:150px; height:150px; border-radius:100px; line-height:100px; background-color: purple; margin: auto; position: absolute; top: 0; bottom: 0; left: 0; right: 0; } Then you can just change the specific CSS property: $(window).load(function(){ $("#myBall").click(function (){ $(this).css("background-color", "lime"); }); }); See your CodePan improved:
type: Answer
upvote count: 1

http://stackoverflow.com/comment/62601576
type: Comment
comment on: http://stackoverflow.com/a/28447695
score: 0
type: AnswerComment
has text: I found the best solution was to end the table, and start a new one. Returning the control of page breaks to natural block elements. Depending on browser (and browser version on chrome), you get VERY different results with this gapping issue. I haven't found a solution, other than as mentioned -- just skipping the entire table page break idea.

http://stackoverflow.com/comment/45364678
score: 0
type: Comment
type: QuestionComment
has text: do you want to add the ` content ` for the last element ?
comment on: http://stackoverflow.com/q/28524244

http://stackoverflow.com/a/28548387
has body: has an selectedItemLabel property which gives you the label of the selected item. You can simply parse it using javascript. var selectedItem = document.querySelector('paper-dropdown-menu').selectedItemLabel; var result= parseInt(selectedItem);
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28535398
type: Answer
answers question: http://stackoverflow.com/q/28535398
score: 3
upvote count: 3

http://stackoverflow.com/comment/45475078
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28583826
type: Comment
has text: Should have said that in your original question.

http://stackoverflow.com/comment/45270972
comment on: http://stackoverflow.com/q/28473620
type: QuestionComment
has text: just use an if else condition, it will tell you a or b is greater than 0,also check both conditions are true case,false case
score: 0
type: Comment

http://stackoverflow.com/a/28478905
answers question: http://stackoverflow.com/q/28478588
type: Answer
upvote count: 3
has body: Yet another way, using the built-in previousSibling property (which includes text nodes as well) [just for information sharing]. $('.title').on('click', '.button', function() { alert(this.previousSibling.nodeValue); // trim the above as it can contain newlines, spaces, etc. as in the source });
score: 3
downvote count: 0

http://stackoverflow.com/q/28528422
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28529304
favorite count: 0
has title: d3js Force Layout Not Working As Expected
tagged with: d3.js
has body: I've been working on a D3JS force layout graph, that isn't quite working as expected. I've uploaded my code to JSFiddle, and can be seen here: http://jsfiddle.net/jonaths/e9L3aq4k/ I think the important part of it is the following, that deals with updating the threshold of the nodes / links: function threshold(thresh) { graph.links.splice(0, graph.links.length); for (var i = 0; i &lt; graphRec.links.length; i++) { if (graphRec.links[i].value &gt; thresh) { graph.links.push(graphRec.links[i]); } } graph.nodes.splice(0, graph.nodes.length); for (var j = 0; j &lt; graphRec.nodes.length; j++) { if (graphRec.nodes[j].value &gt; thresh) { graph.nodes.push(graphRec.nodes[j]); } } restart(); } //Restart the visualisation after any node and link changes function restart() { node = node.data(graph.nodes); link = link.data(graph.links); link.exit().remove(); node.exit().remove(); node.enter().insert("circle", ".node").attr("class", "node").attr("r", function (d) { return d.value / 5 }).style("fill", "steelblue").call(force.drag); link.enter().insert("line", ".node").attr("class", "link").call(force.drag); force.start(); } The idea is that as the threshold is increased, nodes and links that don't meet that threshold are removed. When the threshold is subsequently updated, additional links / nodes should be added / removed accordingly. I used the code here as the basis for what I'm trying to do, but had to amend it to get the nodes to disappear, so there may well be an issue with my code. Now what I'm finding, is that if you increase the threshold slowly, then it works perfectly. However, if you just click the threshold on to a high value, and then subsequently change it again, there is some weird behaviour that results in the graph breaking. You may notice the nodes collect in the top left. Reviewing outputs in the console shows the following error message: Uncaught TypeError: Cannot read property 'weight' of undefined But I can't for the life of me work out why that's happenin…
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/28529304
upvote count: 1
type: Question
tagged with: force-layout
tagged with: javascript

http://stackoverflow.com/comment/45462577
score: 0
comment on: http://stackoverflow.com/a/28576767
type: Comment
has text: or you can use jquery or javascript to bind click event
type: AnswerComment

http://stackoverflow.com/comment/45309066
type: Comment
has text: Its clear now, but, I am still not able to understand that when `-"2"` is transformed into `-2`, why `+"2"` is not transformed into `+2`.
comment on: http://stackoverflow.com/a/28493556
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45416050
comment on: http://stackoverflow.com/a/28551461
score: 1
type: AnswerComment
type: Comment
has text: I'd never spent time thinking about it but I guess this means that JavaScript parsers in browsers - or I suppose the HTML parser - needs to explicitly deal with that stuff. I guess it'd be the HTML parser which would detect that the node in the ` ` tag is a comment, and pass its content that to the JavaScript interpreter instead of the implicit CDATA text node content. I don't work on browser innards however so that's just a guess.

http://stackoverflow.com/q/28574695
score: 0
answer count: 1
has body: I'm using the following Google Apps Script to do some screen scraping. function getLinks(html) { var doc = XmlService.parse(html); var html = doc.getRootElement(); var table = getElementsByClassName(html, "headLinks")[0]; var output = ''; var linksInMenu = getElementsByTagName(table, 'a'); for(i in linksInMenu) output+= XmlService.getRawFormat().format(linksInMenu[i])+'&lt;br&gt;'; return HtmlService.createHtmlOutput(output); } The first line of code: var doc = XmlService.parse(html); is throwing the following error: Error on line 2: The system identifier must begin with either a single or double quote character I believe the error message is telling me that the html there are no single or double quotes around the system Id. Line 2 of the html follows: &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; I not sure what is meant by system identifer. Has anyone run into to this problem and have you been able to come up with a workaround or solution. The Google Apps Script code comes from Romain Vialard's: website
tagged with: javascript
type: UnansweredQuestion
tagged with: parsing
tagged with: http://stackoverflow.com/tag/xml
type: Question
has title: Why am I getting a system identifier error with my google app script
has answer: http://stackoverflow.com/a/28576736
tagged with: google-apps-script

http://stackoverflow.com/comment/45297574
score: 0
has text: Which box are you referring to; the blue left side of the leftmost icon? If it helps, I believe generally a "positional shift from one color to another" is known as a *gradient*. That might help your search. Or, do you actually mean a Gaussian blur effect, like what you get in Photoshop?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28487876

http://stackoverflow.com/a/28457928
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28457856
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28457856
type: Answer
has body: Like this: $('div.text').each(function() { var $this = $(this); $this.append($('&lt;p&gt;').html($this.data('name'))); });
score: 2

internet-explorer
tags question: http://stackoverflow.com/q/28489808
tags question: http://stackoverflow.com/q/28494511
tags question: http://stackoverflow.com/q/28496891
tags question: http://stackoverflow.com/q/28464767
tag name: internet-explorer
tags question: http://stackoverflow.com/q/28443104
tags question: http://stackoverflow.com/q/28591905
tags question: http://stackoverflow.com/q/28546897
tags question: http://stackoverflow.com/q/28482992
tags question: http://stackoverflow.com/q/28556461
tags question: http://stackoverflow.com/q/28464779
tags question: http://stackoverflow.com/q/28588236
tags question: http://stackoverflow.com/q/28566814
tags question: http://stackoverflow.com/q/28575628
tags question: http://stackoverflow.com/q/28444152
tags question: http://stackoverflow.com/q/28503282
tags question: http://stackoverflow.com/q/28476550
tags question: http://stackoverflow.com/q/28472584
tags question: http://stackoverflow.com/q/28563986
tags question: http://stackoverflow.com/q/28482792
tags question: http://stackoverflow.com/q/28448607
tags question: http://stackoverflow.com/q/28580687
tags question: http://stackoverflow.com/q/28469551
tags question: http://stackoverflow.com/q/28479107
tags question: http://stackoverflow.com/q/28454017
type: Tag
tags question: http://stackoverflow.com/q/28590416
tags question: http://stackoverflow.com/q/28557205
tags question: http://stackoverflow.com/q/28558444
tags question: http://stackoverflow.com/q/28535118
tags question: http://stackoverflow.com/q/28480185
tags question: http://stackoverflow.com/q/28465382
tags question: http://stackoverflow.com/q/28567068
tags question: http://stackoverflow.com/q/28476986

http://stackoverflow.com/comment/45260954
comment on: http://stackoverflow.com/q/28467708
score: 0
has text: If `thenumber` is `0`, the loop terminates immediately, since `1 < thenumber + 1` is false.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28530144
tagged with: getelementbyid
has answer: http://stackoverflow.com/a/74035619
has body: I was wondering why this simple code loops forever ? var iBody=document.getElementsByTagName('body')[0]; d=document.createElement('iframe'); d.src='http://m.puaction.com'; d.id="myiFrame"; iBody.appendChild(d); while(document.getElementById('myiFrame').readyState!=='complete') { //do nothing; } alert('iFrame fully loaded'); Basically I want to make sure that it's completely loaded and then check if it's completely visible (another while loop?)
type: UnansweredQuestion
tagged with: iframe
has answer: http://stackoverflow.com/a/28530166
tagged with: appendchild
tagged with: loops
has comment: http://stackoverflow.com/comment/45375357
type: Question
has title: Javascript:: Loop until readyState is complete
tagged with: javascript
score: 0
answer count: 2

http://stackoverflow.com/a/28521393
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45363685
type: Answer
has body: I believe ng-switch is what you are looking for. something like: {{row[column.field]}} {{row[column.field]}} ...and so on this logic could either be written directly into the template, or inside a custom directive. Read the directive guide it's great!
answers question: http://stackoverflow.com/q/28521219
accepted answer of: http://stackoverflow.com/q/28521219

http://stackoverflow.com/comment/45396907
type: Comment
comment on: http://stackoverflow.com/a/28522255
has text: I edited my answer above with the HTML, and jQuery for one form. Use it as a guide and it should help you get the other forms working as well.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28504403
type: UnansweredQuestion
tagged with: php
answer count: 0
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47254175
has body: Hi Stackoverflow Family, So this is a pretty big question; be prepared to read quite a bit. Basically my team and I working on an Employee scheduling application (we're already well into it, so please nothing about changing our stack or anything like that). Anyways, we're building this with PHP, Mongo, JavaScript, JQuery, and Bootstrap; and I'm working more on the db side of things. What I really want to find out after asking this question is to see if my current approach to the db is right; I've basically created several collections and documents that reference each other in order to access or reference specific data that I'm looking for. If that doesn't really make sense check out my schema below: Employee Collection - Contains indexes such as name, employeeNumber, address, etc, employee availability, position &amp; department. (My issue here is I want it to reference other collections which contain their Shift information, but I can only really do that when I insert a document). Shift Collection - Contains indexes such as shiftNumber, shiftStartTime, endTime (This collection, I basically want to reference to employee, such that for creating each employee I have their shift time connected to it). **Schedule Collection ** - Now for the Schedule collection, this is the one that confuses me the most; I basically want our Calendar UI to be able to look through our schedule collection and be able to pull all the shifts in a certain day, or in a specific week. But I have no idea as to how I can approach this from the backend. So far what I've done with the Schedule Collection is that I've mathematically created a Calendar year and placed that within the Schedule; basically it contains a document called Year, and in that Year it contains every day of the week with information such as day number, week number, leapYear, etc. Anyways, I hope this is enough information; my main confusion is the with the main schedule, I think I nearly have the Employee collection functioning…
has title: Implementing an Employee Schedule in MongoDB
type: Question
tagged with: mongodb
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45330223
upvote count: 1
tagged with: schedule
favorite count: 0

http://stackoverflow.com/q/28462262
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28464755
score: 1
tagged with: knockout.js
has comment: http://stackoverflow.com/comment/45250794
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
accepted answer: http://stackoverflow.com/a/28464755
has body: I am finding it difficult to send data to the controller through Ajax post since the object to be sent to the controller cannot be used within the ajax post because of the structure of my code.I am using knockout for data-binding the click event of the Update button. This is my code $(document).ready(function () { var provider = function () { var self = this; self.providerID = ko.observable(providerEditInfo.ProviderID); self.firstName = ko.observable(providerEditInfo.FirstName); self.lastName = ko.observable(providerEditInfo.LastName); self.contactEmail = ko.observable(providerEditInfo.ContactEmail); self.NPI = ko.observable(providerEditInfo.NPI); self.updateProviderDetails = function () { $.ajax({ url: "/Provider/UpdateProviderDetails/", type: "POST", data: { providerForUpdate }, -- Cant send this contentType: "application/json; charset=utf-8", async: false, success: function (result) { if (result.url) { location.href = result.url; } } }); }; self.cancelEdits = function () { if (confirm("Are you sure you want to Cancel?")) { window.location.href = "/Provider/ShowTheListOfProviders"; } }; }; //End of Constructor. var providerForUpdate = new provider(); ko.applyBindings(providerForUpdate); }); On the clck of Update Button,I am calling the 'updateProviderDetails' method. HTML @model Greenway.Demo.DataAccess.Entity.Provider Edit Provider Details: First Name: Last Name: Update Cancel Could someone guide me on how I can send the data to the controller with this code structure.I can't put updateProviderDetails outside the constructor because otherwise, I can't bind it.
has comment: http://stackoverflow.com/comment/45254406
has comment: http://stackoverflow.com/comment/45251518
has title: Posting data using AJAX while using knockout bindings

http://stackoverflow.com/q/28513976
tagged with: javascript
tagged with: dom-events
favorite count: 0
has answer: http://stackoverflow.com/a/28514147
has body: I am creating a Chrome Extension which checks to see if there is "onmousedown" attribute and if so I will execute some code. I have tried this however it isn't working. document.addEventListener("onmousedown", function() { });
tagged with: google-chrome-extension
answer count: 1
tagged with: mousedown
has comment: http://stackoverflow.com/comment/45458604
score: 6
upvote count: 7
accepted answer: http://stackoverflow.com/a/28514147
downvote count: 1
has title: AddEventListener: onmousedown
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45351792
type: Question

http://stackoverflow.com/comment/45342016
comment on: http://stackoverflow.com/a/28511546
type: AnswerComment
type: Comment
score: 2
has text: Yeah, setting `ignoreSynchronization` back to `false` inside `afterEach()` did the trick!

http://stackoverflow.com/comment/45398085
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28542276
type: Comment
has text: @Novocaine, Yes that is definiltely better but I am pretty sue he is never gonna use `https://`

http://stackoverflow.com/comment/45364496
type: Comment
has text: why s=shapes and not just shapes? Also why did you store the for loop in a var. If I take away it also works
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28523458

http://stackoverflow.com/a/28555840
has body: You can use bracket notation, like this var arrayToSubmit = {}; arrayToSubmit[location] = {}; arrayToSubmit[location][type] = { 'qty': qty, 'assetNumber': assetNumber };
has comment: http://stackoverflow.com/comment/45424259
score: 3
accepted answer of: http://stackoverflow.com/q/28555799
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45424360
answers question: http://stackoverflow.com/q/28555799
type: Answer
has comment: http://stackoverflow.com/comment/45424208
upvote count: 3

http://stackoverflow.com/a/29172895
downvote count: 0
score: 1
has body: I got a similar issue and I this site helped me to understand my problem: http://victorblog.com/2012/12/20/make-angularjs-http-service-behave-like-jquery-ajax/ By default: jQuery transmits data using Content-Type: x-www-form-urlencoded. AngularJS transmits data using Content-Type: application/json. Which unfortunately some Web server languages, notably PHP, do not unserialize natively. My solution was: In my .PHP I just did a JSON_DECODE in my content $data = json_decode(file_get_contents('php://input'), true);
upvote count: 1
answers question: http://stackoverflow.com/q/28575847
type: Answer

http://stackoverflow.com/comment/45404522
has text: So, it sounds like coordinates are not correctly read. However, they are correct, in fact sometimes the marker is correctly set
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28545365
score: 0

http://stackoverflow.com/comment/45333723
type: AnswerComment
comment on: http://stackoverflow.com/a/28507192
type: Comment
has text: This is what I've done [thus far](http://files.jayfreestone.com/overflow-chart/). I've embedded (included) it with PHP and I'm just manipulating it with jQuery/JS by adding classes to it.
score: 0

http://stackoverflow.com/q/28448620
downvote count: 0
score: 1
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28448706
accepted answer: http://stackoverflow.com/a/28448706
has title: When I trigger an event, it is fired few times instead one time on input in jQuery
upvote count: 1
possible better answer: http://stackoverflow.com/a/28448704
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45225644
has answer: http://stackoverflow.com/a/28448704
has answer: http://stackoverflow.com/a/28448963
answer count: 4
favorite count: 0
has body: I have the following HTML code, simple one: &lt;input type="text" /&gt; &lt;input type="hidden" /&gt; &lt;input type="button" value="ok" /&gt; and javascript: $(function(){ $(":text").on("keyup", function(){ $(":hidden").val($(this).val()).trigger("propertychange"); }); $(":hidden").on("propertychange", function(){ alert($(this).val()); }); $(":button").on("click", function(){ alert($(":hidden").val()); }); }); When I type something in input type text then alert is displayed few times instead of once time. How to fix it ? See jsFiddle. (I checked with Firefox)
has answer: http://stackoverflow.com/a/28448767
has comment: http://stackoverflow.com/comment/45225712
type: AnsweredQuestion

http://stackoverflow.com/comment/45460565
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28575641
score: 0
has text: Duplicate http://stackoverflow.com/questions/18456169/show-enlarged-picture-when-mouse-hover-over-an-image

http://stackoverflow.com/comment/45459364
score: 1
comment on: http://stackoverflow.com/q/28575014
type: QuestionComment
has text: we need to see where you are creating the element, include that source and the markup as well
type: Comment

http://stackoverflow.com/comment/53884855
type: AnswerComment
comment on: http://stackoverflow.com/a/28561332
type: Comment
has text: An update: It seems like this fix will be merged in 1.4.8 https://github.com/angular/angular.js/pull/12657
score: 1

http://stackoverflow.com/q/28442601
possible better answer: http://stackoverflow.com/a/28442726
has answer: http://stackoverflow.com/a/28442726
answer count: 2
has title: Method to recursively enable/disable buttons within a div?
has answer: http://stackoverflow.com/a/28442736
upvote count: 1
has comment: http://stackoverflow.com/comment/45214753
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45214909
has body: I have a panel of buttons that I want to enable/disable with a single method call. Generalize this to any kind of user input subtree of DOM nodes that you'd like to enable/disable. Is there an existing or commonly-accepted best-practice to achieve this? Or must I write my own in a fashion something like this: var recursivelyDisable = function(node, shouldDisable) { // If there are no children, return if (???) return; // Grab the next child node // Recurse recursivelyEnable(childNode); // Apply the setting node.disabled = shouldDisable; }; In index.html: Toggle A Toggle B Toggle C Toggle D
downvote count: 0
type: Question
tagged with: recursion
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28442736
score: 1

http://stackoverflow.com/comment/45218819
score: 2
type: Comment
comment on: http://stackoverflow.com/a/28444408
has text: @DustinPoissant Your question makes no sense. Do you have the literally snippet of code `var a = "Hello\ World"` or don't you? This is actually important if you want an answer. It is impossible for that string to be just "passed in" to your function, because it is impossible for that string to exist outside of source code. The string isn't `"Hello\ World"`, the string is `"Hello World"`. The backslash is present in the source code *only*.
type: AnswerComment

http://stackoverflow.com/q/28588004
upvote count: 2
has answer: http://stackoverflow.com/a/29429141
answer count: 1
tagged with: angular-ui-router
tagged with: dependency-injection
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45482990
score: 2
downvote count: 0
favorite count: 0
has body: In the in depth guide of the ui router it has a note in the nested states chapter where it says that NOTE: The resolve keys MUST be injected into the child states if you want to wait for the promises to be resolved before instantiating the children. I am using the following example and it seems to me that the child states always waits for the promise of the parent state resolve key to resolve regardless of whether i inject it in the state. .state('contacts', { templateUrl: 'contacts.html', resolve: { // a key that resolves in a second resA: function($q, $timeout) { var deferred = $q.defer(); $timeout(function() { deferred.resolve('promise resolved'); }, 1000); return deferred.promise; } }, controller: function($scope, resA) { console.log(resA); } }) .state('contacts.list', { templateUrl: 'contacts.list.html', // here i do not inject the resolved key from the // parent state but the ctrl still waits 1 second // before it executes controller: function() { console.log('resolved'); } }); Thus, i cannot understand the note from the official guide.
tagged with: angularjs
type: Question
has comment: http://stackoverflow.com/comment/45483119
has title: Angular UI Router - resolve of child state ALWAYS waits for the parent state to resolve
linked to: http://stackoverflow.com/q/28534015

http://stackoverflow.com/comment/45287278
score: 0
type: Comment
type: QuestionComment
has text: First. I will suggest you to remove all `for` statements that possibly locks temporary your browser and treat all rows in PHP. After that, create an input hidden for each row that contains an increment ID. this ID will be treated in your jQuery script. You will save a lot of Javascripts line
comment on: http://stackoverflow.com/q/28478702

http://stackoverflow.com/q/28527027
has comment: http://stackoverflow.com/comment/45405333
tagged with: css
answer count: 0
has comment: http://stackoverflow.com/comment/45397553
has comment: http://stackoverflow.com/comment/45393511
type: Question
has comment: http://stackoverflow.com/comment/45396215
score: 0
tagged with: javascript
has title: New files in Zend Framework 2 Skeleton Application
has comment: http://stackoverflow.com/comment/45405172
has body: I've downloaded the Zend Framework 2 skeleton application and modified the standard layout.phtml and other files to my own layout, but the javascript and stylesheet files seem not to be found, although I can see them in the code inspector. I like to use Aptana Studio 3, and every new file has a red background and a small ? on their icon in the files tree. I'd appreciate any help and suggestion.
type: UnansweredQuestion
tagged with: zend-framework2

http://stackoverflow.com/comment/45289433
comment on: http://stackoverflow.com/q/28483576
score: 0
type: Comment
type: QuestionComment
has text: Uh, there is no reason to post your _entire game_ in the fiddle. http://sscce.org/

http://stackoverflow.com/q/28478429
has title: how to search in the of a document
type: Question
answer count: 1
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28478489
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45279493
type: AnsweredQuestion
has body: I have the following HTML with two elements: www.google.com www.stackoverflow.com One of the elements is in the element, the other in the . Yet the above page upon loading writes on the console: There's 2 links in the body, of which the first one is: [http://www.google.com/]. What's more puzzling, changing document.body.getElementsByTagName to document.documentElement.getElementsByTagName produces exactly the same result. Do I understand right that document.body is then an alias for document.documentElement and does not actually point to the element of the HTML?
has answer: http://stackoverflow.com/a/28478489

http://stackoverflow.com/a/28476215
has body: You use bootstrap.js with the angular-ui-bootstrap.js library? Both libraries are working with the same events. If is this your case, remove the bootstrap.js library.
has comment: http://stackoverflow.com/comment/45275561
score: 0
answers question: http://stackoverflow.com/q/28475390
type: Answer

http://stackoverflow.com/comment/45330692
score: 0
type: AnswerComment
has text: it won't clear the animation queue, you could emit the second false though
type: Comment
comment on: http://stackoverflow.com/a/28505717

http://stackoverflow.com/q/28566487
accepted answer: http://stackoverflow.com/a/28566720
tagged with: node.js
has comment: http://stackoverflow.com/comment/45443316
answer count: 3
has comment: http://stackoverflow.com/comment/45451592
has comment: http://stackoverflow.com/comment/45445505
has answer: http://stackoverflow.com/a/28566967
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28566967
linked to: http://stackoverflow.com/q/28574012
has answer: http://stackoverflow.com/a/28566720
score: 2
type: AnsweredQuestion
has title: node js route not found
downvote count: 0
has body: i have the following method to auth my users: app.all('/*', function(req, res, next) { // CORS headers res.header("Access-Control-Allow-Origin", "*"); // restrict it to the required domain res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS'); // Set custom headers for CORS res.header('Access-Control-Allow-Headers', 'Content-type,Accept,X-Access-Token,X-Key'); if (req.method == 'OPTIONS') { res.status(200).end(); } else { next(); } }); var auth = require('./auth.js'); router.post('/login', auth.login); app.all('/api/*', [require('./middlewares/validateRequest')]); // If no route is matched by now, it must be a 404 app.use(function(req, res, next) { var err = new Error('Not Found'); err.status = 404; next(err); }); And my Auth.js var jwt = require('jwt-simple'); var auth = { login: function(req, res) { var username = req.body.username || ''; var password = req.body.password || ''; if (username == '' || password == '') { res.status(401); res.json({ "status": 401, "message": "Invalid credentials" }); return; } // Fire a query to your DB and check if the credentials are valid var dbUserObj = auth.validate(username, password); if (!dbUserObj) { // If authentication fails, we send a 401 back res.status(401); res.json({ "status": 401, "message": "Invalid credentials" }); return; } if (dbUserObj) { // If authentication is success, we will generate a token // and dispatch it to the client res.json(genToken(dbUserObj)); } }, validate: function(username, password) { // spoofing the DB response for simplicity var dbUserObj = { // spoofing a userobject from the DB. name: 'arvind', role: 'admin', username: 'arvind@myapp.com' }; return dbUserObj; }, validateUser: function(username) { // spoofing the DB response for simplicity var dbUserObj = { // spoofing a userobject from the DB. name: 'arvind', role: 'admin', username: 'arvind@myapp.com' }; return dbUserObj; } } // private method function genToken(user) { var expires = expiresIn(7); // 7 days var token = jwt.…
favorite count: 0
has comment: http://stackoverflow.com/comment/45444616
has comment: http://stackoverflow.com/comment/45443369
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/63255852

http://stackoverflow.com/comment/45494888
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28592170
has text: I know it is not straightforward, but you may have a look at https://github.com/syl22-00/pocketsphinx.js
type: Comment

http://stackoverflow.com/q/28568024
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28568271
has answer: http://stackoverflow.com/a/53807083
answer count: 4
score: 2
type: AnsweredQuestion
upvote count: 2
linked to: http://stackoverflow.com/q/10486769
type: Question
tagged with: dependency-injection
has answer: http://stackoverflow.com/a/28568271
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28568399
has answer: http://stackoverflow.com/a/35632841
has answer: http://stackoverflow.com/a/28568399
has title: Angular injecting $rootScope in provider
has body: I cannot access $rootScope inside of a provider.I looked lot of angular other modules implementations. it is the same as how i implemented. What is wrong? it tried urload as a separate function(similar to other getValue function) it did not work Error is $emit is undefined define(['angularAMD'], function () { var contextServiceModule = angular.module('contextService', []); var contextService = function () { var context = {}; this.$get = ['$rootScope', function ($rootScope) { console.log($rootScope); return function (){ return { init: init, getValue: getValue, setValue: setValue, urlLoad: function () { $rootScope.$emit('onInit', {});/// error here } }; }; }]; this.init = function () { return context; }; this.getValue = function (key) { var value = context[key] ? context[key] : null; return value; }; this.setValue = function (key, value) { context[key] = value; }; } contextServiceModule.provider('contextService', contextService); });
downvote count: 0

http://stackoverflow.com/q/28462953
has body: I have a regex which matches any combination of the number 1,7 and 99, separated by commas. E.g. these should be matched: 1 1,7 1,99 99,1,7 While these should not match: 1, 8 8,99 ,7 1,7,99, The following works fine, but can probably be shortened and made more efficient? /^(1|7|99)(,?(1|7|99)(,?(1|7|99))?)?$/
tagged with: regex
type: AnsweredQuestion
score: 2
has title: Regex for matching specific numbers separated by comma
type: Question
has comment: http://stackoverflow.com/comment/45251884
possible better answer: http://stackoverflow.com/a/28463096
has comment: http://stackoverflow.com/comment/45251931
tagged with: javascript
has comment: http://stackoverflow.com/comment/45251744
upvote count: 2
has comment: http://stackoverflow.com/comment/45251720
has comment: http://stackoverflow.com/comment/45251820
answer count: 3
has comment: http://stackoverflow.com/comment/45252092
has comment: http://stackoverflow.com/comment/45251845
downvote count: 0
has answer: http://stackoverflow.com/a/28464534
favorite count: 0
has answer: http://stackoverflow.com/a/28463019
accepted answer: http://stackoverflow.com/a/28463019
has answer: http://stackoverflow.com/a/28463096
has comment: http://stackoverflow.com/comment/45251814
has comment: http://stackoverflow.com/comment/45252030
has comment: http://stackoverflow.com/comment/45251912

http://stackoverflow.com/a/28486805
type: Answer
has body: Your callback function needs to accept a second param... The first param is the current index of the array and the second param is the object at that index. You may also utilize the keyword this as suggested above. Based on my answer your code would look like this: $('img').each(function(i, img) { source.push($(img).attr('src')); // alternatively -&gt; source.push($(this).attr('src')); }); A second option you may like and puts what you're trying to do onto a single line would be to use the jQuery map function... var source = $.map($('img'), function(img) { return $(img).attr('src'); });
answers question: http://stackoverflow.com/q/28486669
score: 0

http://stackoverflow.com/a/28515872
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28515618
type: Answer
has comment: http://stackoverflow.com/comment/45349102
has body: The probable issue with your code is misplacement of jQuery file, Just try to put it in the &lt;head&gt;...&lt;/head&gt;.
score: 0
answers question: http://stackoverflow.com/q/28515618

jquery-events
tags question: http://stackoverflow.com/q/28589322
tag name: jquery-events
tags question: http://stackoverflow.com/q/28494586
tags question: http://stackoverflow.com/q/28559454
tags question: http://stackoverflow.com/q/28588482
tags question: http://stackoverflow.com/q/28453320
tags question: http://stackoverflow.com/q/28442172
type: Tag
tags question: http://stackoverflow.com/q/28562524
tags question: http://stackoverflow.com/q/28474103
tags question: http://stackoverflow.com/q/28587291
tags question: http://stackoverflow.com/q/28579103
tags question: http://stackoverflow.com/q/28479526

http://stackoverflow.com/comment/45252071
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28444264
has text: Adding the item scope to the controller works, but why? And why isn't it in the example code from ionic themselves.

http://stackoverflow.com/q/28554477
tagged with: angularjs
type: Question
tagged with: ngresource
answer count: 1
has answer: http://stackoverflow.com/a/40242438
score: 0
has comment: http://stackoverflow.com/comment/45626280
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45424413
has title: Syncronization of Multiple Js requests
tagged with: asynchronous
has body: I'm having some issues trying to synchronize multiple Async requests in AngularJS. I'm going to explain what i have and what i need. User has many sites Each site has many subscriptions Each site has many transactions Each transaction is associated with a subscription I'm getting the subscriptions and transactions through a 3rd party API. Each of them returns and Array of Elements who has the associated Id. So i need to make a request for each of the elements of each array and associate both results. I don't know what to do, or how i can handle this. any help is appreciate. $q.all([ PaymentService.getTransactions(profile.payment.account_code), SiteService.getAll(), PaymentService.getUserSubscriptions(profile.payment.account_code) ]).then(function (data) { var transactions = data[0]; var user_sites = data[1]; var user_subscriptions = data[2]; // returns site-by-site angular.forEach(user_sites, function (site) { SiteService.loadSite(site.$value).then(function (loaded_site) { loaded_site.transactions = []; loaded_site.subscriptions = []; angular.forEach(user_subscriptions, function (subscription) { console.log('SUBSCRIPTION: ', subscription); if ( subscription.uuid === loaded_site.recurly_subscription_uuid ) { loaded_site.subscriptions.push(subscription); } }); angular.forEach(transactions, function (transaction) { if ( transaction.subscription ) { if ( getSubscriptionId(transaction.subscription.$.href) === loaded_site.recurly_subscription_uuid ) { loaded_site.transactions.push(transaction); } } }); $scope.sites.push(loaded_site); }); }); })
tagged with: promise

http://stackoverflow.com/comment/45249315
type: AnswerComment
comment on: http://stackoverflow.com/a/28461455
type: Comment
has text: What if i have a site, that lets people costomize the CSS, but whenever they refresh the site, it will revert back to the default colors.
score: 0

http://stackoverflow.com/q/28472095
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45268357
possible better answer: http://stackoverflow.com/a/28473705
has answer: http://stackoverflow.com/a/28474203
type: Question
has comment: http://stackoverflow.com/comment/45268433
answer count: 2
upvote count: 0
has title: Can not fetch Friend List using Facebook Graph API
has comment: http://stackoverflow.com/comment/45271932
has comment: http://stackoverflow.com/comment/45272113
score: -2
has body: This is for the first time i am using Facebook Graph API. I need to get every friends name who is using my app.I tries a lot of methods available online but could not manage to pull friend list so far.I am unable to do this. Please help. Here is what i did so far. Facebook OAuth Javascript Demo Click on Below Image to start the demo: Logs:
tagged with: javascript
has comment: http://stackoverflow.com/comment/45272164
accepted answer: http://stackoverflow.com/a/28474203
tagged with: facebook-javascript-sdk
tagged with: facebook-graph-api
favorite count: 0
downvote count: 2
tagged with: facebook
has answer: http://stackoverflow.com/a/28473705
has comment: http://stackoverflow.com/comment/45271024

http://stackoverflow.com/q/28576874
has title: Google Recaptcha v2 verification failed on server side
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45463049
has comment: http://stackoverflow.com/comment/45463073
tagged with: spring
has comment: http://stackoverflow.com/comment/45463458
tagged with: java
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45462792
has body: I have faced one issue with recaptcha v2. I completed my code with validations on client and server side. But interesting one i have noticed in this recaptcha v2 is if i'm a guest authenticating my login page(demo) with out login of any other google account in another tab, it is showing number(image) to enter(type) and validate. if i'm a guest authenticating my login page(demo) with login into one of my google account in another tab, it is not showing any captcha and validating "i'm not a robot!".. Can anybody tell me whats going on??? Login.jsp &lt;script src='https://www.google.com/recaptcha/api.js' async defer&gt;&lt;/script&gt; &lt;form&gt;&lt;div class="g-recaptcha" name="recaptcha" id="recaptcha" data-sitekey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"&gt;&lt;/div&gt;&lt;/form&gt; Controller.java: Im calling this method in login controller method public boolean captchaValidationAndLogin( String recaptchaResponse, HttpServletRequest request) { try{ String secretParameter="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; System.out.println(recaptchaResponse); // Send get request to Google reCaptcha server with secret key URL url = new URL( "https://www.google.com/recaptcha/api/siteverify?secret=" +secretParameter+"&amp;response="+recaptchaResponse+"&amp;remoteip=" +request.getRemoteAddr()); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("GET"); String line, outputString = ""; BufferedReader reader = new BufferedReader( new InputStreamReader(conn.getInputStream())); while ((line = reader.readLine()) != null) { outputString += line; } System.out.println("Status in string: "+outputString); // Convert response into Object CaptchaStatus status=new Gson().fromJson(outputString, CaptchaStatus.class); if(status.isSuccess()){ System.out.println("success"); return true; } else{ System.out.println("failed"); return false; } }//try catch(Exception e){ e.printStackTrace(); return false; } } LoginController.java: if(loginAttempts &gt;= 3) { /* Captcha …
tagged with: recaptcha
answer count: 0

http://stackoverflow.com/q/28575896
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
score: -1
tagged with: ajax
has body: I am trying to make an Ajax call to Indian Railway API which provides various data in the JSON format. Here is my code: &lt;!DOCTYPE&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"&lt;/script&gt; &lt;script&gt; function getData() { var theUrl = 'http://api.railwayapi.com/between/source/gzb/dest/anvt/apikey/56237/' $.ajax({ url: theUrl, crossDomain: true, dataType: 'jsonp', success: function(data){ alert(JSON.stringify(data)); }, error: function(data){ alert('ERROR'); } }); } &lt;/script&gt; &lt;body&gt; &lt;input type="button" value="Get Data" onclick="getData()"&gt;&lt;/button&gt; &lt;/body&gt; It is a very simple call but I cant understand why it keeps showing Error alert box. Few things that I have tried: 1. I get an error "No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access." if I keep data type as json. On searching for this error, I saw that json should be changed to jsonp, I get the following errors: Resource interpreted as Script but transferred with MIME type text/html: "http://api.railwayapi.com/between/source/gzb/dest/anvt/apikey/56237/?callback=jQuery111208570126367267221_1424232589162&amp;_=1424232589163". It added call back when I changed data type to json, which I understand is correct. While the other error is: Uncaught SyntaxError: Unexpected token : ?callback=jQuery111208570126367267221_1424232589162&amp;_=1424232589163:2 which is on this line "response_code": 200, When I run the API in my browser through URL, it runs perfectly. When I look under developer tools then under Sources in Chrome it does show the JSON response. If that is the case, then why is it not showing alert for "Success". Link to access the API is: http://api.railwayapi.com/between/source/lko/dest/anvt/apikey/56237/ How can I tell the request is cross domain for sure? Any help will be appreciated. Thank You.
has title: Uncaught SyntaxError: Unexpected token : Cross Domain Issue?
favorite count: 0
has answer: http://stackoverflow.com/a/28576032
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json
downvote count: 1
has comment: http://stackoverflow.com/comment/45461123
type: Question

http://stackoverflow.com/a/58588152
has body: Object assign copies one or more source objects to the target object. So we could use Object.assign here. Syntax: Object.assign(target, ...sources) var obj = {}; Object.assign(obj, {"1":"aa", "2":"bb"}) console.log(obj)
has comment: http://stackoverflow.com/comment/109021019
downvote count: 0
answers question: http://stackoverflow.com/q/28527712
type: Answer
upvote count: 10
score: 10

http://stackoverflow.com/q/28515237
has title: Can't make HTML5 Audio Tag to work on mobile browsers
has body: I have a web app that uses the HTML5 &lt;audio&gt; tag and for some reason, while it works fine on Windows and Mac PCs, it doesn't work on iOS and Android. Here's a relevant snippet of my code: Javascript: var audioElement = document.querySelector('#audioplayer'); var source = document.querySelector('#mp3'); source.src = tokObject._url; audioElement.load(); audioElement.play(); HTML: &lt;center&gt; &lt;audio id="audioplayer" style="width:480px;"&gt; &lt;source id="mp3" src="random-placeholder" type="audio/mp3" /&gt; &lt;/audio&gt; &lt;/center&gt;
has comment: http://stackoverflow.com/comment/45347896
tagged with: ios
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45347901
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/39987804
score: 7
favorite count: 0
type: Question
tagged with: android
answer count: 3
upvote count: 7
has answer: http://stackoverflow.com/a/28516166
tagged with: audio
has answer: http://stackoverflow.com/a/28515283

http://stackoverflow.com/a/28545700
downvote count: 0
type: Answer
has body: This should get you started http://jsfiddle.net/41go76g4/ Basically you read the file in with fileAPI in javascript and set the returned blob as the dataURL for an img tag. function handleFileSelect(evt) { var files = evt.target.files; // FileList object // Loop through the FileList and render image files as thumbnails. for (var i = 0, f; f = files[i]; i++) { // Only process image files. if (!f.type.match('image.*')) { continue; } var reader = new FileReader(); // Closure to capture the file information. reader.onload = (function(theFile) { return function(e) { // Render thumbnail. var span = document.createElement('span'); span.innerHTML = ['&lt;img class="thumb" src="', e.target.result, '" title="', escape(theFile.name), '"/&gt;'].join(''); document.getElementById('list').insertBefore(span, null); }; })(f); // Read in the image file as a data URL. reader.readAsDataURL(f); } } document.getElementById('fileInput').addEventListener('change', handleFileSelect, false); ref: http://www.html5rocks.com/en/tutorials/file/dndfiles/
score: 5
upvote count: 5
answers question: http://stackoverflow.com/q/28545509
accepted answer of: http://stackoverflow.com/q/28545509
type: AcceptedAnswer

http://stackoverflow.com/comment/45458201
comment on: http://stackoverflow.com/a/28573933
score: 0
type: AnswerComment
has text: That's a side effect, not the main goal - see original question. I want to get a webpage, transform it (think: from a bloated webpage extract content and put into a lightweight html/css) and display only that lightweight page.
type: Comment

http://stackoverflow.com/a/28447081
answers question: http://stackoverflow.com/q/28446159
has body: Start off with intersection(Object.keys(o1), Object.keys(o2)) Now you just need to write intersection, or find a library which has it (look at underscore). The point is that intersection is a general operation on sets or lists. Rather than writing intersection logic which is inextricably tangled up with the notion of objects and their keys, find or write a method which performs that general intersection operation, then simply feed it the two lists of keys. This way you can also more easily add features to the intersection logic--for instance, finding the intersection of more than two arrays. Still, why bother? Well, one good reason is that this kind of code is less prone to the type of bug you ran into, trying to write a bunch of loops. If you want to write your own intersection, you could do worse than the filter approach by @kennebec: function intersection(a1, a2) { return a1.filter(function(elt) { return a2.indexOf(elt) !== -1; }); } Another advantage of factoring out the intersection logic this way is that you can generalize the rules for something being "contained" in an array. We'll pass the criterion function in as a third parameter: function intersection(a1, a2, contains) { return a1.filter(function(elt) { return contains(a2, elt); }); } For instance I could use this to check for key intersection case-insensitively: intersection(Object.keys(o1), Object.keys(o2), contains_case_insensitive); We can add a default for the contains parameter to handle the usual case: function intersection(a1, a2, contains) { contains = contains || function(a, e) { return a.indexOf(e) !== -1; }; return a1.filter(function(elt) { return contains(a2, elt); }); } Writing this in ES6 with fat-arrow functions is a bit more compact: function intersection(a1, a2, contains) { contains = contains || (a, e) =&gt; a.indexOf(e) !== -1; var _contains = elt =&gt; contains(a2, elt); return a1.filter(_contains); }
score: 0
type: Answer

http://stackoverflow.com/comment/45275639
type: AnswerComment
comment on: http://stackoverflow.com/a/28474540
type: Comment
has text: <c:forEach var="i" begin="1" end="${examPaper.number_of_questions}"> in this if i have 10 questions 10 buttons will be displayed. If i click on evry button, the value returned is 1 only.
score: 0

http://stackoverflow.com/a/28553956
has comment: http://stackoverflow.com/comment/45454384
has comment: http://stackoverflow.com/comment/45456446
has comment: http://stackoverflow.com/comment/45729028
answers question: http://stackoverflow.com/q/28552387
has comment: http://stackoverflow.com/comment/45455501
downvote count: 0
has comment: http://stackoverflow.com/comment/45457006
has comment: http://stackoverflow.com/comment/45461961
has comment: http://stackoverflow.com/comment/45751633
has comment: http://stackoverflow.com/comment/45690613
has body: So assuming that i have accurately figured out what you wanted to do with this then I have a working solution for you right here: http://jsfiddle.net/L7ze91vd/3/ the plugin doesn't seem to work on jsfiddle... but the scrolling of the divs should remain the same. The solution was to set the home div to be a fixed div so it doesn't move when scrolling then just scroll the other divs "on top" of it using a padding div to fill the missing gap from the home div no longer being part of the scroll zone. I modified the html sections to look like this: WELCOME WORK ABOUT ME CONTACT And also had to modify the menu button for the home div from: home to: home and I modified the css by adding these blocks: #wrapper { height:100%; width:100%; position:absolute; } #home { position:fixed; } ul.menu { z-index:1; }
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/45451959
has comment: http://stackoverflow.com/comment/45455232
has comment: http://stackoverflow.com/comment/45455754
upvote count: 1
has comment: http://stackoverflow.com/comment/45457160
has comment: http://stackoverflow.com/comment/45454007

http://stackoverflow.com/a/28548816
upvote count: 3
has comment: http://stackoverflow.com/comment/45410674
accepted answer of: http://stackoverflow.com/q/28548761
answers question: http://stackoverflow.com/q/28548761
has comment: http://stackoverflow.com/comment/45410708
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 3
has body: Simply set the o.bar like this to call the 'set' function: o.bar = 3 Setting `o.bar` to 3 3 EDIT: As @CyberneticTwerkGuruOrc mentions in the comments, the setter does not set anything in this case. To do so you have to use the input value and actually set some (other) value, ex: this.foo = value

http://stackoverflow.com/comment/45311287
has text: not that was not working i use alternate way like this $(".WIWC_T1 a").css('pointer-events', 'none'); $(".WIWC_T1 a").css('color', 'grey');
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28494214

http://stackoverflow.com/q/28505652
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: animation
upvote count: 0
has comment: http://stackoverflow.com/comment/45330637
has comment: http://stackoverflow.com/comment/45330877
accepted answer: http://stackoverflow.com/a/28505717
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45330462
has body: I am running this animation on $(window).scroll() and it works fine for the most part. $('#el').animate({ left: toMove }, 500); The problem is if the user scrolls too fast, two animations will fire and the second animation will fire before the first one has moved far enough. How can I make sure there is only one animation at any given time and then the other animations will follow? I need the element to animate left FULLY any other animations run but I need them all to run. I tried using .queue() but couldn't find the right solution with it.
score: -1
type: Question
has answer: http://stackoverflow.com/a/28505717
has title: Make sure only one animation is being fired
answer count: 1
downvote count: 1

http://stackoverflow.com/comment/45473641
comment on: http://stackoverflow.com/q/28582543
type: Comment
has text: Basically, I'm using FabricJS objects with custom attributes (position in a list) added to them. If I delete one FabricJS object, I need to reindex, for example the one with an attribute index : 3 becomes index : 2. The problem is, each FabricJS is a standalone object and I can build a temporary array containing all the attributes but I still have to reorder them.
type: QuestionComment
score: 0

http://stackoverflow.com/a/28542625
upvote count: 1
has comment: http://stackoverflow.com/comment/45432350
has comment: http://stackoverflow.com/comment/45401142
has comment: http://stackoverflow.com/comment/45431904
has body: If you look through the code, you can see that each button is created using the below function: function createButton(action, handler) { var a = document.createElement("a"); a.href = "#" + action; a.innerHTML = action; a.addEventListener("click", function(event) { handler(); event.preventDefault(); }); return a; } All this does is append a series of links to the DOM, each with a click event handler calling the relevant function (passed as the handler variable), stop, start or reset. To call one of these directly, you can simply call the function- e.g. stop() var Stopwatch = { init: function(elem, options) { var timer = createTimer(), startButton = createButton("start", start), stopButton = createButton("stop", stop), resetButton = createButton("reset", reset), offset, clock, interval; // default options options = options || {}; options.delay = options.delay || 1; // append elements elem.appendChild(timer); elem.appendChild(startButton); elem.appendChild(stopButton); elem.appendChild(resetButton); // initialize reset(); // private functions function createTimer() { return document.createElement("span"); } function createButton(action, handler) { var a = document.createElement("a"); a.href = "#" + action; a.innerHTML = action; a.addEventListener("click", function(event) { handler(); event.preventDefault(); }); return a; } function start() { if (!interval) { offset = Date.now(); interval = setInterval(update, options.delay); } } function stop() { if (interval) { clearInterval(interval); interval = null; } } function reset() { clock = 0; render(0); } function update() { clock += delta(); render(); } function render() { timer.innerHTML = clock / 1000; } function delta() { var now = Date.now(), d = now - offset; offset = now; return d; } // public API this.start = start; this.stop = stop; this.reset = reset; } }; // basic examples var elems = document.getElementsByClassName("basic"); for (var i = 0, len = elems.length; i < len; i++) { Stopwatch.init(elems[i]); } .stopwatc…
accepted answer of: http://stackoverflow.com/q/28542547
has comment: http://stackoverflow.com/comment/45489084
downvote count: 0
has comment: http://stackoverflow.com/comment/45431370
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28542547
type: Answer
score: 1

http://stackoverflow.com/comment/45277160
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28476888
has text: Yes, I have edited the question, the selection restriction is the one that failed to be removed from `site2`..
type: Comment

http://stackoverflow.com/comment/45428368
comment on: http://stackoverflow.com/q/28556285
has text: I know how to do that , but just asking about this question because you pointed me the issue and now its ok .
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28475532
tagged with: http://stackoverflow.com/tag/json
has title: How to get URL from a JSON object part
has body: I have a variable in Javascript like it- var uri = "https:\/\/maps.googleapis.com\/maps\/api\/staticmap?size=100x100&amp;zoom=11&amp;center=22.816667,89.55"; So What I need is it converted like- var uri = "https://maps.googleapis.com/maps/api/staticmap?size=100x100&amp;zoom=11&amp;center=22.816667,89.55"; What I have done is- var uri = "https:\/\/maps.googleapis.com\/maps\/api\/staticmap?size=100x100&amp;zoom=11&amp;center=22.816667,89.55"; var uri_dec = JSON.stringify(uri); And Get https://maps.googleapis.com/maps/api/staticmap?size=100x100&amp;zoom=11¢er=22.816667,89.55 So problem is I am getting ¢er insted of &amp;center. Can anyone help me please? Thanks in advance for helping.
type: Question
has comment: http://stackoverflow.com/comment/45274453
answer count: 2
downvote count: 2
score: -2
tagged with: javascript
has answer: http://stackoverflow.com/a/28475636
favorite count: 0
accepted answer: http://stackoverflow.com/a/28475636
has comment: http://stackoverflow.com/comment/45274418
possible better answer: http://stackoverflow.com/a/28475623
upvote count: 0
has answer: http://stackoverflow.com/a/28475623
type: AnsweredQuestion

http://stackoverflow.com/a/28460655
upvote count: 2
type: Answer
has body: You have a typo in your html template for the ng-value attribute, it should be &lt;label&gt; &lt;input type="radio" ng-model="$parent.selectedItem" ng-value="item"&gt; {{item.name}} &lt;/label&gt;
score: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28460542
downvote count: 0
has comment: http://stackoverflow.com/comment/45247364
answers question: http://stackoverflow.com/q/28460542

whatsapp
tags question: http://stackoverflow.com/q/28541693
tags question: http://stackoverflow.com/q/28584063
type: Tag
tag name: whatsapp

http://stackoverflow.com/q/28443721
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45217039
type: Question
has answer: http://stackoverflow.com/a/28443838
accepted answer: http://stackoverflow.com/a/28443838
has title: Javascript (or angular) point variable to local file (json)
has comment: http://stackoverflow.com/comment/45216992
tagged with: javascript
has comment: http://stackoverflow.com/comment/45217208
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28445747
tagged with: angularjs
has answer: http://stackoverflow.com/a/28445747
has body: I am trying to used locally stored json files to pull in information, right now I am just hardcoding the json in a variable, but what I would like to do is point to some json files I have locally something like - var myData = "scripts/data/myData.json"; Is something like this possible? Thanks!
type: AnsweredQuestion

http://stackoverflow.com/q/28520466
has body: I've set up a style to turn a single-cell table, for example: This is a button Into a button via CSS such as: table.mybutton { border : 1px solid; border-radius : 8px; border-spacing : 2px; font-size : 80%; display : inline-table; cursor : pointer; } table.mybutton:hover { background-color : black; color : white; } I've managed to get it to visit one of two URLs depending on whether the Shift key is held down via this Javascript: var shift = false; function shiftHandler(event) { shift = event.shiftKey; }; window.addEventListener("keydown", shiftHandler, false); window.addEventListener("keypress", shiftHandler, false); window.addEventListener("keyup", shiftHandler, false); function goSomewhere(url1, url2) { if (shift) { window.location.href = url2; } else { window.location.href = url1; } } function goSomewhereElse(url) { window.location.href = url; } The last piece is that I'd like the background color of the button while hovering to change depending on whether the Shift key is held as well. Can this be done? Can it be done without extra libraries? Example Fiddle
type: Question
has comment: http://stackoverflow.com/comment/45357993
score: 5
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28520709
tagged with: css
possible better answer: http://stackoverflow.com/a/28520529
has answer: http://stackoverflow.com/a/28520529
answer count: 2
has comment: http://stackoverflow.com/comment/45357806
has title: Change style on hover while a key is held down
upvote count: 5
tagged with: javascript
has answer: http://stackoverflow.com/a/28520709
type: AnsweredQuestion
downvote count: 0
favorite count: 0

http://stackoverflow.com/a/28573452
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45456720
has comment: http://stackoverflow.com/comment/45456416
accepted answer of: http://stackoverflow.com/q/28573398
has comment: http://stackoverflow.com/comment/45456583
type: Answer
answers question: http://stackoverflow.com/q/28573398
has body: Just use its disabled option: $("#field").autocomplete("option", "disabled", true); var tags = ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"]; $("#field").autocomplete({ source: function(request, response) { var matcher = new RegExp("^" + $.ui.autocomplete.escapeRegex(request.term), "i"); response($.grep(tags, function(item) { return matcher.test(item); })); }, disabled: true, }); function disable(shouldDisable) { shouldDisable = JSON.parse(shouldDisable); // Extract boolean from string parameter $("#field").autocomplete("option", "disabled", shouldDisable); $("#field").focus().trigger($.Event("keydown")); } Autocomplete On Autocomplete Off
upvote count: 3
score: 3

http://stackoverflow.com/comment/45285890
type: Comment
has text: ah i forgot to mention.. you need a lightweight jquery plugin. edited and thanks
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28481526

http://stackoverflow.com/comment/45494227
score: 0
type: AnswerComment
has text: Yes it seems backwards, even Highcharts retains the same axes names whether it is a BAR or COLUMN chart. Despite swapping the axes, your demo is still plotting the line vertically according to the top xAxis, but would like to have it on the right yAxis.
type: Comment
comment on: http://stackoverflow.com/a/28593371

http://stackoverflow.com/q/28493770
has comment: http://stackoverflow.com/comment/45308086
has answer: http://stackoverflow.com/a/28505209
linked to: http://stackoverflow.com/q/6117814
has comment: http://stackoverflow.com/comment/45308015
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45308028
has comment: http://stackoverflow.com/comment/45307828
has answer: http://stackoverflow.com/a/28495602
score: 0
has comment: http://stackoverflow.com/comment/45307898
type: UnansweredQuestion
has body: I'm looking for some help with my coursework as I've spent the last 8 hours trying to find a way to do what i'm trying to accomplish. Now I have to use JavaScript, cannot use plugins but i can use the jQuery Library. I'm basically trying to assign weeks to the semesters of the university year, so we say 29th September 2014 (Monday) to 26th January which is around 15 weeks. Now I'm using something like this: Date.prototype.getWeek = function() { var firstJan = new Date(2014,0,1); var today = new Date(2014, 9, 14); var firstMonSem1 = new Date(2014, 8, 29); var firstMonSem2 = new Date(this.getFullYear(), 1, 1); var dayOfYear = ((today - firstJan + 86400000)/86400000); var startWeekSem1 = ((firstMonSem1 - firstJan + 86400000)/86400000); var startWeekSem2 = ((firstMonSem2 - firstJan + 86400000)/86400000); var currentWeekNumber = Math.ceil(dayOfYear/7); var startWeekNumberSem1 = Math.ceil(startWeekSem1/7); var startWeekNumberSem2 = Math.ceil(startWeekSem2/7); var output = {current: currentWeekNumber, sem1: startWeekNumberSem1, sem2: startWeekNumberSem2}; return output; }; So i'm returning the current week of the year, semester start date for semester 1 and 2. But for this example let's only focus on the first is 29th September (Monday) until 26th January which is around 15 weeks. Now i've worked out based on the values i get when the semester starts and finishes including a 4 week holiday over the christmas period. And then I have an array for the index of which week of the semester we are in, in comparison to the week of the year (this way it could be week 41 in the year and based on the index array I would know that this is week 2). Here's the code (note: it works!) var today = new Date(); var info = today.getWeek(); if (info['current'] &gt;= info['sem1'] &amp;&amp; info['current'] &lt;= (info['sem1'] + 18)) { // Semester 1 var index = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]; var yearWeeks = []; var count = 1; for (var i = info['sem1']; i &lt; (info['sem1'] + 18); i++) { …
type: Question
has title: Going through weeks is automatically changing on wednesday rather than sunday/monday

http://stackoverflow.com/q/28529361
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: How to turn Bootstrap Carousel slides to change on scroll?
tagged with: css
upvote count: 6
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/28529435
downvote count: 1
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28529435
score: 5
linked to: http://stackoverflow.com/q/8189840
has body: I am using bootstrap carousel in my website. But I want its functionality little different. I want slides to change on mouseScroll (each slide on each time mouse scrolled). How can I achieve it with Bootstrap Carousel? $('#myCarousel').carousel({ interval: 3000 }); jsfiddle

http://stackoverflow.com/comment/45459717
type: Comment
comment on: http://stackoverflow.com/a/28574705
score: 0
type: AnswerComment
has text: This actually isn't a perfect answer for me, I now noticed that the enclosure was eliminated. I must preserve the enclosure for this assignment.

http://stackoverflow.com/a/28508014
has body: You can capture the input event: document.querySelector('input').addEventListener('input', function() { alert('Changed!'); }); 1 2 Update I didn't notice the jQuery tag at first, and @YanickRochon made a good point that this should also capture the change event. New Snippet $('input').on('input change', function() { alert('Changed!'); }); 1 2
downvote count: 1
score: 5
has comment: http://stackoverflow.com/comment/45335232
answers question: http://stackoverflow.com/q/28507946
has comment: http://stackoverflow.com/comment/45335348
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45340686
type: Answer
upvote count: 6
has comment: http://stackoverflow.com/comment/45335296
has comment: http://stackoverflow.com/comment/45335119
accepted answer of: http://stackoverflow.com/q/28507946

http://stackoverflow.com/a/28518157
has body: 'num' in your validNumber function doesn't have a value property, so you need to change field=num.value; to field = num; or better, change the function to function validNumber(num) { if(isNaN(num)) { alert("The number entered is not a valid number"); return false; } return true; } Also, you don't need the else clause, as you already return false if it is NaN and return true won't be reached if so.
downvote count: 0
has comment: http://stackoverflow.com/comment/45353706
type: Answer
answers question: http://stackoverflow.com/q/28518115
score: 1
upvote count: 1

http://stackoverflow.com/a/28587312
has comment: http://stackoverflow.com/comment/45487079
has comment: http://stackoverflow.com/comment/45485320
type: Answer
upvote count: 4
downvote count: 0
answers question: http://stackoverflow.com/q/28586201
score: 4
has body: Wow! This was a surprisingly difficult problem, although it seems like it should be simple at first glance. The problem is that, strictly speaking, your requirement demands that only text nodes be processed to transform hashtags into links. Existing HTML should not be touched at all. A naïve approach (seen in the other answers) would attempt to devise a complex regular expression to dodge the HTML. Although this may appear to work for some cases, even nearly all practical cases, it is absolutely not foolproof. Regular expressions are simply not powerful enough to fully parse HTML; it is just too complex a language. See the excellent and rather famous Stack Overflow answer at RegEx match open tags except XHTML self-contained tags. It can't be done perfectly, and should never be done at all. Rather, the correct approach is to traverse the HTML tree using a recursive JavaScript function, and replace all target text nodes with processed versions of themselves, which, importantly, may involve the introduction of (non-text) HTML markup inside the text node. jQuery can be used to accomplish this with minimal complexity, although the task itself necessitates a certain amount of complexity, which, honestly, can't be avoided. As I said, this is a surprisingly difficult problem. HTML Try it Please visit #Microsoft! #facebook Somelink JavaScript if (!window.Node) { window.Node = { ELEMENT_NODE : 1, ATTRIBUTE_NODE : 2, TEXT_NODE : 3, CDATA_SECTION_NODE : 4, ENTITY_REFERENCE_NODE : 5, ENTITY_NODE : 6, PROCESSING_INSTRUCTION_NODE : 7, COMMENT_NODE : 8, DOCUMENT_NODE : 9, DOCUMENT_TYPE_NODE : 10, DOCUMENT_FRAGMENT_NODE : 11, NOTATION_NODE : 12 }; } // end if window.linkify = function($textNode) { $textNode.replaceWith($textNode.text().replace(/#(\w+\.?\w+)/g,'#$1')); }; // end linkify() window.processByNodeType = function($cur, nodeTypes, callback, payload ) { if (!nodeTypes.length) nodeTypes = [nodeTypes]; for (var i = 0; i < $cur.length; ++i) { if ($.inArray($cur.get(i).nodeType,…

maxmind
tags question: http://stackoverflow.com/q/28482330
type: Tag
tag name: maxmind

http://stackoverflow.com/comment/45457489
comment on: http://stackoverflow.com/q/28574024
score: 4
has text: Your form elements do not have a name attribute. Pretty basic stuff.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28590474
type: Answer
score: 1
upvote count: 1
has body: Try this: var loadPrices = function () { $scope.entity = {/* grabs variables from a form*/}; var myEntity = {}; myEntity.Code = $scope.productID.toUpperCase(); myEntity.Attributes = $scope.entity; myEntity.Attributes.Term = $scope.productAttributesObj.Term; myEntity.Attributes.Quantity = 1; $scope.productAttributes.push(myEntity); }; And don't forget to declare $scope.productAttributes as Array $scope.productAttributes = []; btw, more information about json manipulations: Adding/removing items from JSON data with JQuery
downvote count: 0
answers question: http://stackoverflow.com/q/28590222

http://stackoverflow.com/comment/45395041
type: QuestionComment
has text: It's not part of a standard yet and best described in React docs: http://facebook.github.io/react/docs/transferring-props.html
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28534344

http://stackoverflow.com/comment/45257004
comment on: http://stackoverflow.com/a/28465646
type: AnswerComment
type: Comment
has text: @JamesThorpe :) i know the feeling
score: 1

window.location
tags question: http://stackoverflow.com/q/28442835
tags question: http://stackoverflow.com/q/28448649
type: Tag
tag name: window.location
tags question: http://stackoverflow.com/q/28438951

http://stackoverflow.com/comment/45256919
score: 3
comment on: http://stackoverflow.com/q/28465562
type: QuestionComment
has text: Study the "Run" button in developer mode. You can see all the magic.
type: Comment

http://stackoverflow.com/comment/45473530
has text: @SwatiVerma: Could that be a caching problem? Are you sure that there is no reload/that the urls differ (try it with a redirection to someplace else, eg. google ) ?
comment on: http://stackoverflow.com/a/28582321
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/123831506
score: 1
comment on: http://stackoverflow.com/a/36097573
type: AnswerComment
has text: @brandon, if re-requesting the page isn't necessary, what's the alternative?
type: Comment

flux
tag name: flux
tags question: http://stackoverflow.com/q/28578098
type: Tag

http://stackoverflow.com/q/28502871
has body: Basically: in the initials settings can configure the panel visibility var settings = { BasePath: '/', // path to ajax file browser files Id: 'AjaxFileBrowserContainer', // ID of the parent control Url: 'http://webdavserver.com', // the root folder to be displayed Style: 'height: 100%; width: 100%', MsOfficeTemplatesPath: 'http://webdavserver.com/MSOfficeTemplates/', SelectedFolder: '/Pictures', // folder to be selected Panels: { Folders: { Show: false }, FilesView: { Show: false }, Toolbar: { Show: false }, AddressBar: { Show: false }, UploadPanel: { Show: true }, UploadProgressPanel: { Show: true } } }; or later, also can show or hide the panel instanceName.SetShowUploadPanel(true); But none of these statements make the Upload Panel visible, so there any way to show the upload panel without the File panel?.
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28841060
answer count: 1
tagged with: ithit-ajax-file-browser
has title: There is no way to show the "upload panel", without the "file panel" be visible, in ITHit AJAX File Browser?
type: UnansweredQuestion
tagged with: ithit-webdav-server

http://stackoverflow.com/comment/45382693
has text: Just wondering, did you setup the Braintree javascript SDK? https://developers.braintreepayments.com/javascript+php/sdk/client/setup
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28526584

http://stackoverflow.com/comment/45229691
comment on: http://stackoverflow.com/q/28450925
has text: You're missing a closing bracket in `(function({`. It has to be `(function(){`. The missing `'` was corrected here, but please make sure your code is also like that.
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/a/28495625
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28495566
answers question: http://stackoverflow.com/q/28495566
type: AcceptedAnswer
has body: refValues and uniqueAddrs are array variables, and join() method just concatenates all elements in these arrays to a string. This is a quick and dirty way to check string arrays for equality.
downvote count: 0
type: Answer
score: 2

http://stackoverflow.com/a/28490917
answers question: http://stackoverflow.com/q/28490863
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/45302939
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28490863
has body: This function is wrong: function searcher(link){ window.open(link); window.onLoad= addPages(); } It's adding the onload handler to the current window, not the window you just opened. It's also calling the addPages function immediately, and assigning the result to window.onload; you should be setting the onload property to the function itself. function searcher(link) { var win = window.open(link); win.onload = addPages; } Note that none of this will work if the pages you're loading are in a different domain from your script. Javascript can't access contents of windows in a different domain.
type: Answer
has comment: http://stackoverflow.com/comment/45303007

http://stackoverflow.com/a/28550171
answers question: http://stackoverflow.com/q/28550131
score: 1
downvote count: 0
has body: You $.map() them and then .join() 'em. var res = $.map($("select[name='offer1cards[]']"), function(ele) { return $(ele).val(); }).join(', '); alert(res); Demo: http://jsfiddle.net/5t9ddd98/1/
type: Answer
upvote count: 1

http://stackoverflow.com/comment/45468026
has text: Thank you , I need to get data from canvas ,It is containing large image data to get data url from canvas is getting slow
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28578198
type: Comment

http://stackoverflow.com/comment/45432164
type: QuestionComment
comment on: http://stackoverflow.com/q/28560255
score: 0
has text: so you want to start right where you click in the textarea?
type: Comment

http://stackoverflow.com/comment/45443560
type: QuestionComment
score: 0
has text: The problem is that in this way if i type faster i have 4/5/6 etc.. calls in background. I need find a solution to block the other calls if start another. Something like that
comment on: http://stackoverflow.com/q/28566488
type: Comment

http://stackoverflow.com/q/28569503
score: 5
has title: How to get ReactJS to render empty HTML attributes
has answer: http://stackoverflow.com/a/28569784
type: Question
has body: I'm trying to get React to render an empty attribute, but instead it's not including it at all. Any ideas? render(){ return &lt;myComponent foo="{ this.state.foo }" /&gt; } when this.state.foo if falsey, this yields: &lt;mycomponent /&gt; whereas I want: &lt;myComponent foo /&gt;
tagged with: reactjs
upvote count: 5
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45449416
type: UnansweredQuestion

http://stackoverflow.com/q/28540568
has comment: http://stackoverflow.com/comment/45395060
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28540849
accepted answer: http://stackoverflow.com/a/28540849
score: 0
has comment: http://stackoverflow.com/comment/45394782
tagged with: element
linked to: http://stackoverflow.com/q/23423383
answer count: 1
tagged with: attributes
has comment: http://stackoverflow.com/comment/45394828
has comment: http://stackoverflow.com/comment/45394957
has comment: http://stackoverflow.com/comment/45396773
has body: I am in the process of building an e-Commerce shop and have hit a small bump in the road for my actual product page. Based on any product options set that would add to the price if selected, I would like to be able to update the price on the page live when these options have been added. I have managed to iterate through every element with a "data-price-effect" attribute attached to them, HOWEVER, when it comes to a select element, I would need to check if the item is selected as an option, each option has their respective price change attribute of course, but the value would only update to the actual select element. Here is my code upto now: function updatePrice(){ $('[data-price-effect]').each(function( index ) { // do something }); } Basic HTML set-up to explain further: Item 1 Item 2 Item 3 I have NO idea how to even logically do this, not even with some huge messy code. Any pointers here from someone more experienced with Javascript?
type: AnsweredQuestion
tagged with: loops
has title: jQuery - Each loop to select all items by data attribute, but also dependent on select (option) values
has comment: http://stackoverflow.com/comment/45395505
has comment: http://stackoverflow.com/comment/45395009
type: Question

http://stackoverflow.com/a/28463927
score: 0
has comment: http://stackoverflow.com/comment/45253731
has comment: http://stackoverflow.com/comment/45254372
has comment: http://stackoverflow.com/comment/45254696
answers question: http://stackoverflow.com/q/28463878
has comment: http://stackoverflow.com/comment/45253799
type: Answer
has comment: http://stackoverflow.com/comment/45253657
has body: Your question is super confusing, but you can create elements like this var source = document.createElement('source'); and give it an src attribute like source.src = 'myaudio.mp3';
has comment: http://stackoverflow.com/comment/45254273

http://stackoverflow.com/a/31497930
type: Answer
has body: I have the same problem. I am using Customizr 3.3.28. I was able to switch the slider according to the language by editing the php file: ./inc/parts/class-content-slider.php $slider_name_id = $this -&gt; tc_get_current_slider( $queried_id ); if ($_GET['lang'] == 'en_us') { $slider_name_id = 'activities-slider-en-us'; } if ($_GET['lang'] == 'pt_br') { $slider_name_id = 'activities-slider-pt-br'; } I know it is ugly because the slider name is hard-coded, but unless they can support this natively, I will just have to hack it like that. I would try a similar approach for the featured pages, but I believe that they should work out of the box with two languages. Still digging...
answers question: http://stackoverflow.com/q/28476139
score: 0

http://stackoverflow.com/comment/45490967
comment on: http://stackoverflow.com/q/28588388
score: 0
type: Comment
type: QuestionComment
has text: try to use the `gl.vertexAttrib4f(...)` instead of `gl.vertexAttrib1f(...)`. I get a similar problem here: http://stackoverflow.com/questions/28584589/why-i-cant-use-uniform1f-instead-of-uniform4f-for-the-gl-fragcolor-initializing (nobody answered still).

http://stackoverflow.com/a/28519774
has comment: http://stackoverflow.com/comment/45356540
type: Answer
accepted answer of: http://stackoverflow.com/q/28519708
has comment: http://stackoverflow.com/comment/45357840
answers question: http://stackoverflow.com/q/28519708
score: 5
upvote count: 5
has body: In JavaScript, all bitwise operations (and &amp; among them) return signed 32-bit integer as a result, in the range −231 through 231−1, inclusive. That's why you have that extra bit (0xde000000 is greater than 0x7ffffff) representing a sign now, meaning that you get a negative value instead. One possible fix: var r = 0xdeadbeef &amp; 0xff000000; if (r &lt; 0) { r += (1 &lt;&lt; 30) * 4; } console.log( r.toString(16) ); // 'de000000'
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45429396
score: 0
type: AnswerComment
has text: right -- but my source is in shivaji font which the tool @ http://hindi-fonts.com/tools/shivaji-to-Unicode-Converter is good at doing -- any idea how to invoke this code
type: Comment
comment on: http://stackoverflow.com/a/28558022

http://stackoverflow.com/comment/45445425
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28567563
has text: What does `changeClass()` do? Add a class to element?

http://stackoverflow.com/comment/45311560
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28495870
has text: Are you suggesting of using filter only in one level and other levels handle by recursion and loop?
score: 0

http://stackoverflow.com/a/28450003
has comment: http://stackoverflow.com/comment/45227937
has body: Call getResult() on DOM Ready as well &lt;script&gt; jQuery().ready(function(){ getResult(); setInterval("getResult()",60000); }); function getResult(){ jQuery.post("messages.php",function( data ) { jQuery("#msgs").html(data); }); } &lt;/script&gt; &lt;div id="msgs"&gt; &lt;/div&gt;
type: Answer
score: 1
answers question: http://stackoverflow.com/q/28449940
upvote count: 1
downvote count: 0

http://stackoverflow.com/a/28513213
has comment: http://stackoverflow.com/comment/45345880
score: 0
has comment: http://stackoverflow.com/comment/45345436
has comment: http://stackoverflow.com/comment/45347126
type: Answer
answers question: http://stackoverflow.com/q/28512552
has body: $(function() { $("#placeholder").remove(); var margin = {top: 20, right: 20, bottom: 30, left: 40}, width = 960 - margin.left - margin.right, height = 500 - margin.top - margin.bottom; // X is the horizontal axis var x0 = d3.scale.ordinal() // ordinal for non quantitative scales, like names, categories .rangeRoundBands([0, width], .1); // Width of each individual bar? var x1 = d3.scale.ordinal(); var y = d3.scale.linear() .range([height, 0]) // These are the colors var color = d3.scale.ordinal() // .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); .range(["#001F4C", "#003D99", "#005CE6", "#0066FF", "#3385FF", "#80B2FF", "#CCE0FF", "#E6F0FF"]); var xAxis = d3.svg.axis() .scale(x0) .orient("bottom"); var yAxis = d3.svg.axis() .scale(y) .orient("left") // Where the Y axis goes, you'll want it on the left // .tickFormat(d3.format(".1s")); .ticks(6); //.tickValues([0, 1, 2, 3, 4, 5]); var svg = d3.select("body").append("svg") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom) .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); // Bar chart data var csvData = [ {"State":"Co-op","Broccoli":2027307,"Cauliflower":3277946,"Celery":1420518,"Strawberries":2454721,"Oranges":7017731,"Tomatoes":5656528,"Lemons":2472223, "Lettuce":2472223, "Cucumber":2472223}, {"State":"Safeway","Broccoli":2704659,"Cauliflower":4499890,"Celery":2159981,"Strawberries":3853788,"Oranges":10604510,"Tomatoes":8819342,"Lemons":4114496, "Lettuce":2472223, "Cucumber":2472223}, {"State":"Sobeys","Broccoli":1140516,"Cauliflower":1938695,"Celery":925060,"Strawberries":1607297,"Oranges":4782119,"Tomatoes":4746856,"Lemons":3187797, "Lettuce":2472223, "Cucumber":2472223}, {"State":"Superstore","Broccoli":1208495,"Cauliflower":2141490,"Celery":1058031,"Strawberries":1999120,"Oranges":5355235,"Tomatoes":5120254,"Lemons":2607672, "Lettuce":2472223, "Cucumber":2472223}, ]; // Food Prices // var…

http://stackoverflow.com/q/28517500
has title: Confirm HTTP Request Sent
has comment: http://stackoverflow.com/comment/45352292
has answer: http://stackoverflow.com/a/28518739
tagged with: http
type: Question
has comment: http://stackoverflow.com/comment/45354982
tagged with: javascript
has body: I am using the $http get from Angular, I want to confirm that a http request is sent to our API. I am aware of the .success method but this waits for a return, is there a way to just get the $http object to confirm the request has been sent?
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45352220
has comment: http://stackoverflow.com/comment/45352246
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45352258
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45352248
has comment: http://stackoverflow.com/comment/45352412

http://stackoverflow.com/a/55470826
has body: In Chart.Js 2.8.0, the configuration for custom tooltips can be found here: https://www.chartjs.org/docs/latest/configuration/tooltip.html#label-callback (Thanks to @prokaktus) If you want to e.g. show some values with a prefix or postfix (In the example, the script adds a unit of kWh to the values in the chart), you could do this like: options: { rotation: 1 * Math.PI, circumference: 1 * Math.PI, tooltips: { callbacks: { label: function(tooltipItem, data) { console.log(data); console.log(tooltipItem); var label = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index] || ''; if (label) { label += ' kWh'; } return label; } } } } An example fiddle is here, too: https://jsfiddle.net/y3petw58/1/
upvote count: 4
answers question: http://stackoverflow.com/q/28568773
downvote count: 0
type: Answer
score: 4

http://stackoverflow.com/q/28554725
score: 1
tagged with: scroll
has body: Im trying to mimic the functionality of this site https://moto360.motorola.com/ When you scroll down on that page it just jumps to the next "screen" and if you scroll up it jumps back up. My JS is here : var currentDiv = "Home"; var latestScroll = 0; var scrollable = true; $(document).ready(function(){ $("#HomeLink").addClass("activeNav"); $(".navLink").click(function(){ $(".navLink").removeClass("activeNav"); $(this).addClass("activeNav"); var divID = $(this).attr("data-linkID"); scrollTo(divID); }); $(window).scroll(function(){ console.log(scrollable); if (scrollable==true){ var currentScroll = $(window).scrollTop(); if (currentScroll > latestScroll){ scrollable = false; //downscroll if(currentDiv!="About"){ var nextDiv = $("#"+currentDiv).next()[0]; var nextDivID = $(nextDiv).attr("id"); scrollTo(nextDivID); } }else{ scrollable = false; //upscroll if(currentDiv!="Home"){ var prevDiv = $("#"+currentDiv).prev()[0]; var prevDivID = $(prevDiv).attr("id"); scrollTo(prevDivID); } } } }); }); function scrollTo(divID){ currentDiv = divID; var target = $("#"+divID); $('html,body').animate({ scrollTop: target.offset().top }, 500); setTimeout(function() { // Do something after 2 seconds latestScroll = target.offset().top; scrollable = true; }, 2000); } My problem is that once it starts scrolling it jumps to the next screen but then when the jQuery animate is running it registers more scrolls and then just keeps jumping. I've tried adding the boolean scrollable and even a timeout when setting that back to true but it still will jump at least twice. HTML : ZEPPA INFO ABOUT US Anyone have any ideas on how to fix this? I cannot seem to find a way to get it to only register the scrolling once and then reset itself nicely. I have a fiddle here: http://jsfiddle.net/a1cpx2cf/
type: Question
has title: Use $(window).scroll function to jump to divs on a page
tagged with: javascript
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28562297
accepted answer: http://stackoverflow.com/a/28562297
downvote count: 0

http://stackoverflow.com/q/28453686
has answer: http://stackoverflow.com/a/28454013
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/28476514
score: 0
accepted answer: http://stackoverflow.com/a/28476514
has title: Using MapBox wms with ArcGis
tagged with: arcgis
tagged with: mapbox
has body: I am using MapBox and are hoping to present some data from an ArcGis WMS service. It seems to be working fine, except that the projections are all wrong. Mapbox takes in an URL for the service and adds querystring parameters based on the current map view, before sending it to the WMS service. It adds bbox=1115369.116737292,9392582.035682455,1134936.995978297,9412149.914923461 when it should have been something like: bbox=260427.3772,7137390.031000003,261695.991099999,7138611.94860001 I have written a function that overrides the wms Mapbox function, where I am can make adjustments, so all I need is the correct algorithm. It has to take zooming into account.
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28454013

http://stackoverflow.com/q/28440376
possible better answer: http://stackoverflow.com/a/28440445
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28440445
has body: I have a list of check-boxes that I want their content toggled when checked. I have wrote it using jQuery but I would like somehow optimize my code in a way that I don't have to write a function for each check-box. $(document).ready(function() { $("#purpose-1").click(function() { $("#purpose-detail-1").toggle(this.checked); }).triggerHandler('click'); $("#purpose-2").click(function() { $("#purpose-detail-2").toggle(this.checked); }).triggerHandler('click'); $("#purpose-3").click(function() { $("#purpose-detail-3").toggle(this.checked); }).triggerHandler('click'); }); Exhibition Title: Opening Date: Publication Title: Event Title: Event Date: Event Time:
type: Question
has title: Multiple checkboxes toggle using jquery
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28440459
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28440459
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45280094
type: AnswerComment
comment on: http://stackoverflow.com/a/28478673
type: Comment
has text: @charlietfl: What browsers? `document.location` seems to be supported [on all major browsers](https://developer.mozilla.org/en-US/docs/Web/API/document.location#Browser_compatibility)
score: 0

http://stackoverflow.com/comment/45408737
type: Comment
type: QuestionComment
has text: Please update the question with this code, Its not readable here.
score: 0
comment on: http://stackoverflow.com/q/28547788

http://stackoverflow.com/comment/45478962
comment on: http://stackoverflow.com/a/28585648
type: Comment
has text: @lascort changes made
score: 0
type: AnswerComment

http://stackoverflow.com/q/28465330
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28465410
has comment: http://stackoverflow.com/comment/45256363
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28465403
has answer: http://stackoverflow.com/a/28465403
tagged with: angularjs
has answer: http://stackoverflow.com/a/28465410
has body: I don't know what I am doing wrong here, can anyone see what I am doing wrong? I just want to pass my form inputs (in this case a date picker) to a controller function, but everything I try to access just shows up as undefined! Here is my form &lt;form ng-submit="showRefinedGameMarkers(refinements)"&gt; &lt;div class="list"&gt; &lt;div class="datepickers"&gt; From Date: &lt;label class="item item-input"&gt; &lt;input ng-controller="DatepickerCtrl" type="text" placeholder="Pick date" ng-model="refinements.from_datepicker" name="from_datepicker" ng-click="opendateModal()" readonly&gt; &lt;/label&gt; &lt;/div&gt; Here is my controller class .controller('MapController', function($scope, $ionicLoading, gameFactory, $compile) { $scope.showRefinedGameMarkers = function(refinements) { $scope.refinements = refinements; console.log($scope.refinements); ... } }) Everything I have tried is just showing up as undefined, so annoying! Any help would be greatly appreciated thank you
type: AnsweredQuestion
has title: Angular $scope undefined on form submit
tagged with: angularjs-scope
tagged with: ionic-framework
type: Question

http://stackoverflow.com/a/28544232
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45404699
has comment: http://stackoverflow.com/comment/45404748
has body: Check out this jsfiddle Question 1: You need to identify the parent row and grab the data you need and set the values of the inputs. A framework such as handlebars or even underscore.js provide the use of templates which make this process simpler in terms of populating the DOM. var elButton = $(this); var id = elButton.data('id'); var row = elButton.closest('tr'); var data = { firstName: row.find('.firstName').text(), lastName: row.find('.lastName').text(), handle: row.find('.handle').text(), id: id } Question 2: (Note: I'm assuming you mean to a database). You'll need to collect the data from the modal in much the same way we did for the row. Select the values from the modal you want to save and send them via a HTTP request to your server. var data = { firstName: $('#firstName').val(), lastName: $('#lastName').val(), handle: $('#handle').val(), checkinId: $('#checkinId').val() }; $.ajax({ type: "POST", url: "http://yoururl.io/api/location", data: data }); Question 3: (Note: I'm assuming your data is coming from a data source). You can have a function which loads the data using a HTTP request. Simply call this function again which will pull the latest data from your datasource. // Populate the table $.ajax({ type: "GET", url: "http://yoururl.io/api/location", success: function(data) { // Populate the table. e.g. loop over all data items in request response // and create a td for each item } });
has comment: http://stackoverflow.com/comment/45404962
upvote count: 2
answers question: http://stackoverflow.com/q/28543144
has comment: http://stackoverflow.com/comment/45404789
type: Answer
has comment: http://stackoverflow.com/comment/45405034

http://stackoverflow.com/q/28470476
downvote count: 0
tagged with: maps
has title: Do embedded GeoJSON styles work with Mapbox GL?
type: Question
type: AnsweredQuestion
score: 3
has body: Is it possible to utilize the built-in properties attribute of a GeoJSON data source to automatically style a Mapbox GL map without having to pre-specify a style? I have a use case where I dynamically load in GeoJSON LineString data that needs to be a particular color and it already has style data built in: {"properties": {"color": "#ffff33"... Right now, I have a rather inelegant setup where the relevant color is parsed out, translated into a style, and added to the map upon every load: $scope.patternPropToStyle = function(props) { var id = 'pattern' + props.pid; var style = { "id": id, "type": "line", "source": id, "render": { "$type": "LineString", "line-join": "round", "line-cap": "round" }, "paint": { "line-color": props.color, "line-width": 8 } } $scope._mapStyle.layers.push(style); $scope._map.setStyle($scope._mapStyle); } I feel like there has to be a better way to do this.
answer count: 1
tagged with: javascript
favorite count: 0
upvote count: 3
tagged with: mapbox-gl-js
has answer: http://stackoverflow.com/a/28488679
accepted answer: http://stackoverflow.com/a/28488679
tagged with: mapbox

http://stackoverflow.com/q/28552387
has answer: http://stackoverflow.com/a/28572435
downvote count: 0
tagged with: jquery
favorite count: 0
has body: first i' m sorry in advance i'm new in javascript :p i' m trying to integrate the virtualscroll.js i found here in my webpage no problem for the moment but ... I can' t find a solution for integrate this script to all my page and have my home section that taking 100% of the browser :/ also i can' t find how to keep my menu having a scroll spy ( when i m scrolling on the page the underline of the menu move automatically ) i saw examples of the effect i want like: http://www.studiofatale.com the home page is always in 100% of the browser :/ i understand that i can' t get all my section at 100% of the browser but i only need my home page like that SO there is my website code: // JavaScript Document /* * jQuery One Page Nav Plugin * http://github.com/davist11/jQuery-One-Page-Nav * * Copyright (c) 2010 Trevor Davis (http://trevordavis.net) * Dual licensed under the MIT and GPL licenses. * Uses the same license as jQuery, see: * http://jquery.org/license * * @version 3.0.0 * * Example usage: * $('#nav').onePageNav({ * currentClass: 'current', * changeHash: false, * scrollSpeed: 750 * }); */ ;(function($, window, document, undefined){ // our plugin constructor var OnePageNav = function(elem, options){ this.elem = elem; this.$elem = $(elem); this.options = options; this.metadata = this.$elem.data('plugin-options'); this.$win = $(window); this.sections = {}; this.didScroll = false; this.$doc = $(document); this.docHeight = this.$doc.height(); }; // the plugin prototype OnePageNav.prototype = { defaults: { navItems: 'a', currentClass: 'current', changeHash: false, easing: 'swing', filter: '', scrollSpeed: 750, scrollThreshold: 0.5, begin: false, end: false, scrollChange: false }, init: function() { // Introduce defaults that can be extended either // globally or using an object literal. this.config = $.extend({}, this.defaults, this.options, this.metadata); this.$nav = this.$elem.find(this.config.navItems); //Filter any links out of the nav if(this.config.filter !== '') { thi…
has comment: http://stackoverflow.com/comment/45420424
type: UnansweredQuestion
score: 1
tagged with: scroll
upvote count: 1
type: Question
has title: Integration Virtualscroll.js
tagged with: javascript
has comment: http://stackoverflow.com/comment/45420218
has comment: http://stackoverflow.com/comment/45662794
has answer: http://stackoverflow.com/a/28553956
answer count: 2

http://stackoverflow.com/comment/45395954
comment on: http://stackoverflow.com/q/28460069
score: 0
has text: Fixed question. But the problem was that i didn't really know that event bubbling was the issue, hens the strange question :/
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45251720
has text: Does it only have to check 1, 7 and 99?
comment on: http://stackoverflow.com/q/28462953
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28499399
downvote count: 0
type: Answer
has body: You can use mongodb's getIndexes method. meteor mongo db.files.getIndexes() Or you can use mongodb's cursor explain. meteor mongo db.files.find(&lt;query&gt;).explain()
answers question: http://stackoverflow.com/q/28498807
has comment: http://stackoverflow.com/comment/45319029
upvote count: 1
score: 1

http://stackoverflow.com/comment/45328784
comment on: http://stackoverflow.com/a/28501296
type: AnswerComment
has text: Thanks Andy and no worries Mac. I think I understand. I'm passing out - I just finished an all nighter . . .
type: Comment
score: 2

http://stackoverflow.com/a/28447274
has comment: http://stackoverflow.com/comment/45223493
has body: You are running into race-condition issues because of using 'forEach'. Instead of getting all the rows into 'rows', use a 'cursor' instead. You can see the following answer for implementation which is similar to your use-case : https://stackoverflow.com/a/18119789/802651
answers question: http://stackoverflow.com/q/28447211
has comment: http://stackoverflow.com/comment/45223371
type: Answer
score: 0

http://stackoverflow.com/a/28551136
score: 1
has comment: http://stackoverflow.com/comment/45415371
has comment: http://stackoverflow.com/comment/45415825
upvote count: 3
downvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28551080
has body: moment.js is a nice library that handles datetime stuff related in JS. You should try it. http://momentjs.com/ moment("any datetime string", "format of input string").format('YYYY-MM-DD HH:mm:ss'); moment("02/16/2015 10:51 PM").format("YYYY-MM-DD HH:mm:ss") // 2015-02-16 22:51:00
answers question: http://stackoverflow.com/q/28551080
type: Answer

android
tags question: http://stackoverflow.com/q/28587842
tags question: http://stackoverflow.com/q/28464389
tags question: http://stackoverflow.com/q/28472717
tags question: http://stackoverflow.com/q/28556538
tags question: http://stackoverflow.com/q/28575114
tags question: http://stackoverflow.com/q/28518309
tags question: http://stackoverflow.com/q/28492990
tags question: http://stackoverflow.com/q/28490077
tags question: http://stackoverflow.com/q/28523169
tags question: http://stackoverflow.com/q/28517308
tags question: http://stackoverflow.com/q/28455004
tags question: http://stackoverflow.com/q/28559491
tags question: http://stackoverflow.com/q/28560636
tags question: http://stackoverflow.com/q/28525920
tags question: http://stackoverflow.com/q/28565069
tags question: http://stackoverflow.com/q/28471648
tags question: http://stackoverflow.com/q/28549157
tags question: http://stackoverflow.com/q/28519340
tags question: http://stackoverflow.com/q/28587298
tags question: http://stackoverflow.com/q/28503943
tags question: http://stackoverflow.com/q/28566580
tags question: http://stackoverflow.com/q/28450179
tags question: http://stackoverflow.com/q/28500850
tags question: http://stackoverflow.com/q/28559463
tags question: http://stackoverflow.com/q/28484848
tags question: http://stackoverflow.com/q/28578508
tags question: http://stackoverflow.com/q/28513804
tags question: http://stackoverflow.com/q/28577199
tags question: http://stackoverflow.com/q/28481604
tags question: http://stackoverflow.com/q/28437397
tags question: http://stackoverflow.com/q/28569789
tags question: http://stackoverflow.com/q/28439771
tags question: http://stackoverflow.com/q/28537894
tags question: http://stackoverflow.com/q/28496813
tags question: http://stackoverflow.com/q/28573480
tags question: http://stackoverflow.com/q/28514123
tags question: http://stackoverflow.com/q/28516658
tags question: http://stackoverflow.com/q/28515237
tags question: http://stackoverflow.com/q/28546149
tags question: http://stackoverflow.com/q/28535013
tags question: http://stackoverflow.com/q/28471711
tags question: http://stackoverflow.com/q/28532215
tags question: http://stackoverflow.com/q/28507072
tags question: http://stackoverflow.com/q/28437599
tags question: http://stackoverflow.com/q/28574354
tags question: http://stackoverflow.com/q/28532520
tags question: http://stackoverflow.com/q/28510878
tag name: android
tags question: http://stackoverflow.com/q/28556765
tags question: http://stackoverflow.com/q/28492443
tags question: http://stackoverflow.com/q/28499198
tags question: http://stackoverflow.com/q/28480067
type: Tag
tags question: http://stackoverflow.com/q/28540128

http://stackoverflow.com/q/28534426
possible better answer: http://stackoverflow.com/a/28534885
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: sorting
has body: It might sounds weird. I would like to know if it's possible to sort a table by clicking on the side menu link and not from the table header. I know that we can sort, make pagination... inside the table by using some jQuery libraries. But my request here is to sort from the side menu and not from the table header. blabla blabla blabla blabla
has answer: http://stackoverflow.com/a/28534885
favorite count: 0
has answer: http://stackoverflow.com/a/28534767
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28534932
score: 2
has title: Sort table from side menu
upvote count: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28534932
type: Question
tagged with: html-table
has comment: http://stackoverflow.com/comment/45384180

http://stackoverflow.com/comment/45369761
type: QuestionComment
comment on: http://stackoverflow.com/q/28527052
has text: Possibly the browser’s popup blocker at work, because it as attempted to open a new window without user interaction.
score: 0
type: Comment

http://stackoverflow.com/a/28544659
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28543489
has body: You can achieve the same skew appearance by using a linear gradient on a pseudo-element. *, ::after, ::before { box-sizing: border-box; margin: 0; padding: 0; } ul { width: 200px; background: #663399; margin: 25px auto; list-style-type: none; position: relative; } ul::after { position: absolute; content: ""; top: 0; left: 100%; background: linear-gradient(to bottom right, #663399 0%, #663399 50%, transparent 50%, transparent 100%); width: 16px; height: 100%; } ... ... ... ... ... ... ... ... ...
answers question: http://stackoverflow.com/q/28543489

http://stackoverflow.com/comment/45390468
score: 1
comment on: http://stackoverflow.com/q/28538062
type: Comment
type: QuestionComment
has text: are you sure js file path is correct?

http://stackoverflow.com/a/28476815
answers question: http://stackoverflow.com/q/28476576
type: Answer
has body: This will do : http://jsfiddle.net/oL83m567/1/ var count = 0; function countClicks() { count = count + 1; var tick=''; for(var i=0;i&lt;count;i++) tick+= '&amp;#x2714'; document.getElementById("p2").innerHTML = count + tick; }
score: 0

http://stackoverflow.com/a/28581005
has comment: http://stackoverflow.com/comment/45474176
answers question: http://stackoverflow.com/q/28580687
score: 0
has comment: http://stackoverflow.com/comment/45474408
has body: try with document.querySelectorAll(".takings"); rather than document.getElementsByClassName("takings"); querySelectorAll() Method supports IE9 on words More Reference this , this Update We can use getElementsByClassName() in IE6,7,8 there is already a discussion in stackoverflow about this topic so if you want to do something like that then refer this
has comment: http://stackoverflow.com/comment/45474990
has comment: http://stackoverflow.com/comment/45474699
type: Answer
has comment: http://stackoverflow.com/comment/45474275
has comment: http://stackoverflow.com/comment/45474372

http://stackoverflow.com/comment/45222367
type: Comment
has text: just 'HttpPostedFileBase TestImage' ? what about my viewmodel and all its data?
comment on: http://stackoverflow.com/q/28446398
score: 0
type: QuestionComment

http://stackoverflow.com/q/28477348
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28483626
has body: I want to find phone numbers (written in a german way) in a text. I almost finished my javascript regex to find them. This is the regular expression: (((((((00|\+)[0-9]{1,3}[ \-/]?)|0)[ ]?[1-9][0-9]{1,4})[ ]?[\-/]?[ ]?)|((((00|\+)[0-9]{1,3}[ ]?\()|\(0)(\)|[ ]?[1-9][0-9]{1,4}\))[ ]?[\-/]?[ ]?))[0-9]{1,7}([ \-/]?[0-9]{1,5}){0,4}) But now I want to add 2 more things: It should exclude phone numbers with less than 9 digits. I tried to add (?=(.*?\d){9,}) in front of the whole expression. That solution works for 01234 but not for +33 (33) 3) if there are some more numbers following. So what is my mistake? It should exclude numbers without any whitespace (like +49123123123). How can I realize that? To understand better what my intention is, I prepared a demo: Regex101 Test case: +33 (33) 3)44444444444 //the found string has only 5 digits, but it shouldn't be found because of (?=(.*?\d){9,}) +49123123123 //how can I exclude that, because there is no white space in the middle // this is the part where I test all the other phone numbers, if you are interested in: //it should match these phone numbers: testword +49 30 12345-67 testword testword+49 (0)30 12345-67 (0)30 12345-67 (0)30 123 234 (0123)30 12345-67 test (021)30 123 234 s030 12345-67 dsd (030) 12345 55 99testword testword (030) 12345 44 0351 4640-123 09623 12 3 33 09234 1233 +49 123 1 2 12 31 0049 2123 1231 +1 3519 1231 0 30 / 12 34 56 0 30 / 12 34 56 030 / 12 34 56 0123 / 12312 123 testword 0178 1232231 +490 178 1232231 testword +36 (351)4740-991 testword testword +36(351) 4740-991 testword 09623 12333 testword should NOT match (with the reason why it shouldn't match): +49123123123 //because there is no white space 01781232231 //because there is no white space 123456 //because it doesn't have at least 9 digits and no white space 123.123 //because it has a dot 12-12-12 //because there is no white space and there is more than one dash 12-12 -12-12-12 //because there is more than one dash 1990 - 2000 //because it doesn…
has title: find german phone numbers in a text
tagged with: regex
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45277752
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45277566
type: Question
has answer: http://stackoverflow.com/a/28483626
tagged with: javascript
tagged with: phone-number
score: 0

http://stackoverflow.com/comment/45265057
has text: Where is the element which has `accordion` id? Can you make an online demo of your code?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28470078
score: 0

http://stackoverflow.com/a/67374619
answers question: http://stackoverflow.com/q/28518494
score: 0
has body: const age = parseInt(prompt("Cuantos años tienes?")); const acompanied = confirm("Vas a compañado de una persona adulta?"); if (age &gt;= 13 || (age &lt; 13 &amp;&amp; acompanied)) { alert("Puedes entrar"); } else { alert("No puedes entrar"); }
has comment: http://stackoverflow.com/comment/119102966
type: Answer
has comment: http://stackoverflow.com/comment/119087476

charts
tags question: http://stackoverflow.com/q/28482768
tags question: http://stackoverflow.com/q/28561996
tags question: http://stackoverflow.com/q/28506602
tags question: http://stackoverflow.com/q/28444407
tags question: http://stackoverflow.com/q/28525379
tags question: http://stackoverflow.com/q/28541386
type: Tag
tags question: http://stackoverflow.com/q/28573154
tags question: http://stackoverflow.com/q/28499475
tags question: http://stackoverflow.com/q/28442334
tags question: http://stackoverflow.com/q/28499750
tags question: http://stackoverflow.com/q/28456973
tags question: http://stackoverflow.com/q/28579037
tags question: http://stackoverflow.com/q/28437413
tags question: http://stackoverflow.com/q/28578792
tags question: http://stackoverflow.com/q/28552087
tags question: http://stackoverflow.com/q/28477648
tags question: http://stackoverflow.com/q/28515465
tags question: http://stackoverflow.com/q/28485516
tags question: http://stackoverflow.com/q/28474774
tags question: http://stackoverflow.com/q/28449394
tag name: charts
tags question: http://stackoverflow.com/q/28582797
tags question: http://stackoverflow.com/q/28559117
tags question: http://stackoverflow.com/q/28488808
tags question: http://stackoverflow.com/q/28555986
tags question: http://stackoverflow.com/q/28440838
tags question: http://stackoverflow.com/q/28592552

http://stackoverflow.com/a/28587689
score: 1
has comment: http://stackoverflow.com/comment/45483353
has comment: http://stackoverflow.com/comment/45483794
has body: The load() method loads data from a server and puts the returned data into the selected element. from http://www.w3schools.com/jquery/jquery_ajax_load.asp Correct sintax: $( "#result" ).load( "ajax/test.html" ); And you have to correct your code, you have .../script.php instead of ../script.php
upvote count: 1
answers question: http://stackoverflow.com/q/28587358
has comment: http://stackoverflow.com/comment/45484669
has comment: http://stackoverflow.com/comment/45484228
has comment: http://stackoverflow.com/comment/45484136
type: Answer
downvote count: 0

http://stackoverflow.com/comment/45210844
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28440369
has text: What kind of image is it? To send it to the client, you'll need to know what content-type the image is (JPEG, PNG, GIF, ICO)?
score: 0

http://stackoverflow.com/comment/45390609
score: 0
has text: @EhsanSajjad i had tried but again the same situation, i think sample.js i not detecting but i don't know where i loose
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28538062

http://stackoverflow.com/comment/115850461
type: AnswerComment
has text: @ruffin Thank you for pointing this one out! In addition, it's worth mentioning this opensource Chrome plugin CORS Unblock is also available on Firefox and Microsoft Edge.
type: Comment
comment on: http://stackoverflow.com/a/38000615
score: 0

http://stackoverflow.com/a/28448365
answers question: http://stackoverflow.com/q/28440507
upvote count: 1
has comment: http://stackoverflow.com/comment/48582290
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28440507
has body: Pebble.js streams the data of lists to the watch on demand. Six seconds sound like a lot and I have not seen that much delay but there is not much you can do short of re-building your app with the C SDK.
score: 1

http://stackoverflow.com/comment/45337356
comment on: http://stackoverflow.com/a/28509123
score: 0
type: AnswerComment
has text: Like this: $("#mp3").attr("src", tempMp3).load();?
type: Comment

http://stackoverflow.com/q/28553744
type: Question
accepted answer: http://stackoverflow.com/a/28554057
type: AnsweredQuestion
score: 0
answer count: 1
has title: How to display the jQuery Autocomplete response and select it?
tagged with: autocomplete
has body: I hope you can help me with this. I am creating an Ajax autocomplete in my search form. I can get the response array. But I am having a hard time in displaying it in the UI. I can only get is the word 'undefined'. What I want is to perform an Ajax autocomplete then from that the user can select from the suggestions. Here's my code so far. $("#search-shop-input").autocomplete({ source: function(request, response) { $.ajax({ url: 'index.php?route=seller/seller/getSellerNames', dataType: 'json', type: 'post', data: { keyword: request }, success: function(data) { var d = ''; $.each(data.shops, function(key,value) { $.each(value, function(k,v) { console.log(k + ":" + v); //want to get username only }); }); //response(d); } }); }, select: function(event, ui) { $("#seller_list").val(ui.item.label); return false; }, autoFocus: true, min_length: 0 }); SAMPLE OUTPUT: shops: [{user_id: "162", username: "F_Francium_1"}, {user_id: "163", username: "F_Francium_2"},…]
tagged with: jquery-ui-autocomplete
has answer: http://stackoverflow.com/a/28554057
tagged with: javascript
tagged with: jquery
tagged with: ajax

http://stackoverflow.com/q/28568346
has title: Add a document to parent folder?
favorite count: 0
has answer: http://stackoverflow.com/a/28568542
tagged with: google-api-nodejs-client
upvote count: 1
tagged with: node.js
type: AnsweredQuestion
has body: How do I add this doc to a parent folder? The following doesn't work. drive.files.insert({ convert: true, parents: [ { "id":parentId } ], resource: { title: title, mimeType: 'text/csv', }, media: { mimeType: 'text/csv', body: body, } }, function(){ console.log(arguments) })
score: 1
accepted answer: http://stackoverflow.com/a/28568542
type: Question
downvote count: 0
tagged with: javascript
answer count: 1

http://stackoverflow.com/a/28572435
answers question: http://stackoverflow.com/q/28552387
type: Answer
has body: there is the virtual scroll js var VirtualScroll = (function(document) { var vs = {}; var numListeners, listeners = [], initialized = false; var touchStartX, touchStartY; // [ These settings can be customized with the options() function below ] // Mutiply the touch action by two making the scroll a bit faster than finger movement var touchMult = 2; // Firefox on Windows needs a boost, since scrolling is very slow var firefoxMult = 15; // How many pixels to move with each key press var keyStep = 120; // General multiplier for all mousehweel including FF var mouseMult = 1; var bodyTouchAction; var hasWheelEvent = 'onwheel' in document; var hasMouseWheelEvent = 'onmousewheel' in document; var hasTouch = 'ontouchstart' in document; var hasTouchWin = navigator.msMaxTouchPoints && navigator.msMaxTouchPoints > 1; var hasPointer = !!window.navigator.msPointerEnabled; var hasKeyDown = 'onkeydown' in document; var isFirefox = navigator.userAgent.indexOf('Firefox') > -1; var event = { y: 0, x: 0, deltaX: 0, deltaY: 0, originalEvent: null }; vs.on = function(f) { if(!initialized) initListeners(); listeners.push(f); numListeners = listeners.length; } vs.options = function(opt) { keyStep = opt.keyStep || 120; firefoxMult = opt.firefoxMult || 15; touchMult = opt.touchMult || 2; mouseMult = opt.mouseMult || 1; } vs.off = function(f) { listeners.splice(f, 1); numListeners = listeners.length; if(numListeners <= 0) destroyListeners(); } var notify = function(e) { event.x += event.deltaX; event.y += event.deltaY; event.originalEvent = e; for(var i = 0; i < numListeners; i++) { listeners[i](event); } } var onWheel = function(e) { // In Chrome and in Firefox (at least the new one) event.deltaX = e.wheelDeltaX || e.deltaX * -1; event.deltaY = e.wheelDeltaY || e.deltaY * -1; // for our purpose deltamode = 1 means user is on a wheel mouse, not touch pad // real meaning: https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent#Delta_modes if(isFirefox && e.deltaMode == 1) { event.deltaX *…
score: 0

http://stackoverflow.com/comment/45370396
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28527086
has text: just do window.onresize https://developer.mozilla.org/en-US/docs/Web/API/Window.onresize
type: Comment

http://stackoverflow.com/q/28518181
upvote count: 41
has answer: http://stackoverflow.com/a/28520497
accepted answer: http://stackoverflow.com/a/28520497
has answer: http://stackoverflow.com/a/28522944
type: AnsweredQuestion
score: 41
has title: Angular ui-router: how to prevent access to a state
has body: Hello I'm new to angularJS and have been trying to prevent access to certain states based on user critera. This, from ui-router's FAQ describes exactly what I want to do, but I cant get it to work properly. What do I need to but in the data object exactly to accomplish this? (I saw someone throwing in "true" on some blog post tutorial and using it like how I have, but that doesnt seem to work because I get an error that says needAdmin is not defined) Here is my code: angular.module('courses').config(['$stateProvider', function($stateProvider) { // Courses state routing $stateProvider. state('listCourses', { url: '/courses', templateUrl: 'modules/courses/views/list-courses.client.view.html' }). state('createCourse', { url: '/courses/create', templateUrl: 'modules/courses/views/create-course.client.view.html', data: { needAdmin: true } }). state('viewCourse', { url: '/courses/:courseId', templateUrl: 'modules/courses/views/view-course.client.view.html' }). state('editCourse', { url: '/courses/:courseId/edit', templateUrl: 'modules/courses/views/edit-course.client.view.html', data: { needAdmin: true } }); } ]); angular.module('courses').run(['$rootScope', '$state', 'Authentication', function($rootScope, $state, Authentication) { $rootScope.$on('$stateChangeStart', function(e, to) { var auth = Authentication; console.log(auth.user.roles[0]); if (to.data.needAdmin &amp;&amp; auth.user.roles[0] !== 'admin') { e.preventDefault(); $state.go('/courses'); } }); }]);
type: Question
has comment: http://stackoverflow.com/comment/45354006
tagged with: angular-ui-router
has comment: http://stackoverflow.com/comment/45353819
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28522944
answer count: 2
downvote count: 0
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/a/28444774
answers question: http://stackoverflow.com/q/28443761
type: Answer
score: 3
upvote count: 3
has body: function Section (svgNode) { THREE.Object3D.call(this); ... Section.prototype = Object.create(THREE.Object3D.prototype); Section.prototype.constructor = Section; More info about the role of prototype and constructor functions here: Prototypical inheritance - writing up
has comment: http://stackoverflow.com/comment/45578830
has comment: http://stackoverflow.com/comment/45300187
accepted answer of: http://stackoverflow.com/q/28443761
downvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45316585

http://stackoverflow.com/comment/45387029
comment on: http://stackoverflow.com/q/28505453
has text: The website doesn't serve jsonp (only json) so you can't fetch it with a simple AJAX request. Instead you will need to read the file server-side on your webserver before you can read the contents (still with AJAX).
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45235079
comment on: http://stackoverflow.com/a/28454002
has text: That was actually pretty minimal. Don't think I could save any codelines by doing the same with underscore... Thank you.
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/comment/45281406
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28479474
has text: possible duplicate of [What type of DOM Element?](http://stackoverflow.com/questions/6114683/what-type-of-dom-element)
score: 0

http://stackoverflow.com/comment/45656038
comment on: http://stackoverflow.com/a/28681359
has text: Okay, that's perfect.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28553205
tagged with: ios
tagged with: javascript
has body: I have a iOS app based on Cordova/PhoneGap. When profiling my app with XCode Instruments I get the following output: You can see that the memory consumption is always increasing. Is there a way to detect my JavaScript memory leaks in my Cordova App?
score: 4
answer count: 1
has comment: http://stackoverflow.com/comment/48277406
favorite count: 0
tagged with: cordova
has title: Detect Memory Leaks in iOS Cordova 4.0 App
type: UnansweredQuestion
tagged with: memory-leaks
has answer: http://stackoverflow.com/a/42565653
tagged with: java
downvote count: 3
upvote count: 7
type: Question

objective-c
tags question: http://stackoverflow.com/q/28510047
type: Tag
tags question: http://stackoverflow.com/q/28535831
tags question: http://stackoverflow.com/q/28577286
tag name: objective-c
tags question: http://stackoverflow.com/q/28557949
tags question: http://stackoverflow.com/q/28472935

http://stackoverflow.com/comment/45490804
type: Comment
comment on: http://stackoverflow.com/a/28580948
score: 0
type: AnswerComment
has text: Hmmm I see that you did changes but hmmm it still dosn't work... :( when you load page the filter translate still replaces text in english... but it should be in chinese... :/

http://stackoverflow.com/comment/45340515
has text: Added a link (http://jsfiddle.net/at3eyLoL/). I had to modify the code a little so if checks it's an id in the `else if` part, but the issue is visible there.
type: QuestionComment
comment on: http://stackoverflow.com/q/28510620
score: 0
type: Comment

http://stackoverflow.com/comment/45332811
type: QuestionComment
comment on: http://stackoverflow.com/q/28504389
score: 0
type: Comment
has text: Any javascript error, apache log, etc.?

http://stackoverflow.com/q/28455040
type: Question
tagged with: c#
upvote count: 1
downvote count: 0
tagged with: javascript
tagged with: devexpress
answer count: 1
accepted answer: http://stackoverflow.com/a/28488314
favorite count: 0
has body: I have a ribbon with a RibbonSpinEditItem that needs to display/set the number of minutes before a user is automatically logged out if he's been idle for that time. At the moment it's configured as below: themeGroup.Items.Add(MVCxRibbonItemType.SpinEditItem, i => { var spin = (RibbonSpinEditItem) i; spin.Text = "Log out after: "; spin.Name = "TimeBeforeIdle"; spin.PropertiesSpinEdit.MaxValue = 60; spin.PropertiesSpinEdit.MinValue = 5; spin.Size = RibbonItemSize.Small; spin.Value = ModelSessionHelper.TimeBeforeIdle; spin.PropertiesSpinEdit.ClientSideEvents.ValueChanged = "function(s,e){ alert("+ spin.Value + "); }"; }); The problem now is when I change the value of my item it still alerts the first value. Example: Original time: alert 20 +1: alert 20 +1: alert 20 Change to 50: alert 20 I'm guessing this is because the function with the alert is created at the moment my control gets created and uses the value the control has at that moment. So how do I get the alert to use the current value? If I have to use the s-parameter from my javascript function could someone please explain how to handle this? Because if I alert(s) I just get Object [Object]. And I don't know how to get the value of the control out of it? Kind regards.
has answer: http://stackoverflow.com/a/28488314
type: AnsweredQuestion
has title: Get Current Value of RibbonSpinEditItem
tagged with: asp.net-mvc
score: 1

http://stackoverflow.com/a/28558088
type: Answer
has comment: http://stackoverflow.com/comment/45428125
upvote count: 4
type: AcceptedAnswer
downvote count: 0
score: 4
accepted answer of: http://stackoverflow.com/q/28557930
has body: You're using angular, so you shouldn't be doing setInterval, but rather use the $interval service provided by Angular. That, coupled with the correct observation of @techfoobar, would result in the correct behavior you are looking for: app.service('ItemService', ['$interval', function($interval) { var items = [9000]; this.addItem = function () { items.push(Math.random()); } $interval(this.addItem, 5000); return { get: function() { return items; } } }]); Working Plunker.
answers question: http://stackoverflow.com/q/28557930

http://stackoverflow.com/q/28465902
type: Question
accepted answer: http://stackoverflow.com/a/28466004
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/45257508
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I have this code which is used for retrieving a value from some external resource, the problem is that when the value is displayed every character is in a new row and before every character there is a column with numbers, like a character counter. Current HTML display: 1 a 2 k 3 p 4 p 5 . I want to display it in a single row without counting numbers: akpp. I first tried removing the key and then value the value but then I only get numbers in new rows without the value. Part of the jquery code function prettydump(obj) { ret = "" $.each(obj, function(key, value) { ret += " " + key + " " + value + " "; }); return ret; } var info = $(' '); $(info).append($(' ').append(prettydump(data.result.path))); Any help would be highly appreciated!
has answer: http://stackoverflow.com/a/28466004
type: AnsweredQuestion
has title: jQuery retrieving results in one row instead of table rows
has comment: http://stackoverflow.com/comment/45257549

http://stackoverflow.com/comment/45298744
type: QuestionComment
has text: scope list (requested params):scope:'public_profile,email,user_about_me,user_birthday,user_friends,read_friendlists,user_hometown,user_education_history' version : 'v2.2' js.src = "//connect.facebook.net/en_US/sdk.js"
score: 0
comment on: http://stackoverflow.com/q/28465522
type: Comment

http://stackoverflow.com/a/28554917
answers question: http://stackoverflow.com/q/28546181
has body: I hope this JavaScript function solve your problem: function nodeToJSON(node) { if(!node.tagName) { return {}; } var key = node.className ? node.className : node.tagName.toLowerCase(); if(node.hasChildNodes && node.hasChildNodes()) { if(node.childNodes.length == 1 && node.childNodes[0].nodeType === 3) { var child = node.childNodes[0]; var value = child.wholeText ? child.wholeText.trim() : ""; } else { var value = []; for(var index in node.childNodes) { var child = node.childNodes[index]; if(!child.tagName) { continue; } if(child.tagName == "IMG") { value.push({img: child.src}); } if(child.tagName == "A") { value.push({a: child.href}); } else { value.push(nodeToJSON(child)); } } } } else { var value = ""; } var result = {}; result[key] = value; return result; } The function expect a selected HTML element (see DOM API), for example the whole HTML document: console.log(JSON.stringify(nodeToJSON(document.documentElement))); If you have a string input, convert it to a DOM. I use the innerHTML property: var html = document.createElement("html"); html.innerHTML = " headline my content "; nodeToJSON(html);
score: 0
has comment: http://stackoverflow.com/comment/45424931
type: Answer

http://stackoverflow.com/a/28584331
score: 0
answers question: http://stackoverflow.com/q/28582797
has body: You can prepare your own function to position ticks, it is tickPositioner
type: Answer
has comment: http://stackoverflow.com/comment/45481602

http://stackoverflow.com/a/28464801
has comment: http://stackoverflow.com/comment/45255327
downvote count: 1
answers question: http://stackoverflow.com/q/28464767
has body: location.assign(encodeURIComponent('/step2.php?id=1')); The problem is likely due to the value of your variables. If they contain special or invalid characters, those needs to be passed through encodeURIComponent before being assigned location.assign
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/45255254
score: 1

http://stackoverflow.com/q/28553863
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28553898
has body: I've been searching around Google for a while and can't seem to find an answer to this issue of mine. I'm also somewhat new to js, so there's probably an easier way or something obvious I'm missing. Here's what I'm doing: I want to create nine divs, and then put nine divs into each of those original nine. I have the following function: function createDivs() { for(i = 0; i &lt; 9; ++i) { var bigSquare = document.createElement("div"); document.body.appendChild(bigSquare); bigSquare.className = "square"; for(i = 0; i &lt; 9; ++i) { var smallSquare = document.createElement("div"); smallSquare.className = "pixel"; bigSquare.appendChild(smallSquare); } } } I thought this would create 9 groupings of 9 divs, those groupings being labeled under the class name "square" and the divs within each grouping being labeled with class name "pixel", but this isn't the case. Only one "bigSquare" div (containing nine "pixel" divs) is created instead of the nine that I want. I feel as if the creation of each new "bigSquare" div is simply replacing the previous one with each iteration of the loop, but I'm not sure. And it that was the case, I'm not sure how to work around it...any help? The way I've attempted to describe this is probably quite confusing :/
answer count: 3
accepted answer: http://stackoverflow.com/a/28553883
tagged with: createelement
tagged with: javascript
has answer: http://stackoverflow.com/a/28553884
score: 0
has title: Creating Objects and Appending Them to Dynamically Created Objects
has answer: http://stackoverflow.com/a/28553883
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28553884
type: Question

http://stackoverflow.com/comment/45322217
comment on: http://stackoverflow.com/a/28496886
type: Comment
score: 0
has text: Yes, that is what the example does: `img.onclick = function() {alert('Hello');};` The example is working, right?
type: AnswerComment

http://stackoverflow.com/comment/45392656
comment on: http://stackoverflow.com/q/28538406
score: 0
type: Comment
type: QuestionComment
has text: @JackieM I don't know if the padding is at fault, I've not had a chance to look at your code that closely. But it's generally a bad security decision to stray from standard solutions and switching to something standard would reduce your code base, thus narrowing the problem down.

http://stackoverflow.com/q/28545720
has comment: http://stackoverflow.com/comment/45406410
has answer: http://stackoverflow.com/a/28546030
has title: Setting session in php from value being set in the page
has comment: http://stackoverflow.com/comment/45406590
tagged with: php
type: AnsweredQuestion
tagged with: session
has comment: http://stackoverflow.com/comment/45406466
type: Question
has comment: http://stackoverflow.com/comment/45404848
has comment: http://stackoverflow.com/comment/45404898
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45404565
has comment: http://stackoverflow.com/comment/45404916
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/45406059
accepted answer: http://stackoverflow.com/a/28546030
has comment: http://stackoverflow.com/comment/45404759
answer count: 1
has body: I'm trying to set a php session onload $_SESSION["tusername"] = $_POST['ttuser']; however my value is being set in jQuery on $(function() { $('#ttuser').val(tusername); When the page is loaded, the session is not set as I believe the session is being set before the textbox value is set by jQuery. I tried using ajax to post a value to the page, but it doesn't retrieve it. The only way I am setting the session now is on a button click, the exact same way. Any ideas? Thanks in advance EDIT Here is the Function at the start where everything is set, as requested $(function() { // Initialize. If we are already logged in, there is no // need for the connect button Twitch.init({clientId: CLIENT_ID}, function(error, status) { if (status.authenticated) { // we're logged in :) $('.authenticatedd').removeClass('hidden'); } else { $('.welcometitle').html('Not yet connected with Twitch?'); // Show the twitch connect button $('.authenticate').removeClass('hidden'); } }); var token = Twitch.getToken(); $('.twitch-connect').click(function() { Twitch.login({ scope: ['user_read', 'channel_read', 'channel_editor', 'channel_commercial', 'user_subscriptions', 'channel_check_subscription'] }); }) Twitch.api({method: 'channel'}, function(error, channel) { $('#streamkey').text(channel.stream_key); }); Twitch.api({method: 'user'}, function(error, user) { var tusername = user.display_name; var tlogo = user.logo; $('#twitchname').text(tusername); $('#ttuser').val(tusername); $.get("setsession.php?ttuser="+tusername, function(){ }); console.log(tlogo); if (tlogo != null) $('#twitchlogo').attr('src', tlogo); $.cookie('logo', tlogo, { expires: 14, path: '/'}); $('.sidename').html('' + tusername + ' Logged in'); var currentdate = new Date(); var datetime = currentdate.getHours() + ":" + currentdate.getMinutes() + ":" + currentdate.getSeconds(); var items = []; items.push(' Status ' +datetime+ ' Logged in ') $('#eventlog').prepend( items.join('') ); }); });

http://stackoverflow.com/q/28448028
favorite count: 0
tagged with: angularjs
has title: how to get whole Date object from input date and input time in javascript
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28448361
downvote count: 0
score: 1
type: Question
has comment: http://stackoverflow.com/comment/45224691
answer count: 2
has answer: http://stackoverflow.com/a/28448189
accepted answer: http://stackoverflow.com/a/28448189
has answer: http://stackoverflow.com/a/28448361
has comment: http://stackoverflow.com/comment/45224834
tagged with: javascript
has body: I have these two inputs: &lt;input type="date" ng-model="year"&gt; &lt;input type="time" ng-model="time"&gt; I want to create a Date object from these two values. Something like this: new Date(year, time); how can I do that?
upvote count: 1

http://stackoverflow.com/comment/45244409
type: QuestionComment
type: Comment
has text: In other words, you're currently running your index.html from `C:/Users/Someguy/Desktop/Somefolder/index.html` directly in your browser. Instead, start a webserver that points localhost to `C:/Users/Someguy/Desktop/Somefolder/` and use localhost.
score: 1
comment on: http://stackoverflow.com/q/28458803

http://stackoverflow.com/a/28584415
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28580396
has body: I think this article may help you, it is all about nodejs server serving static content, so nginx is recommended to do this purpose. If you have to use nodejs server then you should make all files smaller in terms of size, no need for example to minimize libraries files as jquery since it is already minimized, scripts should be minimized only, you can even minimize all libs files into one javascript file called libs.min.js as example and the rest of your scripts in another file called script.min.js.
upvote count: 5
answers question: http://stackoverflow.com/q/28580396
score: 5

http://stackoverflow.com/q/28484597
has comment: http://stackoverflow.com/comment/45291632
has answer: http://stackoverflow.com/a/28552221
has body: I am using this accordian and I have a link on an external page, (see below). I would simply like when the user clicks on that external link, a specific accordion section would open on the new page (page2.html in this case). (I know you can have a area open of your choosing in the default section of the .js but that's different). I tried this. The link on the external page. foo Set up an ID on the page with the accordion. EducationOpen or Close And some jQuery on the accordion page to handle that selection. $(function() { $('#st-accordion').accordion(); if ($('a[href="#Education"]') == $(window.location.hash)) { $('#st-accordion').accordion(); // I also have tried calling the `accordion();` on the `$('a[href="#Education"]')` to activate it. } }); I am close, sort of. All I get is when the user clicks from the external page, the user get pushed down to the correct link, but I can't get it to uncollapse). Thanks in advance! UPDATE I tried this. $(document).ready(function() { $('#st-accordion').accordion(); $('#Education').focus(function() { console.log('test'); // <-- This worked in the console. $('a[href="#Education').accordion({open:2}); // <-- This did not. }); });
type: Question
accepted answer: http://stackoverflow.com/a/28552221
tagged with: javascript
score: 0
answer count: 2
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has title: How do I check if the window has scrolled to a href and then execute a function in javascript/jQuery?
possible better answer: http://stackoverflow.com/a/28518998
has comment: http://stackoverflow.com/comment/45291432
has answer: http://stackoverflow.com/a/28518998
type: AnsweredQuestion

http://stackoverflow.com/a/28441934
answers question: http://stackoverflow.com/q/28441491
score: 0
has body: You can create a separate function to handle click event function toggle(div) { if ('block' == div.style.display) div.style.display = "none"; else div.style.display = "block"; return false; } Gifts that Don't Impact your Lifestyle There are many ways to give a gift to without impacting your lifestyle. Gifts that Increase your Income You can enhance your income while supporting a Charitable Gift Annuity or Charitable Remainder Trust. Gifts that Provide for your Heirs You can pass assets to your family on a tax favorable basis while providing immediate support.
type: Answer

http://stackoverflow.com/a/28485447
downvote count: 0
has comment: http://stackoverflow.com/comment/45292998
has comment: http://stackoverflow.com/comment/45292816
has body: Could be like... And some controller code that is similar to... $scope.firstWidth = 100 + "px"; $scope.secondWidth = $scope.firstWidth; Then somewhere change first width and notice that second width would automatically change. In essence. I don't know if this is the best way as there are many ways to do this but here is the simplest. Example for comments $scope.size = Whatever number your controller is giving you for this dynamic size
has comment: http://stackoverflow.com/comment/45293336
score: 1
has comment: http://stackoverflow.com/comment/45293052
upvote count: 1
has comment: http://stackoverflow.com/comment/45293213
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45293137
has comment: http://stackoverflow.com/comment/45293454
accepted answer of: http://stackoverflow.com/q/28485305
has comment: http://stackoverflow.com/comment/45293901
has comment: http://stackoverflow.com/comment/45292954
type: Answer
answers question: http://stackoverflow.com/q/28485305
has comment: http://stackoverflow.com/comment/45293485

http://stackoverflow.com/comment/45287777
has text: excuse me for the late reply... there are too many files (js and css) to add them all in jsfiddle.net. What i can do is to paste the link of the theme live preview. (i can for sure add a link with my own url, but i think that will be against stackoverflow rules ? ) The link is : http://themeforest.net/item/-horizillax-horizontal-parallax-html-template-/full_screen_preview/7879442
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28461278
type: Comment

http://stackoverflow.com/a/28465024
downvote count: 0
has body: According to this blog post you have to wait for the description to load fully. Just in the same way you have to wait for a subgrid to load before accessing it.
score: 3
has comment: http://stackoverflow.com/comment/45299196
answers question: http://stackoverflow.com/q/28440363
upvote count: 3
type: Answer

http://stackoverflow.com/comment/45274564
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28475430
score: 0
has text: Replace your function with mine and let me know if it works

http://stackoverflow.com/q/28440158
type: AnsweredQuestion
has title: how to get all outer(parent) divs id values from wrapper div using prototype?
has body: I want to get only first outer all divs id value from below HTML structure. I want to output like p1,test,contents which is outer divs ids value("p1,test,contents") in "padder" div not all divs id value . i tried below code but it returns all div ids value but i want to only outer divs id and its value like p1,test,contents(this is outer divs id and its value which i want) in below html structure. $('padder').select('div').each(function(el){ alert($(el).id); });
score: 1
type: Question
tagged with: prototypejs
tagged with: javascript
upvote count: 1
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28440200
accepted answer: http://stackoverflow.com/a/28440200
favorite count: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45292837
type: AnswerComment
type: Comment
has text: Mike what do you meanby short tags? and Bouke what do you mean by php for templating, i dont understand those comments
comment on: http://stackoverflow.com/a/28484971
score: 0

http://stackoverflow.com/comment/45317783
type: Comment
comment on: http://stackoverflow.com/q/28499198
score: 0
type: QuestionComment
has text: Show your code to us.

http://stackoverflow.com/comment/45322907
has text: Now I'm a bit closer to the problem: 1st at all the IE debug not really correct. The others: the main module's original goal is generating html. After a bit deeper check in module i saw it generates the code by using outerHTML on passed object (img). Seems outerHTML does not contain the event things (like onclick). As I told, I'm noob, so need searching-seeking-looking for solution... Thank you very much, your code led me the - perhaps - right way :)
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28496886

http://stackoverflow.com/comment/45433751
type: QuestionComment
has text: Where is the value of $level coming from? Database? Would you like to update the database each time user changes value in the drop-down.
comment on: http://stackoverflow.com/q/28554445
score: 0
type: Comment

http://stackoverflow.com/comment/53140971
has text: Thank you for your answer! Whilst it wasn't in direct relation to what I was doing, this really was helpful to create my solution!
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28507647
type: Comment

http://stackoverflow.com/comment/45401054
has text: I figure out like <select id='selectbox_'+obj[i].b_id onChange='update(this.id)', It is not passing the id of dynamic list but only passing selectbox_ without concatenation of obj[i].b_id. Please tell me how to concatenate 'selectbox_' to obj[i].b_id.
comment on: http://stackoverflow.com/a/28541650
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28554453
accepted answer of: http://stackoverflow.com/q/28553681
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45822584
score: 0
has comment: http://stackoverflow.com/comment/45791331
type: Answer
has comment: http://stackoverflow.com/comment/45782969
has comment: http://stackoverflow.com/comment/45791532
has body: You need to check if seconds and mins are both zero and if they are return out of the Decrement function rather than calling setTimeout again. function Decrement() { if (document.getElementById) { minutes = document.getElementById("minutes"); seconds = document.getElementById("seconds"); // if less than a minute remaining if (seconds.value &lt; 59) { seconds.value = secs; } else { minutes.value = getminutes(); seconds.value = getseconds(); } console.log(seconds.value); if (minutes.value == 0 &amp;&amp; seconds.value == 0) { return; } secs--; setTimeout('Decrement()', 1000); } } I am not certain what you are going for with the &lt; 59 condition. Try removing that logic like this: function Decrement() { if (document.getElementById) { minutes = document.getElementById("minutes"); seconds = document.getElementById("seconds"); minutes.value = getminutes(); seconds.value = getseconds(); console.log(seconds.value); if (minutes.value == 0 &amp;&amp; seconds.value == 0) { return; } secs--; setTimeout('Decrement()', 1000); } }
answers question: http://stackoverflow.com/q/28553681
has comment: http://stackoverflow.com/comment/45747351
has comment: http://stackoverflow.com/comment/45783220

http://stackoverflow.com/comment/86210374
type: Comment
has text: Can't understand completely how it works, but surely does work. Will look up the docs. Thanks!
comment on: http://stackoverflow.com/a/28560896
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45477558
comment on: http://stackoverflow.com/a/28584999
type: Comment
has text: Could you please elaborate more?
score: 0
type: AnswerComment

http://stackoverflow.com/a/28473114
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45273112
type: Answer
has comment: http://stackoverflow.com/comment/45273596
has comment: http://stackoverflow.com/comment/45270249
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45273741
has comment: http://stackoverflow.com/comment/45545788
has body: If you're handling the forms in the same php page you can do something like: Report1 Report2 Report3 <div id="form_sub_container1" style="display:<?= ( isset($_POST['rep1']) || (!isset($_POST['rep2']) && !isset($_POST['rep3'])))? 'block':'none'?>"> //report1 functionalities <div id="form_sub_container2" style="display: <?= isset($_POST['rep2']) ? 'block':'none'?>"> //report2 functionalities <div id="form_sub_container3" style="display: <?= isset($_POST['rep3'])? 'block':'none'?>"> //report3 functionalities Because only the submitted form will be set.
has comment: http://stackoverflow.com/comment/45549268
answers question: http://stackoverflow.com/q/28471040
has comment: http://stackoverflow.com/comment/45272416
has comment: http://stackoverflow.com/comment/45550089
accepted answer of: http://stackoverflow.com/q/28471040

http://stackoverflow.com/comment/45216992
score: 1
has text: You have to make an AJAX request to your JSON File. Are you using AngularJS?
comment on: http://stackoverflow.com/q/28443721
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28456550
type: Answer
has body: You should be seeing about 3 errors, one per item. The reason is that you use src instead of ng-src, hence the browser immediately tries to fetch the image. Change to: &lt;img ng-src="images/tt/{{mod.name}}.png"/&gt;
answers question: http://stackoverflow.com/q/28456509
score: 2
downvote count: 0
upvote count: 2

http://stackoverflow.com/a/28476603
answers question: http://stackoverflow.com/q/28476389
upvote count: 2
score: 2
downvote count: 0
has body: $.getScript return Deferred object which you can use to build serial chain. Something like this: $.getScript("/assets/libs/swal/sweet-alert.min.js").done(function () { $.getScript("/assets/js/jquery.form.js").done(function () { $.getScript("/assets/js/jquery.preloader.js").done(function () { $.getScript("/assets/js/item_inventory.js"); }); }); });
type: Answer

http://stackoverflow.com/comment/57839354
type: AnswerComment
has text: @Benjamin can you elaborate your idea further?
type: Comment
comment on: http://stackoverflow.com/a/28478683
score: 0

http://stackoverflow.com/a/28590381
has body: Check the currentTime in the timeupdate event callback: var pausetime = 2; // stop at 2 seconds var myPlayer = videojs('example_video_1'); myPlayer.on('timeupdate', function(e) { if (myPlayer.currentTime() &gt;= pausetime) { myPlayer.pause(); } }); myPlayer.play(); JSFiddle demo: http://jsfiddle.net/EdjxN/17/
type: Answer
score: 7
upvote count: 7
accepted answer of: http://stackoverflow.com/q/28590280
downvote count: 0
has comment: http://stackoverflow.com/comment/54143515
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28590280

http://stackoverflow.com/comment/45459589
has text: These days, the amount of script usually vastly outweighs the actual content, so it probably doesn't matter. E.g. this page is nearly 800kB, but the HTML is about 70kB. About 200kB is CSS, maybe 100kB is images, the rest is script.
comment on: http://stackoverflow.com/q/28574979
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28455878
answers question: http://stackoverflow.com/q/28455669
type: AcceptedAnswer
has body: #menu li { list-style-type: none; float: left; margin-right: 10px; position: relative; } #menu ul li&gt;div { position: absolute; top: 20px; } Fiddle Guess it's what you want to achieve
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28455669

http://stackoverflow.com/comment/45395175
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28507532
type: Comment
has text: @Diin i tested with parent-info/stuff,it works for me ,if it does not for you, create one fiddle and show me dinn.

http://stackoverflow.com/a/28518038
has body: Its not an error to not find the user, but by not handling the missing object case on the fetch, its being treating implicitly as an error. So... fromUserPointer.fetch().then(f(result) { // good stuff }).then(f(result) { // good stuff }).then(f(result) { // good stuff }, f(error) { // this is good stuff too, if there's no mode of failure // above that would cause you to want NOT to delete, then... response.success(); });
score: 1
answers question: http://stackoverflow.com/q/28517099
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45357242
has comment: http://stackoverflow.com/comment/45354343
accepted answer of: http://stackoverflow.com/q/28517099

http://stackoverflow.com/comment/45331697
has text: I use listview controll
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28505702

http://stackoverflow.com/q/28535620
has title: referring to jsfiddle.net with POST data
tagged with: php
has body: In the site http://www.amcharts.com/demos/ I found that they are providing way to edit the demos in jsfiddle but for every demo the jsfiddle.net link remains the same as follows jsfiddle-link I guess they are referring jsfiddle.net with some post data. Though i'm not sure about that. Any idea how it can be achieved.
tagged with: jsfiddle
type: AnsweredQuestion
tagged with: post
type: Question
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28536408
accepted answer: http://stackoverflow.com/a/28536408
tagged with: amcharts

http://stackoverflow.com/q/28565777
tagged with: asp.net
has body: I have next problem: Angularjs $http post request dont binding body attributes with model on server side. Model created but with null properties. I have tested with Chrome Postman and firefox poster. All works and binding. So problem supposed to be in angullar local.signup = function(user) { $http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded"; return $http.post(config.signupUrl, {displayName:user.displayName,email:user.email, password: user.password}) .then(function(response) { if (config.loginOnSignup) { shared.setToken(response); } else if (config.signupRedirect) { $location.path(config.signupRedirect); } return response; }); }; and server side controller method [HttpOptions] [HttpPost] [Route("signup")] public IHttpActionResult Signup([FromBody] User model) { if (model == null || String.IsNullOrWhiteSpace(model.email)) return BadRequest("Email Address is required."); if (String.IsNullOrWhiteSpace(model.displayName)) return BadRequest("Name is required."); ...... } EDIT User model public class User { public string displayName { get; set; } public string email { get; set; } public string password { get; set; } }
tagged with: rest
tagged with: angularjs
has title: Angularjs $http post doesnt binding with asp.net web api server model
type: AnsweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/45441923
has answer: http://stackoverflow.com/a/28615752
has comment: http://stackoverflow.com/comment/45448863
type: Question
tagged with: c#
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28615752
answer count: 1

http://stackoverflow.com/comment/45251209
score: 1
type: AnswerComment
has text: @YourFriend [When is “use jQuery” not a valid answer to a JavaScript question?](http://meta.stackexchange.com/questions/45176/when-is-use-jquery-not-a-valid-answer-to-a-javascript-question) :-D
type: Comment
comment on: http://stackoverflow.com/a/28462280

http://stackoverflow.com/comment/45314545
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28466915
has text: Thanks! I understand. So the (relative) URL in the second argument of the open function is the file returned in response to the post (that may also do some messing about on the server before it returns some output)? The documentation on this (e.g. http://www.w3schools.com/ajax/tryit.asp?filename=tryajax_post) misses the one thing that one really needs to see: the file demo_post.asp to which it refers. I realise that this will be server-dependent, but an example there would still help...
type: AnswerComment

http://stackoverflow.com/comment/45323593
type: Comment
has text: thank you :) the code you posted was so long, i did'nt check for other issues.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28500688

http://stackoverflow.com/q/28542720
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46116670
tagged with: javascript
has title: unexpected script/css conflict, how to resolve?
score: -1
has body: I've asked this question earlier on which has been technically answered by Bardh Lohaj but unfortunately the answer itself presents a further problem. The question is about a cool way to ajax upload files in a multi field form. The solution would work perfectly except that because the form is using bootstrap.min.css in order to display form sections in JS triggered tabs - meaning the form is nicely broken up into manageable parts while remaining all as one page, means the nice solution offered by Bardh does not function correctly. What is the best way forward to resolve the css/js conflict in order to get both functions to operate fully? I've never had this sort of problem before. As requested, here is a fiddle of the page, I cannot get the +1 feature seated in Section 3, to work on the fiddle as it does on the real page. Fiddle: http://jsfiddle.net/k3dj214k/2/ I want to get this working in the file upload section (Section 3) of the page on the above fiddle. I've tried several times but always with the same failure - the bootstrap.min.css that is required for the tab function, breaks the file upload function. Advice on how to get them both working together is appreciated. There is too much code to paste in here, please review jsfiddle link above
has answer: http://stackoverflow.com/a/28586951
has comment: http://stackoverflow.com/comment/45399884
upvote count: 0
has comment: http://stackoverflow.com/comment/46103250
linked to: http://stackoverflow.com/q/28526841
answer count: 1
has comment: http://stackoverflow.com/comment/45399731
favorite count: 0
tagged with: ajax
tagged with: css
accepted answer: http://stackoverflow.com/a/28586951
has comment: http://stackoverflow.com/comment/45398932
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45405993

http://stackoverflow.com/a/28438221
has body: Yes, you're on the right track: formName.$invalid is what you're looking for. &lt;div id="errorInfoHeader" ng-show="formName.$invalid"&gt; See this plunkr that demonstrates what you're trying to do: http://plnkr.co/edit/9Ny58FY9rv74sxXryKmh?p=preview
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/45207888
has comment: http://stackoverflow.com/comment/45206654
has comment: http://stackoverflow.com/comment/45207060
answers question: http://stackoverflow.com/q/28438009
accepted answer of: http://stackoverflow.com/q/28438009
type: AcceptedAnswer
downvote count: 0
score: 4

http://stackoverflow.com/a/28480582
type: Answer
answers question: http://stackoverflow.com/q/28479754
has body: In this case it is only about execution context. The function is always the same, the only thing that changes is the meaning of the 'this' object within the function. You can specify the context by using .apply(), and also you can force permanently a specific context with .bind() You can see it in my version of your code: var x = 3; var foo = { x: 2, baz: { x: 1, bar: function() { return this.x; } } } var go = foo.baz.bar; alert(go.apply(this)); alert(go.apply(foo)); alert(go.apply(foo.baz)); var goBinded = foo.baz.bar.bind(foo.baz); alert(goBinded()); alert(goBinded.apply(foo));
score: 0

http://stackoverflow.com/q/28443754
tagged with: css
type: AnsweredQuestion
score: 2
downvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/45261283
tagged with: javascript
tagged with: jquery
has body: I have a graph contains "svg:a" elements with xlink:href values set. I need to zoom and pan around the diagram, but I want the "svg:a" elements to still be clickable. Once I added in the zoom behaviour, the click event no longer gets to the "svg:a" element. How do I fix this? Note: right click "open in new tab" still works. Here is a fiddle: http://jsfiddle.net/0kwudfhc/5/ Here is the running version: http://jsfiddle.net/0kwudfhc/5/embedded/result/ The relevant part of the source: &lt;style&gt; ... .overlay { fill: none; pointer-events: all; } ... &lt;/style&gt; &lt;script type="text/javascript"&gt; (function() { function render(data){ var svg = d3.select("#diagram") .append("svg:svg") .attr("width", data.diagram.width) .attr("height", data.diagram.height) .append("g") .attr("transform", "translate(0,"+data.diagram.height+")") .append("g") .call(d3.behavior.zoom().scaleExtent([0.5, 8]).on("zoom", zoom)) .on("dblclick.zoom", null) .append("g"); svg.append("rect") .attr("class", "overlay") .attr("x", 0) .attr("y", -data.diagram.height) .attr("width", data.diagram.width) .attr("height", data.diagram.height); function zoom() { svg.attr("transform", "translate(" + d3.event.translate + ") scale(" + d3.event.scale + ")"); } ... var docs = svg.append("g").attr("id", "docs") .data([d3.values(data.documents).sort(function(a,b){return a.order - b.order;})]) .selectAll(".node") .data(function(d){return d;}) .enter() .append("svg:a") .attr("class", "node") .attr("target", "_top") .attr("xlink:href", function(d){return d.url;}) .append("g") .attr("id", function(d){ return "node_"+d.id;}) .attr('transform', function(d) { return "translate("+d.x+","+d.y+")" }) .on('mouseover', function(d) { ... }) .on('mouseout', function(d) { ... }); ... };
has comment: http://stackoverflow.com/comment/45254291
has answer: http://stackoverflow.com/a/28467925
accepted answer: http://stackoverflow.com/a/28467925
has title: How to make SVG:A elements clickable when using D3.js Pan & Zoom behaviour?
upvote count: 2
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45217807
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js

http://stackoverflow.com/a/55010904
score: 0
has body: According to the Mozilla documentation using only { create: true} : The existing file or directory is removed and replaced with a new one, then the successCallback is called with a FileSystemFileEntry or a FileSystemDirectoryEntry, as appropriate. Tested in Chrome 72 this seems to be the case. This does not work as the file seems to be persist. The file will be overwritten (first bytes) but the size will remain the same. So this is a bug in at least Chrome 72. Source
answers question: http://stackoverflow.com/q/28458632
type: Answer

http://stackoverflow.com/a/28612617
answers question: http://stackoverflow.com/q/28590195
has body: First save the Analytics code into a variable. Then append it to the head tag when the button is clicked. ga = "(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-XXXXXXXX-X', 'auto');" + "ga('send', 'pageview');" $('a.button').on('click', function() { $('head').append('&lt;script&gt;' + ga + '&lt;/script&gt;'); });
has comment: http://stackoverflow.com/comment/85979174
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/28590195
upvote count: 1

http://stackoverflow.com/q/28509939
has body: I'm very new to JSON and JSONP. I've read through each of the posts that are recommend by the SO search for this error, but I can't seem to get a handle on it. I have the following code to grab data from an EXTERNAL website: $.ajax({ url: "https://url.com/authenticate?login=test&amp;apiKey=test", dataType: 'jsonp', success:function(json){ console.log("login successful"); } }); When I load the page, I get: Uncaught SyntaxError: Unexpected token : and when I click on the error in Chrome, I see {"Status":{"Code":"2","Message":"Authentication Succeeded","Success":"true"}} with a little red x after "true"}) From this, it seems as though I have succeeded in logging in, but I'm doing something else wrong because my console.log("login successful"); never fires. What am I doing wrong? P.S. I've tried dataType: 'json' but I get the No 'Access-Control-Allow-Origin' header is present as I'm on a different server, so I went back to jsonP as this is cross-domain. I've also tried the above url as url: "https://url.com/authenticate?login=test&amp;apiKey=test&amp;callback=?", as I've read I need a callback, but I don't really understand what the functionality of callback is and either way, the error that gets returned (whether &amp;callback=? is in there or not) is: authenticateUser?login=test&amp;apiKey=test&amp;callback=jQuery111107732549801003188_1423867185396…:1 Uncaught SyntaxError: Unexpected token : so it's adding the callback in either way.... Also, from the API I'm trying to access: "this uses the REST protocol, and provides data structured as XML or JSON" This is not a duplicate of the linked post as the information in the linked post does a great job of explaining what JSONP is, but doesn't answer my specific question regarding why I get data back (so my call is successful,) but why I still get an error and cause my script to stop.
has comment: http://stackoverflow.com/comment/45339441
favorite count: 0
has comment: http://stackoverflow.com/comment/45340508
has comment: http://stackoverflow.com/comment/45345108
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45341790
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45341783
has title: Uncaught SyntaxError: Unexpected token : - data still coming through
has comment: http://stackoverflow.com/comment/45341782
has comment: http://stackoverflow.com/comment/45341817
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28511525
accepted answer: http://stackoverflow.com/a/28511525
score: 0
has comment: http://stackoverflow.com/comment/45341905
linked to: http://stackoverflow.com/q/2067472
upvote count: 1
answer count: 1

http://stackoverflow.com/comment/45460217
type: Comment
has text: possible duplicate of [Persist javascript variables across pages?](http://stackoverflow.com/questions/1981673/persist-javascript-variables-across-pages)
comment on: http://stackoverflow.com/q/28575322
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45299907
comment on: http://stackoverflow.com/q/28488189
type: Comment
type: QuestionComment
score: 1
has text: You have to be more specific ("app is not working" is too broad). How is the app not working as your traffic increases? (are clients getting errors? threads not responding? logging not working? etc.) Describe the symptoms that you're experiencing.

http://stackoverflow.com/a/28523426
answers question: http://stackoverflow.com/q/28523394
type: Answer
upvote count: 46
downvote count: 3
type: AcceptedAnswer
has body: You should be able to include currency prefix in composition of label inside function... var options = { animation: false, scaleLabel: function(label){return '$' + label.value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");} }; http://jsfiddle.net/vy0yhd6m/80/
has comment: http://stackoverflow.com/comment/88978325
score: 43
has comment: http://stackoverflow.com/comment/45363370
has comment: http://stackoverflow.com/comment/111392441
accepted answer of: http://stackoverflow.com/q/28523394

http://stackoverflow.com/a/28453162
type: Answer
has comment: http://stackoverflow.com/comment/45233867
answers question: http://stackoverflow.com/q/28453117
has comment: http://stackoverflow.com/comment/45233460
has body: Try this stopPropagation(): Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event. event.stopPropagation() Updated Demo
score: 0

http://stackoverflow.com/comment/45437697
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28563642
has text: This should be a comment, not an answer.
type: AnswerComment

http://stackoverflow.com/comment/45470153
score: 0
has text: The location.hostname works with only current domain. I want the expected results from all urls which is in string form.
type: AnswerComment
comment on: http://stackoverflow.com/a/28580467
type: Comment

http://stackoverflow.com/q/28506286
has comment: http://stackoverflow.com/comment/45331769
score: 0
answer count: 0
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/45332286
has comment: http://stackoverflow.com/comment/45331838
has title: My JSON Array object doesn't arrive to PHP correctly
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45332163
type: Question
has body: I've been running to a wall several days with a problem with my AJAX form. I serialize my form with serializeObject and that seems to be working well, but I keep having problems with an array of checkboxes that seems to not be "going through". My form: Logo design Photo session Facebook cover image design Business cards Lorem ipsum The serialized object: company-address: "" company-email: "" company-name: "" company-rep-email: "" company-rep-name: "" company-rep-phone: "" domain-existing: "" domain-owner: "" domain-owner-id: "" extra-services[]: Array[3] 0: "logodesign" 1: "photosession" 2: "coverimage" length: 3 __proto__: Array[0] pack: "standard" paying: "Aasta kaupa" promocode: "" As you can see, the extra-services is correctly serialized to an array. When I then receive the form object in PHP and echo it back for testing, try to echo it back as a whole, I see that the extra-services array is not being treated as an array anymore and is broken: extra-services[: "coverimage" "coverimage" is the last item from the actual array...
tagged with: arrays
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/1688599

http://stackoverflow.com/a/28448724
has body: $.getJSON('http://whateverorigin.org/get?url=' + encodeURIComponent('http://www.radioactivefm.gr/live/api/last5Json.php') + '&amp;callback=?', function(data) { $('body').html(JSON.parse(data.contents).map(function(item, index){return item[0] + "-" + item[1] + "-" + item[2]})); });
score: 0
accepted answer of: http://stackoverflow.com/q/28446992
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28446992
type: Answer

http://stackoverflow.com/q/28556388
type: Question
tagged with: if-statement
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45425063
has body: Ok, so i have this basic IF statement down below. It says that if the number input is larger than that huge number that i put in it should print out the words 'I know you aint make that much.' It works when i tested it but when you try to type in another number to calculate the text just stays there and doesn't leave even after the calculation. The only way that it leaves is if you reload the page. Here is the code: &lt;script&gt; function moneyFunction() { var money = document.getElementById('textmoney').value; var dailyE = money/365; document.getElementById('demo').innerHTML = ("$" + dailyE + " " + "per day"); if ( document.getElementById('textmoney').value == 0) { document.getElementById('demo').innerHTML = "ERROR"; } if ( document.getElementById('textmoney').value &gt; 1000000000000000000000000000000000000000000000000000000000000000000) { document.getElementById('demo').innerHTML = (dailyE); document.getElementById('liar').innerHTML = "I know you aint make that much."; } } function reloadFunction() { location.reload(); } &lt;/script&gt;
answer count: 2
has answer: http://stackoverflow.com/a/28556416
upvote count: 0
has comment: http://stackoverflow.com/comment/45424964
favorite count: 0
has answer: http://stackoverflow.com/a/28556411
type: UnansweredQuestion
downvote count: 2
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45425105
has title: Why won't this IF statement work properly?

http://stackoverflow.com/comment/45258664
has text: That's because JS & PHP can't interact the way you're doing it now. You will need to run an ajax request to a php script that returns the `y` value from your `get_server_cpu_usage()` function.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28466255
score: 1

http://stackoverflow.com/comment/45324107
has text: I did an alert instead. It Prepends new lines to it.
score: 0
comment on: http://stackoverflow.com/q/28502393
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28524035
has comment: http://stackoverflow.com/comment/45364315
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/45364342
downvote count: 2
type: Question
has answer: http://stackoverflow.com/a/28524065
answer count: 2
has comment: http://stackoverflow.com/comment/45364311
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/28524079
has title: About Javascript window.open(input path here);
has comment: http://stackoverflow.com/comment/45364299
has body: &lt;script type="text/javascript"&gt; $('.nav.lessons&gt;li').click(function () { $id=$(this).closest('ul').attr('id'); window.open( $id+"/" + this.id + ".php"); }) &lt;/script&gt; this code will open a php file from my chapter1/lesson1.php and so on i got code from the internet im just wondering how to change the window.open( $id+"/" + this.id + ".php"); because i want to open it on the path student/chapter1/lesson1.php

http://stackoverflow.com/q/28556309
has comment: http://stackoverflow.com/comment/45565499
has comment: http://stackoverflow.com/comment/45564722
has comment: http://stackoverflow.com/comment/45508838
has title: Security Issues by calling require() with untrusted string (require.js)
has comment: http://stackoverflow.com/comment/45451923
type: AnsweredQuestion
upvote count: 2
has body: My browser application uses require.js. The app displays one of many different widgets on the the screen. The URL fragment contains the path to a widget (a require.js path) and then there is a call to require to dynamically load it: var moduleName = getUrlFragement('widget'); // accesses window.location require(moduleName); moduleName is an untrusted string. The user can make it whatever they want. What are the security issues with this? Here are my own findings so far: An attacker cannot load an arbitrary URL from a different domain An attacker cannot load an arbitrary URL from the same domain An attacker can force the loading of any module my application defines, which would run any initialization logic that module has. This should not be allowed. Is there anything I missed?
tagged with: requirejs
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28630419
has comment: http://stackoverflow.com/comment/45562318
has comment: http://stackoverflow.com/comment/45473154
tagged with: javascript
has comment: http://stackoverflow.com/comment/45428609
answer count: 1
accepted answer: http://stackoverflow.com/a/28630419
score: 1
has comment: http://stackoverflow.com/comment/45483738
favorite count: 0
has comment: http://stackoverflow.com/comment/45425081
tagged with: security

http://stackoverflow.com/q/28495558
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28495559
type: Question
has body: In order to make my webapp more usable, I wanted to use some king of step-by-step user guide within the application, so the user knows what, when and where to click to achieve its aims. So, after a lot of researching, I came up with trip.js, which is stylable and pretty much customizable. BUT! When trying to do some of my steps, I missed two functions: onFinishStep and onStartStep. Yes, you have an event, called onTripChange and, here, taking into account the index of the step, you can do some actions. But, what if I want to make an action just after a step ends? It wouldn't be executed until next step starts, and that would be too late. I don't know if there is any hidden functionality (or not so hidden) that I may missed, but I've read the Docs and there seems not to be any. Also, looking through the code I cannot find any calls executed this way. So, what I'm asking for is how to make it to achieve this: two functions, one executed right when the step starts and one executed just when it has ended.
tagged with: javascript
has title: Trip.js: onFinishStep and onStartStep
score: 0
answer count: 1
tagged with: jquery

http://stackoverflow.com/a/28513318
has comment: http://stackoverflow.com/comment/45370175
has body: A better approach: You don't need all those backgnd2 classes since you have only those DIVs inside a common parent. Don't use inline styles! Use your stylesheet. Don't use fixed width (px). Use % for responsive design. 2000*1331px images are not suited for the web. Specially not for mobile devices. Care about your user's bandwidth. When setting a background-image to cover you don't need to worry about it being repeated. Make your JS more flexible to element's indexes, count your elements using length. Create a "current index counter", iterate over it increment it and resetting using % (reminder). For a better UX, allow the user to pause on hover. Here's an eample: jQuery(function($) { // DOM ready. $ alias in scope. $('.gallery').each(function() { var $gal = $(this), $sli = $gal.find(">*"), tot = $sli.length, c = 0, itv = null; $sli.hide().eq(c).show(); // Hide all but first slide function anim() { c = ++c % tot; // increment/reset counter $sli.fadeOut().eq(c).stop().fadeIn(); } function play() { itv = setInterval(anim, 3000); } function pause() { clearInterval(itv); } $gal.hover(pause, play); // Pause on hover play(); // Start loop }); }); .gallery { position: relative; height: 200px; } .gallery>* { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: none 50%; background-size: cover; }
downvote count: 0
has comment: http://stackoverflow.com/comment/45358799
accepted answer of: http://stackoverflow.com/q/28512328
score: 1
answers question: http://stackoverflow.com/q/28512328
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45358224
upvote count: 1
type: Answer

http://stackoverflow.com/q/28499647
tagged with: arrays
tagged with: javascript
has title: Select values from an array and map to some strings such that same string always gets the same value and with minimum no. of repetitions?
score: 0
has body: I have a fixed size array in JavaScript with certain color codes: var colorArray = ["#2476B4","#97DD8F","#C7C7C7","#ADC9E7","#D42A27","#C2A091","#BFBB23","#FF9895","#E377C2","#DCD892","#FDBB79","#F3B8D2","#18BDCE","#C7B2D0","#A4DAE4"]; I want to assign these to certain strings. There are two requirements: If the no. of strings is less than the no. of available colors than the color should not be repeated. And if the no. of strings is more then as minimum repetition as possible. Each time a string appears the same color should be assigned to it. Currently I am generating hash for the strings and taking modulo of that hash with the size of my array. This gives me the same color every time for the same string but that is causing a lot of repetition, which when the no. of strings is more is not an issue but when the no. of strings is less than the no. of available colors, makes it look very bad. ---EDIT--- Here is the code I tried: //API to generate integer of string String.prototype.hashCode = function(){ var hash = 0; for (i = 0; i &lt; this.length; i++) { char = this.charCodeAt(i); hash += char; } if(hash &lt; 0) { hash = hash * -1; } return hash; }; //API to assign color bucket function assignToBucket(number) { var dataColor = number % colorArray .length; return colorArray [dataColor]; } //API to get color for each string function AssignColorToData(columnString) { var str = columnString; if(str.length &gt; 110) { str = columnString.slice(0,100) + columnString.slice(columnString.length - 10); } var hash = str.hashCode(); return assignToBucket(hash); }
tagged with: hash
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45318603
has comment: http://stackoverflow.com/comment/45319091
type: Question

http://stackoverflow.com/a/28456625
has body: To check that an object has a property you can use: "weapon" in equippedItems or equippedItems.hasOwnProperty("weapon")
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28456560
has comment: http://stackoverflow.com/comment/45240594

http://stackoverflow.com/a/28490620
has comment: http://stackoverflow.com/comment/45464845
has body: The pages in an angular app don't actually reload like traditional web apps and because of that the GA code most likely isn't firing. I recommend using Angulartics instead of the normal GA code. I can't help ya on the directive question because I don't really know Angular but I work in analytics and have had that problem with Angular apps.
accepted answer of: http://stackoverflow.com/q/28485774
answers question: http://stackoverflow.com/q/28485774
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/45409877
type: AnswerComment
has text: either inject a ` ` tag or try `targetWindow.eval()`
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28544926

http://stackoverflow.com/a/28466208
answers question: http://stackoverflow.com/q/28466120
has comment: http://stackoverflow.com/comment/45258087
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45258160
has body: Try using jquery .trigger() function: select.trigger("onchange");
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/28466120

http://stackoverflow.com/comment/45491076
has text: if contentElement == null, then "cat"+cat.ownedBy is not existing in your DOM
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28592241
score: 0

http://stackoverflow.com/comment/45485863
type: Comment
has text: Happy to help. :) And, actually, there is a "hiccup" in my code . . . give me a few minutes to get it sorted out. I'll update here when I've fixed it.
comment on: http://stackoverflow.com/a/28589031
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45304354
has text: And how are you including `datacontext.js` in `categories.js`? Javascript isn't Python, there is no `datacontext.getCategories` unless you manually assign it that way. Otherwise it's just `getCategories`.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28491708
score: 0

http://stackoverflow.com/comment/45207531
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28438201
has text: You just need to use a random string, the easiest solution is to use the current time. Added this to the answer.

http://stackoverflow.com/q/28591499
has title: Why do I get a blank page when running my application from Netbeans?
has comment: http://stackoverflow.com/comment/45500996
has comment: http://stackoverflow.com/comment/45531054
tagged with: javascript
has comment: http://stackoverflow.com/comment/45521967
has comment: http://stackoverflow.com/comment/45494759
has answer: http://stackoverflow.com/a/28615500
has comment: http://stackoverflow.com/comment/45531977
answer count: 1
downvote count: 0
favorite count: 0
has body: Yesterday everything was working just fine but today I'm running into this annoying blank page whenever I try to run my application from the IDE. My server is Glassfish/port4848 then run from the IDE http://localhost:8080/ecommerce/ The problem seems to be when I add these two library references at the top of the page: &lt;!DOCTYPE html&gt; &lt;%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%&gt; &lt;%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%&gt; &lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt; Sql statetments &lt;sql:query var="selectedCategory" dataSource="jdbc/ecommerce"&gt; SELECT name FROM category WHERE id = ? &lt;sql:param value="${pageContext.request.queryString}"/&gt; &lt;/sql:query&gt; &lt;sql:query var="categoryProducts" dataSource="jdbc/ecommerce"&gt; SELECT * FROM product WHERE category_id = ? &lt;sql:param value="${pageContext.request.queryString}"/&gt; &lt;/sql:query&gt; When I remove the SQL statements from the top, the page loads perfectly fine when I request it in my local browser. Thing is I need the libraries to be able to run these JSTL: Category page/ left column (vertical menu bar) &lt;c:forEach var="category" items="${categories.rows}"&gt; &lt;c:choose&gt; &lt;c:when test="${category.id == pageContext.request.queryString}"&gt; &lt;div class="categoryButton" id="selectedCategory"&gt; &lt;span class="categoryText"&gt; ${category.name} &lt;/span&gt; &lt;/div&gt; &lt;/c:when&gt; &lt;c:otherwise&gt; &lt;a href="category?${category.id}" class="categoryButton"&gt; &lt;div class="categoryText"&gt; ${category.name} &lt;/div&gt; &lt;/a&gt; &lt;/c:otherwise&gt; &lt;/c:choose&gt; &lt;/c:forEach&gt; Displaying the product within the table (right column/products container) &lt;c:forEach var="product" items="${categoryProducts.rows}" varStatus="iter"&gt; &lt;tr class="${((iter.index % 2) == 0) ? 'lightBlue' : 'white'}"&gt; &lt;td&gt; &lt;img src="${initParam.productImagePath}${product.name}.png" alt="${product.name…
has comment: http://stackoverflow.com/comment/45493875
has comment: http://stackoverflow.com/comment/45532784
accepted answer: http://stackoverflow.com/a/28615500
type: AnsweredQuestion
tagged with: netbeans
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45531907
type: Question
tagged with: jstl

http://stackoverflow.com/comment/45415138
comment on: http://stackoverflow.com/q/28550738
type: Comment
score: 0
has text: Well your number-matching regex explicitly requires that the number come at the very end of the string - that's what `$` means in a regular expression.
type: QuestionComment

http://stackoverflow.com/a/28534296
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28534123
type: Answer
score: 0
accepted answer of: http://stackoverflow.com/q/28534123
has body: A Better Solution for the same. test1 test2 test3 test4 test5 test6 test1 test2 test3 test4 test5 test6

file
type: Tag
tag name: file
tags question: http://stackoverflow.com/q/28531847
tags question: http://stackoverflow.com/q/28580912

http://stackoverflow.com/a/28532623
has comment: http://stackoverflow.com/comment/45381496
score: 1
answers question: http://stackoverflow.com/q/28532410
downvote count: 0
has comment: http://stackoverflow.com/comment/45388185
type: Answer
has comment: http://stackoverflow.com/comment/45388543
has body: ($scope.embedItem.type == 'youtube') { $scope.embedItem.embedCode = "YOUTUBE-EMBED-CODE-HERE" } that line has less than 100 bytes, if you have 200 embed codes, that's 20kB of (uncompressed) size. And if you used a lookup array, it's really only the size of the array itself that matters, i.e. { 'youtube' : 'http://youtube.com/...' }, ... Compare that to 120kB of (minified) AngularJS alone - it shouldn't trouble you. The key is that it's very likely that the embed codes will change, so you'll right now have to write a piece of code for the modification which must be tested, maintained, updated, deployed, be usable, etc... If, in a more distant future, you really end up having implemented 1,000 services to embed, you could send only the relevant subset to the client and combine that with client-side storage... This is easy to optimize when it's really important. I'd suggest to focus on getting the functionality ready, optimize only when required.
upvote count: 1

http://stackoverflow.com/q/28482201
answer count: 2
has title: Cannot get correct viewbag value after a post
tagged with: jquery
has body: I need to get a record count out of a successful Ajax post. Since the datatype is "html", I cannot check for a specific record count via json. So, what I'm doing is trying to apply the record count to a ViewBag variable (from a Controller method) and assign it to a hidden html field that I can check after the post. If 0 records are returned, I can display a proper message to the user. My process is as follows: I'm using MVC 5.2 In the GET for the Controller method, I set the ViewBag variable count to 1 (for a test. Ideally, it should be 0). The View assigns the value of the ViewBag variable to the JS variable. In the POST, I get the record count from the records retrieved and assign it to the ViewBag property. The View again should assign the value of the ViewBag variable to the JS variable. When the POST finishes, the JS variable checks if the value is 0 and then would display the proper message. However, the issue I'm having is that the initial value I set during the GET of 1, never changes. I've verified during debugging, that when the POST occurs in the controller, the ViewBag property is set to 0 (no records returned). I purposely set the initial value to 1 (in the GET) just to see if the value has changed. Can someone please inform me why the JS variable is not being updated to the value of 0 (step 4 above) after the POST? Here is my code: Controller // GET: Customers/CustomerProjects/Details public async Task&lt;ActionResult&gt; Details() { ViewBag.projectCount = "1"; ViewBag.CustomerEmail = await db.GetCustomerDDLAsync(); return View(); } [HttpPost] // POST: Customers/CustomerProjects/Details/5 public async Task&lt;ActionResult&gt; Details(short? id) { if (id == null) { return View("IDIsNull"); } ViewBag.CustomerEmail = await db.GetCustomerDDLAsync(); Customer customer = await db.GetProjectsByCustomerIDAsync(id); if (customer == null) { return View("ObjectModelNull"); } ViewBag.projectCount = customer.Projects.Count.ToString(); return View(customer); } VIEW …
tagged with: ajax
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/7993263
tagged with: razor
has answer: http://stackoverflow.com/a/28482369
type: Question
tagged with: asp.net-mvc
tagged with: javascript
has answer: http://stackoverflow.com/a/28488788
score: 0

http://stackoverflow.com/comment/45436783
type: Comment
has text: Ok I must admit the HTML documentation was a bit confusing, but it would seem like using mouseenter/mouseleave instead of mouseover/mouseout fixes the problem. Anyway I'm going to repost an answer with a cleaner solution for what you want to do...
type: QuestionComment
comment on: http://stackoverflow.com/q/28560886
score: 0

http://stackoverflow.com/a/28509665
answers question: http://stackoverflow.com/q/28509609
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/28509609
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has body: After digging through the source code of React.NET I found that it uses Newtonsoft to serialize the data. So you can use JRaw. @Html.React("Comments", new { data = Model, conn = new Newtonsoft.Json.Linq.JRaw("$.hubConnection()") }) Then I just needed to include a simple mock so that it wouldn't throw errors during server-side rendering. // this file contains mocks for global variables that are referenced by server-side code but only needed client-side. For example SignalR. // mock jQuery var $ = jQuery = {}; // mock SignalR API $.hubConnection = function() {}; Works like a charm!

http://stackoverflow.com/q/28584063
downvote count: 0
tagged with: javascript
tagged with: whatsapp
favorite count: 0
has title: Share an image from my website on Whatsapp
linked to: http://stackoverflow.com/q/21935149
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/66263587
linked to: http://stackoverflow.com/q/22461558
answer count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/66245210
has comment: http://stackoverflow.com/comment/45483070
has comment: http://stackoverflow.com/comment/45476190
score: 1
has body: My website is used mainly from mobiles and I want to allow my users to click a "Share on Whatsapp" button which will open Whatsapp on their device with an image ready to be sent. I know how to share text, as explained here, but I haven't found anything about image sharing.
type: Question

http://stackoverflow.com/a/73233351
has body: This would be unsafe. Consider the following: Click on phishing link: phishing-bank.com Website mimics: your-bank.com and changes url to your-bank.com . No way the user can tell the difference now, assuming he doesn't analyse the certificate chain.
answers question: http://stackoverflow.com/q/28461691
type: Answer
score: 0

http://stackoverflow.com/q/28460761
has answer: http://stackoverflow.com/a/28460816
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45247514
has body: I am new to struts , I need a serverside Java script Validation in struts 1.2. I did a lot of googling but did not get anything useful Server side validation with page refersh and page error is easy , But i do not have idea about how to prompt with Javascript and then display the same jsp page Thanks in advance any link , simple example could be useful
tagged with: struts-1
has answer: http://stackoverflow.com/a/28870776
tagged with: jakarta-ee
tagged with: java
has comment: http://stackoverflow.com/comment/45248848
has comment: http://stackoverflow.com/comment/45250996
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45248089
type: Question
has comment: http://stackoverflow.com/comment/45248663
has title: Struts 1.2 server-Side JavaScript Validation

http://stackoverflow.com/comment/45424445
has text: why don't you create a fiddle for this ? use www.jsfiddle.net
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28555363
score: 0

http://stackoverflow.com/comment/45459258
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28574945
has text: Thank you for pointing out my oblivious mistake. I was using that before, but forgot to remove that from the function declaration. It is now working perfectly fine.

http://stackoverflow.com/comment/45289594
type: QuestionComment
has text: if you're using Chrome, use DEVELOPER TOOLS (right click on the page and go to Inspect Element) http://developer.chrome.com/devtools and check the Network tab. What kind of response are you getting?
comment on: http://stackoverflow.com/q/28482992
score: 0
type: Comment

http://stackoverflow.com/q/28534549
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I'm writing a Chrome extension and I'm trying to programmatically trigger a keypress event on the textarea element where you type in Facebook chat. If I look at the element in the inspector, I can see that it has an onkeydown handler set: onkeydown="run_with(this, ["legacy:control-textarea"], function() {TextAreaControl.getInstance(this)});" --but I can't trigger it. While trying to figure out why I can't trigger it, I found that when I select the element using one of the classes on it and type document.querySelector('._552m').onkeydown in the console, it comes up null. Likewise, using getAttribute on it for onkeydown comes up null. What am I missing here? How can I get at this event handler? Why can I see it set on the element in the inspector and yet not access it programmatically in the usual way? Is React pulling some weird magic here? Edit: document.querySelector('._552m').attributes shows the onkeydown attribute listed....wtf...
has comment: http://stackoverflow.com/comment/45394675
type: UnansweredQuestion
score: 0
tagged with: facebook
has comment: http://stackoverflow.com/comment/45414268
has title: 'onkeydown' attribute visible but null?
has comment: http://stackoverflow.com/comment/45413072
has answer: http://stackoverflow.com/a/28555097
type: Question
linked to: http://stackoverflow.com/q/10455626
tagged with: reactjs
tagged with: javascript
tagged with: event-handling

http://stackoverflow.com/comment/45222234
score: 0
comment on: http://stackoverflow.com/q/28446402
has text: Sorry but no, you can't read scope in your template function. If your template depends on scope element, you compile your template in linking phase.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28564820
accepted answer: http://stackoverflow.com/a/28570204
tagged with: http://stackoverflow.com/tag/xml
has body: I am trying to load my parse my XML document but the HTML page remains null, is there something that I'm doing wrong. index.html script.js Click here to view the code sample.xml <?xml version="1.0" encoding="utf-8"?> Madness Baggy Trousers 3 30 sample.xsl <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="hitrecords/record"> <xsl:value-of select="."/> <xsl:value-of select="@genre"/> <xsl:value-of select="artist"/> </xsl:for-each> </xsl:template> </xsl:stylesheet>
has answer: http://stackoverflow.com/a/28570204
tagged with: xslt
type: AnsweredQuestion
has title: Cannot load XML documents on web page with JavaScript
type: Question
answer count: 1
tagged with: javascript
score: 0

http://stackoverflow.com/comment/59390633
type: Comment
comment on: http://stackoverflow.com/a/28574544
has text: Great, finally a working CSS solution and no JS required. Excellent!
score: 0
type: AnswerComment

http://stackoverflow.com/a/28514563
has comment: http://stackoverflow.com/comment/45346890
score: 1
accepted answer of: http://stackoverflow.com/q/28514456
has comment: http://stackoverflow.com/comment/45347907
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45346843
answers question: http://stackoverflow.com/q/28514456
upvote count: 1
has body: &lt;script&gt; var Components = function(){ var attributes; var _init = function(elm){ attributes = elm.attributes; console.log("Method Executing:Compnents.init") console.log(attributes.id.value); } return { init:_init, } }(); &lt;/script&gt;

http://stackoverflow.com/a/28518719
answers question: http://stackoverflow.com/q/28518624
score: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45354611
type: Answer
has body: Just modify it a bit for (var i = 0; i &lt; path.length; i++) { // If the image has arrived to the div position, function continue if (player.image.x == player.x &amp;&amp; player.image.y == player.y) { player.x = path[i].position.x * 40; player.y = path[i].position.y * 40; } else i--; // It wont increase your i if condition is not satisfied. }
upvote count: 1

http://stackoverflow.com/comment/45436424
comment on: http://stackoverflow.com/a/28562245
type: AnswerComment
has text: Then please [edit your question](https://stackoverflow.com/posts/28562189/edit) and add an example that includes these characters.
score: 0
type: Comment

http://stackoverflow.com/q/28506311
has comment: http://stackoverflow.com/comment/45331779
score: 0
answer count: 3
tagged with: undefined
favorite count: 0
has answer: http://stackoverflow.com/a/28506382
has comment: http://stackoverflow.com/comment/45331996
has title: Why does this function return undefined.property in JS?
type: AnsweredQuestion
tagged with: object
accepted answer: http://stackoverflow.com/a/28506378
upvote count: 1
has answer: http://stackoverflow.com/a/28506404
downvote count: 1
has body: I am going over the MDN JavaScript guides and am trying to work along with the example near the bottom of the page. var car = { make: "Ford", model: "Mustang" }; function dump_props(obj, obj_name) { var result = ""; for (var i in obj) { console.log(result += obj_name + "." + i + " = " + obj[i] + "&lt;br&gt;"); } result += "&lt;hr&gt;"; console.log(result); } dump_props(car); I've altered the original code to return console statements but when I put this in JSBin.com, the console returns: "undefined.make = Ford&lt;br&gt;" "undefined.make = Ford&lt;br&gt;undefined.model = Mustang&lt;br&gt;" "undefined.make = Ford&lt;br&gt;undefined.model = Mustang&lt;br&gt;&lt;hr&gt;" Why the undefined? Thanks
type: Question
has answer: http://stackoverflow.com/a/28506378
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28506382

http://stackoverflow.com/comment/45352729
comment on: http://stackoverflow.com/q/28517771
type: Comment
type: QuestionComment
has text: what does `validar` return?
score: 0

exacttarget
tag name: exacttarget
tags question: http://stackoverflow.com/q/28443329
type: Tag

http://stackoverflow.com/q/28491468
has body: I am running the following code (on document ready) to try to get google analytics event tracking working. The hitCallback is being run as expected, but the events are not being shown in Google Analytics. $(function() { console.log('pushing event'); ga('send', { 'hitType': 'event1', 'eventCategory': 'button', 'eventAction': 'click', 'eventLabel': 'contact form', 'hitCallback' : function () { console.log('event received'); } }); }); This code is currently live on http://atmosfire.com.au/. In Google Analytics / Real Time / Events, I can see 1 active user (me), but none of the events I am triggering are being logged. Help?
answer count: 1
has answer: http://stackoverflow.com/a/28491798
tagged with: event-tracking
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45303824
has title: Google Analytics (Universal) event tracking not working
accepted answer: http://stackoverflow.com/a/28491798
type: Question
tagged with: google-analytics
has comment: http://stackoverflow.com/comment/45303807
tagged with: javascript
score: 0

http://stackoverflow.com/comment/45350001
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28516237
has text: U were right about not being able to find the css or js files. Some tutorial told me to link to jquery.pack.js, but I changed it to jquery.js only, and now it works in my cleaned out example. BUT it still doesn't work in my other files where I linked to bootstrap and such other. Does the hierarchy of linking here matter? the .fancybox class is within other classes, does that matter as well?

http://stackoverflow.com/comment/45314041
has text: try jquery like $("idofbutton").click(function(){ //your corresponding code }); add id field to button
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28497236

http://stackoverflow.com/comment/45418762
has text: Enable php error logs to discover what is going on
score: 0
comment on: http://stackoverflow.com/q/28552049
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45442789
has text: It says (or said) something like that you have to add some code to your post before you can link to fiddle, Also the post couldn't be saved before there was some code, or the link was removed (or obfuscated, as you did).
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28565653

http://stackoverflow.com/comment/45432252
comment on: http://stackoverflow.com/q/28560070
score: 0
has text: You can orderby 2 attributes, you can orderby function. You do not need custom filter for this.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45571709
comment on: http://stackoverflow.com/a/28633084
type: Comment
score: 0
type: AnswerComment
has text: Do you have a link or can you assemble the slider in a fiddle?

http://stackoverflow.com/a/28475628
score: 2
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28475434
has comment: http://stackoverflow.com/comment/45275021
has body: try doing this: var temp = document.createElement('div') temp.innerHTML = this.templateString; then you can move all the children to this.containerNode after doing the binding.
type: Answer
accepted answer of: http://stackoverflow.com/q/28475434
upvote count: 2

http://stackoverflow.com/comment/45298263
comment on: http://stackoverflow.com/q/28471602
score: 0
has text: I will try that and see if I have any luck, thank you. (:
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45357416
has text: Just use the index to reference it.. `$array['username'] = 'someusername'; $array['password'] = 'somepassword';`
comment on: http://stackoverflow.com/a/28520245
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/29688152
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28449382
downvote count: 0
answers question: http://stackoverflow.com/q/28449382
score: 1
has comment: http://stackoverflow.com/comment/47520768
has body: Pretty simple, it's more about geometry and logic than physics... if I understand your simplified world. In the case of boulderdash (or also sokoban), where the movement is tiled-based, when you are about to move the character you first check the adjacent tile, in the direction of the movement. It could be walkable or occupied by a movable object (or also a wall). If there's a movable object, then you check the next adjacent tile. If it's walkable then means the movable object it's indeed movable. Otherwise, that movable object is currently not movable. In a non-tiled scenario like yours seems, you check for collision with a first box and, when this happens, you check the presence of a next colliding box, adding a new colision point the size of the first box, in the direction of the movement.
upvote count: 1

http://stackoverflow.com/q/28564586
has title: Centering labels on the chart
has comment: http://stackoverflow.com/comment/45470401
has comment: http://stackoverflow.com/comment/45441252
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45440636
has body: I've got a problem with labels on chart. Text label is centered badly or it is missing. For example: jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/bar-basic/ Screenshot: (Firefox browser) And it works well only in chrome. I'm using version 4.1.0. (Created: 16.02.2015) Thanks in advance!
has comment: http://stackoverflow.com/comment/45443814
type: Question
tagged with: highcharts
tagged with: javascript
has comment: http://stackoverflow.com/comment/45467883
score: 0

http://stackoverflow.com/comment/45205613
type: QuestionComment
has text: [**Stop abusing arrays!!!**](http://andrewdupont.net/2006/05/18/javascript-associative-arrays-considered-harmful/)
comment on: http://stackoverflow.com/q/28437693
score: 0
type: Comment

code-duplication
tag name: code-duplication
tags question: http://stackoverflow.com/q/28449902
type: Tag

http://stackoverflow.com/comment/45255413
comment on: http://stackoverflow.com/q/28458373
score: 0
type: Comment
type: QuestionComment
has text: But now, how do I reference my models or routes or views with Jasmine? For instance, I can't do `var app = $(app); app.models...`. Thoughts?

http://stackoverflow.com/q/28543977
type: UnansweredQuestion
upvote count: 1
tagged with: php
score: 1
type: Question
has body: I tried to create a onchange event in ckeditor and I succeed. For that while loading the editor I initialize the contents with setData method. Every thing is fine so far. But while loading contents, the variable which holds the editor contents seems to have problem with multi line character.Even though I assign quotes at the beginning and end of the string, only the first line gets quoted, while the remaining lines doesn't sometimes it works, sometimes it doesn't. LInk1 Link2 Meanwhile while assigning these values, while assigning these values CKEDITOR.on('instanceCreated', function (e) { e.editor.on('instanceReady', function (ev) { if(this.id == 'cke_1') { set_data = '&lt;?php echo ($esti); ?&gt;'; e.editor.setData(set_data); } }); The contents variable gets assigned like this. I tried with removing \n, replaced single quotes with &#039; Sometimes it works, sometimes it doesn't
downvote count: 0
tagged with: javascript
tagged with: ckeditor
favorite count: 0
has title: While assigning CKeditor contents(slightly big contents) to a variable, recieving unterminated string error
answer count: 0

http://stackoverflow.com/comment/45490410
comment on: http://stackoverflow.com/a/28591149
type: AnswerComment
score: 0
type: Comment
has text: Can you log what is in `$scope.data` in your directive link/controller? I have edited my answer with a snippet where you can see that `arrayResult[key]` is the right format, but I don't have enough information to understand what is wrong in your code.

http://stackoverflow.com/a/28437520
type: Answer
has comment: http://stackoverflow.com/comment/45205506
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28437451
answers question: http://stackoverflow.com/q/28437451
has body: Data Driven Documents (D3) is what the page in question is using. Knockout.JS is also a useful library for updating of elements in response to user input. These are both javascript libraries.
type: AcceptedAnswer
downvote count: 0
score: 1

http://stackoverflow.com/comment/45288372
has text: I suggest that you enable Java Console and examine the logs (On Windows: Control Panel => Java => Advanced Tab => Java Console Option => Show console). Also post the code you wrote to call the applet method, it may help.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28482535
score: 2

http://stackoverflow.com/comment/45413264
type: AnswerComment
comment on: http://stackoverflow.com/a/28549843
type: Comment
has text: Well, true, however with the proliferation of HFT and everything I figure these will be huuge arrays, and better to play it safe ;)
score: 0

http://stackoverflow.com/a/28584756
type: Answer
has body: there were easier way, ng-class - check if validateDob returning false, if yes, show validation frame.
score: 0
answers question: http://stackoverflow.com/q/28582090

http://stackoverflow.com/comment/45379958
type: Comment
type: QuestionComment
has text: yes being able to see what is actually going on would surely be helpful
score: 0
comment on: http://stackoverflow.com/q/28488344

http://stackoverflow.com/q/28540598
has body: I want to assign a javascript function to ng-click which name is sourced by a rest service. &lt;li ng-class="{ active: isActive('url')}" data-ng-repeat="menu in mb.data"&gt; &lt;a href="{{menu.href}}" data-ng-click="{{menu.javascript}}"&gt;{{menu.label}}&lt;/a&gt; &lt;/li&gt; Sadly the angularjs parser throws an exception if one use {{ }} inside of ng-click. So I have tried several workarounds like using a callback function &lt;a href="{{menu.href}}" data-ng-click="call(menu.javascript)"&gt;{{menu.label}}&lt;/a&gt; But none of my ideas succeeded. How can I assign a javascript functions name in ng-lick? Btw. the function itself is part of the $scope. Edit- Here is the controller: The "$menu" service is simply a get rest request. The request result is a json object and only holding string values. In the current issue the result for menu.javascript is "loginModal()". .controller('HeaderController', function($scope, $http, ModalService, $menu, $routeParams) { $scope.loginModal = function() { console.log("modal", ModalService); // Just provide a template url, a controller and call 'showModal'. ModalService.showModal({ templateUrl: "/modals/login.modal.html", controller: "LoginController" }).then(function(modal) { // The modal object has the element built, if this is a bootstrap modal // you can call 'modal' to show it, if it's a custom modal just show or hide // it as you need to. console.log(modal.element); modal.element.modal(); modal.close.then(function(result) { console.log(result ? "You said Yes" : "You said No"); }); }); }; $menu.get($routeParams, function(data){ $scope.menu = data; }); }) Edit 2: Interestingly when I use {{menu.javascript}} then the correct string "loginModal()" is available in the DOM. But the angular parser stopped there due to errors.
favorite count: 0
has title: AngularJS pass string as function to use at ng-click
has comment: http://stackoverflow.com/comment/45394952
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45394874
has comment: http://stackoverflow.com/comment/45395054
has answer: http://stackoverflow.com/a/28541100
accepted answer: http://stackoverflow.com/a/28541100
type: AnsweredQuestion
tagged with: angularjs-ng-click
downvote count: 0
has answer: http://stackoverflow.com/a/43038188
score: 17
tagged with: angularjs-scope
type: Question
has comment: http://stackoverflow.com/comment/45395107
answer count: 2
has comment: http://stackoverflow.com/comment/45394863
tagged with: javascript
possible better answer: http://stackoverflow.com/a/43038188
tagged with: http://stackoverflow.com/tag/html
upvote count: 17

http://stackoverflow.com/comment/45411291
type: AnswerComment
type: Comment
has text: Oh my god...thank you so much. And I assume I would just change the p's if I want to add images, etc. in it?
comment on: http://stackoverflow.com/a/28535267
score: 0

http://stackoverflow.com/comment/45210804
type: Comment
type: QuestionComment
score: 1
has text: I would recommend updating your question displaying relevant source code, this will save us having to guess / assume what you have working so far. If you want this problem fixing then display the relevant source code to help us help you. If we have nothing to debug then we don't have the answers for you.
comment on: http://stackoverflow.com/q/28440005

http://stackoverflow.com/comment/45483919
has text: same class and same name?
comment on: http://stackoverflow.com/q/28588470
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28488667
tagged with: reactjs
has comment: http://stackoverflow.com/comment/45299456
tagged with: javascript
linked to: http://stackoverflow.com/q/28463189
tagged with: reactjs-flux
upvote count: 1
answer count: 1
tagged with: refluxjs
has answer: http://stackoverflow.com/a/28516465
has body: I'm working on a React app with Reflux and I'm having a problem connecting a store to a component. Here's the code // src/stores/post.js var Reflux = require('reflux'); var $ = require('jquery'); var PostActions = require('../actions/post'); module.exports = Reflux.createStore({ init: function() { this.listenTo(PostActions.vote, this.onVote); }, getInitialData: function() { return { title: "Post 1", content: "This is a post!", voteCount: 6 } }, onVote: function(postId, studentId, voteValue) { this.trigger(); console.log("VOTE ACTION TRIGGERED"); } }); // src/actions/post.js var Reflux = require('reflux'); module.exports = Reflux.createActions([ "vote" ]); // src/components/posts/upvote.js var React = require('react'); var Reflux = require('reflux'); var PostStore = require('../../stores/post'); var PostActions = require('../../actions/post'); module.exports = React.createClass({ mixins: [Reflux.ListenerMixin], getInitialState: function() { return { voteCount: this.props.votes } }, componentDidMount: function() { this.listenTo(PostStore, this.onVoteCountChange); }, componentWillUnmount: function() { this.unsubscribe(); }, onVoteCountChange: function(newVoteCount) { this.setState({ voteCount: newVoteCount }); }, handleClick: function() { console.log(PostActions); PostActions.vote( null, null, null ); }, render: function() { return ( &lt;div className="votes"&gt; &lt;p&gt;{this.state.voteCount}&lt;/p&gt; &lt;span className="glyphicon glyphicon-chevron-up" onClick={this.handleClick}&gt;&lt;/span&gt; &lt;/div&gt; ) } }); The problem is, the code works when I run it in the Node console: &gt; var PostStore = require('./src/stores/post'); undefined &gt; var PostActions = require('./src/actions/post'); undefined &gt; PostActions.vote(null, null, null); undefined &gt; VOTE ACTION TRIGGERED But when I run the tests, the event doesn't get logged. However, I know the click is happening because handleClick() is being called and the PostActions object is being printed to the conso…
favorite count: 0
type: UnansweredQuestion
has title: Reflux event not triggering
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45299548
type: Question

http://stackoverflow.com/q/28583357
has answer: http://stackoverflow.com/a/31543772
type: Question
score: 3
tagged with: http://stackoverflow.com/tag/json
has body: I'm using a nodejs server, and i successfully encrypt/decrypt (with IV &amp; Key) a json in Base64 with crypto node module. However, when I send an emit action with my AES 128 CTR json to a web client, i received correctly my json with base64 data encrypted, but my problem is when i wan't to decrypt this. In CryptoJS documentation, i found an example like this : var text = "Hello world"; var key = CryptoJS.enc.Base64.parse("myKey"); var iv = CryptoJS.enc.Base64.parse("myIv"); var encrypted = CryptoJS.AES.encrypt(text, key, {iv: iv}); console.log(encrypted); // print something like that s {init: function, $super: s, ciphertext: l.WordArray.t.extend.init, key: s, iv: s…} var decrypted = CryptoJS.AES.decrypt(encrypted, key, {iv: iv}); console.log(decrypted.toString(CryptoJS.enc.Utf8)); // print Hello world We can easily decrypt an "Hello world" because it was encrypted by CryptoJS in my web client. But my problem is that i want to decrypt a data which is not using CryptoJS encrypt system. I want to do something like this : var text = "myJsonEncryptedInBase64"; var key = CryptoJS.enc.Base64.parse("myKey"); var iv = CryptoJS.enc.Base64.parse("myIv"); var decrypted = CryptoJS.AES.decrypt(text, key, {iv: iv}); console.log(decrypted.toString(CryptoJS.enc.Utf8)); //print my decrypted json I've got an error because CryptoJS decrypt method using an array data like this : s {init: function, $super: s, ciphertext: l.WordArray.t.extend.init, key: s, iv: s…} Can you please help me ? Thanks a lot. Edit : Node.js input : {name:"toto", age:"15"} (encrypted with crypto in Base64). Node.js output: mfrpKm5k5YtGkX6rp9/Bmz+cCkcz5tiLKQcxmOpDUow= Emitting output throw socket.io to web client. Web client JS input : mfrpKm5k5YtGkX6rp9/Bmz+cCkcz5tiLKQcxmOpDUow= Web client JS ouput : {name:"toto", age:"15"} (Decrypting with same IV &amp; KEY)
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/31543772
tagged with: javascript
has comment: http://stackoverflow.com/comment/45476120
favorite count: 0
has title: How to decrypt AES 128 in CryptoJS (nodejs / web browser)
has comment: http://stackoverflow.com/comment/45475617
tagged with: cryptography
tagged with: cryptojs
tagged with: node.js
type: AnsweredQuestion
upvote count: 3

http://stackoverflow.com/a/28524321
has body: Try this: var dir = "./Simple Root/Test/Thing/Test/Thing/".match(/^.*?\/(.*?)\//); alert(dir[1]); Check https://regex101.com/r/pM7sF9/1
answers question: http://stackoverflow.com/q/28524277
score: 0
type: Answer

http://stackoverflow.com/comment/45212847
score: 0
type: Comment
has text: So i am using $set, the reason I'm not setting the entire object is because this is an import script from a spreadsheet. So i'm looping over rows. Some data can already exist however, so I need to find the index and update that.
type: AnswerComment
comment on: http://stackoverflow.com/a/28439167

http://stackoverflow.com/comment/45423306
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28554791
type: AnswerComment
has text: @MrBearAndBeer *"you should use the comments to help the user"*.. And what exact value are you trying to add with your comments, Mr?

http://stackoverflow.com/comment/45482279
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28585975
score: 0
has text: Yes you can. You could also create a form model to handle your model and other inputs.

http://stackoverflow.com/comment/45258503
has text: Ah.. sorry man, after I saw it I just changed it and totally forgot that onkeyup wasn't in your code :)
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28465293

http://stackoverflow.com/q/28465334
tagged with: javascript
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: datepicker
score: 2
has title: How reset date range for Linked Picker on eonasdan Bootstrap 3 Datepicker?
downvote count: 0
tagged with: twitter-bootstrap
type: Question
has body: I'm use eonasdan Bootstrap 3 Datepicker for date input. I want to make a button to reset date range for linked pickers, like in this link: http://eonasdan.github.io/bootstrap-datetimepicker/#linked-pickers I tried this but it didn't work, minDate and maxDate don't reset. &lt;script type="text/javascript"&gt; $(function () { $('#datetimepicker6').datetimepicker({ format: 'YYYY-MM-DD 00:00:00',locale: 'en-gb',showClear:true }); $('#datetimepicker7').datetimepicker({ format: 'YYYY-MM-DD 23:59:59',locale: 'en-gb',showClear:true}); $("#datetimepicker6").on("dp.change",function (e) { $('#datetimepicker7').data("DateTimePicker").minDate(e.date); }); $("#datetimepicker7").on("dp.change",function (e) { $('#datetimepicker6').data("DateTimePicker").maxDate(e.date); }); $('#clearDate').click(function() { $('#EventDateStart').val(''); $('#EventDateEnd').val(''); $('#datetimepicker6').data("DateTimePicker").minDate(false); $('#datetimepicker7').data("DateTimePicker").maxDate(false); return false; }); }); &lt;/script&gt;
upvote count: 2
has answer: http://stackoverflow.com/a/29487620
answer count: 2
has answer: http://stackoverflow.com/a/28465470

http://stackoverflow.com/a/28504426
answers question: http://stackoverflow.com/q/28500432
has comment: http://stackoverflow.com/comment/45477261
type: Answer
score: 0
has body: Supposing that in some place in your code you have var student0 = someFuntionGetStuden(0); var student1 = someFuntionGetStuden(1); var student2 = someFuntionGetStuden(2); instead you can do like this var students = []; students.push(someFuntionGetStuden(0)); students.push(someFuntionGetStuden(1)); students.push(someFuntionGetStuden(2)); cont=0; for(i in students){ tree(students[i],cont++); }

http://stackoverflow.com/a/34220689
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/28476986
has comment: http://stackoverflow.com/comment/56187020
has body: I don't know, if this is still an issue. But I ran into an similar condition where calling location.reload(true)in an iframe refreshed the parent and loaded the content of the iframe into the browser. I made some researches but couldn't find anything which would trigger this problem. I also created a test page with an iframe which reloads itself but there the refresh worked properly in IE 11. But for the case where IE has the problem described above I now use location.href = location.href.replace(location.hash, '') instead of location.reload(true) as a solution. One limitation of this approach is that it doesn't force the browser to clear the cache of the page. I also did not test this in IE 10 yet but feel free to add a comment if it works there. I hope this helps.
downvote count: 0
has comment: http://stackoverflow.com/comment/56354482
type: Answer

http://stackoverflow.com/comment/80721728
type: Comment
score: 0
type: AnswerComment
has text: I have notice that Zoom buttons have dissapeared from map when I set content="IE=edge". Do you know why?
comment on: http://stackoverflow.com/a/28589626

http://stackoverflow.com/comment/93288863
type: Comment
type: QuestionComment
has text: Take a look at : [How to node : coding-challenges-with-streams](http://howtonode.org/coding-challenges-with-streams) I think you can use exactly the same approach !
comment on: http://stackoverflow.com/q/28446226
score: 0

http://stackoverflow.com/comment/45353771
type: QuestionComment
has text: @romainl ah, thanks for those tips!
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28518042

http://stackoverflow.com/q/28469326
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45342689
has title: Dynamically setCurrentTime in MediaElement.js
tagged with: video
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/45264105
tagged with: javascript
has body: I need to play a video from anywhere based on timestamp info from a transcript. Here's the video: &lt;video id="demo" width="720" height="600" controls="controls" preload="true"&gt;&lt;source type="video/mp4" src="sample.m4v" /&gt;&lt;track label="English" srclang="en" kind="subtitles" type="text/vtt" src="sample.vtt" /&gt;&lt;/video&gt; Here's a snippet of the transcript: *ABD: yes it’s the [opposite *JUL: [yeah &lt;span class="movControl" id="play" name="current_time" value="15"&gt;&amp;#9654;&lt;/span&gt; °↑i do (h) not even try° &lt;span class="movControl" id="play" name="current_time" value="16"&gt;&amp;#9654;&lt;/span&gt; Here's the javascript code &lt;script src="/mediaelementjs/jquery.js"&gt;&lt;/script&gt; &lt;script src="/mediaelementjs/mediaelement-and-player.min.js"&gt;&lt;/script&gt; var media; // we need this global variable var t1 = document.getElementsByName("current_time")[0].value; t1 = parseInt(t1); jQuery(document).ready(function ($) { $("video").mediaelementplayer({ enableKeyboard: true, pauseOtherPlayers: true, framesPerSecond: 25, loop: false, startVolume: 0.8, keyActions: [], startLanguage: 'en', success: function (mediaElement, domObject) { media = mediaElement; // make it available for other functions } }); $(".movControl").on("click", function () { media.setCurrentTime(t1); // set starting time media.play(); }); }); // ready So, when a user click on a icon anywhere in the transcript, I want to grab its corresponding time (e.g., 15 seconds) and assign it to the MediaElement setCurrentTime function. I tried the above code but it did not work. Would you please give me some help? Much appreciated!
score: 0
tagged with: mediaelement.js
tagged with: jquery

http://stackoverflow.com/a/28513402
has comment: http://stackoverflow.com/comment/45345222
score: 1
upvote count: 1
has body: Because the HTML element may not be on the page when the code is executed. Use below: window.onload=function(){ var test = document.getElementById("delete"); test.onclick = function popup(){return confirm("Are you sure?")}; };
has comment: http://stackoverflow.com/comment/45345162
has comment: http://stackoverflow.com/comment/45345184
downvote count: 0
answers question: http://stackoverflow.com/q/28513383
has comment: http://stackoverflow.com/comment/45345293
has comment: http://stackoverflow.com/comment/45345064
type: Answer

http://stackoverflow.com/comment/45357386
comment on: http://stackoverflow.com/q/28520284
score: 0
has text: No, nothing. I also double-checked directories.
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28551255
accepted answer of: http://stackoverflow.com/q/28550827
answers question: http://stackoverflow.com/q/28550827
has comment: http://stackoverflow.com/comment/45472540
score: 5
upvote count: 5
type: AcceptedAnswer
downvote count: 0
has body: So debug basically has an on-off switch but it's not in your javascript code, it's in the DEBUG environment variable value. So if you wanted to turn on debugging for your sample snippet you would do: In bash: export DEBUG=module-name node myapp.js In powershell: $env:DEBUG = 'module-name' node myapp.js Debugging is off by default, so if you unset DEBUG in your shell, nothing will be output.
type: Answer

http://stackoverflow.com/a/47202743
score: 1
has body: Logging with AJAX request usually works because a successful AJAX request sets session cookies that will be sent in all subsequent requests transparently. Maybe your cookies are set but for some reason are not set transparently: you can check with xhr.getAllResponseHeaders() / xhr.getResponseHeader() and after that set them with document.cookie. If no session cookies, then this behaviour usually fails. You can try to redirect with the username+password in the url (not recommended because username+password probably will be visible in the browser address url bar afterwards): window.location.href = window.location.protocol + "//" + username + ":" + password + "@" + window.location.hostname + (window.location.port ? ":" + window.location.port : "") + '/app/test.html'; Also you should test to delay the redirection... because maybe it's working but you need to give some extra time to the browser, did you try: var encoded = Base64.encode(username + ':' + password); $.ajax({ url: "/app/test", type: "GET", beforeSend: function(xhr) { xhr.setRequestHeader('Authorization', 'Basic ' + encoded); }, success: function() { setTimeout(function() { window.location.href = '/app/test.html'; }, 333); } });
upvote count: 2
answers question: http://stackoverflow.com/q/28589224
type: Answer
downvote count: 1

http://stackoverflow.com/a/28450658
type: Answer
has comment: http://stackoverflow.com/comment/45230233
upvote count: 1
has body: this inside showCoords point to window, so this.ui does not exist and when you try to get this.ui.holder you get an error inside Jcrop changes handler. So your changes handler breaks plugin.
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45229620
answers question: http://stackoverflow.com/q/28450321

http://stackoverflow.com/q/28489790
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28489929
favorite count: 0
tagged with: iframe
possible better answer: http://stackoverflow.com/a/28490044
has body: I am loading a .js file I wrote. Within that .js file I am creating a Iframe like this var frmSource = "http://MYLINK.com/mypage.php?" + encodeURI(URLBuilder); ifrm = document.createElement("IFRAME"); ifrm.setAttribute("src", frmSource);a ifrm.style.width = 0+"px"; ifrm.style.height = 0+"px"; ifrm.setAttribute("frameBorder", "0"); document.body.appendChild(ifrm); URLBuilder contains the GET variables to the next page The issue occurs at document.body.appendChild(ifrm); and my error is javascript typeerror: null is not an object (evaluating 'document.body.appendchild') I suspect the issue is it is trying to append the iframe to the body but the body has not properly loaded. I am currently only getting this issue in safari.
upvote count: 1
has answer: http://stackoverflow.com/a/28490044
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28489929
has title: Javascript: document.body.appendchild has a null value
has answer: http://stackoverflow.com/a/31350091
score: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: typeerror

http://stackoverflow.com/a/28450366
upvote count: 1
answers question: http://stackoverflow.com/q/28447256
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45230927
has body: It is never secure to save a username and password in the sessionstorage. The sessionStorage can be read by someone with access to the device and use this for other purposes. Parse has it's own guidelines for using it's API where they have long thought about the security of their API. Because you are new to web development in general, I would suggest you will read the security guidelines from parse and how to use parse in Javascript. When a user logs in the Parse.User.current() is set. This is a cache object and can be saved to local storage. This does not contain the username and password of a user but instead a sessionToken and probably other information. This cached object need to be used when communicating with the Parse API. Please read this part about the current user to get a better understanding about how this works.
accepted answer of: http://stackoverflow.com/q/28447256
has comment: http://stackoverflow.com/comment/45231240
type: Answer
has comment: http://stackoverflow.com/comment/45229714
score: 1

http://stackoverflow.com/comment/45239983
type: AnswerComment
type: Comment
score: 1
has text: ` ` this `div`
comment on: http://stackoverflow.com/a/28456627

http://stackoverflow.com/q/28483633
tagged with: javascript
tagged with: markdown
has comment: http://stackoverflow.com/comment/46730213
score: 0
has body: I'm trying to build a "mini-book" from some markdown pages. paths are files : docs/src/md/XYZ.md* and template : "docs/src/templates/page.txt" the desired result would be a single page with sections, printing page-breaks after sections and 2 columns (left and right) per section. file are freely named 0A-title0A, 0B-title0B, 1A-title1A, 1B-title1B... where the two-letters prefix (example "2A") stands for page two, "A" (left) column. I'm a bit confused using gulp-template, gulp-order, and so on... since I have to : grab markdown files in correct order transform them into HTML markup build a proper data object to pass to template() or swig() grab the template file (lodash or swig) generate in the template, the right number of sections corresponding to the number of pages (from 0 to N) what's the quickest approach ? could I do it into one single task regards EDIT : This not appears to work... the second call to 'gulp.src' seems to reset the stream and 'data0' object ! var docsOrdering = [ "0A-moxicubes.md", "0B-moxicubes.md", "1A-presentation.md", "1B-presentation.md", "2A-partie.md", "2B-mouvements.md", "3A-regle-capture.md", "3B-regle-retournement-deplacements.md", "4A-scores.md", "4B-classements.md" ]; gulp.task("build:docs", function() { var data0 = { sections : [] }; return gulp.src("src/md/*.md") .pipe(order(docsOrdering)) .pipe(markdown()) .pipe(data(function(file, cb) { var name = path.basename(file.path); // util.log(name); page = name.charAt(0); side = name.charAt(1) === "A" ? "left" : "right"; if(! data0.sections[page]) data0.sections[page] = {}; data0.sections[page][side] = file.contents.toString(); return cb(null, data0); })) // is this allowed, and have sense to grab the swig template ?? .pipe(gulp.src("src/text/docs.html")) .pipe(swig({ data : data0 } )) .pipe(gulp.dest("build")); });
tagged with: http://stackoverflow.com/tag/html
tagged with: templates
tagged with: gulp
answer count: 0
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45361065
has title: js gulp : building a simple 2-columns page from markdowns

http://stackoverflow.com/q/28496588
has title: ion auth forgot password mail not received in mail account
possible better answer: http://stackoverflow.com/a/28512887
tagged with: ion-auth
tagged with: email
favorite count: 0
score: 2
downvote count: 0
tagged with: php
has answer: http://stackoverflow.com/a/28512887
type: AnsweredQuestion
has body: In ion auth my forgot password mail sent successfully but not received in my email account... I have searched many tutorials but can't find any solution. Please Help me to solve this. my email config file $config['email_config'] = array( 'mailtype' =&gt; 'html', 'protocol' =&gt; 'smtp', 'smtp_host' =&gt; 'ssl://smtp.gmail.com', 'smtp_port' =&gt; '465', 'smtp_user' =&gt; 'k10kevalam@gmail.com', 'smtp_pass' =&gt; 'k10@kevalam', ); in ion_auth config $config['use_ci_email'] = TRUE; // Send Email using the builtin CI email class, if false it will return the code and the identity $config['email_config'] = 'file'; in ion_auth.php library if ($this-&gt;email-&gt;send()) { echo $this-&gt;email-&gt;print_debugger(); $this-&gt;set_message('forgot_password_successful'); return TRUE; } display message :"email sent" in my ion_auth.php controller function forgot_password() { { $this-&gt;form_validation-&gt;set_rules('email', $this-&gt;lang-&gt;line('forgot_password_username_identity_label'), 'required'); } else { $this-&gt;form_validation-&gt;set_rules('email', $this-&gt;lang-&gt;line('forgot_password_validation_email_label'), 'required|valid_email'); } if ($this-&gt;form_validation-&gt;run() == false) { //setup the input $this-&gt;data['email'] = array('name' =&gt; 'email', 'id' =&gt; 'email', ); if ( $this-&gt;config-&gt;item('identity', 'ion_auth') == 'username' ){ $this-&gt;data['identity_label'] = $this-&gt;lang-&gt;line('forgot_password_username_identity_label'); } else { $this-&gt;data['identity_label'] = $this-&gt;lang-&gt;line('forgot_password_email_identity_label'); } //set any errors and display the form $this-&gt;data['message'] = (validation_errors()) ? validation_errors() : $this-&gt;session-&gt;flashdata('message'); $this-&gt;_render_page('auth/forgot_password', $this-&gt;data); } else { // get identity from username or email if ( $this-&gt;config-&gt;item('identity', 'ion_auth') == 'username' ){ $identity = $this-&gt;ion_auth-&gt;where('username', strtolower($this…
has answer: http://stackoverflow.com/a/28501651
accepted answer: http://stackoverflow.com/a/28501651
tagged with: codeigniter
type: Question
upvote count: 2
answer count: 2
tagged with: javascript

http://stackoverflow.com/q/28539182
tagged with: store
type: AnsweredQuestion
has title: EXTJS 5 Load a VERY SIMPLE string array in store
type: Question
has body: I have a back end service that gives me an object which only contains an array of string. This is for example what the service gives me: { "DepartementsResult": [ "AME-CM", "BMAU", "BMKR", "BNVS" ] } So to get this data I want to create a nice and simple store, but a first problem appear: what should be the field??? var store = Ext.create('Ext.data.Store', { fields: ['data'], // What should be the fields here, I have none ^^" pageSize: 0, autoLoad: false, proxy: { type: 'ajax', url: 'data.json', // this file contains the data described above reader: { type: 'json', rootProperty: 'DepartementsResult' } } }); And then when I want to create a combo using this store I don't know what I should write also: var combo = Ext.create('Ext.form.field.ComboBox', { store: store, displayField: 'data', // what field should be displayed ^^" ? valueField: 'data', // same here I don't really know what to write fieldLabel: 'Departements', renderTo: Ext.getBody() }); Here is the link https://fiddle.sencha.com/#fiddle/iau to the sencha fiddle with the code described bellow ! Thanks a lot !!
score: 5
tagged with: arrays
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28593300
accepted answer: http://stackoverflow.com/a/28593300
favorite count: 0
tagged with: extjs
tagged with: extjs5
upvote count: 5
downvote count: 0

http://stackoverflow.com/q/28522749
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/54929855
tagged with: javascript
linked to: http://stackoverflow.com/q/6896592
score: 27
accepted answer: http://stackoverflow.com/a/28522823
possible better answer: http://stackoverflow.com/a/28537803
favorite count: 0
has title: Save Web page directly to PDF using JS
has answer: http://stackoverflow.com/a/28537803
upvote count: 28
tagged with: http://stackoverflow.com/tag/pdf
tagged with: http://stackoverflow.com/tag/html
has body: I want to save web page directly to PDF. What I have done is- &lt;form&gt; &lt;input type=button name=print value="Print" onClick="window.print()"&gt; &lt;/form&gt; But it gives me option for print or save the page as PDF. But what I want is when I click on the button, it directly save the page as PDF not showing any option. Is there any solution in JavaScript? Thanks in advance for helping.
linked to: http://stackoverflow.com/q/17293135
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28522823

http://stackoverflow.com/comment/45491835
comment on: http://stackoverflow.com/q/28592241
score: 1
has text: @johnSmith Works now, thanks! My problem was that ownedBy actually was the name of the category, and not it's ID.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28590969
answers question: http://stackoverflow.com/q/28590809
type: Answer
score: 4
has comment: http://stackoverflow.com/comment/45488950
has body: url: '@Url.Action("GetByWeight", "Wrestler")', that line needs to be rendered on a cshtml page. it doesnt get processed in a .js file.
upvote count: 4
has comment: http://stackoverflow.com/comment/45488395
accepted answer of: http://stackoverflow.com/q/28590809
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28499967
has body: here is my js: function sumAllFields() { var priceSum = 0; $(".price").each(function () { var o = $(this).parent().parent().index(); priceSum += Number($("#area" + o).text()) * $("#price" + o).val(); }) $("#sumPrice, #printSumPrice").html(priceSum.toFixed(2)); } And here is relevant html: 520 785 2.46 × 510 785 0.80 × What I am trying to do is to automatically sum all .price fields after one is dynamically deleted, and all I get is NaN. Before I delete any row, I get a nice number, but after I delete any rows, I get NaN.
has comment: http://stackoverflow.com/comment/45320614
possible better answer: http://stackoverflow.com/a/28500376
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28500376
score: 0
has comment: http://stackoverflow.com/comment/45319282
has answer: http://stackoverflow.com/a/28500138
type: Question
has title: jquery: Summing values after dynamic delete of content gets NaN
tagged with: javascript
answer count: 2
accepted answer: http://stackoverflow.com/a/28500138
tagged with: jquery
tagged with: nan

http://stackoverflow.com/comment/45312115
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28493567
score: 0
has text: Remember that you can't append `text` elements to any element -- it would have to be a `g` element.

yammer
type: Tag
tags question: http://stackoverflow.com/q/28438385
tag name: yammer
tags question: http://stackoverflow.com/q/28439274

http://stackoverflow.com/comment/45361233
type: Comment
has text: Everything else seems fine! just make sure your html is arranged like the one I wrote on the answer.. you have to move that sticky row to a new table.
type: AnswerComment
comment on: http://stackoverflow.com/a/28521780
score: 0

http://stackoverflow.com/a/28443780
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45230967
has body: It's a series of statements really popup_window != is_null // if true, continue to the statement in the parenthesis &amp;&amp; ( "function" == typeof popup_window.close // if true continue to close the window &amp;&amp; popup_window.close() , popup_window = is_null // this is executed as long as "popup_window != is_null" ); // is truthy, it doesn't depend on the other conditions assuming is_null is really null, firstly popup_window must not be null. Secondly, we can assume popup_window is another window, opened with window.open, as it supposedly has to have a close function, and it's a bit of a Yoda condition, but it can also be written typeof popup_window.close === "function" so popup_window has to have a close method to continue to the next step. The final step closes the popup window if it's not null, and if it has a close method. popup_window.close() so the other two conditions have to be truthy to get this far, there has to be a window, and it has to have a close method, and then that close method is called, and the window is closed. And then there's the comma. From the docs The comma operator evaluates each of its operands (from left to right) and returns the value of the last operand. and we have ("function" == typeof popup_window.close &amp;&amp; popup_window.close(), popup_window = is_null); lets write it a little differently ( // ↓ must be thruthy .... ↓ for this to execute (typeof popup_window.close === "function" &amp;&amp; popup_window.close()) , popup_window = is_null ); // ↑ unrelated, it's just another operand, seperated by comma The trick here is that the last part, after the comma, is always executed, as all operands seperated by the comma is evaluated. This means that if popup_window is not is_null, popup_window is explicitly set to is_null, regardless of the second condition. The second condition is also only exectuted it popup_window is not is_null, it then checks if there is a close() method, and closes the window, the statement after the comma…
upvote count: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28443386
type: Answer
accepted answer of: http://stackoverflow.com/q/28443386

http://stackoverflow.com/comment/45370340
comment on: http://stackoverflow.com/q/28527286
score: 0
type: Comment
has text: do you get any error on you console? also try to run your app w/o the route resolver and the authService provider
type: QuestionComment

http://stackoverflow.com/comment/45235509
has text: are you using any external font styles ?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28451655
score: 0

http://stackoverflow.com/comment/45494063
has text: Could you use the .NET fileupload or ajaxfileupload controls? There's some functionality already built into these for free, with the AjaxFileUpload it'll support uploading multiple documents in one post...
score: 0
comment on: http://stackoverflow.com/q/28588937
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28487626
tagged with: javascript
tagged with: jquery
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
possible better answer: http://stackoverflow.com/a/28487937
has answer: http://stackoverflow.com/a/28488109
has body: I cannot figure out how to change the colour of my menu elements when the "center" container or the "right" container is clicked (returning its state once clicked on again). Currently my 3 lines that are within my menu are white, I want to change them to red when these "center" and "right" containers are clicked. HTML for menu and containers: LOREM IPSUM LOREM IPSUM CSS for menu elements: .menu .line { height: 5px; width: 40px; background: #fff; position: absolute; top: 22.5px; left: 5px; -webkit-transition: all 250ms linear; transition: all 250ms linear; z-index: 100; } .menu .line:after, .menu .line:before { content: ' '; height: 5px; width: 40px; background: #fff; position: absolute; -webkit-transition: all 250ms linear; transition: all 250ms linear; } .menu .line:before { top: -10px; } .menu .line:after { bottom: -10px; }
has answer: http://stackoverflow.com/a/28487937
type: AnsweredQuestion
has title: Change colour of an element when clicked
accepted answer: http://stackoverflow.com/a/28487949
type: Question
score: 0
has answer: http://stackoverflow.com/a/28487949

http://stackoverflow.com/a/28440906
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28440771
type: Answer
accepted answer of: http://stackoverflow.com/q/28440771
has body: The "hidden value" that you are refering to, is actually the value attribute of the option. The one between the tags is the text of the option. When specified the value attribute, the .val() method from JQuery will already return the correct value. var selected = $('#selection').val(); alert(selected); try 1 try 2 try 3

http://stackoverflow.com/q/28586231
upvote count: 10
accepted answer: http://stackoverflow.com/a/28586394
has comment: http://stackoverflow.com/comment/45479674
downvote count: 0
possible better answer: http://stackoverflow.com/a/28586369
favorite count: 0
has answer: http://stackoverflow.com/a/28586369
tagged with: angularjs
answer count: 5
score: 10
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/37993450
has answer: http://stackoverflow.com/a/28586356
has answer: http://stackoverflow.com/a/28586326
tagged with: event-propagation
type: Question
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/28586394
has title: AngularJS: How to stop event propagation from ng-click?
has comment: http://stackoverflow.com/comment/45479818
tagged with: javascript
has body: I have directive that does something like so: app.directive('custom', function(){ return { restrict:'A', link: function(scope, element){ element.bind('click', function(){ alert('want to prevent this'); }); } } }); yes, it's necessary to do jQuery-way binding for this case. And now I want to stop this event(click) propagation if some condition met. Tried to do: $event.stopPropagation(); $event.preventDefault(); but it did not help. here fiddle for example - http://jsfiddle.net/STEVER/5bfkbh7u/

http://stackoverflow.com/q/28510338
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
favorite count: 0
tagged with: facebook
tagged with: css
upvote count: 6
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28510392
has comment: http://stackoverflow.com/comment/45339779
has body: I've been searching around the internet for a while now and am unable to find anything that works. I want to use my own custom image for the share button but whenever I try to surround the image the share button disappears. Sorry for lack of information because I'm new to the Facebook SDK. Any help would be greatly appreciated, thanks. Current code that I have:
type: Question
has title: Custom image for Facebook share button
tagged with: javascript
score: 6
accepted answer: http://stackoverflow.com/a/28510392
has comment: http://stackoverflow.com/comment/45339910

http://stackoverflow.com/comment/45339761
has text: @hopkins-matt seems like the image is not always fully visible in that solution. Correct me if wrong
comment on: http://stackoverflow.com/q/28510310
score: 0
type: QuestionComment
type: Comment

variables
tags question: http://stackoverflow.com/q/28572206
tag name: variables
tags question: http://stackoverflow.com/q/28516101
tags question: http://stackoverflow.com/q/28554867
tags question: http://stackoverflow.com/q/28445431
tags question: http://stackoverflow.com/q/28462158
tags question: http://stackoverflow.com/q/28461096
type: Tag
tags question: http://stackoverflow.com/q/28480185
tags question: http://stackoverflow.com/q/28448417
tags question: http://stackoverflow.com/q/28560602
tags question: http://stackoverflow.com/q/28585559
tags question: http://stackoverflow.com/q/28583578
tags question: http://stackoverflow.com/q/28590132
tags question: http://stackoverflow.com/q/28438851

http://stackoverflow.com/q/28503617
has answer: http://stackoverflow.com/a/28504134
downvote count: 0
has answer: http://stackoverflow.com/a/28504056
score: 1
has title: Sequelize wait until loop finished with callback
favorite count: 0
tagged with: promise
linked to: http://stackoverflow.com/q/23803743
tagged with: sequelize.js
has comment: http://stackoverflow.com/comment/45327264
has answer: http://stackoverflow.com/a/28631024
answer count: 4
tagged with: node.js
type: AnsweredQuestion
has body: coming from a php background, I'm trying to get my head around this callback stuff. Basically I wanna get some rows, then I would like to loop through these rows and check them against an other model (different db). I want the call back to wait until they all have been looped through and checked. The callback gets called before sequelize has looped through all the results. Basically I want the function to be 'blocking'. What do I have to change? toexport.getlasttransactions = function(lower,upper,callback){ var deferred = Q.defer(); var transactionsToUpdate = []; /////////////////////////// // set import conditions // /////////////////////////// var lowerbound = (lower) ? lower.format() : moment.utc().subtract(10, 'minutes').format(); var upperbound = (upper) ? upper.format() : moment.utc().format(); /////////////////////////////// // get IDs From Failed syncs // /////////////////////////////// FailedSync.find({ limit: 100 }) .then(function(res){ var FailedIDs = []; _.each(res, function(value,index){ FailedIDs.push(value.transaction_id); }); // build condition var queryCondition = { where: { updated_at: { between: [lowerbound,upperbound] } }, limit: 3 }; if(FailedIDs.length &gt; 0){ queryCondition = { where: Sequelize.and({ updated_at: { between: [lowerbound,upperbound] } }, Sequelize.or( { id: FailedIDs } )) } } ////////////////////////////// // get Phoenix Transactions // ////////////////////////////// PhoenixTransaction .findAll(queryCondition) .then(function(poenixTrx){ _.each(poenixTrx, function(value, index){ Transaction.findOne({ where: { id: value.id }}) .then(function(result){ if(!result || result.length === 0){ transactionsToUpdate.push(value); console.log('!result || result.length === 0') } else if(result &amp;&amp; result.length === 1){ if(result.hash != value.hash){ transactionsToUpdate.push(value); console.log('result.hash != poenixTrx[i].hash') } } }) .catch(function(err) { console.log(err) }) }) deferred.resolve(transactionsToUpdate); }) .catch(funct…
upvote count: 1
possible better answer: http://stackoverflow.com/a/28504423
has answer: http://stackoverflow.com/a/28504423
type: Question
accepted answer: http://stackoverflow.com/a/28631024
tagged with: javascript
has comment: http://stackoverflow.com/comment/45327277

http://stackoverflow.com/comment/45467551
type: QuestionComment
comment on: http://stackoverflow.com/q/28579480
type: Comment
has text: you want to say I should create it on "this"
score: 0

http://stackoverflow.com/a/28443599
upvote count: 1
has body: You can't switch from display:none to display:block in a transition. This is why your animations are happening instantly. Including the display change in the transition tells CSS to snap to position. You need to switch display to block, then wait a frame, then apply your other new properties for them to animate. This is why when you change the values in the inspector they animate. Here's a codepen showing an example of the above http://codepen.io/gunderson/pen/emyReW
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28442301

http://stackoverflow.com/a/28473434
has body: The Ext.Msg.alert method does not stop javascript code from executing. It means that after the first Ext.Msg.alert has shown script execution carries on, opening the second Ext alert. According to how it works only one instance of alert message can be presented at a time, so the second one simply overwrites the first one. As far as native alert function is concerned, it works totally different. It blocks UI and stops subsequent script execution. You can see it because it is rendered over any other page layout. That's why even though Ext alert is presented native browser alert will still cover it.
accepted answer of: http://stackoverflow.com/q/28473076
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28473076
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/comment/45345667
type: QuestionComment
comment on: http://stackoverflow.com/q/28513827
has text: so , after tr , td i can put my VAR with "," right?
score: 0
type: Comment

http://stackoverflow.com/comment/45254082
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/28464161
has text: `#lists ul { width: 100%; }`
type: Comment

http://stackoverflow.com/comment/45484327
has text: oh i am so sorry lars.. I am not sure what is goin on with fiddle. can i zip and send the files to your email id?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28558334

http://stackoverflow.com/a/28448320
has comment: http://stackoverflow.com/comment/45225118
has body: You can trigger the click event for first span using: $("#product-cat-menu .right-plus:first").click();
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/45225096
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/28448301

http://stackoverflow.com/q/28455539
answer count: 0
type: Question
tagged with: javascript
has title: expanding search bar exanding to the left
score: 0
has body: I'm using this. The code works fine and i have implemented it without problems. But is there any way to make the search bar expand towards the left and and not the default right? My Html: search The Css: #label { width: 29px; height: 29px; position: relative; z-index: 20; } #label label { display: block; width: 29px; height: 29px; background: url("../images/search_icon.png") 0 0; font-size: 0; color: rgba(0, 0, 0, 0); text-indent: -9999px; cursor: pointer; } #label label:hover { background: url("../images/search_icon.png") -60px 0 } #label.active label { background: url("../images/search_icon.png") -60px 0 } #input { position: absolute; top: 0; left: 60px; width: 450px; height: 60px; z-index: 5; overflow: hidden; } #input input { display: block; position: absolute; top: 0; left: -450px; width: 100%; height: 100%; margin: 0; padding: 0 10px; border:1px solid #e9e9e9; background-color: #fff; color: #fff; font-size: 18px; -webkit-backface-visibility: none; -moz-backface-visibility: none; -ms-backface-visibility: none; backface-visibility: none; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; -webkit-transition: left 0; -moz-transition: left 0; -ms-transition: left 0; -o-transition: left 0; transition: left 0; } #input input:focus { outline: none } #input.focus { z-index: 20 } #input.focus input { left: 0; -webkit-transition: left 0.3s; -moz-transition: left 0.3s; -ms-transition: left 0.3s; -o-transition: left 0.3s; transition: left 0.3s; } The JS: (in the footer include file) (function(window){ // get vars var searchEl = document.querySelector("#input"); var labelEl = document.querySelector("#label"); // register clicks and toggle classes labelEl.addEventListener("click",function(){ if (classie.has(searchEl,"focus")) { classie.remove(searchEl,"focus"); classie.remove(labelEl,"active"); } else { classie.add(searchEl,"focus"); classie.add(labelEl,"active"); } }); // register clicks outisde search box, and toggle correct classes document.addEventListene…
type: UnansweredQuestion
tagged with: searchbar
tagged with: css
has comment: http://stackoverflow.com/comment/45238124
has comment: http://stackoverflow.com/comment/45237692
tagged with: twitter-bootstrap-3

http://stackoverflow.com/comment/45295282
has text: @AlienWebguy True, I didn't really think of it like that. Might as well delete my answer.
type: Comment
comment on: http://stackoverflow.com/a/28486739
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45471725
type: Comment
comment on: http://stackoverflow.com/a/28581160
has text: You're also missing closing ` ` tags on both modals. I have updated my answer with an example.
type: AnswerComment
score: 0

http://stackoverflow.com/a/28464927
has body: The problem in your code is that, if you check for "*somestring*", the .indexOf() function will actually look for that exact string, meaning that asterisks aren't used as a wildcard, and will only match if the string contains them. Here's an example: "hello".indexOf("*hello") // -1 there's no * "123hello".indexOf("*hello") // -1 there's no * "*hello".indexOf("*hello") // 0 here it is, in the first position "123*hello".indexOf("*hello") // 3 and again, in the fourth position So, in your case, you should use Regular Expressions, like this: var urlExp= /https?\:\/\/(facebook|google|example)\.com/i; chrome.tabs.onCreated.addListener(function (tab) { if (urlExp.test(tab.url)) { chrome.tabs.remove(tab.id); alert("things"); } });
type: Answer
answers question: http://stackoverflow.com/q/28464452
has comment: http://stackoverflow.com/comment/45628945
has comment: http://stackoverflow.com/comment/45634476
score: 0

http://stackoverflow.com/a/28488995
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/45300344
answers question: http://stackoverflow.com/q/28487894
has body: If you generalize your problem, you're basically asking if you can verify a sort of 'path' in an object as being legitimate. The way I would do this is with an a function that takes the object and the desired 'path': function has(obj, path){ var temp = obj; var path = path.split('.'); for(var i = 0; i &lt; path.length; i++){ if(temp[path[i]]) temp = temp[path[i]];//path still exists else return false;//path ends here } return true;//the whole path could be followed } This example uses a path passed as 'bar.foo' but you could easily adjust for an array ['bar','foo'] or so that it is a variable amount of arguments passed in. This would make your example: if(has(someObject, bar + '.' + foo)){ if(typeof someObject[bar][foo] == "function"){ // Do something } } While this doesn't reduce this example in specific, if you had a much longer path to search, this could significantly reduce if statements chained together. You could modify the function so that it returns the value specified by the path should it exist instead of true so that you only deal with one line: function get(obj, path){ var temp = obj; var path = path.split('.'); for(var i = 0; i &lt; path.length; i++){ if(temp[path[i]] !== undefined) temp = temp[path[i]];//path still exists else return undefined;//path ends here } return temp;//the whole path could be followed } if(typeof get(someObject, bar + '.' + foo) === 'function'){ //do something }
score: 1
upvote count: 1

testing
tags question: http://stackoverflow.com/q/28580540
tags question: http://stackoverflow.com/q/28449902
tag name: testing
tags question: http://stackoverflow.com/q/28505101
tags question: http://stackoverflow.com/q/28456457
tags question: http://stackoverflow.com/q/28495406
tags question: http://stackoverflow.com/q/28443667
type: Tag
tags question: http://stackoverflow.com/q/28517910
tags question: http://stackoverflow.com/q/28503961
tags question: http://stackoverflow.com/q/28511013
tags question: http://stackoverflow.com/q/28440763

http://stackoverflow.com/q/28458750
has comment: http://stackoverflow.com/comment/45324995
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45330362
has comment: http://stackoverflow.com/comment/45326042
has title: AngularJS ngRepeat replacing bindings with nothing
tagged with: angularjs-ng-repeat
answer count: 0
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45330112
has comment: http://stackoverflow.com/comment/45244303
has body: I have an AngularJS app that is searching through a list of services, which then displays the results below the search bar using ngRepeat. The right amount of search results are being displayed, but the bindings are being filled with nothing, leaving the anchor tags empty. Here is the markup being generated: I have the exact same code running on my local machine, it works as expected, and the versions of AngularJS are the same, so I have no clue what is going on. Has anyone experienced this before, and how have hey resolved it? No errors are thrown, the data is being retrieved via AJAX from a json file. Here is the template with the ngRepeats in it: {{service.serviceName}} {{service.abstract}} {{service.office}} {{service.contact}} The code behind this isn't really all that important since it is an exact copy of everything from one page to another, and it works on the previous page. There are no differences in the HTML, CSS or Javascript, other than the fact that the markup on the new page is filled in with blanks. I have already checked to make sure that the json data is being pulled in correctly, and that the versions of AngularJS are the same (Version is 1.2.21). Here are the custom filters: serviceSearchbar.filter('startFrom', function () { return function (input, start) { start = +start; //parse to int return input.slice(start); } }); serviceSearchbar.filter('hasValue', function() { return function (input) { if (angular.element('#servicesQuery').val()) { return input; } return []; } }); serviceSearchbar.filter("isSelected", function () { return function (input) { var response = {}; if (input !== undefined) { Object.keys(input).forEach(function (tag) { if (input[tag] !== false) { response[tag] = true; } }); } return response; } }); serviceSearchbar.filter("filterTags", ["$filter", function ($filter) { return function (input, tags) { var selectedTags = [], response = input, found = false, numSelectedTags; if (input === undefined) { return input; } if (tags !== un…
has comment: http://stackoverflow.com/comment/45326014
tagged with: javascript
score: 0

jasmine
tags question: http://stackoverflow.com/q/28491640
tags question: http://stackoverflow.com/q/28500405
tag name: jasmine
tags question: http://stackoverflow.com/q/28520476
tags question: http://stackoverflow.com/q/28500161
tags question: http://stackoverflow.com/q/28546182
tags question: http://stackoverflow.com/q/28454166
tags question: http://stackoverflow.com/q/28458373
tags question: http://stackoverflow.com/q/28495406
tags question: http://stackoverflow.com/q/28560787
tags question: http://stackoverflow.com/q/28583479
tags question: http://stackoverflow.com/q/28503961
tags question: http://stackoverflow.com/q/28536866
tags question: http://stackoverflow.com/q/28446327
tags question: http://stackoverflow.com/q/28557749
type: Tag
tags question: http://stackoverflow.com/q/28443188
tags question: http://stackoverflow.com/q/28580540

http://stackoverflow.com/comment/45431035
type: QuestionComment
has text: You have to award it manually. Bro please clicked on the +50 near my answer, please :) .To award the bounty manually, click on the +50 (or whatever bounty amount was allocated) button on the left side of the answer you want to award
score: 0
comment on: http://stackoverflow.com/q/28480578
type: Comment

http://stackoverflow.com/comment/45348839
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28506385
has text: the idea of starting the animation where it paused is in some cases useful, but in my example its quite annoying. I am trying to remove this. You have created `index` to count where the action takes places. I would like to set `index` to the value of the `li`s number (like the fourth li sets the index to `index (4)` so that the animation continues where the user has left the hover! I can't make it work. Can you help me once again?
score: 0

http://stackoverflow.com/comment/45292074
type: QuestionComment
comment on: http://stackoverflow.com/q/28484995
has text: You're declaring the array such that it's only initialized in the `else` clause. Whenever you find an object and decide to recurse, "arrayJSON" will be `undefined`.
score: 0
type: Comment

http://stackoverflow.com/q/28483152
has answer: http://stackoverflow.com/a/28566432
favorite count: 0
has answer: http://stackoverflow.com/a/28483284
accepted answer: http://stackoverflow.com/a/28619125
has answer: http://stackoverflow.com/a/28483498
type: AnsweredQuestion
tagged with: object
score: 3
has comment: http://stackoverflow.com/comment/45288403
has title: How do you search object for a property within property?
has comment: http://stackoverflow.com/comment/45294872
has comment: http://stackoverflow.com/comment/45298898
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45302208
has answer: http://stackoverflow.com/a/28521243
possible better answer: http://stackoverflow.com/a/28520496
tagged with: arrays
has answer: http://stackoverflow.com/a/28520496
tagged with: javascript
answer count: 6
upvote count: 4
tagged with: search
has comment: http://stackoverflow.com/comment/45294916
has body: I have this object: key = { spawn:{type:1,img:app.assets.get('assets/spawn.svg')}, wall:{type:2,img:app.assets.get('assets/wall.svg')}, grass:{type:3,img:app.assets.get('assets/grass.svg')}, spike:{type:4,img:app.assets.get('assets/spike.svg')}, ground:{type:5,img:app.assets.get('assets/ground.svg')} }; And I have an array with only types and I need to add the given image to it, the array looks something like this: [{type:1,image:null},{type:3,image:null},{type:2,image:null},{type:2,image:null},{type:5,image:null}] Basically I want to loop the array, find the type in the key object and get the given image and save it into the array. Is there any simple way to do this?
has comment: http://stackoverflow.com/comment/45294842
has answer: http://stackoverflow.com/a/28619125

http://stackoverflow.com/a/28531263
answers question: http://stackoverflow.com/q/28525649
type: Answer
has body: As pwdst mentioned above, its better to use feature detection rather than User Agent sniffing, so the best thing to do over here is to, use Modernizer.touch as they say why to reinvent the Wheel. so lets see the solution: if(win.width &gt;=1024 &amp;&amp; Modernizr.touch == false) { /*This is for the desktop with a dimension of 1024px or above*/ /*You can put any thing specific inside*/ } if(win.width == 1024 &amp;&amp; Modernizr.touch == true) { /*This is for the tablet or touch interfaces with a dimension of 1024px*/ /*You can put any thing specific inside*/ /*there might be some mistake here but you get the idea !!*/ } Quite easy and simple using Modernizer JS. I hope this answers the question, ofcourse its my question and I got what I wanted however there might some better solutions out there.
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/123024269
downvote count: 0

http://stackoverflow.com/comment/45382837
comment on: http://stackoverflow.com/q/28534034
type: Comment
type: QuestionComment
has text: Sorry for my poor english, i was wanted to on submit then post the value and insert into database. But what i face now is it nothing happen when i'm trying to click "Yes". Any suggestion? Thanks
score: 0

http://stackoverflow.com/comment/45394922
type: Comment
comment on: http://stackoverflow.com/a/28540367
has text: you should type $(window).addEventListener(); Not '$(window).addEventListener') Or you can type only window.addEventListener();
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45446598
comment on: http://stackoverflow.com/a/28567777
type: AnswerComment
has text: From the question: "*And my question is how to change this .tree style to another one? And if i click again the style return to the beginning style?*" Sounds like toggle to me.
score: 0
type: Comment

http://stackoverflow.com/q/28547390
has comment: http://stackoverflow.com/comment/45409806
score: 0
has comment: http://stackoverflow.com/comment/45408925
answer count: 1
tagged with: mapbox
type: AnsweredQuestion
tagged with: leaflet
has title: array of marker layers is not being deleted from leaflet map
has answer: http://stackoverflow.com/a/28575482
accepted answer: http://stackoverflow.com/a/28575482
type: Question
has comment: http://stackoverflow.com/comment/45410280
has body: I am using the following code to delete circles from the map before adding new circles depending on location. if(markers.length&gt;0) { for (var i = 0; i &lt; markers.length; i++) { map.removeLayer(markers[i]); } } var lat,lon; var road; var detector; //var svg=d3.select("#map").append("svg"); data.forEach(function(d) { lat=d.lat; lon=d.lon; road=d.road; detector=d.detectorid; markers.push((new L.circle([lat, lon], 500, { color: 'yellow', fillColor: '#f0f', fillOpacity: 0.5 })).bindPopup("Road Name:"+road+"&lt;br&gt;Detector ID: "+detector)) }); for (var i = 0; i &lt; markers.length; i++) { map.addLayer(markers[i]); } map.setView([lat, lon],13); map.dragging.enable(); But the previous circles are not being added. New circles are being added side by side the old circles are kept. How can I remove the previous circles?
has comment: http://stackoverflow.com/comment/45412583
tagged with: javascript

http://stackoverflow.com/comment/67051086
type: Comment
comment on: http://stackoverflow.com/a/28591782
type: AnswerComment
has text: I agree with @DanaWoodman - there is no need for you to use JQuery here react's lifecycle should update the component when a state is updated.
score: 0

http://stackoverflow.com/a/31128793
answers question: http://stackoverflow.com/q/28557245
has body: It appears that Transloadit still does not support base64 data, but with newer browsers it's possible to take base64 data from a variable, convert it to binary, and send it in a file upload. http://support.transloadit.com/discussions/questions/8587-how-to-upload-a-canvas-image-to-transloadit
score: 0
type: Answer

http://stackoverflow.com/comment/45403082
type: QuestionComment
score: 1
has text: Please define "doesnt work". What you expect your code to do, and what it does instead? Also it would be nice to know the values of `name`, `uid` and `blub` variables, and how and where you've defined those variables.
comment on: http://stackoverflow.com/q/28544908
type: Comment

http://stackoverflow.com/comment/45421623
comment on: http://stackoverflow.com/q/28554349
has text: I was hoping to just use the bootstrap css without having to add classes. Shouldn't that be part of the bootstrap css? This is the first time I have ever had this occur and I have used bootstrap for other navbar menus. This is the first time implementing a template made by someone else.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28573714
score: 0
type: Answer
has body: Nikola offered the solution I was looking for. My random typos in code aside— the concept of creating a function that refreshes the random time variable, then calling that particular function in place where the time parameter of the animation is, works brilliantly. In this case I used tweenMax but could easily translate to a setInterval or any number of parameters that require one variable to change every time its is called.
answers question: http://stackoverflow.com/q/28556304

http://stackoverflow.com/q/28538306
type: AnsweredQuestion
has body: In the following code example, clicking on the anchor with id openPage should open a new page. The test only succeeds, when using a short delay sleep(1000) as getCurrentUrl does not seem to wait until the page is loaded. var element = driver.findElement(webdriver.By.id('openPage')); element.click(); driver.sleep(1000); var promise = driver.getCurrentUrl(); promise.then(function (url) { assert.strictEqual(url, 'page title'); }); What would be the proper (async) way to code this without using a delay ?
tagged with: webdriver
type: Question
has comment: http://stackoverflow.com/comment/45404992
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28549224
has comment: http://stackoverflow.com/comment/45405365
accepted answer: http://stackoverflow.com/a/28549224
linked to: http://stackoverflow.com/q/520812
tagged with: selenium-webdriver
has title: Wait for page to load using webdriverjs with mocha/chai

http://stackoverflow.com/a/45569023
has body: MetisMenu support animate with animate.css like this: &lt;ul class="animated bounce"&gt; ... &lt;/ul&gt; You also need to include animate.min.css in the document: &lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css" /&gt; If it does not work try eliminating any conflicts by temporarily disabling other CSS files in your template to narrow down the problem. Examples / Fiddle Hover example.
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28579564
score: 1
downvote count: 0

http://stackoverflow.com/comment/45379678
score: 0
has text: And always, always, always sanitize user input. Always.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28532282

http://stackoverflow.com/q/28502470
tagged with: javascript
has comment: http://stackoverflow.com/comment/45324232
has title: Min and max index in JavaScript array
has comment: http://stackoverflow.com/comment/45324294
upvote count: 1
has comment: http://stackoverflow.com/comment/45324185
has body: I have simple question. I have JS array like that: data[-5]=[...]; data[-2]=[...]; data[-1]=[...]; data[4]=[...]; data[6]=[...]; data[7]=[...]; How can I get automatically the minimum (data[-5]) and maximum (data[7]) element?
has answer: http://stackoverflow.com/a/28502625
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45324797
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45324363
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28502731
tagged with: arrays

http://stackoverflow.com/comment/45456622
comment on: http://stackoverflow.com/a/28573386
score: 0
has text: The iteration is not happening twice, here. Just iterate once over all the objects, remove the `id` from the `linksTo` property of each object, if present, at the same time check if the node which is to be deleted is found, keep track of its `index`. Then remove the `Object` from the `array` at last by its index.
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/45358960
type: Comment
has text: I am unsure of the syntax to get the images to show up when I choose different options in my list
type: AnswerComment
comment on: http://stackoverflow.com/a/28515082
score: 0

http://stackoverflow.com/comment/45378299
has text: answer anyone, so I can check?
comment on: http://stackoverflow.com/q/28531469
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45447735
comment on: http://stackoverflow.com/q/28568651
type: Comment
type: QuestionComment
score: 0
has text: what is the point of the directive? also, the model is going to be the object from the array, not the id of that object. http://plnkr.co/edit/CPhENXYXP7csvW00up2I?p=preview

http://stackoverflow.com/comment/45474421
has text: No problem, you can include more explanation about the problem , or you can clarify it your own your way
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28583354
type: AnswerComment

http://stackoverflow.com/q/28438807
tagged with: reactjs
type: AnsweredQuestion
has title: How to build a table dynamically
downvote count: 0
score: 1
favorite count: 0
has body: I try to build a table dynamicly with reactJS but have two questions that I can´t solve : In the GridList component I got this row <GridRow data={data1} key={i} /> I dont really want to fetch the "global" var but instead use the data that are sent in to the method? How do I do this? In the GridRow I need too loop the columns(as I do right now) but I need to get the proper cell value and right no I just gets this exception : Error while rendering "GridBox" to "react1": Unable to get property 'data' of undefined or null reference Code var data1 = {"Columns":[{"Title":"Title1","HTMLClass":"g1_Title"},{"Title":"Title2","HTMLClass":"g2_Title"},{"Title":"Title3","HTMLClass":"g3_Title"}],"Rows":[{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]}]}; var GridRow = React.createClass({ render: function() { if(this.props.data){ var Cell = this.props.data.Columns.map(function (column, i) { return ( {this.props.data.Cells[i]} ); }) } return ( {Cell} ); } }); var GridHead = React.createClass({ render: function() { if(this.props.data){ var Cell = this.props.data.Title; var HtmlClass = this.props.data.HTMLClass; } return ( {Cell} ); } }); var GridList = React.createClass({ render: function() { if(this.props.data){ var Header = this.props.data.Columns.map(function (columns) { return ( <GridHead data={columns} /> ); }); var Row …
type: Question
has answer: http://stackoverflow.com/a/28439690
upvote count: 1
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28439690

http://stackoverflow.com/comment/45236584
has text: I just though it might be a problem related to dependence between .js files, and would be useful to other people facing the problem. Sorry
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28454764

http://stackoverflow.com/comment/45213209
type: AnswerComment
has text: Cap the generations where? I'm sure whatever you are thinking of is highly possible.
type: Comment
comment on: http://stackoverflow.com/a/28441335
score: 0

mobile-browser
tags question: http://stackoverflow.com/q/28450096
tag name: mobile-browser
type: Tag
tags question: http://stackoverflow.com/q/28529925

mediawiki-extensions
tag name: mediawiki-extensions
tags question: http://stackoverflow.com/q/28592460
type: Tag
tags question: http://stackoverflow.com/q/28457480

http://stackoverflow.com/q/28554186
tagged with: validation
has body: I have these scripts... Name: &lt;input type="text" id="inputName" onblur="verifyName(this.value)"&gt; &lt;script type="text/javascript"&gt; function verifyName(nameInput) { if(nameInput=="") { // error alert('please enter your name'); } else { // accepted } } &lt;/script&gt; This will display an error if the user don't want to enter his/her name on the textbox. What if the user is lazy and he/she will enter " " (a space or more) as a name? This can be accepted by the JavaScript. It will return false on the if condition. But I want the user not to enter only spaces. Is there any way to do that? Note: Any number of spaces (without any letters) inputted are invalid. If the user inputs one of the texts below, JavaScript should accepts/rejects the input as follows... "John" --&gt; valid "" --&gt; invalid "John Doe" --&gt; valid " " --&gt; invalid "John Doe" --&gt; valid (can be edited to remove too many spaces) " Kim" --&gt; valid (can be edited to remove too many spaces) " " --&gt; invalid
duplicate of: http://stackoverflow.com/q/498970
accepted answer: http://stackoverflow.com/a/28554249
answer count: 4
has comment: http://stackoverflow.com/comment/45421328
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28554236
has answer: http://stackoverflow.com/a/28554236
score: 0
has answer: http://stackoverflow.com/a/28554249
type: Question
has answer: http://stackoverflow.com/a/28554460
has title: Make Textbox with Value of All Spaces Invalid
tagged with: javascript
linked to: http://stackoverflow.com/q/498970
has answer: http://stackoverflow.com/a/28554245

http://stackoverflow.com/comment/45483553
comment on: http://stackoverflow.com/a/28537379
type: AnswerComment
score: 0
type: Comment
has text: @HessamMT You're certainly welcome, sir! Feel free to mark my answer as correct, and/or up-vote it if I helped.

http://stackoverflow.com/comment/45398125
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28542284
score: 0
has text: `$.each({"type": "Item", "type": "Item2", "name": "Item Name", "name": "Item Name2"}, function(key, value) {console.log(key);});`: "type", "name".

http://stackoverflow.com/comment/45234189
comment on: http://stackoverflow.com/q/28453483
has text: You have hardcoded gridview id in your function (#devGV). Perhaps try to pass the gridview as an argument of the calculate function?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45385038
has text: Yeah, if you are in the angular realm, its good to use $ scopes.
type: AnswerComment
comment on: http://stackoverflow.com/a/28535149
type: Comment
score: 0

http://stackoverflow.com/q/28509855
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28510222
tagged with: mongoose
has answer: http://stackoverflow.com/a/28510344
has comment: http://stackoverflow.com/comment/45338824
has comment: http://stackoverflow.com/comment/45339664
has body: I have created a Mongoose connection manager to manage a unique connection per user in my application. At the time that a user logs in, I create a new connection to a custom database URI that is unique to that user. I name the connection so that it can be retrieved (looked up) later. Example invocation: var myConnection = require('connection-manager').createConnection(user._id); As you can see here, I name my connections after an _id property of a user object. Easy enough. I can then look up my unique connection for this user using: var myConnection = require('connection-manager').getConnection(user._id); The only difference between those two methods is that one creates and returns the new connection and the other (the getConnection() method) does a simple look up in the pool of current connections and returns the connection object that matches our passed name (user._id). Here's where I'm running into problems. In my server controllers, I normally do this: var mongoose = require('mongoose'), Foo = mongoose.model('Foo'); This is really straight forward. I'm loading the model, 'Foo', that has been registered with the default Mongoose connection. This is handy because all methods of my controller can simply invoke this model by doing something like: exports.create = function(req, res, next) { myFoo = new Foo({whatever: whatever}); }; This works because Foo was declared and loaded at the start of the file. But now that I'm moving to a connection manager, I need to be able to do something like this in my controller file: 'use strict'; var manager = require('connection-manager').getConnection(user._id), Foo = manager.model('Foo'); exports.create = function(req, res, next) { var myFoo = new Foo({whatever: whatever}); }; The problem is that the request object that gets passed to exports.create() is where the user._id is that I need in order to look up my custom connection in the connection manager. How do I work around this..?
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28510344
type: Question
has title: MEAN.JS -- Request objects, Express controllers, and Mongoose Schemas
tagged with: mean-stack
tagged with: javascript
has comment: http://stackoverflow.com/comment/45339733
has comment: http://stackoverflow.com/comment/45339448
tagged with: express
has comment: http://stackoverflow.com/comment/45339601
possible better answer: http://stackoverflow.com/a/28510222
has comment: http://stackoverflow.com/comment/45339636

vb6
type: Tag
tag name: vb6
tags question: http://stackoverflow.com/q/28582943

soundmanager2
tags question: http://stackoverflow.com/q/28442754
type: Tag
tag name: soundmanager2

http://stackoverflow.com/a/28561641
has body: This worked for me: $('#tabs-5-expand').click(function(){ $('#tabs-5-node23').parents('li').each(function() { $('#tree5').checkboxTree('expand', $(this)); }); });
accepted answer of: http://stackoverflow.com/q/28561406
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28561406

http://stackoverflow.com/comment/45303720
score: 0
comment on: http://stackoverflow.com/q/28491260
type: QuestionComment
type: Comment
has text: No, this is just one example where I had the problem. Any other wrapper could be set to overflow: scroll; The point is that i need to show my popup when user scroll 80% of the page. So when there are css rules like this one, scroll doesn't work on window so I need to dynamically find which element is scrolling or set scroll to propagate or any other solution just to show my popup after 80% scroll

http://stackoverflow.com/comment/45489901
type: AnswerComment
type: Comment
has text: Make sure to take the element and put that in your element. Have a look at the source file for an example. This is for Bootstrap, a css framework to make the Div look like a button.
comment on: http://stackoverflow.com/a/28588999
score: 0

http://stackoverflow.com/comment/45358742
comment on: http://stackoverflow.com/a/28518034
score: 0
type: Comment
has text: I guess I got your point (each column `rowspan` make divider for the next column rows). I was thinking the same when I wrote the code, but dropped the idea as it would still leve a place for further optimisations - like merging columns that have the same values but not next to each other (lets say **John** has a *cow , lion* and *cow* again, so there's a place to make a *cow* with `rowspan=2` and a *lion* with `rowspan=1` :-) ). I will think about and I'll give you know. It will for sure require a 2D array and **at least** one more loop (through the array)
type: AnswerComment

http://stackoverflow.com/q/28592790
type: AnsweredQuestion
score: 3
tagged with: alert
possible better answer: http://stackoverflow.com/a/28593115
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28593179
tagged with: javascript
upvote count: 4
answer count: 2
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has body: I'm using Bootstrap and want to realize the following: having a kind of an alert box which disappears after a short period of time automatically. I have something special in my Imagination which I saw often but can't find at the moment. I think the standard bootstrap alert (http://getbootstrap.com/javascript/#alerts and http://getbootstrap.com/components/#alerts) is not the right thing, is it? Because I want something to just "appear on top of something", so not as content of the page, if you know what I mean. So it should just show a short "success information" when entering the page, and then it should disappear again. Or do I missunderstand Bootstrap alert wrong and it's exactly what I'm searching for? If yes, how do I use it? Where do I have to put that "div"?
has title: alert box automatic disappear
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/45492210
has answer: http://stackoverflow.com/a/28593179
has answer: http://stackoverflow.com/a/28593115

http://stackoverflow.com/comment/45330637
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28505652
has text: You should debounce onscroll event by using a timeout e.g. BUT you could use instead: `$('#el:not(:animated)').animate({ left: toMove }, 500);`

http://stackoverflow.com/comment/45252628
has text: The problem with letting the server-side handle multiple items is it can't update the status on the calling page as it processes each item.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28462851

http://stackoverflow.com/a/28590766
type: Answer
answers question: http://stackoverflow.com/q/28474387
has body: I would highly recommend that you have your JSON response return a hash instead of an array. I believe Ember's RESTAdapter is expecting the JSON response to look like the following: { "events": [ { "Id": 1, "Name": "psilva", "Project": "a", "Objectives": "s", "City": "a", "Country": "s", ... The main advantage is that you can sideload records of different types, which many APIs end up doing to avoid the overhead of making multiple requests for resources, in addition to being a bit more explicit about exactly what you're returning with your response.
score: 0

http://stackoverflow.com/q/28586244
linked to: http://stackoverflow.com/q/15627161
type: Question
has answer: http://stackoverflow.com/a/28586496
tagged with: javascript
score: 0
has title: How to share search functionality between controllers in Angular JS
answer count: 1
has comment: http://stackoverflow.com/comment/45479722
has comment: http://stackoverflow.com/comment/45479792
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45479723
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45479856
has body: I have 3 controllers that all do a paged search of data. They use different base URLs but have the same basic functionality. They have the variables offset, pageSize, etc and methods search, next, prev, etc. What would be the proper way to share this functionality between the controllers? I'm thinking of using a service but I don't know if that's the wrong way to go about doing it or not.

http://stackoverflow.com/a/28469723
type: Answer
has body: I'm afraid you are not able to do this in javascript. I would prefer to write a global function and use it like this: var v1 = 100; var result1 = percentage(v1); var v2 = null; var result2 = percentage(v2); If you have defined a 'namespace' for your library. You can add the percentage function to your 'namespace'. Like this: // 'mylib' is your namespace window.mylib = {}; window.mylib.percentage = function (value) { // ... }; var result = mylib.percentage(null); The namespace mylib can be changed to some shorter word (so it looks more elegant). For example, use $ instead of `mylib', then you can use it like this: var result = $.percentage(null); NOTICE: Many existing libraries like jQuery already use $, so you should make sure they won't conflict. I would prefer to use short alias (2 or 3 chars) of your project name as the 'namesapce'.
accepted answer of: http://stackoverflow.com/q/28469511
answers question: http://stackoverflow.com/q/28469511
type: AcceptedAnswer
score: 0

http://stackoverflow.com/comment/45443922
score: 0
comment on: http://stackoverflow.com/a/28566720
type: Comment
has text: sadly this didnt change anything
type: AnswerComment

http://stackoverflow.com/a/28573964
answers question: http://stackoverflow.com/q/28573663
type: Answer
has comment: http://stackoverflow.com/comment/45457462
has comment: http://stackoverflow.com/comment/45457706
has body: document.frm.display.value -= v_mult, document.frm.display.value = v_sing; document.frm.display.value -= (" + Ticket" + document.frm.display.value = " + Ticket" I want the value to be "Ticket" but I don't want "Ticket" to be erased when I need to add "VIP". I think you want something like this: val = document.frm.display.value; document.frm.display.value = (v_mult + val + v_sing); You may be getting NaN because you are adding strings to numbers with +=
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28573663
has comment: http://stackoverflow.com/comment/45499334

http://stackoverflow.com/q/28446087
has answer: http://stackoverflow.com/a/28446143
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I have implemented multiselect filter like this http://www.erichynds.com/examples/jquery-ui-multiselect-widget/demos/#animations However after refresh it is holding the value(because filtered records are showing in UI) but the multiselect checkbox is getting cleared. Can you please suggest me how to bring back the selected value in the UI after refresh? This is my code to retain the value from cookie after refresh searchString = cookievalue.trim(); searchString = searchString.replace(/%20/g,' '); searchString = searchString.replace(/%7C/g, '|'); //searchString = searchString.replace(/%27/g, "'"); if (searchString.indexOf(ws1) &gt;= 0){ //j$('#first').prop('checked') = true; document.getElementById('aa').checked = true; } if (searchString.indexOf(ws2) &gt;= 0){ document.getElementById('bb').checked = true; } oTable.fnFilter(searchString,18,true,false);
has title: Filter is getting cleared after refresh
upvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28446143
score: 1
type: Question

http://stackoverflow.com/comment/45469756
type: Comment
type: AnswerComment
score: 0
has text: Great, now, to check that _at least one textbox is filled_, replace `&&` with `||` and I'll upvote :)
comment on: http://stackoverflow.com/a/28580783

http://stackoverflow.com/comment/50976974
comment on: http://stackoverflow.com/a/28813121
type: AnswerComment
has text: What is the current status?
score: 0
type: Comment

http://stackoverflow.com/a/28537279
has body: In Danf, when you define Notifier.defineDependency('_listener', 'listener');, a proxy is created on the listener used by the notifier. This proxy prevent you to use anything else than what it is specified in the interface listener. To sum up, yes the interfaces are ensured, no you won't be able to call method doUpdate in the notifier. However, as this feature takes a lot of performances (because it is not a built in javascript feature), it is only enabled in debug mode.
accepted answer of: http://stackoverflow.com/q/28536562
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28536562
type: Answer
upvote count: 2
score: 2

http://stackoverflow.com/a/28441673
has comment: http://stackoverflow.com/comment/45215641
has comment: http://stackoverflow.com/comment/45215347
upvote count: 1
answers question: http://stackoverflow.com/q/28439611
score: 1
has comment: http://stackoverflow.com/comment/45215496
has comment: http://stackoverflow.com/comment/45213874
has body: As I commented your code works just fine without reporting unhandled rejection: function promise3(value1, value2) { return Promise.reject(new Error("the error")) } var promise1 = Promise.resolve(); var promise2 = Promise.resolve(); var promise4 = Promise.join(promise1, promise2, function (value1, value2) { // promise 3 needs the values resolved from promise1 and promise2 return promise3(value1, value2); }); Promise.all([promise4]).catch(function(error) { console.log(error.message === "the error") }); http://jsfiddle.net/6hx0zdd2/ What's more likely is that you have forgotten a return statement somewhere which is needed to wire promises together and make chaining (and error propagation) work.
has comment: http://stackoverflow.com/comment/45213165
downvote count: 0
has comment: http://stackoverflow.com/comment/45215895
has comment: http://stackoverflow.com/comment/45213184
type: Answer

http://stackoverflow.com/comment/45224769
type: Comment
has text: i need to show all th table values within the UI or make that part only scrollable..
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28447220

http://stackoverflow.com/comment/45308472
comment on: http://stackoverflow.com/q/28494171
score: 0
type: Comment
type: QuestionComment
has text: are you referring to pagination ?

http://stackoverflow.com/comment/45238438
has text: The spaces before the decimal points are messing with the sort order, since you only apply `parseFloat()` to those values. `parseFloat()` will stop parsing at the space.
comment on: http://stackoverflow.com/q/28455890
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/a/28478302
score: 1
upvote count: 1
type: Answer
downvote count: 0
has body: If you give your submit buttons names, it will create an extra space in the url if the method is set on GET(which you probably use): &lt;input type="submit" name="on" value="Switch Tile On"&gt; &lt;input type="submit" name="off" value="Switch Tile Off"&gt; You will get url/tile=x&amp;on=Switch+Tile+On If you hit the first button. Now you can check whether the button was "on" or "off" with if(isset($_GET['on'])) or if(isset($_GET['off']))
answers question: http://stackoverflow.com/q/28478148

angular-ui
tags question: http://stackoverflow.com/q/28536559
tags question: http://stackoverflow.com/q/28514785
type: Tag
tags question: http://stackoverflow.com/q/28588318
tags question: http://stackoverflow.com/q/28541179
tags question: http://stackoverflow.com/q/28461579
tags question: http://stackoverflow.com/q/28558375
tag name: angular-ui
tags question: http://stackoverflow.com/q/28504011

http://stackoverflow.com/comment/45309215
comment on: http://stackoverflow.com/q/28494579
type: Comment
score: 1
type: QuestionComment
has text: It depends on the server methods where form is being posted...:)

http://stackoverflow.com/comment/45321064
type: Comment
has text: It looks like you've created arrays (`[]`) when you actually need objects (`{}`). In JavaScript if you want to use non-numerical keys (e.g. "11h30") you'll need to use an object instead.
score: 3
comment on: http://stackoverflow.com/q/28500851
type: QuestionComment

http://stackoverflow.com/a/28461088
has body: Try (function ($) { $.fn.rollDice = function () { // `dice` array var dice = ["\u2680" , "\u2681" , "\u2682" , "\u2683" , "\u2684" , "\u2685"]; // return _two_ `dice` items, // remove `+ dice[ // 1 + Math.floor(Math.random() * dice.length - 1) // ]` , to return _one_ die // `1 + Math.floor(Math.random() * dice.length - 1) // ]` returns "pseudo" random number, // utilized to reference an `index` within `dice` array return $(this).text(dice[ 1 + Math.floor(Math.random() * dice.length - 1) ] + dice[ 1 + Math.floor(Math.random() * dice.length - 1) ]) } }(jQuery)); // call `$.fn.rollDice` on `.dice` selector $(".dice").rollDice(); (function ($) { $.fn.rollDice = function () { var dice = ["\u2680" , "\u2681" , "\u2682" , "\u2683" , "\u2684" , "\u2685"]; return $(this).text(dice[ 1 + Math.floor(Math.random() * dice.length - 1) ] + dice[ 1 + Math.floor(Math.random() * dice.length - 1) ]) } }(jQuery)); $(".dice").rollDice() .dice { font-size:72px; margin:0; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="dice"&gt;&lt;/div&gt;
answers question: http://stackoverflow.com/q/28460760
has comment: http://stackoverflow.com/comment/45248159
score: 0
has comment: http://stackoverflow.com/comment/45248722
has comment: http://stackoverflow.com/comment/45248782
type: Answer
has comment: http://stackoverflow.com/comment/45248494

http://stackoverflow.com/q/28454452
score: 0
has body: I am new in the development of Confluence Add-Ons. I want to use the example from the API. For instance look at this Page Dialog 2, there are the HTML-Code and the JS-Code separated. I know how to define a JS-File and how to refer to the atlassian-plugin.xml. Look here com.atlassian.auiplugin:ajs <resource type="download" name="confluence.js" location="/js/confluence.js"/> But where I must define the HTML-Code?
answer count: 1
has title: Confluence Plug-In where to define HTML code
has answer: http://stackoverflow.com/a/28956000
type: UnansweredQuestion
tagged with: confluence
type: Question
tagged with: javascript

http://stackoverflow.com/q/28442781
tagged with: http://stackoverflow.com/tag/csv
answer count: 1
has body: I am having trouble figuring out how to get a downloadable csv file to be available if I successfully use Ajax. I will link the js ajax script as well as my php file that is called in the Ajax function. Thank you for the assistance. I am returning back to the Success function of my Ajax function. I just do not know how to make my Data return as a downloadable csv file. JS Function: function popupClick2 (){ var popupObj2 = {}; var c = '0'; var p = '0'; var i = '0'; if (document.getElementById('checkboxC').checked){c = '1'} if (document.getElementById('checkboxP').checked){p = '1'} if (document.getElementById('checkboxI').checked){i = '1'} popupObj2["checkboxC"] = c; popupObj2["checkboxP"] = p; popupObj2["checkboxI"] = i; popupObj2["rangeD"] = $('#rangeD').val(); popupObj2["year"] = $('#year').val(); popupObj2["popupObj"] = '2'; $.ajax({ type: "POST", dataType: "text", url: "popupAjax.php", data: popupObj2, cache: false, success: function(data) { alert("Success"); //I would like to have the csv file downloadable here. }, error: function(jqXHR, textStatus, errorThrown) { console.log(jqXHR); console.log(textStatus); console.log(errorThrown); } }); closePopup2(); } PHP (popupAjax.php) &lt;?php $weekEnding = ''; $PHSN = ''; header('Content-Type: text/csv; charset=utf-8'); header('Content-Disposition: attachment; filename=eWFO-Report.csv'); $output = fopen('php://output', 'w'); fputcsv($output, array('Week Ending', 'WN', 'Project Title', 'Project Contact', 'Org No', 'PHSN', 'No', 'Verified By', 'Date Verified', 'Comments', 'Notes')); /*** connect to SQL DB ***/ $dbe = get_db_connection('db'); $dbe-&gt;connect(); /*** connect or Oracle DB ***/ $db = oci_connect('query','pw','server:1521/world'); if (!$db){ $e = oci_error(); trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR); } $query = "SELECT * FROM db.dbstuff WHERE (STATUS = 'ACTIVE' OR STATUS = 'CLOSED') AND NUMBER &lt;&gt; ' '"; $runQuery = oci_parse($db, $query); oci_execute($runQuery); while($row = o…
has comment: http://stackoverflow.com/comment/45215085
tagged with: php
has answer: http://stackoverflow.com/a/28443000
accepted answer: http://stackoverflow.com/a/28443000
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
upvote count: 1
has title: Downloadable CSV file Via Ajax
tagged with: javascript
favorite count: 0
tagged with: ajax

http://stackoverflow.com/comment/45299326
comment on: http://stackoverflow.com/q/28483216
has text: http://jsfiddle.net/vyqo59ua/ @JCSama
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28439185
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45209257
has comment: http://stackoverflow.com/comment/45208295
has body: If you look in the console you are getting the error Uncaught TypeError: Cannot read property '0' of undefined looking at the data the query returns we notice that data.tracks[i].album returns { "released": "2006", "href": "spotify:album:2knAf4wg8Gff8q1bXiXCTz", "name": "The Dutchess", "availability": { "territories": "MX" } } there is no property images so when you call data.tracks[i].album.images[0] you get the undefined error, causing the script to halt execution. I'm unfamiliar with the spootify api but taking a quick glance at the api theres the endpoint for get-album. Heres what I was able to come up with to get the album art $.get("http://ws.spotify.com/search/1/track.json?q=Fergie",function(data){ var albumId = data.tracks[97].album.href.split(":")[2]; $.get("https://api.spotify.com/v1/albums/" + albumId,function(albumResponse){ var firstImage = albumResponse.images[0]; $('body').append($(' ',{ src : firstImage.url, width : firstImage.width, height : firstImage.height })); }) }) You should research more into how to get the album art since I'm unsure if this is the optimal solution. The search endpoint you mentioned is different from the one your using. One your using url: 'http://ws.spotify.com/search/1/track.json?q=' + artist, One you linked to url: 'https://api.spotify.com/v1/search?q=' + artist + '&type=track,artist&market=GB', Heres your solution with the change in endpoint $('#findTracks').click(function(e) { e.preventDefault(); // override/don't submit form $('#recommendations').empty(); var artist = $('#artist').val(); var userid = ""; var playlistid = ""; $.ajax({ //url: 'http://ws.spotify.com/search/1/track.json?q=' + artist, url: 'https://api.spotify.com/v1/search?q=' + artist + '&type=track,artist&market=GB', type: 'GET', dataType: 'json', success: function(data) { if (data.tracks.items.length > 0) { data.tracks = data.tracks.items data.artists = data.artists.items var tracksLength = data.tracks.length, html = ''; for (var i = 0; i < tracksLength;…
upvote count: 2
has comment: http://stackoverflow.com/comment/45219138
type: Answer
accepted answer of: http://stackoverflow.com/q/28438883
score: 2
answers question: http://stackoverflow.com/q/28438883

http://stackoverflow.com/q/28455407
has answer: http://stackoverflow.com/a/28457756
upvote count: 1
downvote count: 1
type: Question
has title: How do I retrieve an image uploaded to Amazon S3 via CollectionFS:S3
tagged with: amazon-s3
accepted answer: http://stackoverflow.com/a/28457756
answer count: 2
has body: In a Meteor project I am using CollectionFS:S3 to save images to a bucket in S3. I'm not able to see how to load them back into the project. I have tried to use the FSFile.url() method as show in the code below but it's returning: /cfs/files/images/e6jQ4Txgvb37GisEQ/imagename.jpg?token=XXX I was expecting an Amazon S3 url as in s3-eu-west-1.amazonaws.com/mybucket/myfolder/imagename.jpg view.html: {{#each images}} URL: {{this.url}} &lt;img src="{{this.url}}" alt="thumbnail"&gt; {{/each}} view.js images: function () { return images.find(); } All examples I can see on the CollectionFS github page use the url method so can't see why I'm not able to access the images.
has comment: http://stackoverflow.com/comment/45240319
tagged with: javascript
favorite count: 0
score: 0
has comment: http://stackoverflow.com/comment/45241514
has comment: http://stackoverflow.com/comment/45242647
possible better answer: http://stackoverflow.com/a/32302794
has answer: http://stackoverflow.com/a/32302794
tagged with: meteor
type: AnsweredQuestion

http://stackoverflow.com/a/28482011
answers question: http://stackoverflow.com/q/28477967
has body: Since you are destructuring the first argument and have no named reference for it, how about this.options = arguments[0]? If you don't want external functions to modify it you could deep-freeze it. If you want it to be inaccessible use an instance-keyed WeakMap in the module's scope to hide them. To get default values you can use this instead: const defaults = {...} function(options) { this.options = Object.assign({}, defaults, options) // now destructure to local vars as needed ... } Beware: Object.assign is just a shallow merge.
score: 0
has comment: http://stackoverflow.com/comment/45287791
type: Answer

http://stackoverflow.com/a/28579736
answers question: http://stackoverflow.com/q/28579401
has body: Try this document.onkeydown = function(evt) { evt = evt || window.event; if (evt.keyCode == 27) { alert("Escape"); // Here is your code for hiding menu. } };
score: 0
type: Answer

http://stackoverflow.com/comment/45372279
has text: Also running the app without the services etc does not change the behaviour.
score: 0
comment on: http://stackoverflow.com/q/28527286
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45479478
has text: TY! Where do you think is the best place to put this? I'd ultimately like to make this into a gem..
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28585507

http://stackoverflow.com/a/28509793
score: 0
has comment: http://stackoverflow.com/comment/45340209
has body: Export your function so that you can call it from the HTML. (function() { var x = 4; var btn = document.createElement('button'); btn.type = "button"; btn.style.width = "100"; btn.textContent = "click me"; btn.id = "bid"; btn.addEventListener('click', myfunction); document.body.appendChild(btn); function myfunction() { alert(x); } window.myfunction = myfunction; })();
answers question: http://stackoverflow.com/q/28508932
type: Answer
has comment: http://stackoverflow.com/comment/45340505
has comment: http://stackoverflow.com/comment/45340526

http://stackoverflow.com/comment/45326318
comment on: http://stackoverflow.com/a/28502908
type: Comment
has text: Your "data2" after the eval will be an Array. You'll need to access the data from it as an array.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45418391
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28552353
score: 2
has text: Perhaps because you're still using `JSON.parse`? If your code has changed, edit your question. Also, again in your PHP, use real booleans (`true` and `false`), not strings (`"true"` and `"false"`). Do the same in your JavaScript, ie `if (!data.taken)`

http://stackoverflow.com/a/28547682
upvote count: 1
has comment: http://stackoverflow.com/comment/45411480
has comment: http://stackoverflow.com/comment/45411821
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28547632
score: 1
has body: Any function without a return statement will return undefined. In this case, you need to add return test() to return the value of the call to test from your method. Meteor.methods({ testingFunction: function() { return test(); } });
has comment: http://stackoverflow.com/comment/45411362
answers question: http://stackoverflow.com/q/28547632
type: Answer
has comment: http://stackoverflow.com/comment/45411948
has comment: http://stackoverflow.com/comment/45412157

http://stackoverflow.com/comment/45491187
score: 1
comment on: http://stackoverflow.com/q/28592241
has text: It might be possible to answer the question in its current state, but it would be easier if perhaps you could add the `li ...element creation...` code, as well as your initial HTML, and your sequence of add events. As John Smith pointed out, something isn't existing in your DOM but we don't see how your DOM starts or how it is set. or make a fiddle/add a code widget?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/31236229
upvote count: 5
score: 4
has body: To get full advantage of static variable I followed this approach. To be more specific, we can use it to use private variable or having only public getter, or having both getter or setter. In the last case it's same as one of the solution posted above. var Url = (() =&gt; { let _staticMember = []; return class { static getQueries(hash = document.location.hash) { return hash; } static get staticMember(){ return _staticMember; } }; })(); Usages: console.log(Url.staticMember); // []; Url.staticMember.push('it works'); console.log(Url.staticMember); // ['it works']; I could create another class extending Url and it worked. I used babel to convert my ES6 code to ES5
type: Answer
answers question: http://stackoverflow.com/q/28445693
downvote count: 1
has comment: http://stackoverflow.com/comment/50471336
has comment: http://stackoverflow.com/comment/50471059
has comment: http://stackoverflow.com/comment/50471056

http://stackoverflow.com/q/28474739
score: 0
answer count: 2
has body: We have a multi tenant website. The customer wants to have custom styles according to their standards. I have a requirement where in the admin settings page there will be option given to the administrator to change the color of nav bar , body text color , anchor color and so on. What would be the best approach to dynamically change the color?
has answer: http://stackoverflow.com/a/39181948
type: UnansweredQuestion
tagged with: css
has title: Changing styles dynamically in asp.net mvc application
tagged with: less
type: Question
tagged with: asp.net-mvc
tagged with: javascript
has answer: http://stackoverflow.com/a/28475079

http://stackoverflow.com/a/28542248
type: Answer
has comment: http://stackoverflow.com/comment/45398262
score: 0
has body: Try this way. $('#userMenu').on({"show.bs.dropdown",function () { $('.dropdown-menu').addClass('animated fadeInDown'); }); $('#userMenu').on({"shown.bs.dropdown",function () { $('.dropdown-menu').removeClass('animated fadeInDown'); }); $('#userMenu').on({"hide.bs.dropdown",function() { $('.dropdown-menu').addClass('animated fadeOutDown'); }); $('#userMenu').on({"hidden.bs.dropdown",function () { $('.dropdown-menu').removeClass('animated fadeOutDown'); });
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/28541887

http://stackoverflow.com/q/28527394
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28586472
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I am trying to replicate the "tabs" section as explained in this tutorial: Google material Design. Everthing works fine except when I insert a date which uses a datepicker widget from this url: Datepicker. As soon as I select the date all the tabs in Megamenu become unresponsive HTML code for the tabs: Home Reminder Reports Insurance History Between Dates Insurance history of Account Insurance Amount between dates Bulletin Board Welcome Wasim(1117004017) Script for datepicker: $("#dtBox").DateTimePicker(); This renders Megamenu like this: One more strange thing I came across is that as soon as tabs become unresponsive and I click on "Reports" tab I get this:
score: 0
tagged with: datepicker
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28586472
has title: Tabs become unresponsive
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/45502162
type: AnswerComment
has text: Yes but I am not sure how to modify MY code to work it correctly.
type: Comment
comment on: http://stackoverflow.com/a/28580753
score: 0

http://stackoverflow.com/q/28562113
has title: What is the simplest way to make a webapp on AWS?
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: amazon-web-services
favorite count: 0
accepted answer: http://stackoverflow.com/a/28573617
score: -3
downvote count: 3
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28573617
has body: Is there an option to start a webapp/webserice on AWS just out of the box by uploading code without installing, configuring and etc?

http://stackoverflow.com/a/28515082
type: Answer
has comment: http://stackoverflow.com/comment/45357555
has body: You have set the style attribute on your p tag in a wrong manner and put the &lt;/p&gt; in a wrong place. I am not sure where to place &lt;/p&gt; but you can change accordingly Edited code: &lt;p style="font-size:0"&gt;&lt;/p&gt;Accident Code: &lt;BR&gt; &lt;form name="accident" action=""&gt; &lt;select id='List6' name='List6'&gt; &lt;option selected&gt;Make a selection&lt;/option&gt; &lt;/select&gt; &amp;nbsp; &lt;select id='List7' name='List7' onchange="getValue3(this.value, this.form['List6'].value, this.form['List6'].value)"&gt; &lt;option selected &gt;&lt;/option&gt; &lt;/select&gt; &lt;/form&gt; And for adding images in your select tag add these to your CSS: #List6 option[value=value1]{ background-image:url(img1.png); } #List6 option[value=value2]{ background-image:url(img2.png); } #List7 option[value=value1]{ background-image:url(img11.png); } /*And so on.. */ And you can also you use this. It is exactly what you need
answers question: http://stackoverflow.com/q/28514922
has comment: http://stackoverflow.com/comment/45364007
has comment: http://stackoverflow.com/comment/45357145
score: 0
has comment: http://stackoverflow.com/comment/45348472
has comment: http://stackoverflow.com/comment/45358960

http://stackoverflow.com/comment/45440858
score: 1
comment on: http://stackoverflow.com/q/28564611
type: Comment
type: QuestionComment
has text: I recommend reviewing your requirements for this. Make sure there aren't any ambiguities. Are you supposed to print the file to one specific printer, regardless of who the user is? Are you expected to use the printer specified by Windows as the default? (Edge case: What happens if they've set their default printer to PDF Creator?) Would it be easier to write a script, _e.g._, a BAT file or BASH script, to send the file to the printer?

http://stackoverflow.com/comment/45306005
type: Comment
type: QuestionComment
has text: you can refer this http://jsbin.com/dopugehaci/1/edit?html,css,output
comment on: http://stackoverflow.com/q/28492443
score: 0

http://stackoverflow.com/comment/110331720
type: Comment
score: 23
has text: For TS, you can fool Jest and TS: .`mockImplementation(() => mockDate as unknown as string);`. Test like `expect(new Date()).toBe(mockDate);` works…
type: AnswerComment
comment on: http://stackoverflow.com/a/57599680

http://stackoverflow.com/a/28583137
has comment: http://stackoverflow.com/comment/45473731
type: Answer
downvote count: 0
has body: If you are using event delegation, only then this answer applies In jQuery 1.5, you have the .delegate() method, you can use that $( "table" ).delegate( "td", "click", function() { $( this ).toggleClass( "chosen" ); }); Don't use .live() as it is removed in verions >= 1.9
answers question: http://stackoverflow.com/q/28583053
score: 1
upvote count: 1

http://stackoverflow.com/q/28450263
tagged with: node.js
has title: define is not defined Javascript Node
score: 14
accepted answer: http://stackoverflow.com/a/28452145
type: AnsweredQuestion
upvote count: 14
has body: I am trying to run a Javascript file with Node to post blog updates to Tumblr. So far in my main.js file I have this: // Tumblr Information var tumblr = require('./vendor/tumblr'); tumblr.request(require('request')); var Blog; var jq = require('./vendor/jquery-1.11.1.min'); var reqq = require('./vendor/require'); var inher = require('./vendor/inheritance'); var grammars = require('./tracery/grammar'); But then I receive the following error when I run node main.js ReferenceError: define is not defined at Object.&lt;anonymous&gt; (B:\Documents\Google Drive\Programming\CMPM 147 Tracery\Tumblr Tracery\js\ tracery\grammar.js:6:1) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.&lt;anonymous&gt; (B:\Documents\Google Drive\Programming\CMPM 147 Tracery\Tumblr Tracery\js\ main.js:11:16) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) And here is where the error is being thrown in the grammar.js file: define(["./modifiers", "./node"], function(universalModifiers, Node) {'use strict'; // other stuff... }); I do not think a module is being loaded properly because it is stating the define function isn't defined. I believe this function comes from requireJS but I don't think I am loading it properly. Does anyone have any suggestions on why define might not be defined, or suggestions on how to load the correct module? Thank you.
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45228720
tagged with: require
has answer: http://stackoverflow.com/a/28452145
favorite count: 0
has comment: http://stackoverflow.com/comment/45229532
tagged with: requirejs
has comment: http://stackoverflow.com/comment/45228678

http://stackoverflow.com/q/28467074
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: SimpleCart JS shelfItem in table?
favorite count: 0
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/45299708
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28647918
tagged with: javascript
score: 0
tagged with: simplecart
has body: How would I be able to make the "Add to Cart" work if I were to put the simple_cart ShelfItem in table? I'm still cannot find a way to make this work. I'm using the eshopper template, which have the section id with cart items and so on. But if I were to put the simplecart javascript in the , , and so on, when I press the add to cart it won't work. Somebody please teach me how to use this, thanks. Sorry I counldt find the answer or I dont know how to do it. Edit: Add cart is working now I guess? At least able to make the "quantity" to increase, or able to empty the cart, but now the price is not updating, what did I do wrong? https://i.sstatic.net/tT172.jpg Home Shopping Cart Item Description Price Quantity SubTotal Star Wars Character Encyclopedia $35.99 + - Add to Cart Percy Jackson and the Olympians 5 Book $80.99 Add to Cart Star Wars: The Jedi Path $30.99 Add to Cart The Return of Nagash (The End Times) $50.99 Add to Cart Star Wars: Darth Vader and the Ghost Prison $65.99 <a href="#" onclick="simpleCart.add('name=Star Wars: Darth Vader and the Ghost Prison<','price=65.99','image=Images (Books)/Images/thumb/51m3gTdOteL.jpg');return false;"> Add to Cart

http://stackoverflow.com/q/28529724
has title: Unable to read Javascript responseXML from PHP
upvote count: 1
type: Question
has body: I have a database of shipping zones that I want to access through an AJAX request using PHP. PHP is not correctly generating XML for responseXML. If I change my url to a .xml file then the script works. Here is my PHP to generate XML ` <? libxml_use_internal_errors(true); $country_id = intval($_GET['country']); $country_id = 74; $con = mysqli_connect("localhost", "tradingb_data", "[s;_m@NN2;)F", 'tradingb_tradingbloc'); if (!$con) { die('Could not connect: ' . mysqli_error($con)); } mysqli_select_db($con,"ajax_demo"); $sql="SELECT * FROM `shipping_zones` WHERE zone_type = 'Province' and parent_zone = '$country_id' ORDER BY zone"; $result = mysqli_query($con,$sql); echo "<?xml version=\"1.0\" ?> <shipping_zones>"; while($row = mysqli_fetch_array($result)) { $row_id = $row['id']; $row_zone = $row['zone']; echo " $row_id $row_zone "; } echo "</shipping_zones>"; mysqli_close($con); ?> ` Here is my Javascript ` function changeCountry(){ var e = document.getElementById(\"country_id\"); var country_id = e.options[e.selectedIndex].value; if(country_id == 1){ // Display states document.getElementById('display_province').style.display = \"none\"; document.getElementById('display_state').style.display = \"\"; document.getElementById('display_state').style.visibility = \"visible\"; } else{ // Display Province document.getElementById('display_state').style.display = \"none\"; document.getElementById('display_province').style.display = \"\"; document.getElementById('display_province').style.visibility = \"visible\"; // Remove current selection list // Get Provinces for country_id var xmlhttp = new XMLHttpRequest(); // Include fix for IE6 and IE5 if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var xmlDoc = xmlhttp.responseXML; // get each pr…
accepted answer: http://stackoverflow.com/a/28530478
tagged with: javascript
has answer: http://stackoverflow.com/a/28529834
answer count: 3
downvote count: 0
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28530478
tagged with: php
possible better answer: http://stackoverflow.com/a/28548170
tagged with: http://stackoverflow.com/tag/xml
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28548170
score: 1

http://stackoverflow.com/comment/45352797
score: 0
type: AnswerComment
has text: I think its the query that is confusing me. can you please break it down for me. I have other input to add to the query. Thanks
comment on: http://stackoverflow.com/a/28516811
type: Comment

http://stackoverflow.com/comment/45669453
type: AnswerComment
has text: have you tried **afterShowForm event handler** of **navGrid**. by using this event handler you can code and register different date picker for add and edit options. Syntax: jQuery(htmlTableId).jqGrid('navGrid', pager, { }, { // edit options afterShowForm: function(){ }, ... }, {// add options afterShowForm: function(){ }, ... } ... );
comment on: http://stackoverflow.com/a/28642955
type: Comment
score: 0

http://stackoverflow.com/comment/45443502
has text: My suggestions presumed that either iOS8 and Safari were not the cause of the bug or if they were, no fix was available so a work around had to be found involving updates to CSS, JavaScript, etc. That presumption may not be correct. It may be worthwhile to search for updates for iOS8 and/or Safari that may address your specific issue. Also test with a non-Safari browser to see if this issue is Safari specific. Other browsers can provide insight into this issue.
type: AnswerComment
comment on: http://stackoverflow.com/a/28517529
score: 0
type: Comment

http://stackoverflow.com/a/28579946
answers question: http://stackoverflow.com/q/28579298
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2
has body: Does this go anywhere near doing what you want? Draw at pencil using transparent, line width 10 and then draw over the line solid using smaller line width (8). Perhaps you could get more variation by randomly varying the second line width between 7, 8 and 9? EDIT could also randomly set opacity of second line between say 1 and 0.8! Permanently set opacity on first line and added this code to the function stroke() ctx.globalAlpha = "1"; ctx.lineWidth = 6; ctx.beginPath(); ctx.moveTo(previousMouseX, previousMouseY); ctx.lineTo(mouseX, mouseY); ctx.closePath(); ctx.stroke(); Changed code snippet var canvas = document.getElementById("canvas"); var ctx = canvas.getContext("2d"); var previousMouseX = null; var previousMouse = null; var isDrawing = false; var lineWidth = 10; var brush = 1; var myColor = "#FF0000"; function getMousePosition(canvas, evt) { var rect = canvas.getBoundingClientRect(); if (evt.clientX !== undefined &amp;&amp; evt.clientY !== undefined) { return { x: evt.clientX - rect.left, y: evt.clientY - rect.top }; } } /* BUTTONS */ $("#btn1").on("click", function() { ctx.globalAlpha = "0.2"; }); $("#btn2").on("click", function() { ctx.globalAlpha = "1"; }); $("#change-color").on("click", function() { ctx.strokeStyle = "#009933"; }); $("#canvas").on("mousedown", function(e) { isDrawing = true; var pos = getMousePosition(canvas, e); move(pos.x, pos.y); }); $("#canvas").on("mousemove", function(e) { if(isDrawing) { var pos = getMousePosition(canvas, e); stroke(pos.x, pos.y); } }); $("#canvas").on("mouseup", function() { isDrawing = false; }); function stroke(mouseX, mouseY) { ctx.globalCompositeOperation = "source-over"; ctx.lineJoin = ctx.lineCap = "round"; ctx.lineWidth = 10; ctx.globalAlpha = "0.2"; //NOTE ALWAYS SET TO 'TRANSPARENT' needs variable if you want to switch to solid. ctx.beginPath(); ctx.moveTo(previousMouseX, previousMouseY); ctx.lineTo(mouseX, mouseY); ctx.closePath(); ctx.stroke(); ctx.globalAlpha = "1"; ctx.lineWidth = 6; ctx.beginPath(); c…
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28579298

http://stackoverflow.com/comment/45292825
type: Comment
comment on: http://stackoverflow.com/a/28483822
has text: Re: URLs and iframes, I'm not completely clear on what you want to do. Do you want to 1) show the webpage in the iframe, 2) show the HTML source for the webpage in the frame (as if you had used "View Source" from the browser menu), or 3) show a cached version of the webpage that you stored in your database?
type: AnswerComment
score: 0

http://stackoverflow.com/a/28489093
type: Answer
has body: This works: $('p').filter(function () { return $(this).html().replace(/&amp;nbsp;/g, '').length === 0 }).remove() jsFiddle example While you said "I want to remove the non-breaking space and the P it is in", you only need to remove the P since that will take the &amp;nbsp; with it.
has comment: http://stackoverflow.com/comment/45300856
score: 0
answers question: http://stackoverflow.com/q/28488932

http://stackoverflow.com/a/28519968
answers question: http://stackoverflow.com/q/28494586
has body: I finally downloaded once again jQuery v2.1.1. and it worked ! Thanks for your help
score: 0
type: Answer

http://stackoverflow.com/comment/45447312
score: 0
type: Comment
has text: Thank for your answer ;) I passed this variables to my script, but I have few questions. First, my array looks like: /* */ var floatdata = {"float0":"right-column","float1":"left-column"}; /* */ Shouldn't it count float[n] from 1? Because my rows starting from 1. Second question, should I add any condition to my inputs in *.js file? If yes, how would it look like?
type: AnswerComment
comment on: http://stackoverflow.com/a/28564765

http://stackoverflow.com/q/28532215
has answer: http://stackoverflow.com/a/28548063
favorite count: 0
tagged with: android
type: AnsweredQuestion
tagged with: cocoonjs
has body: The webview+ from cocoonjs gives a huge performance boost to my ionic application that uses a good amount css3 animations. I want to be able to build my application using webview+ from cocoonjs. The instructions are straight forward and the commands don't throw an error but once I load the application on the device it's still using the default webview. I'm thinking it has something to do with android.json or the config.xml.
tagged with: ionic-framework
type: Question
tagged with: javascript
has title: How to build ionic application using cocoonjs webview+?
accepted answer: http://stackoverflow.com/a/28548063
score: 0
upvote count: 1
answer count: 1
downvote count: 1

http://stackoverflow.com/a/28584966
downvote count: 0
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45477772
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28584823
has comment: http://stackoverflow.com/comment/45477267
has body: If you make a request to this method in an ajax call, the resulting bytestream will be in the result object in javascript. That's not useful at all. You shouldn't be doing this in an ajax call at all. Either generate a normal html link pointing to the request url, or build the url in javascript and put it in window.location. If you need to send a POST instead, make an html form and post that. You can populate the data with javascript and then invoke submit(). Check here for more details: JavaScript post request like a form submit
answers question: http://stackoverflow.com/q/28584823
type: AcceptedAnswer

http://stackoverflow.com/q/28477108
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/45277702
type: Question
has comment: http://stackoverflow.com/comment/45277880
tagged with: forms
has comment: http://stackoverflow.com/comment/45278495
tagged with: javascript
tagged with: jquery
has body: i have 20 user in my database and have 20 form in my site . this code show 20 form and i should send message every day to 20 user and want copy too all text area and submit them . i want have a form for send too all . <?php while ($row = mysql_fetch_array($users)) { ?> <form id="<?php echo $row["id"] ?>" name="" method="post" onsubmit="return sendPushNotification('<?php echo $row["id"] ?>')"> Name: <?php echo $row["name"] ?> Email: <?php echo $row["email"] ?> <input type="hidden" name="regId" value="<?php echo $row["gcm_regid"] ?>"/> <?php } } else { ?> No Users Registered Yet! <?php } ?> tihs code create 20 form with 20 id and : Ok just i want 1 form too send too all , no more.
type: UnansweredQuestion
has title: copy text to textarea and submit all form in php
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/45277727

http://stackoverflow.com/comment/45252333
score: 0
type: AnswerComment
type: Comment
has text: Actually max-height does not set the current height. It just tells browser not to exceed this limit.
comment on: http://stackoverflow.com/a/28462785

http://stackoverflow.com/a/28461119
has comment: http://stackoverflow.com/comment/45249047
score: 4
answers question: http://stackoverflow.com/q/28459708
downvote count: 0
has body: You just need to use the "checkValidity()" method on the form before submitting in your onclick function like this: if($("#add2").checkValidity()) { document.getElementById('add2').submit(); } See this fiddle: http://jsfiddle.net/36uv2e52/33/
type: Answer
upvote count: 4

http://stackoverflow.com/a/28441930
has comment: http://stackoverflow.com/comment/45286637
has body: Use WordPress Conditional Tags. Use Php to set the cookie to a default. Something like... &lt;?php if (is_page(id)) { $defaultView = 'list'; } else { $defaultView = 'grid'; } setcookie("gridcookie", $defaultView); ?&gt; Replace id with the page id for your main shop page. Or use one of the other options http://codex.wordpress.org/Function_Reference/is_page
has comment: http://stackoverflow.com/comment/45297509
has comment: http://stackoverflow.com/comment/45216402
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45277343
has comment: http://stackoverflow.com/comment/45224974
has comment: http://stackoverflow.com/comment/45293422
answers question: http://stackoverflow.com/q/28441573

http://stackoverflow.com/comment/45278813
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28477555
has text: your javasvript function call suma.php and not sumar.php

http://stackoverflow.com/a/28445460
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28445431
accepted answer of: http://stackoverflow.com/q/28445431
has body: It's either what @user148098 has suggested OR: party() function party(){ alert("You must find your way into the party and kill the VIP")}; where you define a function explicitly.
type: AcceptedAnswer

http://stackoverflow.com/a/28565351
upvote count: 5
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28565333
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28565333
has body: You need to get value of textbox using .val(). $(element).length will return the length of number of objects present in $(element), which is 1 in your case: $(element).val().length Working Demo
type: Answer
score: 5

http://stackoverflow.com/q/28437492
score: 0
answer count: 1
tagged with: arrays
has answer: http://stackoverflow.com/a/28440381
has body: I'm new to jqplot and I have been trying to display a graph with the dates (x axis) and values(y axis) from a database. I managed to save the dates and values into a nice string ( all the data is separated by commas and in the good order) but when I call $.jqplot('chart1', [total1], it does not work! :( I have tried everything and I'm running out of ideas and hope. any help or pointers would be greatly appreciated. regards from a desperate newbie &lt;?php $conn = mysql_connect($host, $user, $password); mysql_select_db($database); $MenuSelection = $_POST['dropDownMenu'];// select field from dropdownmenu $conn = mysql_connect($host, $user, $password); mysql_select_db($database); $sql = "SELECT date," . $MenuSelection . " FROM errorscounted where date between '$CurrentDate' and '$FinalDate'"; $result = mysql_query($sql); $data = array(); while ($row = mysql_fetch_assoc($result)) { $data[] = $row; } mysql_free_result($result); mysql_close(); ?&gt; &lt;script type="text/javascript" &gt; $(document).ready(function () { var total1 = ""; // create a for loop to get dates and values and save them in a string &lt;?php for ($x = 0; $x &lt;= 4; $x++) { ?&gt; var line1 = [['&lt;?php echo $data[$x]['date'] ?&gt;', &lt;?php echo $data[$x][$myvalue] ?&gt;], ]; // concatenated the string and seperated the dates and values by a comma total1 = total1.concat(line1) + ","; &lt;?php } ?&gt; //delete the last comma total1 = total1.substring(0, total1.length - 1); // an alert that shows that all the data was saved correctly alert(total1); var plot1 = $.jqplot('chart1', [total1], { animate: !$.jqplot.use_excanvas, title: 'Number of errors from &lt;?php echo $_POST['dateStart'] ?&gt; to &lt;?php echo $_POST['dateEnd'] ?&gt; for &lt;?php echo $_POST['dropDownMenu'] ?&gt; ', seriesDefaults: { pointLabels: {show: true} }, axesDefaults: { tickRenderer: $.jqplot.CanvasAxisTickRenderer, tickOptions: { angle: -30, fontSize: '10pt' } }, axes: { xaxis: { renderer: $.jqplot.CategoryAxisRenderer, // re…
tagged with: php
accepted answer: http://stackoverflow.com/a/28440381
has title: display graph in jqplot using two variables from a database
tagged with: graph
type: AnsweredQuestion
tagged with: jqplot
tagged with: javascript
type: Question

http://stackoverflow.com/q/28468485
tagged with: css
answer count: 1
score: 0
has body: im crazy with this trouble, i try to make a scrolling with angularjs and jquery, here a litle code jsfiddle in my machine this run idk why dont run in jsfiddle, well my problem is when i making click and mousemove, i can scrolling, but when the mouse is out &lt;div id="move2"...., the scroll move very fast, is like if you put click in list and drag it to down, the scrolling move very fast to down. please help me
tagged with: javascript
has answer: http://stackoverflow.com/a/28469007
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: disable auto scrolling when select out div
tagged with: angularjs
type: Question

http://stackoverflow.com/a/28468292
has body: I believe you want: if (number === 0) { document.write("ERROR"); } If you want to reference a variable, don't wrap it in quotation marks. The way you have it, you are trying to access the value property of string, which doesn't exist (will return undefined). Secondly, a single equal sign = assigns a value, not compares it. If you want to compare equality, try === which will return true if the values on either side are of the same type and value. Good luck learning :) --edit-- Note that if your variable number is actually a string, use the == equality rather than ===. The == comparison doesn't check for types.
score: 0
answers question: http://stackoverflow.com/q/28468257
type: Answer

http://stackoverflow.com/comment/45422070
type: Comment
comment on: http://stackoverflow.com/q/28541866
has text: @charlietfl added more js for better understanding of the problem.
score: 0
type: QuestionComment

http://stackoverflow.com/q/28475382
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/28475457
downvote count: 0
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/45274473
linked to: http://stackoverflow.com/q/14863022
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28475457
tagged with: settimeout
upvote count: 2
has body: Im fixing an issue on a web application that uses setTimeout to inform the back end to keep the session alive. This works as expected in all scenarios except for the following: The setTimeout is not triggering while there are back to back sync AJAX posts happening. I understand that there can be a delay for the setTimeout firing as JavaScript is single-threaded and has to wait for one task to complete. My question is: Why is the setTimeout not firing at all? Why is it fired at the end of all the AJAX requests and not in between? This is my keepAlive function function keepAlive() { var img = new Image(1, 1); img.src = "google.com" + '?' + new Date(); timer = setTimeout(function () { keepAlive(); }, 10000); } I have created a quick and dirty demo of my problem in jsfiddle. Thanks in advance!
has title: setTimeout blocked by continuous AJAX requests?
has comment: http://stackoverflow.com/comment/45274107
type: Question
possible better answer: http://stackoverflow.com/a/28475476
has answer: http://stackoverflow.com/a/28475476

http://stackoverflow.com/comment/45620725
score: 0
comment on: http://stackoverflow.com/q/28511483
has text: my blog is: alegadamene.pt by captation I mean the text that is present on screen, normally immediatly below the photo.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/116005596
has text: this is angular related
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/56015361
type: Comment

http://stackoverflow.com/comment/45242096
type: Comment
comment on: http://stackoverflow.com/a/28456654
has text: That forces jsonp but it doesn't call the function to build up the items
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45251738
comment on: http://stackoverflow.com/a/28440026
has text: here is form you can check this
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28580540
possible better answer: http://stackoverflow.com/a/28581133
type: Question
has body: I'm using Jasmine to test my angular application and want to spy on an anonymous function. Using angular-notify service https://github.com/cgross/angular-notify, I want to know whether notify function have been called or not. Here is my controller: angular.module('module').controller('MyCtrl', function($scope, MyService, notify) { $scope.isValid = function(obj) { if (!MyService.isNameValid(obj.name)) { notify({ message:'Name not valid', classes: ['alert'] }); return false; } } }); And here is my test: 'use strict'; describe('Test MyCtrl', function () { var scope, $location, createController, controller, notify; beforeEach(module('module')); beforeEach(inject(function ($rootScope, $controller, _$location_, _notify_) { $location = _$location_; scope = $rootScope.$new(); notify = _notify_; notify = jasmine.createSpy('spy').andReturn('test'); createController = function() { return $controller('MyCtrl', { '$scope': scope }); }; })); it('should call notify', function() { spyOn(notify); controller = createController(); scope.isValid('name'); expect(notify).toHaveBeenCalled(); }); }); An obviously return : Error: No method name supplied on 'spyOn(notify)' Because it should be something like spyOn(notify, 'method'), but as it's an anonymous function, it doesn't have any method. Thanks for your help.
answer count: 2
tagged with: testing
score: 5
has title: How to spy on anonymous function using Jasmine
downvote count: 0
tagged with: javascript
tagged with: karma-jasmine
has answer: http://stackoverflow.com/a/32078280
tagged with: jasmine
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28581133
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/32078280
upvote count: 5

http://stackoverflow.com/q/28577640
answer count: 0
downvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/64421043
has body: I have a situation where I want to use "Content-Length" header from another domain with Lighttpd using XHR HEAD request but I get Refused to get unsafe header 'content-length' message. My idea is to add response header based on another response header in lighttpd.conf: setenv.add-response-header = ('X-Content-Length' =&gt; GET_MY_RESPONSE_HEADER('Content-Length')) Is there a way to write GET_MY_RESPONSE_HEADER() function/property in config file?
has comment: http://stackoverflow.com/comment/45718745
tagged with: javascript
upvote count: 2
tagged with: response-headers
tagged with: http-content-length
favorite count: 0
type: UnansweredQuestion
has title: Add response header based on another header in Lighttpd
has comment: http://stackoverflow.com/comment/45737100
tagged with: xmlhttprequest
has comment: http://stackoverflow.com/comment/45755161
score: 2
tagged with: lighttpd

http://stackoverflow.com/a/28471199
has comment: http://stackoverflow.com/comment/45268289
has comment: http://stackoverflow.com/comment/45268012
has body: Remove the '?' in the url where you define the REST API in the node.js code and it will work fine: app.get('/:locale', setLanguage, function (req, res) { console.log(req.cookies.locale); res.render('index'); }); As well as the way you checking for undefined is incorrect you can simply do it like this: if (req.params.locale) { //Rest of your code } UPDATE (try this): // set a cookie to requested locale var setLanguage = function(req, res) { var locale = req.params.locale || 'pt'; res.cookie('locale', locale); } res.render('index'); }; app.get('/:locale', setLanguage});
has comment: http://stackoverflow.com/comment/45268132
type: Answer
has comment: http://stackoverflow.com/comment/45267202
has comment: http://stackoverflow.com/comment/45268892
has comment: http://stackoverflow.com/comment/45267306
score: 0
answers question: http://stackoverflow.com/q/28470814

http://stackoverflow.com/a/28478475
answers question: http://stackoverflow.com/q/28478425
type: Answer
has comment: http://stackoverflow.com/comment/45301404
has comment: http://stackoverflow.com/comment/45280292
score: 0
has body: When you hardcode the class It works because its present when the DOM is build but its not the same with the later case. You need to reinitialize fancybox by $(".fancybox").fancybox(); $(function(){ //set target var var $targetTable = $('.photo-frame a'); //loop trough each table and insert the fancybox class on the href tag $targetTable.each(function() { $targetTable.addClass('fancybox'); }); $(".fancybox").fancybox(); });

http://stackoverflow.com/comment/45453220
has text: Copy the code as in my question, fill up the request.send with 3k (in my case when compressed it becomes 1.5k) of data and test it on different network speed in DevTools (250kbps, 750kbps, 30Mbps) and you'll see this result.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28570061
type: Comment

http://stackoverflow.com/q/28588388
has answer: http://stackoverflow.com/a/54512301
linked to: http://stackoverflow.com/q/28584589
tagged with: google-chrome-devtools
tagged with: webgl
accepted answer: http://stackoverflow.com/a/28600761
type: Question
has body: I have a webgl page running in chrome. Every now and then chrome will report the following error. [.WebGLRenderingContext]GL ERROR :GL_INVALID_OPERATION : glDrawElements: attempt to render with no buffer attached to enabled attribute 1 I've tried to debug where the error is occurring but I cannot. I can reliably cause it to occur, but when I debug the error is reported on seemingly random lines. I suspect this is because of the asynchronous nature of gpu rendering. Is there a good way to debug this?
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45491249
has comment: http://stackoverflow.com/comment/45490967
answer count: 3
has title: debugging webgl in chrome
possible better answer: http://stackoverflow.com/a/28592267
has answer: http://stackoverflow.com/a/28592267
favorite count: 0
has comment: http://stackoverflow.com/comment/45492506
has answer: http://stackoverflow.com/a/28600761
score: 6
tagged with: google-chrome
upvote count: 6
type: AnsweredQuestion

http://stackoverflow.com/q/28444895
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45219352
has answer: http://stackoverflow.com/a/28476998
score: 1
has comment: http://stackoverflow.com/comment/45223663
has comment: http://stackoverflow.com/comment/45219612
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28454484
answer count: 3
has title: Recursive retry in Promise
has answer: http://stackoverflow.com/a/28445073
favorite count: 0
has comment: http://stackoverflow.com/comment/45219475
has body: Now I am learning how to write JavaScript code with promise. Here is my case, the deliverMessage function in Sender try to connect with amqp. If success, then call publish_ to send messages. Otherwise, call reconnect_ to reconnect to amqp after 3 seconds. The codes are as following, Sender.prototype.reconnect_ = function( err ) { console.error('MessageBus disconnected, attempting to reconnect' + err); this.createFakeChannel_(); return setTimeout( this.deliverMessage.bind(this), 3000); }; Sender.prototype.deliverMessage = function() { when(amqp.connect( this.addr_ )) .with( this ) .then( this.createChannel_ ) .then( this.createExchange_ ) .then( this.handleUnrouteableMessages_ ) .then( this.handleDisconnections_ ) .catch( this.reconnect_ ) .done( this.publish_ ); //? publish_ is invoked in all case? }; Actually, whether the connection is succeeded or failed, publish_ is called anyway. Could anyone help me how to implement it with promise?
tagged with: promise

http://stackoverflow.com/comment/45291923
score: 0
type: QuestionComment
type: Comment
has text: @vol7ron you are on point and those are advanced techniques, I agree. I guess the people who would be employing them would know when to deviate form the general best practices of not nesting elements like this and wouldn't hesitate to do so.
comment on: http://stackoverflow.com/q/28467421

http://stackoverflow.com/q/28539768
type: Question
type: AnsweredQuestion
has body: Hi I am not good using regex. So I have a question. I want to split text by specific token. Token list will be ". ", "? ". Also I want to exclude specific word in split text. specific word list will be 'Mr .'. ex) Mr. Smith bought this. and me too. -> ["Mr. Smith bought this.", "and me too."] I want to split this text by using (javascript) regex. How can I do?
accepted answer: http://stackoverflow.com/a/28540321
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45400483
has title: How to I write regular expression that split by include token and exclude token
has comment: http://stackoverflow.com/comment/45393794
tagged with: regex
has answer: http://stackoverflow.com/a/28540321
score: -3
downvote count: 3

http://stackoverflow.com/q/28542182
answer count: 2
has comment: http://stackoverflow.com/comment/45398481
downvote count: 3
has comment: http://stackoverflow.com/comment/45397911
has body: Hi Guys I have just been working on jsfiddle but when I load it into an offline .html the js script doesnt run? Here is the code in the html file anyone know why?? Sorry im new to using jsfiddle and not sure why I cant just copy and paste the code I work on into a html file when im offline to work on it further. Thank you for all the help! Item Value Quantity Total Item 60 $ Item $ Total event cost (viability) $ total Go!
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
score: -3
upvote count: 0
has comment: http://stackoverflow.com/comment/45397795
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45397810
type: Question
has answer: http://stackoverflow.com/a/28542276
has title: script not running from jsfiddle?
has answer: http://stackoverflow.com/a/28542219
has comment: http://stackoverflow.com/comment/45397820

http://stackoverflow.com/q/28526354
has body: I've got two tasks. Sass: gulp.task('sass', function() { gulp.src('src/sass/**.{scss, sass}') .pipe(sourcemaps.init()) .pipe(sass({outputStyle: 'compressed'})) .on('error', handleErrors) .pipe(autoprefixer()) .pipe(sourcemaps.write('.')) .pipe(gulp.dest('dist/css')) .pipe(browserSync.reload({stream: true})) }); And CSS optimization task: gulp.task('cssopt', ['sass'], function() { gulp.src('dist/css/style.css') .pipe(uncss({html: ['http://example.dev//']})) .pipe(cmq({log: true})) .pipe(shrink()) .pipe(rename({suffix: '.opt'})) .pipe(gulp.dest('dist/css')) }); The cssopt task relies on the sass task, cause it's using the style.css file that the sass generates. But it won't work, it can't find the style.css file, cause it's not there. If I run the sass separately first, then the cssopt works cause the style.css is there. From the docs (emphasis mine): An array of tasks to be executed and completed before your task will run. Docs also say: Note: Are your tasks running before the dependencies are complete? Make sure your dependency tasks are correctly using the async run hints: take in a callback or return a promise or event stream. Which I don't quite understand: "async run hints"... wat... I tried to run a clean task as deps for sass and that worked well, though. I could smash these into one task, but the cssopt takes quite long (the uncss is pretty slow when you give it an URL), and I need the style.opt.css file only on production anyway. I am using the latest version (1.3.3) of gulp-sass.
tagged with: javascript
has title: What are gulp task async run hints?
score: 3
answer count: 1
downvote count: 0
tagged with: gulp
favorite count: 0
accepted answer: http://stackoverflow.com/a/28529470
has comment: http://stackoverflow.com/comment/45369165
tagged with: node.js
type: AnsweredQuestion
upvote count: 3
type: Question
has answer: http://stackoverflow.com/a/28529470

http://stackoverflow.com/comment/45262404
comment on: http://stackoverflow.com/a/28468044
type: Comment
score: 1
has text: That can sometimes happen when binding click event handlers. Unfortunately there isn't a great way to deal with it. The most common solution is to unbind the click handler right after the click happens, do whatever, then rebind it. Check out http://jsfiddle.net/fb5w97m4/1/
type: AnswerComment

http://stackoverflow.com/comment/45233867
comment on: http://stackoverflow.com/a/28453162
type: AnswerComment
score: 0
type: Comment
has text: Ohhhh @SnorkS I misunderstood problem :(

http://stackoverflow.com/q/28492355
has comment: http://stackoverflow.com/comment/45313874
answer count: 1
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has body: I have a app that shows coloured dots moving across the screen, following set routes. There is a save button the saves the current screen to a .png format. The problem I am having is that if I click the save image button several times the images don't just show the current position of that click, they show all previous positions from when the save button was clicked. E.g. if at click 1 the dot is as position 1 and click 2 it is at position 2. Image two will show positions 1 and 2. A third image would show positions 1,2 and 3. Obviously there is an issue with layering or not clearing the canvas but I can't see the problem. the save code (wrapped in an AngularJS app) is : $scope.saveImage = function() { var stageWidth = jQuery("#mainStage").width(); var stageHeight = jQuery("#mainStage").height(); var html = d3.select("#mainStage") .attr("version", 1.1) .attr("xmlns", "http://www.w3.org/2000/svg") .attr("width",stageWidth) .attr("height",stageHeight) .node().parentNode.innerHTML; var imgsrc = 'data:image/svg+xml;base64,' + btoa(html); jQuery("#canvas").height(stageHeight); jQuery("#canvas").width(stageWidth); var canvas = document.getElementById("canvas"); var context = document.querySelector('canvas').getContext("2d"); var image = new Image; image.src = imgsrc; image.onload = function() { context.drawImage(image,0,0); var canvasdata = canvas.toDataURL("image/png"); var pngimg = '&lt;img src="' + canvasdata + '"&gt;'; var a = document.createElement("a"); console.log(a); a.download = "sample.png"; a.href = canvasdata; a.click(); }; } Thanks in advance.
has title: HTML5 Canvas and hiding lower layers
type: Question
has answer: http://stackoverflow.com/a/29346877
tagged with: canvas

http://stackoverflow.com/comment/45473851
type: Comment
comment on: http://stackoverflow.com/a/28561206
score: 0
type: AnswerComment
has text: Modify the data in the `countryDataResponse` object. You'll see the cities array. Modify that from `"cities":["toronto"]` to `"cities":["toronto", "*your new city*"]`

http://stackoverflow.com/comment/45376032
has text: Also if anyone wants it I created a plunker with Joppe's code working in it http://plnkr.co/edit/CrS9n9iZ8pusqJcYijrz?p=preview
type: AnswerComment
comment on: http://stackoverflow.com/a/28519751
score: 0
type: Comment

http://stackoverflow.com/q/28474556
has comment: http://stackoverflow.com/comment/45273502
type: Question
tagged with: canvas
answer count: 1
has title: Data attribute refresh canvas
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has body: I have a circle shape that I draw via data-percent. If 90 percent it will draw 90 percent of the shape. Every second my idea is to remove 1 percent of this square, the problem is that setting the data attribute doesnt work and if I do it via the DOM the shape doesnt update itself. $(document).ready(function() { var charta = $(".chart"); var value = charta.data("percent"); charta.data("percent", "200"); &lt;div class="chart" data-percent="90"&gt;&lt;/div&gt;
has answer: http://stackoverflow.com/a/28484770

http://stackoverflow.com/q/28510671
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28510817
tagged with: observer-pattern
tagged with: observers
type: Question
score: 0
has body: I am working through the Ember Guides and am reading about observers. They note that Observers in Ember are currently synchronous. This means that they will fire as soon as one of the properties they observe changes. And give the example that Person.reopen({ lastNameChanged: function() { // The observer depends on lastName and so does fullName. Because observers // are synchronous, when this function is called the value of fullName is // not updated yet so this will log the old value of fullName console.log(this.get('fullName')); }.observes('lastName') }); Yet when I try out this code it returns the new 'fullName'. Why is this happening?
answer count: 1
tagged with: javascript
tagged with: ember.js
has title: Ember.js Guide's .observes() sync example not working

http://stackoverflow.com/q/28468430
has answer: http://stackoverflow.com/a/28469353
tagged with: http://stackoverflow.com/tag/html
score: -1
answer count: 1
downvote count: 1
has title: Better approach than using append in div contenteditable
tagged with: dom
has body: I have a contenteditable div, in which if user presses enter after some content, two break tags gets created. line 1 &lt;/br&gt; &lt;/br&gt; If user manually starts typing it becomes line 1 &lt;/br&gt; line 2 &lt;/br&gt; But i am using jQuery append function to put some html content jQuery('.editor').append(e.target.innerHTML); But it becomes line 1 &lt;/br&gt; &lt;/br&gt; html content Is there any way to not have two line gap between the content?
upvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
favorite count: 0
tagged with: jquery-plugins
type: Question

http://stackoverflow.com/a/28585234
answers question: http://stackoverflow.com/q/28585102
score: 5
upvote count: 5
has body: [BEGIN] =&gt; VEVENT [CREATED] =&gt; 20121030T105658Z [LAST-MODIFIED] =&gt; 20121030T105658Z [DTSTAMP] =&gt; 20121030T105658Z [SUMMARY] =&gt; Winterferien Bayern [DTSTART;VALUE=DATE] =&gt; 20120220 [DTEND;VALUE=DATE] =&gt; 20120225 [URL] =&gt; http://www.schulferien.org [DESCRIPTION] =&gt; Alle Termine auf www.schulferien.org [TRANSP] =&gt; TRANSPARENT [UID] =&gt; Winterferien-Bayern-201202251205422257@schulferien.org [END] =&gt; VEVENT PRODID The PRODID are your app / company details in the format Business BEGIN:VEVENT The start tag for an event. You can have as many vevents as you require. SUMMARY This is the event title. UID A unique ID for the event. This is important and required, and allows you to push changes to event details after they have been created. If you are retrieving database rows, the primary key is an ideal candidate for the UID value. STATUS (optional. default value is CONFIRMED) The event status is optional and can be one of CONFIRMED, TENTATIVE, CANCELLED. A cancelled event shows with a line through text decoration on iOS. DTSTART, DTEND The event start and end timestamp. This should be formatted as demonstrated using the defined iCal format.If your dates are not already in the UTC timezone, you should convert them to UTC before outputting as this is the expected timezone when the timestamp ends with “Z”. There are options to specify a timezone which are beyond the scope of this tutorial. It is worth noting that if you enter an address or phone number into the DESCRIPTION field (which I haven’t documented) in plain text, iOS will auto-link the text and will jump to the Maps app or Phone app with the details pre-filled. END:VEVENT The close tag for an event. Remember, you can have as many vevents as you require.
downvote count: 0
type: Answer

http://stackoverflow.com/comment/45275902
has text: You have to configure your server root to be the root of your angular project.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28461916
type: Comment

http://stackoverflow.com/q/28545727
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45407731
has body: In Firefox 35, the cursor alternates between default and pointer when hovering the mouse over an element with cursor: pointer and updating the document title using: document.title = "New Title"; Since I have to update the document title very frequently (show unread count in title), this causes the cursor to flicker quite constantly. Is there any workaround for this?
score: 0
has title: Cursor flickers when updating document title using javascript
tagged with: firefox
tagged with: javascript
has comment: http://stackoverflow.com/comment/45405280
answer count: 0

http://stackoverflow.com/a/28494489
type: Answer
upvote count: 2
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45747634
answers question: http://stackoverflow.com/q/28491490
has body: I think the problem is that you are hitting the wrong url. What is the url(scheme) of your VRP (Vehicle Routing Problem) service you are trying to make request?

http://stackoverflow.com/comment/45383680
comment on: http://stackoverflow.com/q/28534344
type: QuestionComment
has text: @Qantas94Heavy, It's not quite a duplicate because the other question doesn't mention rest destructuring.
score: 0
type: Comment

http://stackoverflow.com/q/28486903
downvote count: 0
tagged with: javascript
tagged with: gulp
possible better answer: http://stackoverflow.com/a/32020792
answer count: 3
has answer: http://stackoverflow.com/a/28492877
has title: combined coffee and js development with Gulp
favorite count: 0
score: 2
upvote count: 2
has answer: http://stackoverflow.com/a/28510519
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28492877
tagged with: coffeescript
type: Question
has answer: http://stackoverflow.com/a/32020792
has body: Using Gulp to streamline my build process on a per-save basis, while eliminating the need for "temp" files is my goal (and why I chose to use Gulp over Grunt) I've recently discovered that, apparently, the coffeescript compiler cannot handle dealing with basic Javascript as a source So this, errors out: gulp.task('scripts', function() { var stream = gulp.src([ "bower_components/d3/d3.js", "bower_components/angular/angular.js", "bower_components/foundation/js/foundation.js", "public-dev/scripts/app.js", "public-dev/scripts/**/*.js", "public-dev/scripts/**/*.coffee" ]) .pipe(coffee()) .pipe(concat('compiled.js')) .pipe(gulp.dest('./public/scripts')) ; return stream; }); This produces the output/errpr: [11:58:51] Starting 'scripts'... events.js:72 throw er; // Unhandled 'error' event ^ /var/www/node.fortiguard.dev/bower_components/d3/d3.js:1:2: error: reserved word "function" !function() { ^ How should I set this up, without again creating any temp files? What I liked about the LESS compiler, is that it can still be fed straight CSS files and it'd be fine. I was kind of hoping the Coffee compiler would react the same way
tagged with: gulp-concat

http://stackoverflow.com/comment/45227815
comment on: http://stackoverflow.com/a/28449883
type: Comment
score: 0
type: AnswerComment
has text: He didn't mentioned dynamic case. I guess

http://stackoverflow.com/comment/45357490
type: QuestionComment
type: Comment
has text: No, I copied `phone-detail.html` straight from the tutorial. `PhoneDetailCtrl` is the name of the controller.
comment on: http://stackoverflow.com/q/28520284
score: 0

http://stackoverflow.com/comment/45357469
type: Comment
has text: @DigitalBrent You didn't update the code properly. Look at my answer carefully and note the difference between mine and yours around the declaration of the "tele_in" function.
comment on: http://stackoverflow.com/a/28511486
score: 0
type: AnswerComment

http://stackoverflow.com/q/28543711
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/28544191
has body: I have a webpage with a canvas for implementing graphics rendering, and would like to align some text and buttons to the left of it. My HTML code is as follows: Controls Man Use the mouse to rotate the view. So what I want to align to the left is everything in the 'controls' class. Currently it is being displayed below the canvas on a new line. I want it to be aligned to the left starting on the same line as the canvas, with the canvas remaining centered. I am using a stylesheet and would like to know how to implement this using css. My site can be seen here. It is the Controls section I want to move up towards the top of the page. Any help would be much appreciated, thank you.
tagged with: webgl
has answer: http://stackoverflow.com/a/28544191
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28543797
upvote count: 2
answer count: 2
has title: How to align text and buttons next to canvas (WebGL + JavaScript + CSS)
downvote count: 1
has answer: http://stackoverflow.com/a/28543797
has comment: http://stackoverflow.com/comment/45401011
favorite count: 0

http://stackoverflow.com/q/28535851
tagged with: asp.net
tagged with: ajax
has comment: http://stackoverflow.com/comment/45386148
has title: How to get data from Ajax
has answer: http://stackoverflow.com/a/28536614
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45386551
tagged with: c#
tagged with: http://stackoverflow.com/tag/json
has body: I have a variable called sid which handle number of seat. I want to throw sid to TryJSON.aspx method test. then I wanna do manipulate data on method test then throw back the result to this ajax. but I have an error when I just try to throw sid var sid = jQuery(this).attr('id'); console.log(sid); $.ajax({ url: "TryJSON.aspx/test", type: "POST", data: JSON.stringify({ 'noSeat': sid }), contentType: "application/json; charset=utf-8", success: function (response) { var arr = JSON.parse(response.d); console.log(arr); }, error: function () { alert("sorry, there was a problem!"); console.log("error"); }, complete: function () { console.log("completed"); } }); this is my C# code to receive noSeat [WebMethod] [ScriptMethod(UseHttpGet = true)] public static string test(string noSeat) { // return noSeat; //JavaScriptSerializer serializer = new JavaScriptSerializer(); // return new JavaScriptSerializer().Serialize(new { noSeat = noSeat }); } I have try return only noSeat and also with Javascript serializer. but it has an error. it says An attempt was made to call the method 'test' using a POST request, which is not allowed. I have been tried return "Success !!" but it doesn't appear on console and still same error. what's the matter ?
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45385911

http://stackoverflow.com/comment/45304255
comment on: http://stackoverflow.com/a/28464724
type: AnswerComment
score: 0
type: Comment
has text: That looks like it would work pretty well. You could take it a step further and lazy load as previously described to save bandwidth on page bounces or brief visits, but that should pretty much resolve the initial loading issue.

http://stackoverflow.com/comment/45296019
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28486665
has text: Oh crap, forgot, this gets me all the time too. On your client the namespace should be 'connect' not 'connection'.

http://stackoverflow.com/comment/45294882
has text: this is great solution but what about if I have that in separate divs like this http://jsbin.com/luyanataqa/1/edit?html,css,output is not working now.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28486434
type: Comment

http://stackoverflow.com/q/28575949
favorite count: 0
has body: I have array something like this: var array1 = [ {"name":"a","groups":["xxx","yyy"]}, {"name":"abc","groups":["xxx","yyy"]}, {"name":"abcd","groups":["zzz","xxx","yyy"]} ]; and var array2 = ["xxx","yyy"]; I need to return the entire index of array1 when both "xxx" and "yyy" of array2 matches only to the "xxx" and "yyy" of array1. Like in this example, it should only return array1[0] and array1[1]. Any help will be greatly appreciated. Thank you.
has answer: http://stackoverflow.com/a/28576065
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/28576175
accepted answer: http://stackoverflow.com/a/28576175
type: Question
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/28576174
has comment: http://stackoverflow.com/comment/45461380
has title: intersection of arrays in javascript
possible better answer: http://stackoverflow.com/a/28576065
has comment: http://stackoverflow.com/comment/45462479
has comment: http://stackoverflow.com/comment/45462315
answer count: 3
linked to: http://stackoverflow.com/q/500504
downvote count: 1

http://stackoverflow.com/a/28562372
upvote count: 1
score: 1
has body: var time = 1000/60; setInterval(function(){ alert("Hello"); }, time); 1000 is milliseconds divided by 60. But there is a downfall with this approach, if your function doesn't have time to run in that time (a very short timespan) it will not wait until it's finished. So it can have quite disastrous effects on your application. Then it's probably better to call setTimeout recursively so it will finish executing your function before it's called again. var time = 1000/60; (function loop(){ setTimeout(function(){ // logic here // recurse loop(); }, time); })(); Sure requestAnimationFrame is nice but it's not supported on older browsers. If you want working code in older browsers I would advise using a recursive settTimeout approach. That will work everywhere!
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45435536
answers question: http://stackoverflow.com/q/28562342
has comment: http://stackoverflow.com/comment/45435765

http://stackoverflow.com/q/28509177
has answer: http://stackoverflow.com/a/32929997
tagged with: meteor
favorite count: 0
has title: Meteor: form with two submit buttons (determine button clicked in event handler)
possible better answer: http://stackoverflow.com/a/28509345
has body: I have a simple form with two inputs: "title" and _"description", and two buttons: "save" (save for later) and "submit". For both I would want to get the values of my form fields and insert/update my collections accordingly. &lt;template name="NewScenarioForm"&gt; &lt;form id="newScenarioForm" &gt; &lt;textarea type="text" id="title" name="title" rows="1" cols="75" placeholder="Type to add a title"&gt;&lt;/textarea&gt;&lt;br/&gt; &lt;textarea type="text" id="description" name="description" rows="4" cols="100" placeholder="Type to add a description" &gt;&lt;/textarea&gt;&lt;br/&gt; &lt;input type="submit" id="saveScenarioButton" name="action" title="Save Scenario" value="Save" /&gt; &lt;input type="submit" id="submitScenarioButton" name="action" title="Submit for approval" value="Submit" /&gt; &lt;/form&gt; &lt;/template&gt; Right now I'm detecting the event like this: "click #saveScenarioButton": function(event, template) { event.preventDefault(); var title = template.find("#title").value; var description = template.find("#description").value; ... //Do stuff with this information to persist information Meteor.call("saveScenario", title, description); .... } And I need to repeat the whole function for the other button. I would would like to detect the event and determine which button was pressed instead. I have been struggling with an event handler like: "submit #newScenarioForm": function(event) { But then I don't know how to determine the button clicked, since I can't figure out an event property. Is there a way to determine the button if I wanted to use the form ID in my event handler instead of the ID of each button (or a smarter way to approach this altogether?)?
has answer: http://stackoverflow.com/a/28509345
upvote count: 1
has answer: http://stackoverflow.com/a/28509715
type: AnsweredQuestion
score: 1
tagged with: forms
type: Question
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28509715
answer count: 3

http://stackoverflow.com/tag/csv
type: Tag
tag name: csv
tags question: http://stackoverflow.com/q/28503653
tags question: http://stackoverflow.com/q/28495689
tags question: http://stackoverflow.com/q/28442781
tags question: http://stackoverflow.com/q/28556901
tags question: http://stackoverflow.com/q/28505432
tags question: http://stackoverflow.com/q/28543821
tags question: http://stackoverflow.com/q/28551543
tags question: http://stackoverflow.com/q/28504953
tags question: http://stackoverflow.com/q/28495959
tags question: http://stackoverflow.com/q/28550772

http://stackoverflow.com/q/28467117
has answer: http://stackoverflow.com/a/28511411
tagged with: firefox
downvote count: 0
tagged with: javascript
answer count: 1
has title: Firefox extension: get click data when context menu
favorite count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: contextmenu
has body: In my extension I want to hide/show items on the context menu based on the url I get: from a link if the user opens the context menu over one, from the text selected, also if the user opens the context menu over the text. In the function to show/hide items in the context menu I do the following check: if (gContextMenu.onLink) { url = gContextMenu.target.href; } if (gContextMenu.isTextSelected) { url = content.window.getSelection(); } If some text is selected in the page, and the user opens the context menu over a link, both conditions are true. Also, if some text is selected, and the user opens the context menu anywhere in the page (over the selection or not), the isTextSelected flag is also true. Is there a way I can detect what is the real element over which the user has used the right click? How can I know if the right click was over the selected text or not?
score: 1
type: Question

http://stackoverflow.com/comment/45419939
type: Comment
type: AnswerComment
has text: This helps, Im not getting NaN but now Im not getting it in the table.
comment on: http://stackoverflow.com/a/28553524
score: 0

http://stackoverflow.com/q/28497365
score: 0
tagged with: prepend
tagged with: append
has body: I have this function that moves a HTML element around the DOM based on whether the window size is less than 640px or more. I'm moving the image with prepend and append, but because the function fires every time the window is resized I think I'm asking for performance issues. The code: function moveDealsImage() { var mobile_width = 640; var wi = $(window).width(); if (wi &lt; mobile_width) { $( ".deals-header" ).prepend( $("div.htp") ); } else { $( ".deals-header" ).append( $("div.htp") ); } } window.addEventListener("resize", moveDealsImage); moveDealsImage(); I need to keep the listener in there. Is there a way to do that, but then only prepending/appending the element once each time that the if or else statements become true? (instead of it happening on every pixel change)
accepted answer: http://stackoverflow.com/a/28497909
has title: Prepend and append content based on browser size
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28497909
type: Question
answer count: 1
tagged with: addeventlistener
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45343459
type: Comment
has text: but i get this `14144`
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28512522

http://stackoverflow.com/comment/45329089
type: AnswerComment
has text: This solved my problem. Thank you! And thanks everyone for quick replies. I'll try to figure out what console telling me
score: 0
comment on: http://stackoverflow.com/a/28504365
type: Comment

http://stackoverflow.com/comment/45475429
comment on: http://stackoverflow.com/q/28583100
has text: maybe stupid, but are you sure to use the same timestamp
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28512328
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28513318
favorite count: 0
possible better answer: http://stackoverflow.com/a/28512469
answer count: 3
has answer: http://stackoverflow.com/a/28512543
has answer: http://stackoverflow.com/a/28512469
has body: I am using javascript to change my css class background image every few seconds. It is working great the problem is it just stops after it shows the last image. Can anyone show me what to add to this code so that it will continuously loop itself? $(window).load(function() { $(document).ready(function() { setInterval(fadeDivs, 5000); //call it every 2 seconds function fadeDivs() { var visibleDiv = $('.bckgnd:visible:first'); //find first visible div visibleDiv.fadeOut(400, function() { //fade out first visible div var allDivs = visibleDiv.parent().children(); //all divs to fade out / in var nextDivIndex = (allDivs.index(visibleDiv) + 1) % allDivs.length; //index of next div that comes after visible div var nextdiv = allDivs.eq(nextDivIndex); //find the next visible div var lastDiv = $('.backgnd3'); var firstDiv = $('.backgnd1'); if (currentDiv != lastDiv) { var nextdiv = allDivs.eq(nextDivIndex); //find the next visible div } else { var nextdiv = firstDiv; //the next div will be the first div, resulting in a loop } nextdiv.fadeIn(400); //fade it in }); }; }); }); .backgnd1 { width: 100%; height: 452px; background: url ('http://quaaoutlodge.com/sites/all/themes/marinelli/img/backgrounds/backgnd1.jpg'); background-size: cover; background-repeat: no-repeat; background-color: #000; } .backgnd2 { width: 100%; height: 452px; background-image: url ('http://quaaoutlodge.com/sites/all/themes/marinelli/img/backgrounds/the_lodge.jpg'); background-size: cover; background-repeat: no-repeat; background-color: #000; } .backgnd3 { width: 100%; height: 452px; background-image: url('http://quaaoutlodge.com/sites/all/themes/marinelli/img/backgrounds/getting_here.jpg'); background-size: cover; background-repeat: no-repeat; background-color: #000; } .index_roof_background { background-color: #000; width: 1600px; height: 452px; margin: 0px; padding-top: 0px; margin-left: auto; margin-right: auto; } &lt;div class="index_roof_background"&gt; &lt;div style="position:absolute; z-index: 2;disp…
has title: How make a fade slideshow loop?
upvote count: 1
has answer: http://stackoverflow.com/a/28513318
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45344590
type: Question

http://stackoverflow.com/a/28512469
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45343548
has body: First put the firstDiv, lastDiv in their own variables. Then you will need something like this if (currentDiv != lastDiv) { var nextdiv = allDivs.eq(nextDivIndex); //find the next visible div } else { var nextdiv = firstDiv; //the next div will be the first div, resulting in a loop } nextdiv.fadeIn(400); //fade it in Tell me if you need more help.
answers question: http://stackoverflow.com/q/28512328

http://stackoverflow.com/comment/45351143
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28516500
score: 0
has text: First error when debugging your code is this line `dynamicData[i][arr[i]['name']];`. This is doing nothing - what should it do?

http://stackoverflow.com/comment/59433927
score: 0
type: Comment
has text: haha.. he thought that he will copy the code written in highlight.pack.js inside the folder ^_^ @JonRoby ... you will copy the file dude..
type: AnswerComment
comment on: http://stackoverflow.com/a/28574046

http://stackoverflow.com/comment/45411328
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28548667
has text: Edited to fix that, also included the `unescape`-less version in my answer.

http://stackoverflow.com/comment/45386130
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28535742
has text: do you know how to check for errors? because you are getting one I am pretty sure
score: 0

http://stackoverflow.com/a/28452967
has comment: http://stackoverflow.com/comment/45233162
has comment: http://stackoverflow.com/comment/45262701
has comment: http://stackoverflow.com/comment/45233125
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45234501
has comment: http://stackoverflow.com/comment/45234084
has comment: http://stackoverflow.com/comment/45233448
has comment: http://stackoverflow.com/comment/45233491
answers question: http://stackoverflow.com/q/28452882
has body: You can check all of them by running this jquery code: $.each( $("input[id^='myInputIDStatusStartWith']"), function(){ $(this).prop('checked', true); }); Where myInputIDStatusStartWith is that part of your input ids which is similar. You can change your button into: &lt;input type="submit" name="submit" value="submit" onclick="checkAllCheckboxes()"&gt; And you can define this function "checkAllCheckboxes" in a JavaScript script like: function checkAllCheckboxes(){ $.each( $("input[id^='myInputIDStatusStartWith']"), function(){ $(this).prop('checked', true); }); } Don't forget to include the jquery library in your page.
has comment: http://stackoverflow.com/comment/45233574

http://stackoverflow.com/a/28565882
score: 2
upvote count: 2
has body: Improve this to return string.Empty when there is no data available. public static string LoadLatest(int offset, int fetch) { var LoadSql = db.Query("Exec dbo.SD_unionServices @0, @1", offset, fetch);"); foreach (var item in LoadSql) { Load_sb.Append(item.title + "&lt;br /&gt;"); } if(Load_sb.Count() &gt; 0) return Load_sb.ToString(); else return string.Empty; }
downvote count: 0
has comment: http://stackoverflow.com/comment/45444870
has comment: http://stackoverflow.com/comment/45445231
answers question: http://stackoverflow.com/q/28565702
has comment: http://stackoverflow.com/comment/45446115
type: Answer

http://stackoverflow.com/a/28464482
downvote count: 0
has body: Yes. Screen readers use this attribute. But you also have to test that screen readers would consider correctly a dynamic change in this attribute.
has comment: http://stackoverflow.com/comment/45255601
type: Answer
has comment: http://stackoverflow.com/comment/45255513
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28459846
answers question: http://stackoverflow.com/q/28459846
has comment: http://stackoverflow.com/comment/45255223
score: 2
type: AcceptedAnswer

http://stackoverflow.com/q/28485056
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/93794188
has title: Json File - Getting Json data from PHP file and pass it to a JavaScript variable in an HTML File
answer count: 0
has comment: http://stackoverflow.com/comment/45292450
has comment: http://stackoverflow.com/comment/45292250
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45292079
score: 1
tagged with: http://stackoverflow.com/tag/json
has body: I am creating a Data grid using Jquery. I have a php file which will fetch the data from a MySQL table, create a json and pass it to an HTML page. That HTML Page contains the code for parsing the JSON data. Once I get the data in HTML page, I pass it onto data grid which would display the information. Now, my question is: I am not able to read the json data in html file. There might be an issue with the file that is been sent. There might be an issue with code itself. Is there is method by which I can debug the code. I am using PHPStorm as the IDE for creating this application. I have created a JsFiddle : http://jsfiddle.net/3pm98dot/ HTML: $(function () { var northwindProductsJSON; $.getJSON("testFileV0.7.php?callback=",function(data) { northwindProductsJSON = JSON.parse(data); }); var northWindCategoriesJSON = [ { "ID": 0, "Name": "Food" }, { "ID": 1, "Name": "Beverages" }, { "ID": 2, "Name": "Electronics" } ]; //Formatting for igGrid cells to display igCombo text as opposed to igCombo value function formatCategoryCombo(val) { var i, category; for (i = 0; i &lt; northWindCategoriesJSON.length; i++) { category = northWindCategoriesJSON[i]; if (category.ID === val) { val = category.Name; } } return val; } function showFeedback(elementID, message) { var selector = '#' + elementID; $(selector).stop(true, true).html(message) .fadeIn(500).delay(3000).fadeOut(500); } //Grid Initialization $("#gridProducts").igGrid({ dataSource: northwindProductsJSON, autoGenerateColumns: false, primaryKey: "ID", autoCommit: true, width: "100%", height: "360px", columns: [ { headerText: "", key: "ID", dataType: "number", width: "8%" }, { headerText: "Name", key: "Name", dataType: "string", width: "24%" }, { headerText: "Category", key: "CategoryID", dataType: "number", width: "34%", formatter: formatCategoryCombo } ], features: [ { name: 'Updating', columnSettings: [{ //The combo is defined as an editor provider. Combo options are defined under 'editorOptions'. columnKey: "CategoryID", ed…
has comment: http://stackoverflow.com/comment/45629628
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45293482
type: UnansweredQuestion

http://stackoverflow.com/comment/45428707
comment on: http://stackoverflow.com/a/28556740
has text: Right so is there any solution for this.?
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/comment/45288709
type: Comment
has text: https://developers.google.com/maps/documentation/javascript/examples/map-geolocation
comment on: http://stackoverflow.com/q/28483025
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45291452
comment on: http://stackoverflow.com/a/28471409
has text: I'm disappointed this isn't straightforward. What's the point of having the [modules option](http://requirejs.org/docs/optimization.html#wholeproject) in the [build config](https://github.com/jrburke/r.js/blob/master/build/example.build.js#L355) if you've got to jump through hoops to have the compiled modules loaded dynamically?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28553066
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/28553374
tagged with: canvas
has answer: http://stackoverflow.com/a/28553429
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28553429
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: on my Canvas when you change size i have it soo you can go from 1 - 100 but i have it so it goes up in 5's but when you got to 1 and go up again it goes to 6 then up again and goes to 11 and so on. here it is http://jsfiddle.net/daniel9000/tsaytohj/2/ here is my java script function processData(c1, c2) { var cv1 = document.getElementById(c1).value; var cv2 = document.getElementById(c2).value; alert(cv1 + "\n" + cv2); } var canvas = document.getElementById('canvas'); var context = canvas.getContext('2d'); var radius = 10; var dragging = false; canvas.width = window.innerWidth; canvas.height = window.innerHeight; context.lineWidth = radius * 2; var putPoint = function (e) { if (dragging) { var bounds = canvas.getBoundingClientRect(); var mouseX = e.clientX + bounds.left; var mouseY = e.clientY - bounds.top; var mouseX = e.clientX + bounds.left - 0; context.lineTo(mouseX, mouseY) context.strokeStyle = document.getElementById('color1').value; context.stroke(); context.beginPath(); context.arc(mouseX, mouseY, radius, 0, Math.PI * 2); context.fillStyle = document.getElementById('color1').value; context.fill(); context.beginPath(); context.moveTo(mouseX, mouseY); } } var engage = function (e) { dragging = true; putPoint(e); } var disengage = function () { dragging = false; context.beginPath(); } canvas.addEventListener('mousedown', engage); canvas.addEventListener('mousemove', putPoint); canvas.addEventListener('mouseup', disengage); var setRadius = function (newRadius) { if (newRadius &lt; minRad) newRadius = minRad; else if (newRadius &gt; maxRad) newRadius = maxRad; radius = newRadius; context.lineWidth = radius * 2; radSpan.innerHTML = radius; } var minRad = 1, maxRad = 100, defaultRad = 20, interval = 5, radSpan = document.getElementById('radval'), decRad = document.getElementById('decrad'), incRad = document.getElementById('incrad'); decRad.addEventListener('click', function () { setRadius(radius - interval); }); incRad.addEventListener('click', function () { setRadi…
has answer: http://stackoverflow.com/a/28553374
type: AnsweredQuestion
has title: canvas drawing size fix needed

http://stackoverflow.com/a/28444875
score: 1
has body: use preventDefault. This method makes sure the default action of the event will not be triggered. function CheckRequired(event) { var ret = true; $(".required").each( function() { var check = $(this).val(); if(check == '') { //alert($(this).attr("id")); event.preventDefault(); } }); if(!ret) { alert("One or more fields cannot be blank"); event.preventDefault(); } }
upvote count: 1
answers question: http://stackoverflow.com/q/28444683
has comment: http://stackoverflow.com/comment/45219607
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28444683
type: Answer

http://stackoverflow.com/comment/45375065
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28529734
has text: @jfriend00: Updated with a more generic implementation. Hope that's what OP is looking for.

http://stackoverflow.com/a/33680300
type: Answer
has body: With 1.0, React-Router depends on the history module as a peerDependency. This module deals with routing in the browser. By default React-Router uses the HTML5 History API (pushState, replaceState), but you can configure it to use hash-based routing (see below) The route handling is now done behind the scenes, and ReactRouter sends new props down to the Route handlers when the route changes. The Router has a new onUpdate prop callback whenever a route changes, useful for pageview tracking, or updating the &lt;title&gt;, for example. Client (HTML5 routing) import {Router} from 'react-router' import routes from './routes' var el = document.getElementById('root') function track(){ // ... } // routes can be children render(&lt;Router onUpdate={track}&gt;{routes}&lt;/Router&gt;, el) Client (hash-based routing) import {Router} from 'react-router' import {createHashHistory} from 'history' import routes from './routes' var el = document.getElementById('root') var history = createHashHistory() // or routes can be a prop render(&lt;Router routes={routes} history={history}&gt;&lt;/Router&gt;, el) Server On the server, we can use ReactRouter.match, this is taken from the server rendering guide import { renderToString } from 'react-dom/server' import { match, RoutingContext } from 'react-router' import routes from './routes' app.get('*', function(req, res) { // Note that req.url here should be the full URL path from // the original request, including the query string. match({ routes, location: req.url }, (error, redirectLocation, renderProps) =&gt; { if (error) { res.status(500).send(error.message) } else if (redirectLocation) { res.redirect(302, redirectLocation.pathname + redirectLocation.search) } else if (renderProps) { res.status(200).send(renderToString(&lt;RoutingContext {...renderProps} /&gt;)) } else { res.status(404).send('Not found') } }) })
upvote count: 27
score: 27
answers question: http://stackoverflow.com/q/28553904
downvote count: 0

http://stackoverflow.com/comment/45411924
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28548807
has text: This actually led me to the solution of the unserialize method that has been created in JavaScript for unserializing data after running the PHP serialize.

http://stackoverflow.com/q/28590416
has comment: http://stackoverflow.com/comment/45489193
has body: My site simply displays a main image with an image slider beneath it. The images are not appearing in IE 8 or IE9, but begin showing up in IE10. The HTML for the gallery is simply: &lt;div class="fotorama" data-nav="thumbs" data-width="100%" data-ratio="800/600" data-minwidth="350" data-maxwidth="700" data-minheight="300" data-maxheight="100%" margin-top= -5%;&gt; &lt;img src="http://www.pampangahouses.com/wp-content/uploads/2012/08/leighton-front-view.jpg"&gt; &lt;img src="http://www.pampangahouses.com/wp-content/uploads/2012/08/leighton-front-view.jpg"&gt; &lt;img src="http://www.pampangahouses.com/wp-content/uploads/2012/08/leighton-front-view.jpg"&gt; &lt;img src="http://www.pampangahouses.com/wp-content/uploads/2012/08/leighton-front-view.jpg"&gt; &lt;img src="http://www.pampangahouses.com/wp-content/uploads/2012/08/leighton-front-view.jpg"&gt; &lt;/div&gt; Here is a screenshot of the images not displaying in IE8/IE9: and here it is in IE10: the css for "fotorama" is here: http://testsite24.netai.net/public/css/fotorama.css and js code here: http://testsite24.netai.net/public/js/fotorama.js If IE8/9 does not support a necessary function here, can you recommend a fall-back solution for these versions? Thanks so much! Full demo site: http://testsite24.netai.net/public/demo6.html
downvote count: 0
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28593028
linked to: http://stackoverflow.com/q/1204288
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28591063
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45487511
has title: Images are not showing up in IE 8 or IE 9 for some reason
possible better answer: http://stackoverflow.com/a/28591063
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45497901
tagged with: internet-explorer
has answer: http://stackoverflow.com/a/28593028
tagged with: javascript
has comment: http://stackoverflow.com/comment/45487841
answer count: 2

tamper-data
tags question: http://stackoverflow.com/q/28516842
type: Tag
tags question: http://stackoverflow.com/q/28511248
tag name: tamper-data

http://stackoverflow.com/a/29163752
answers question: http://stackoverflow.com/q/28532350
score: 0
has body: Have you added these 2 lines at the top of your custom.css.scss file? @import "bootstrap-sprockets"; @import "bootstrap"; Your _header.html.erb works fine in my app. Only difference I can see here is that you use: gem 'bootstrap-sass' and I use: gem 'bootstrap-sass', '3.2.0.0'
type: Answer

http://stackoverflow.com/q/28449876
accepted answer: http://stackoverflow.com/a/28450078
favorite count: 0
tagged with: angularjs
has title: Controller as vm with ng-click
type: AnsweredQuestion
tagged with: angularjs-scope
has answer: http://stackoverflow.com/a/32842078
type: Question
upvote count: 4
answer count: 2
has answer: http://stackoverflow.com/a/28450078
downvote count: 0
possible better answer: http://stackoverflow.com/a/32842078
tagged with: javascript
has body: I am trying to follow John Papa's Angular Style Guide however i cannot get the model data of input file with ngClick. When i try with $scope everything works just fine. Here is the Demo on Plnkr. Glad for your help.
score: 4

http://stackoverflow.com/comment/53903795
comment on: http://stackoverflow.com/a/29254099
type: AnswerComment
has text: minview didn't work for me, minView (capital V) did.Thanks!
type: Comment
score: 2

image
tags question: http://stackoverflow.com/q/28498736
tags question: http://stackoverflow.com/q/28545619
tags question: http://stackoverflow.com/q/28515337
tags question: http://stackoverflow.com/q/28592033
tags question: http://stackoverflow.com/q/28497327
tags question: http://stackoverflow.com/q/28530217
tags question: http://stackoverflow.com/q/28458052
tags question: http://stackoverflow.com/q/28526898
tags question: http://stackoverflow.com/q/28563073
tags question: http://stackoverflow.com/q/28447770
tags question: http://stackoverflow.com/q/28586730
tags question: http://stackoverflow.com/q/28440369
tags question: http://stackoverflow.com/q/28549157
tags question: http://stackoverflow.com/q/28520842
tags question: http://stackoverflow.com/q/28501510
tags question: http://stackoverflow.com/q/28575290
tags question: http://stackoverflow.com/q/28476671
tags question: http://stackoverflow.com/q/28547365
tags question: http://stackoverflow.com/q/28456303
tags question: http://stackoverflow.com/q/28444039
tags question: http://stackoverflow.com/q/28506901
tags question: http://stackoverflow.com/q/28489975
tags question: http://stackoverflow.com/q/28476577
tags question: http://stackoverflow.com/q/28563939
tags question: http://stackoverflow.com/q/28545974
tags question: http://stackoverflow.com/q/28580785
tags question: http://stackoverflow.com/q/28465555
tags question: http://stackoverflow.com/q/28567212
tag name: image
tags question: http://stackoverflow.com/q/28585116
tags question: http://stackoverflow.com/q/28491583
tags question: http://stackoverflow.com/q/28438430
tags question: http://stackoverflow.com/q/28503917
tags question: http://stackoverflow.com/q/28566148
tags question: http://stackoverflow.com/q/28514922
type: Tag
tags question: http://stackoverflow.com/q/28532602
tags question: http://stackoverflow.com/q/28486669
tags question: http://stackoverflow.com/q/28533016
tags question: http://stackoverflow.com/q/28489134
tags question: http://stackoverflow.com/q/28542627
tags question: http://stackoverflow.com/q/28483650
tags question: http://stackoverflow.com/q/28467079

http://stackoverflow.com/a/28579702
type: Answer
has comment: http://stackoverflow.com/comment/45477647
accepted answer of: http://stackoverflow.com/q/28567281
answers question: http://stackoverflow.com/q/28567281
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45475022
downvote count: 0
type: AcceptedAnswer
has body: A few aspects: • The script is OK so far, as it does work in Reader XI (and it also should work in Acrobat). • cSubmitAs: "PDF" requires that the filled form is saved. This is possible without limitations only in Reader XI; in earlier versions, you would have to assign Extended Rights to the form, in order to make it saveable. • You might activate the Console in Reader X, in order to see whether there are indeed error messages. • FORGET Preview.app!!! Preview.app does not support (Acrobat) JavaScript, and therefore, the script gets ignored. But even worse, when saving a filled form, Preview.app messes up the document in a way that it is no longer usable. If there is a higher chance that your users use Preview.app, you have to protect the form by make it non-fillable by default, and use a document-level script to make it fillable. In fact, that may be necessary if your form will also be used on iDevices etc. Aside from the issues mentioned, it might be necessary encode special characters in cURL.

http://stackoverflow.com/comment/45213874
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28441673
type: Comment
has text: Just tried this. The rejected promise is definitely being returned in all cases. Still hunting for the cause. I think I should mention again that my error handling is actually working as expected. The place I'm seeing this issue right now is when I'm running my mocha tests for my API with intentionally faulty data. The errors get caught and handled as expected but I still see this message.

http://stackoverflow.com/comment/45358995
score: 0
type: AnswerComment
has text: Should I remove that question? Or is there a way you could answer it? And I'll mark you as correct?...Beause you are.
type: Comment
comment on: http://stackoverflow.com/a/28518034

http://stackoverflow.com/comment/45315950
comment on: http://stackoverflow.com/q/28498014
has text: please upload the code to jsfiddle and i will look at it
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28551377
has body: I made a really simple version of this, so it'd be easier to isolate the problem. What it does is listens for a click, then changes the height of the article (which contains everything else) and makes the button disappear. The styles are overflow: hidden (to hide stuff that overflows the height in this case) and a static height. read_more.addEventListener('click', function () { main.style.height = 'auto'; read_more.style.display = 'none'; }); http://jsfiddle.net/snlacks/5f2qpx04/
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28551087

http://stackoverflow.com/comment/49594288
type: Comment
has text: Great solution! It's easy to forget the factories are instantiated at birth and the error messages can hide the true problem!
comment on: http://stackoverflow.com/a/28445137
score: 0
type: AnswerComment

http://stackoverflow.com/q/28532310
answer count: 0
tagged with: javascript
type: UnansweredQuestion
has body: I use the Ace editor on my website but I'm wondering if there exists any addons to make a simple Markdown toolbar above the editor - just like the one on the Ask question on Stackoverflow. I've been looking for a stable and active open source project but I couldn't find one.
score: 2
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ace-editor
type: Question
upvote count: 2
tagged with: codemirror
linked to: http://stackoverflow.com/q/21900938
has comment: http://stackoverflow.com/comment/50763403
has title: Bold, italic buttons in Ace editor

http://stackoverflow.com/comment/45241434
has text: change your id into a class? IDs shouldn't be duplicate.. Also put an example of your problem in action in a jsfiddle. Makes it easier to see what your problem is..
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28457473

http://stackoverflow.com/comment/45328841
comment on: http://stackoverflow.com/q/28504643
has text: To add the subject into the body of the email you can add ` $subject` into `$mailBody` for example: `$mailBody="Name: $sender\nEmail: $senderEmail\nPhone: $senderPhone\nCompany: $senderCompany\n$subject\n\n$message";` As for sending the form data to PHP, you asked for suggestions on how to do that without pushing the user to that PHP page. Well Ajax will do that. This is where you will have to learn rather than copy/paste If you have no interest in learning then I recommend you hire a developer.
score: 1
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45464187
type: AnswerComment
comment on: http://stackoverflow.com/a/28577715
type: Comment
has text: You can do that by adding the property revert: true in the draggable call. like jQuery( ".child" ).draggable({ cursor: "move", revert: true});
score: 0

http://stackoverflow.com/a/28454936
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28454823
has comment: http://stackoverflow.com/comment/45240038
answers question: http://stackoverflow.com/q/28454823
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/45240124
score: 2
has body: rtserver-id isn't a valid identifier - so if you want it as a field/property name, you need to quote it. You can see this in a Chrome Javascript console, with no need for any Java involved: &gt; var aClientEnv = { sessionId: "", rtserver-id: 1 }; Uncaught SyntaxError: Unexpected token - &gt; var aClientEnv = { sessionId: "", "rtserver-id": 1 }; undefined &gt; aClientEnv Object {sessionId: "", rtserver-id: 1} Basically I don't think anything's adding spaces - you've just got an invalid script. You can easily add the quotes in your Java code: " \"rtserver-id\": 1, " +
type: AcceptedAnswer

http://stackoverflow.com/comment/45473054
has text: Thank you to both Anurag and Vivek. Works great
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28582363
score: 0

http://stackoverflow.com/comment/45466947
type: Comment
has text: Could you please edit in the above code and share to me? thanks
comment on: http://stackoverflow.com/a/28579222
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45234758
comment on: http://stackoverflow.com/q/28453242
has text: Modify the `maxFileSize` property.
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/45525956
comment on: http://stackoverflow.com/a/28588619
score: 0
type: AnswerComment
has text: Good call; that's a bit cleaner than mine.
type: Comment

http://stackoverflow.com/a/28509505
score: 6
upvote count: 6
accepted answer of: http://stackoverflow.com/q/28509479
has comment: http://stackoverflow.com/comment/45338082
answers question: http://stackoverflow.com/q/28509479
has comment: http://stackoverflow.com/comment/45338232
has comment: http://stackoverflow.com/comment/45338848
type: AcceptedAnswer
downvote count: 0
has body: your input has name="username" but you are looking for $_POST['user']
type: Answer
has comment: http://stackoverflow.com/comment/45338483
has comment: http://stackoverflow.com/comment/45338640
has comment: http://stackoverflow.com/comment/45338367
has comment: http://stackoverflow.com/comment/45338781

http://stackoverflow.com/q/28476791
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45276619
has comment: http://stackoverflow.com/comment/45277022
has comment: http://stackoverflow.com/comment/45277202
has title: Passing html control id to javascript from aspx file
has comment: http://stackoverflow.com/comment/45277230
type: Question
has comment: http://stackoverflow.com/comment/45277237
score: 0
has body: I'm amazed I haven't found an answer to this yet. I'm using a standard html button (as opposed to an asp:Button) in an ASPX file. When calling a javascript function from the onclick attribute, if the javascript call contains a variable, it fails. For example, onclick="func1()" will run perfectly, however, onclick="func2(this.id)", doesn't. I understand that this.id shouldn't work in an asp:Button, but should it fail in a standard html button? EDIT: HTML: &lt;button id="Hour" type="button" class="butshape" onclick="return middlePress(this.id)" disabled&gt;&lt;/button&gt; Javascript: function middlePress(clicked_id){ document.getElementById("lengthtext").innerHTML=clicked_id; clearEnd(); switch(clicked_id){ case "Day": document.getElementById("11").innerHTML=Date(); document.getElementById("12").innerHTML="Previous 24"; document.getElementById("12").disabled=false; break; case "Week": document.getElementById("11").innerHTML=Date(); document.getElementById("12").innerHTML="Previous 7 Days"; document.getElementById("12").disabled=false; break; case "Month": document.getElementById("11").innerHTML=Date(); document.getElementById("12").innerHTML="Previous 30 Days"; document.getElementById("12").disabled=false; break; } }
tagged with: javascript
has comment: http://stackoverflow.com/comment/45277302
has comment: http://stackoverflow.com/comment/45276625
has answer: http://stackoverflow.com/a/28477274
answer count: 3
possible better answer: http://stackoverflow.com/a/28477066
has answer: http://stackoverflow.com/a/28477077
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28477066
accepted answer: http://stackoverflow.com/a/28477274
tagged with: asp.net
has comment: http://stackoverflow.com/comment/45276715
has comment: http://stackoverflow.com/comment/45277112

http://stackoverflow.com/comment/45365042
has text: @SaiKrishnaDeep, You missed `(..)` (capturing group). See the forked version: http://jsfiddle.net/tsvbdsj1/
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28524324

openlayers-3
type: Tag
tags question: http://stackoverflow.com/q/28535104
tag name: openlayers-3

http://stackoverflow.com/comment/45405483
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28545954
score: 0
has text: Yes it requires V1.8.3 as you can see in the first version however if i load that jQuery version the plugin just doesn't work at all

http://stackoverflow.com/a/28573998
accepted answer of: http://stackoverflow.com/q/28572473
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/52788150
has comment: http://stackoverflow.com/comment/52707813
answers question: http://stackoverflow.com/q/28572473
has body: For the future warriors: That is how passport is supposed to work. Detailed explanation on how passport works is here The thing that is missing here is the bodyparser in the post call to /login. You might think passport knows how to parse req.body! Wrong! It doesn't! Express v 4 onwards body-parser has to be installed independetly and used as : var bodyParser = require('body-parser'); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); In the post request: app.post('/login', function(req, res, next) { console.log('in login post!'); console.log('body parsing: ' + req.body.username + ' ' + req.body.password); passport.authenticate('login', function(err, user, info) { if (err) { console.log('passport err: ' + err); return next(err); } if (!user) { console.log('no user found!'); return res.redirect('/'); } req.logIn(user, function(err) { if (err) { console.log('login error: ' + err); return next(err); } return res.redirect('/admin'); }); })(req, res, next); }); As you can see, I wrote a custom logIn callback function, which makes more sense and easily debuggable than just successRedirect and failureRedirect. Without the body-parser the custom function wont work because passport doesnt know how to parse req.body. The api doc of passport should mention this! Well, now since everything works as intended, the world makes sense now!
type: Answer
upvote count: 5
downvote count: 0
score: 5

http://stackoverflow.com/comment/45491249
type: QuestionComment
type: Comment
score: 1
has text: @Bush vertexAttrib4f is setting all values of a *disabled* Vertex Attribute Array, used as a *default value* and not at all needed if you plan to actually supply those values from a buffer. It has no effect once you enable it.
comment on: http://stackoverflow.com/q/28588388

http://stackoverflow.com/comment/45307639
has text: Node.js is just a JavaScript engine (V8) + standard library. To learn the standard library, have a look at the documentation: http://nodejs.org/api/. If you want to use it as a web server without a framework, I guess you are looking for the HTTP module: http://nodejs.org/api/http.html
comment on: http://stackoverflow.com/q/28493574
score: 4
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28532565
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45380068
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45380152
has title: Calling a function with an ID to edit
tagged with: http://stackoverflow.com/tag/html
has body: This is what i am working with so far: http://jsfiddle.net/k5rh3du0/ I need to call a function with an onLoad and onerror tag with an image. &lt;img src="http://www.etreeblog.com/favicon.ic0" alt="status" onerror="javascript:offline(blog)" onLoad="javascript:online(blog)"/&gt; &lt;img src="http://www.etreestore.com/favicon.ic0" alt="status" onerror="javascript:offline(store)" onLoad="javascript:online(store)"/&gt; &lt;script&gt; offline(site){ document.getElementById((site)).style.backgroundColor = "Red"; } online(site){ document.getElementById((site)).style.backgroundColor = "Green"; } &lt;/script&gt; &lt;div style="background-color:Orange;" id="site"&gt; Site &lt;/div&gt; &lt;div style="background-color:Orange;" id="blog"&gt; Blog &lt;/div&gt; Using something like this. How can i get this to work? -The images will have the visibility:hidden; css.
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28532642

fabricjs
tags question: http://stackoverflow.com/q/28553107
tags question: http://stackoverflow.com/q/28497274
tag name: fabricjs
tags question: http://stackoverflow.com/q/28450553
type: Tag
tags question: http://stackoverflow.com/q/28540366

http://stackoverflow.com/comment/45210650
type: QuestionComment
comment on: http://stackoverflow.com/q/28439611
has text: Yes, this happens in numerous places in my app, but the error is always caught successfully. If it changes anything promise3 might be something that gets immediately rejected such as a Promise.try with synchronous logic.
score: 0
type: Comment

http://stackoverflow.com/q/28495106
has answer: http://stackoverflow.com/a/28495346
answer count: 4
downvote count: 0
has title: Immediately-Invoked Function inside of an Angular Controller, good practice?
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28495346
type: Question
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/28496439
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28495434
upvote count: 3
has answer: http://stackoverflow.com/a/28495169
has answer: http://stackoverflow.com/a/28496439
has body: I have recently start using angular, and I'm coding one of my first controllers like that: 'use strict'; angular .module('stakeholder') .controller('StakeholderViewController', ['$scope','stakeholderViewFactory', function($scope, stakeholderViewFactory) { $scope.users = []; var loadUsersTable = (function(){ stakeholderViewFactory.getAccessUsers({stakeholderId: 3}). success(function(data, status, headers, config) { $scope.users = data; }). error(function(data, status, headers, config) { //TODO: Alert }); })(); } ]); The thing is that I need the loadUsersTable to execute when the page loads, and I thought that using an inmmediatly invoked function could be the best and clearest option, but I can smell that this is not a good move for some reason that I don't know. Maybe the best option is something like that, although you have to write more: 'use strict'; angular .module('stakeholder') .controller('StakeholderViewController', ['$scope','stakeholderViewFactory', function($scope, stakeholderViewFactory) { $scope.users = []; var loadUsersTable = function(){ stakeholderViewFactory.getAccessUsers({stakeholderId: 3}). success(function(data, status, headers, config) { $scope.users = data; }). error(function(data, status, headers, config) { //TODO: Alert }); }; loadUsersTable(); } ]); Could anyone point me the best practice to write this? Thanks!
tagged with: angularjs-scope

http://stackoverflow.com/q/28499475
accepted answer: http://stackoverflow.com/a/28506118
has body: i'm, using charts.js librarie and would like to know how could I add some mark to the hole of a doughnut chart (sth like a percentage)- My js jQuery(document).ready(function(){ var data = [ { value: 5, color:"#A1638C", highlight: "#BF7AAF", label: "Días Completados 1/21" }, { value: 95, color: "#07659A", highlight: "#4190BA", label: "Días pendientes 20/21" }, ] var ctx = jQuery("#myChart").get(0).getContext("2d"); var myDoughnutChart = new Chart(ctx).Doughnut(data); }); My canvas: &lt;canvas id="myChart" width="264px"&gt;&lt;/canvas&gt;
upvote count: 10
type: Question
tagged with: canvas
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/61657503
has answer: http://stackoverflow.com/a/45729677
has answer: http://stackoverflow.com/a/58975058
answer count: 4
has answer: http://stackoverflow.com/a/28506118
has title: Inserting percentage charts.js doughnut
possible better answer: http://stackoverflow.com/a/45729677
tagged with: charts
type: AnsweredQuestion
tagged with: chart.js
score: 10

http://stackoverflow.com/q/28534327
accepted answer: http://stackoverflow.com/a/28534400
has body: Is there any text similarity algorithm in javascript? I want to compare too essays to determine how similar they are. I was thinking about edit distance, but I don't know how to translate it into percentage.
favorite count: 0
tagged with: similarity
tagged with: text
possible better answer: http://stackoverflow.com/a/28534331
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/28534400
has answer: http://stackoverflow.com/a/28534331
upvote count: 7
type: Question
answer count: 2
downvote count: 4
has title: Algorithm to compute similarity of two strings in javascript
has comment: http://stackoverflow.com/comment/45384325
tagged with: javascript

http://stackoverflow.com/q/28515512
tagged with: http://stackoverflow.com/tag/json
has title: Javascript: Hiding/Making it difficult to understand client objects
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
score: 0
linked to: http://stackoverflow.com/q/14570831
answer count: 1
has body: Is there any known way to "hide" or to just make it difficult for users to see and understand my client side objects (which is store as JSON object)? The reason i want that is because i don't want others to simply copy my data. Consider the fact i'm getting my data from server side and instead of just fetching it as is to a JSON object, I am guessing i could add some algorithm which mixes the data on the server, and only i could know how to plug it back on the client. I am of course aware to the fact this is not a 100% hiding solution since everything is still visible on the client side. I hope my question phrased well enough to understand my goal.
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/28515963

http://stackoverflow.com/q/28465305
has title: Passing ASP.NET label id to Javascript
answer count: 2
possible better answer: http://stackoverflow.com/a/28466224
upvote count: 1
has answer: http://stackoverflow.com/a/28466224
accepted answer: http://stackoverflow.com/a/28465487
tagged with: javascript
has body: I can get the Label value to change when I use the following code document.getElementById('<%=lblDropdownValue.ClientID %>').innerHTML = ddl.value; But I would like to pass it as a parameter as shown below, but it does not seem to work. <asp:DropDownList id="ddlProducts" runat="server" onclick="myfunction(this,'<%=lblDropdownValue.ClientID %> "')"> <asp:ListItem Selected="True" Value="-1"> Please Select </asp:ListItem> <asp:ListItem Value="Car"> BMW </asp:ListItem> <asp:ListItem Value="Music"> MP3 </asp:ListItem> </asp:DropDownList> <asp:Label Text="" id="lblDropdownValue" runat="server"/>
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: asp.net
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/28465487

http://stackoverflow.com/q/28573803
accepted answer: http://stackoverflow.com/a/28573837
has body: So my simple question is : Which is the best solution ( performance and memory wise) in this case : A. we process the variable into a new one and use it everywhere we need : // imagine (a) is an incomming variable that // we can't change or else we will break something var a = "carrots"; var b = a.substr(0,a.length-1); // and then use b everywhere B. we process the variable on the fly: // imagine (a) is an incomming variable that // we can't change or else we will break something var a = "carrots"; // and then use "a.substr(0,a.length-1);" everywhere Please, it's not about how code is written ,is all about which one is faster and better. Which one you choose and why?
has answer: http://stackoverflow.com/a/28573915
type: AnsweredQuestion
has title: Which one is faster and why ? javascript
tagged with: performance
has answer: http://stackoverflow.com/a/28573906
possible better answer: http://stackoverflow.com/a/28573906
type: Question
has comment: http://stackoverflow.com/comment/45457138
tagged with: javascript
tagged with: logic
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28573837

http://stackoverflow.com/a/28466296
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28466259
downvote count: 0
score: 1
has body: It is simple. jQuery shows the element using display:block which then needs a row instead of a cell. You can manually toggle it yourself to inline-block change slideToggle() behaviour to display:inline-block instead of display:block? (jQuery) Toggle div style "display:none" to "display:inline" In your case you should just use float:left on the first div. http://jsfiddle.net/v1etme23/1/ .redDiv{ display:inline-block; background-color:red; float:left; }

http://stackoverflow.com/a/28708111
has body: There is no RetrieveEntityAsync() function in the official SDK.Metadata.js library. Did you write that yourself? Or get that library from somewhere online? Either way, just call the standard SDK.Metadata.RetrieveEntity() function, it is asynchronous, and it works just fine in IE. Also, if you are declaring entityLogicalName and RetrieveAttributeName globabally, then you don't need to pass them to the onSucess method, they will already be available there.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28451722

http://stackoverflow.com/comment/45364299
has text: What is your question about that code?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28524035
score: 1

extjs4
tags question: http://stackoverflow.com/q/28483419
tag name: extjs4
tags question: http://stackoverflow.com/q/28540257
tags question: http://stackoverflow.com/q/28527128
tags question: http://stackoverflow.com/q/28524757
type: Tag
tags question: http://stackoverflow.com/q/28578703
tags question: http://stackoverflow.com/q/28580190
tags question: http://stackoverflow.com/q/28474402

http://stackoverflow.com/comment/45440493
type: Comment
comment on: http://stackoverflow.com/a/28564855
has text: Thank you, most all printers are IP based and on the local network. This seems like a complicated path. I'll see what I can do. Thank you for your input.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/96547576
has text: @infodev to my knowledge there is no default option in v2 to allow rounded rectangles
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28584276
type: Comment

http://stackoverflow.com/q/28555012
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28555233
tagged with: codeigniter
type: Question
score: 5
upvote count: 5
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28555171
accepted answer: http://stackoverflow.com/a/28555233
has comment: http://stackoverflow.com/comment/45423079
has answer: http://stackoverflow.com/a/28555171
has title: Javascript Duplicate a div in html and get the values from duplicated div's in form submit
downvote count: 0
has comment: http://stackoverflow.com/comment/49146326
favorite count: 0
has answer: http://stackoverflow.com/a/28555357
has answer: http://stackoverflow.com/a/28558237
has body: In my codeigniter view, I've a div containing a select box and a textbox. Also there is an 'Add more' button. My task is to duplicate this whole div when the add more button is clicked and when I submit the form I need to get the field values from the original div and duplicated div's. How Can I accomplish this? I tried duplicating div using jquery clone method. But couldn't find the solution. Here is the code what I tried so far: <?php echo form_open("vehicle/addparts");?> select disabled>Select Parts A B C Quantity <?php echo form_close();?> Javascript:

http://stackoverflow.com/a/28614852
score: 0
answers question: http://stackoverflow.com/q/28589938
has body: So I found a workaround. If I set async to false in my ajax request, then the success function is hit and everything works as it should.
type: Answer

http://stackoverflow.com/a/28539739
has body: Use this code instead $("ol").append("&lt;li&gt;"+$("#test").val()+"&lt;/li&gt;);
score: 0
answers question: http://stackoverflow.com/q/28539594
type: Answer

rpc
tag name: rpc
tags question: http://stackoverflow.com/q/28527128
type: Tag

http://stackoverflow.com/a/28492481
type: Answer
answers question: http://stackoverflow.com/q/28491329
score: 0
has body: You can use the following three functions to keep track of route change HTML &lt;body ng-app="myApp" ng-controller="AppCtrl"&gt;......&lt;/body&gt; JS .controller('AppCtrl', function ($scope, $rootScope, $log, $location) { $scope.$on('$routeChangeStart', function (event, toState, toParams, fromState, fromParams) { }); $scope.$on('$routeChangeSuccess', function (event, toState, toParams, fromState, fromParams) { }); $scope.$on('$routeChangeError', function (event, toState, toParams, fromState, fromParams) { }); });

http://stackoverflow.com/comment/45351821
type: AnswerComment
has text: I would add that, yes, the OP's code would have been vulnerable to injection, but there is such a thing as $eval and $evalAsync in Angular (neither of which are needed here of course), These are for evaluating "angular expressions": https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$eval
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28517314

http://stackoverflow.com/comment/45425105
score: 0
has text: The question is totally misleading. Clear the text in "liar". And review your code before posting here and wasting people's time
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28556388

http://stackoverflow.com/comment/45323400
type: Comment
score: 1
has text: That is dangerous. These event can cause infinite loops if one decides to edit the DOM tree in that event handler.
comment on: http://stackoverflow.com/a/28502100
type: AnswerComment

http://stackoverflow.com/q/28453909
upvote count: 1
has comment: http://stackoverflow.com/comment/45234787
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45234904
tagged with: regex
type: AnsweredQuestion
downvote count: 0
tagged with: rhino
score: 1
tagged with: java
accepted answer: http://stackoverflow.com/a/28454048
has title: How does JavaScript identify unquoted plain expression as RegExp Object?
type: Question
tagged with: javascript
tagged with: mozilla
has answer: http://stackoverflow.com/a/28454048
has body: Considering the JavaScript RegExp and its declaration process you may declare a regular expression in JavaScript on the fly var exp_blood = /^[A|a|B|b|AB|ab|O|o]{1,2}[+-]{1}$/; or initialize it with its constructor RegExp var exp_blood = new RegExp("/^[A|a|B|b|AB|ab|O|o]{1,2}[+-]{1}$/"); Considering this scenario I would like to build an object on the fly without initializing any constructor explicitly or with a finite/unique expression. I would like to declare an object without using its Constructor named HL7V2. I could create an object with its Constructor. For example: var hl7 = new HL7V2("MSH|^~\&amp;|SENDERAPP|SENDERFAC|COVCDR|COVCDR|20130212221503||ORU^R01|1676326503009050|P|2.6"); But my goal is to instantiate it on the fly like RegExp in JavaScript var hl7 = MSH|^~\&amp;|SENDERAPP|SENDERFAC|COVCDR|COVCDR|20130212221503||ORU^R01|1676326503009050|P|2.6; Is it possible or any suggestion?

http://stackoverflow.com/q/28454023
tagged with: javascript
has comment: http://stackoverflow.com/comment/45235262
score: 0
has body: I'm trying to do some long polling and I'm having a hard time figuring out how I can read data from the server as it gets sent. I have the following on the client: var xhr = $.ajax('/getData'); setInterval(function(){ console.log(xhr.responseText); }, 1000); // reads response each 1s The server app.get('/getData', function(req, res){ setInterval(function(){ res.write('hi-' + Math.random()); // write random stuff each 1s }, 1000); }); But xhr.responseText only gets populated when the request finishes. Is this even possible to do? I have to make a new request for /getData every time I need something? I can't take advantages of the same request?
answer count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45235741
has answer: http://stackoverflow.com/a/28454112
tagged with: node.js
has answer: http://stackoverflow.com/a/28454120
type: Question
has title: Ajax reading response from server as it gets sent

http://stackoverflow.com/a/59280299
downvote count: 0
score: 8
upvote count: 8
has body: This works perfectly fine with me. It takes label and format the value. options: { tooltips: { callbacks: { label: function(tooltipItem, data) { let label = data.labels[tooltipItem.index]; let value = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index]; return ' ' + label + ': ' + value + ' %'; } } } }
type: Answer
answers question: http://stackoverflow.com/q/28568773

http://stackoverflow.com/a/28456207
upvote count: 2
has body: No one seems to have suggested this yet... If you want Force to always be forceBase + modifyForce then make it a function. function Force(){ return forceBase + modifyForce } Which now makes this work (note Force is now called with (): { forceBase++; document.getElementById("Force").innerHTML = Force(); }
answers question: http://stackoverflow.com/q/28456044
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45238964
score: 2

http://stackoverflow.com/comment/45312006
has text: sorry, that's a copy and paste from libreoffice, the data is held in csv.
score: 0
comment on: http://stackoverflow.com/q/28495689
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28543739
upvote count: 0
has comment: http://stackoverflow.com/comment/45401008
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45401684
answer count: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45402891
has comment: http://stackoverflow.com/comment/45401592
downvote count: 1
has comment: http://stackoverflow.com/comment/45403018
has body: I have an iframe and I need to use that iframe to create a new object from a script running in the main frame. The problem is, when I instantiate an object in this way, it gives back undefined, so I do not have a way to get the reference and manipulate the object. The example shows what is going on: //main.html //second.html I know that this is caused, because the execution environment differs for the main frame and the iframe, but is there any way to get a reference for the object created on the iframe? I tried to put the variable to the iframe's global scope, hoping that it works, but it is still undefined: //main.html //second.html
tagged with: iframe
has title: How to get a reference to an object created on an iframe from the main frame
has comment: http://stackoverflow.com/comment/45401717
type: Question
has comment: http://stackoverflow.com/comment/45401085
has answer: http://stackoverflow.com/a/28544068

http://stackoverflow.com/a/29565282
has body: This could be done easily using the stroke-dasharray and stroke-dashoffset properties of an SVG path. They can be changed with the skrollr.js library like any other css property like margin etc. This is explained well in the following example : http://jakearchibald.com/2013/animated-line-drawing-svg/ Hope this helps. :)
score: 1
upvote count: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28522906

http://stackoverflow.com/a/28603660
accepted answer of: http://stackoverflow.com/q/28586611
answers question: http://stackoverflow.com/q/28586611
score: 0
type: AcceptedAnswer
has body: I was trying to replace the whole row of ng grid in a single line as row.entity = $scope.tempArray which didnt work Then I tried replacing cell be cell.It worked I created an array for temporary storage. $scope.tempArray = { data1:"", data2:"" } in edit function I copied the row data to tempArray as $scope.tempArray.data1 = row.entity.col1; $scope.tempArray.data2 = row.entity.col2; in cancel function the row data is set back to original as row.entity.col1 = $scope.tempArray.data1; row.entity.col2 = $scope.tempArray.data2;
type: Answer

http://stackoverflow.com/comment/45231892
type: Comment
comment on: http://stackoverflow.com/a/28451489
score: 0
type: AnswerComment
has text: No its not working in my site. When I select any option nothing happens.

http://stackoverflow.com/q/28485351
answer count: 4
type: AnsweredQuestion
upvote count: 19
possible better answer: http://stackoverflow.com/a/28485435
has answer: http://stackoverflow.com/a/45525432
has comment: http://stackoverflow.com/comment/45293619
score: 19
type: Question
has comment: http://stackoverflow.com/comment/45292773
has body: I have a span inside of a div and the div must remain 200px wide and the text must fit on one line within the div. The text within the span is dynamically generated so I can't possibly know which content will break to a new line and which will not. This sentence is too large to fit within the div. If I use the CSS property white-space:nowrap; the words will spill to the outside of the div, which of course, we don't want. How would I reduce the font-size (or zoom) based on if the line breaks or not? I would prefer a CSS answer, but I understand if that is outside of CSS's abilities.
has comment: http://stackoverflow.com/comment/45292582
has comment: http://stackoverflow.com/comment/45293633
tagged with: javascript
has answer: http://stackoverflow.com/a/28485435
accepted answer: http://stackoverflow.com/a/28485608
downvote count: 0
linked to: http://stackoverflow.com/q/14431411
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45292691
has answer: http://stackoverflow.com/a/28485608
linked to: http://stackoverflow.com/q/687998
has answer: http://stackoverflow.com/a/28485639
tagged with: http://stackoverflow.com/tag/html
has title: How to: Reduce font-size if a line breaks
tagged with: css

http://stackoverflow.com/comment/45232225
has text: where is your js code. In a external file 'myfile.js'? The JavaScript code has to be in the .cshtml file in order to the Html helpers to work
comment on: http://stackoverflow.com/q/28452504
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/45290672
comment on: http://stackoverflow.com/q/28484332
score: 0
type: Comment
type: QuestionComment
has text: Why not use: javascripts toLowerCase() method http://www.w3schools.com/jsref/jsref_tolowercase.asp

http://stackoverflow.com/comment/45464006
has text: @Antrikshy: I posted there as an answer, added there example. It's better and clearer solution than using `important`, forget on it.
comment on: http://stackoverflow.com/q/28577547
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28622974
has comment: http://stackoverflow.com/comment/45600672
has comment: http://stackoverflow.com/comment/45584317
has comment: http://stackoverflow.com/comment/45615533
score: 0
answers question: http://stackoverflow.com/q/28592460
has comment: http://stackoverflow.com/comment/45561295
has comment: http://stackoverflow.com/comment/45577900
type: Answer
has body: Try the Gadgets extension. It's the one Wikipedia uses; well-maintained and fairly easy to use. Or, is this is a local wiki, only accessible to you, and you don't care about security at all, you can just enable arbitrary HTML in wikitext via $wgRawHtml.

http://stackoverflow.com/a/28570680
answers question: http://stackoverflow.com/q/28567692
score: 1
upvote count: 1
has body: A lot of questions, let's see if I can answer those. If your existing application is properly internationalized, I don't think there is any need to modify the database. Just make sure it is able to handle international characters (NCHAR, NVARCHAR, NTEXT in MS SQL, valid character encodings in others). As for DB design, it is good to keep things locale-independent as long as you can. For instance it is better to store keys in the database and resolve them at runtime. However, if your data is dynamic (i.e. you have product names and their descriptions that changes often), the only way to go is to have translation table and look the data up using valid locale. It's quite complex in relational world (i.e. joins), but it could be done. 2,3. All the numeric columns should be kept locale-independent and formatted on the UI side. The more problematic would be prices and sales orders - you would need an additional column to store the currency code (i.e. 12.34 | USD). On the UI side you would need to pass the code to the Angular currency filter. The only gotcha here is, Angular does not support easy locale context switching, so you would need to use a hacky library like Angular Dynamic Locale to load the formats for you. Similar. Keep it locale-independent. DB built-in types should automatically handle that for you and give you nice DateTime/DateTimeOffset (in a .Net world) back. The only gotcha would be the time zone - it may make sense to use DATETIMEOFFSET MS SQL type, as others does not store time zone. There is an alternative way to store date and times in the database - you may decide to store it as a number of milliseconds since January 1, 1970 UTC - as BIGINT type. Especially if you are going to read this directly to JS, you will be able to easily re-create JS Date object (should you need this for calculations or something) in a valid time zone (it works the other way round as well). All you have to do to format date is to use this number (not date, that is AFAIR) and…
downvote count: 0
type: Answer

http://stackoverflow.com/comment/45320526
type: QuestionComment
comment on: http://stackoverflow.com/q/28490150
score: 0
has text: You may need to try jQuery uploader instead of using XHR directly.
type: Comment

string
tags question: http://stackoverflow.com/q/28533785
tags question: http://stackoverflow.com/q/28592995
tags question: http://stackoverflow.com/q/28449780
tags question: http://stackoverflow.com/q/28487596
tags question: http://stackoverflow.com/q/28522750
tags question: http://stackoverflow.com/q/28444386
tags question: http://stackoverflow.com/q/28559276
tag name: string
type: Tag
tags question: http://stackoverflow.com/q/28549707
tags question: http://stackoverflow.com/q/28521737
tags question: http://stackoverflow.com/q/28517594
tags question: http://stackoverflow.com/q/28455688
tags question: http://stackoverflow.com/q/28519633
tags question: http://stackoverflow.com/q/28550738
tags question: http://stackoverflow.com/q/28502601
tags question: http://stackoverflow.com/q/28504052
tags question: http://stackoverflow.com/q/28547436

http://stackoverflow.com/comment/45296528
type: Comment
comment on: http://stackoverflow.com/a/28461077
has text: I just ran the following line of code: `var sheet = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/MySpreadsheet_ID/edit#gid=1676698598');` and it worked.
score: 1
type: AnswerComment

http://stackoverflow.com/comment/45348164
comment on: http://stackoverflow.com/a/28514854
score: 0
type: AnswerComment
type: Comment
has text: looks like all the input field have not a name property with the same value as the id. you shoul have something like: since jquery is using the id and get and post use the name

http://stackoverflow.com/a/28464655
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28464602
type: Answer
has body: function showName(file) { $("#dir").val(file); }
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28464602

http://stackoverflow.com/q/28488546
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/28488675
accepted answer: http://stackoverflow.com/a/28488606
answer count: 3
upvote count: 1
possible better answer: http://stackoverflow.com/a/28488614
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28488614
has answer: http://stackoverflow.com/a/28488606
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45298805
score: 1
has title: Remove class and add class
has body: I'm working on a JavaScript and CSS3 responsive HTML menu for mobile devices. The JS is quite simple. It gets the element ID of the body and if the menu is closed it changes class to menuOpen, and vice versa. The CSS handles all the transitions and displays of the actual menu. &lt;script type="text/javascript"&gt; function menuButton() { if( document.getElementById("htmlbody").className == "menuClosed" ) { document.getElementById("htmlbody").className = "menuOpen"; } else { document.getElementById("htmlbody").className = "menuClosed"; } } &lt;/script&gt; The problem I ran into is this. Instead of removing the entire class and replacing the entire class, how can I remove a single class and then add a single class? Since an element will contain multiple classes I need to change the condition to see IF it contains the className, as opposed to being the actual className. I believe I can simply add the new class by doing the JS below but I don't know how to remove the old class. document.getElementById("htmlbody").className += "menuOpen"; Hope I've provided enough details. EDIT Thanks for help. I've managed to get this to work great. Does just what I need to. &lt;script type="text/javascript"&gt; function menuButton() { var htmlBody = document.getElementById("htmlbody"); if( htmlBody.classList.contains("menuClosed") ) { htmlBody.className = htmlBody.className.replace(/(?:^|\s)menuClosed(?=\s|$)/g, " menuOpen"); } else { htmlBody.className = htmlBody.className.replace(/(?:^|\s)menuOpen(?=\s|$)/g, " menuClosed"); } } &lt;/script&gt;

http://stackoverflow.com/a/28586918
has comment: http://stackoverflow.com/comment/45490697
has body: You have another problem, which is that you're trying to compare one field to another: days_of_validity isn't actually a valid variable. You'll need to do an aggregation. Something like this: db.post.aggregate([ {"$project":{ "creation_date":1, "earliest":{"$subtract": [ISODate(), {"$multiply":["$days_of_validity", 1000*3600*24]}]}}}, {"$project": {"delta": {"$subtract":["$creation_date", "$earliest"]}}}, {"$match":{"delta": {"$lt": 0}}}])
answers question: http://stackoverflow.com/q/28585918
type: Answer
score: 0

http://stackoverflow.com/a/28508598
upvote count: 2
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28506654
type: Answer
has body: You can take a look at JAXB. It is part of Java SE. You only need to map your XML schema to few POJO classes and describe them with JAXB annotations. Possible code to map an XML to an object, and vice versa, will take ~5 lines. You can read about it here: http://docs.oracle.com/javase/tutorial/jaxb/intro/

http://stackoverflow.com/a/28573566
answers question: http://stackoverflow.com/q/28573319
upvote count: 1
type: Answer
downvote count: 0
score: 1
has body: In order to trigger #doReload's click callback, try putting your script after the markup: &lt;form action="" method="POST" enctype="multipart/form-data"&gt; &lt;input type="file" name="image" /&gt; &lt;input id="doReload" type="submit"/&gt; &lt;/form&gt; &lt;script&gt; var btn = document.getElementById("doReload"); btn.onclick = function(){ setTimeout(function(){ $("#div1").load("News.php"); }, 5000); } &lt;/script&gt; or wrapping it in $( document ).ready(function() { ... }); But since (afaik) there isn't a callback on html form submission success, you may want to do the post using jQuery's $.post and then use its success callback to retrieve the new data.

http://stackoverflow.com/q/28492170
has body: When the body element has style 'overflow: hidden', it automatically removes the scrollbar because it's no longer needed (because of the overflow hidden). This removes the 15 pixels of spacing to the right (which is only there because of the scrollbar). This also causes the browser to shift by 15 pixels. Is there a way to avoid this? I know I can just add a 15 pixels spacing to the right, but some browsers have a scroll bar that just hovers over the browser and I don't want a 15 pixels spacing to be there in that case.
tagged with: browser
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45305158
favorite count: 0
has title: 15px scrollbar space on right when Body has "overflow: hidden"
linked to: http://stackoverflow.com/q/12582555
has comment: http://stackoverflow.com/comment/45305279
tagged with: css
tagged with: cross-browser
score: 2
answer count: 0
upvote count: 2
type: UnansweredQuestion
type: Question

http://stackoverflow.com/a/28564431
upvote count: 2
answers question: http://stackoverflow.com/q/28563940
accepted answer of: http://stackoverflow.com/q/28563940
type: AcceptedAnswer
downvote count: 0
has body: If you check the documentation Calendars: get for example: you will notice it states Requires authorization Now normally if you set something to public you will be able to retrieve it using a public API key. I took one of my test calendars set it to public then tried to retrieve it using a public API key. (both key and calendar name have been changed) https://www.googleapis.com/calendar/v3/calendars/tfaf72h2ubfsftl3h4l5qd87s@group.calendar.google.com?key=AIzaSyBBH88dIQPjcl5nIG-n1mmuQ12J7HThDBL results are { "error": { "errors": [ { "domain": "global", "reason": "required", "message": "Login Required", "locationType": "header", "location": "Authorization" } ], "code": 401, "message": "Login Required" } } Conclusion: You must be authenticated to retrieve data. Either using OAuth2 or a service account. Normally I would suggest you use a service account and grant it access to the Calendar in question. I would not use a service account with JavaScript due to security issues, so I cant help you with that. Answer to your question you must be authenticated to see a calendar. there is no way around that.
type: Answer
score: 2

http://stackoverflow.com/comment/45445614
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28566680
score: 0
has text: Yes I'm sure the client knows, but it's an NDA, it's my job, I'm not going to risk anything. Note I've updated the question above and added some details to focus it on the issue.

http://stackoverflow.com/comment/45295369
has text: This will probably lag all the same - you still rebuild the full DOM.
comment on: http://stackoverflow.com/a/28481063
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28577779
has comment: http://stackoverflow.com/comment/45464949
tagged with: replace
type: Question
upvote count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45464345
has title: Javascript for replacing text on Wikia site
answer count: 0
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45474785
tagged with: text
score: 1
has body: I want to use some JS Scripts to replace some bad words automatically on my Wikia site. Here my code: $(function () { var str = document.getElementById("WikiaPage").innerHTML; var res = str.replace(/badword1/gi, "beep").replace(/badword2/gi, "beep"); document.getElementById("WikiaPage").innerHTML = res; }); Then it works. But this code causes crash on Wikia Comments Section, Recent Wiki Section in WIkia Rail and some issues may I don't know yet. How can i do now? Any help is appreciated. Thank everyone.
has comment: http://stackoverflow.com/comment/45465457
tagged with: wikia

http://stackoverflow.com/q/28500258
type: Question
has comment: http://stackoverflow.com/comment/45319992
has comment: http://stackoverflow.com/comment/45320244
has title: AngularJS ng-if filter on a div
answer count: 1
has comment: http://stackoverflow.com/comment/45320065
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28502376
has comment: http://stackoverflow.com/comment/45363274
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45320233
has comment: http://stackoverflow.com/comment/45320154
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45320408
score: 0
has comment: http://stackoverflow.com/comment/45320197
accepted answer: http://stackoverflow.com/a/28502376
type: AnsweredQuestion
has body: Can I make a NG-IF function in angular if the NG-IF is in a certain div ID? I've got my application with tabs in the page, I'm loading the tabs with a NG-Repeat. And giving the certain div's different ID's, I can't put a variable in the NG-Model from the Div ID so I can't load out filtered data. I have 8 Different groups, and in every group should be ONLY the filtered content. If this is the array: { "name": "Lucy", "gender": "Female", "hobby": "games", }, { "name": "John", "gender": "Male", "hobby": "pets", }, { "name": "Chris", "gender": "Male", "hobby": "music", }, { "name": "Annie", "gender": "Female", "hobby": "sports", }, And I want 4 different tabs with "hobbies" "Games" "Pets" "Music" and "sports" In the Games tab only Lucy should show up In the Pets tab should only John show up Etc HTML Info: Hobbies: {{item.Hobby}} Alle leerlingen Hobby {{item.Name}} {{item.Hobby}} There could be some typo's, but thats not the problem, i've recreated it fastly with different content.
has comment: http://stackoverflow.com/comment/45320548

http://stackoverflow.com/comment/45414690
score: 1
type: Comment
has text: `document.getElementsByClassName("image_div_name").firstElementChild.src`
type: QuestionComment
comment on: http://stackoverflow.com/q/28550718

http://stackoverflow.com/comment/45259622
score: 0
type: Comment
has text: Sorry to bother Timmerz. What if a user wants to change accordion header (formationName) from accordion directly, rather than hard coded (party). By the way accordion header in editable. could you give me a hint to handle it?
comment on: http://stackoverflow.com/a/28466938
type: AnswerComment

http://stackoverflow.com/q/28487894
has answer: http://stackoverflow.com/a/28488995
has comment: http://stackoverflow.com/comment/45298244
has comment: http://stackoverflow.com/comment/45298160
has comment: http://stackoverflow.com/comment/45297938
type: Question
upvote count: 2
tagged with: typeof
has comment: http://stackoverflow.com/comment/45298034
has title: Dependent Object Type Check Javascript Seems Redundant
has body: Is there a better way of doing this? If I do this: if(typeof someObject[bar][foo] == "function"){ // Do something } I get a someObject[bar][foo] is not an object error which it's referring to someObject[bar] if bar does not exist. This means that the code assumes you know that someObj[bar] is defined. So my solution was was this: if(typeof someObj[bar] === "object"){ if(typeof someObject[bar][foo] == "function"){ // Do something } } If we want to make an effort to reduce code lines and to make good, clean, readable code then looks redundant and ugly. Is there a better way of doing this without having to go through two if points? I realize that it's not that big of a deal, but I'm wondering if there is a better way.
tagged with: javascript
has comment: http://stackoverflow.com/comment/45298359
accepted answer: http://stackoverflow.com/a/28488978
answer count: 3
has answer: http://stackoverflow.com/a/28488968
favorite count: 0
has answer: http://stackoverflow.com/a/28488978
downvote count: 0
tagged with: object
score: 2
type: AnsweredQuestion
tagged with: if-statement
possible better answer: http://stackoverflow.com/a/28488968
has comment: http://stackoverflow.com/comment/45298560

regex
tags question: http://stackoverflow.com/q/28554151
tags question: http://stackoverflow.com/q/28485298
tags question: http://stackoverflow.com/q/28496618
tags question: http://stackoverflow.com/q/28592271
tags question: http://stackoverflow.com/q/28530388
tags question: http://stackoverflow.com/q/28544596
tags question: http://stackoverflow.com/q/28546871
tags question: http://stackoverflow.com/q/28524277
tags question: http://stackoverflow.com/q/28549019
tags question: http://stackoverflow.com/q/28573521
tags question: http://stackoverflow.com/q/28588037
tags question: http://stackoverflow.com/q/28581791
tags question: http://stackoverflow.com/q/28481580
tags question: http://stackoverflow.com/q/28477348
tag name: regex
tags question: http://stackoverflow.com/q/28550049
tags question: http://stackoverflow.com/q/28460817
tags question: http://stackoverflow.com/q/28517760
tags question: http://stackoverflow.com/q/28540721
tags question: http://stackoverflow.com/q/28580752
tags question: http://stackoverflow.com/q/28573022
tags question: http://stackoverflow.com/q/28580173
tags question: http://stackoverflow.com/q/28527602
tags question: http://stackoverflow.com/q/28540498
tags question: http://stackoverflow.com/q/28495920
tags question: http://stackoverflow.com/q/28524460
tags question: http://stackoverflow.com/q/28518813
tags question: http://stackoverflow.com/q/28547831
tags question: http://stackoverflow.com/q/28482489
tags question: http://stackoverflow.com/q/28482170
tags question: http://stackoverflow.com/q/28504685
tags question: http://stackoverflow.com/q/28573335
tags question: http://stackoverflow.com/q/28566619
tags question: http://stackoverflow.com/q/28499433
tags question: http://stackoverflow.com/q/28550772
tags question: http://stackoverflow.com/q/28455688
tags question: http://stackoverflow.com/q/28563997
tags question: http://stackoverflow.com/q/28555162
tags question: http://stackoverflow.com/q/28535375
tags question: http://stackoverflow.com/q/28585951
tags question: http://stackoverflow.com/q/28575952
tags question: http://stackoverflow.com/q/28529020
tags question: http://stackoverflow.com/q/28562142
tags question: http://stackoverflow.com/q/28497476
tags question: http://stackoverflow.com/q/28501764
tags question: http://stackoverflow.com/q/28465901
tags question: http://stackoverflow.com/q/28462953
tags question: http://stackoverflow.com/q/28517869
tags question: http://stackoverflow.com/q/28456833
tags question: http://stackoverflow.com/q/28566492
tags question: http://stackoverflow.com/q/28439287
tags question: http://stackoverflow.com/q/28523051
tags question: http://stackoverflow.com/q/28453909
tags question: http://stackoverflow.com/q/28573684
tags question: http://stackoverflow.com/q/28535377
tags question: http://stackoverflow.com/q/28539768
tags question: http://stackoverflow.com/q/28482087
tags question: http://stackoverflow.com/q/28591169
tags question: http://stackoverflow.com/q/28443588
tags question: http://stackoverflow.com/q/28472264
tags question: http://stackoverflow.com/q/28537471
tags question: http://stackoverflow.com/q/28511501
tags question: http://stackoverflow.com/q/28492452
tags question: http://stackoverflow.com/q/28554352
tags question: http://stackoverflow.com/q/28460078
tags question: http://stackoverflow.com/q/28581782
tags question: http://stackoverflow.com/q/28444386
tags question: http://stackoverflow.com/q/28581922
tags question: http://stackoverflow.com/q/28555379
tags question: http://stackoverflow.com/q/28586201
tags question: http://stackoverflow.com/q/28455767
tags question: http://stackoverflow.com/q/28469240
tags question: http://stackoverflow.com/q/28546652
tags question: http://stackoverflow.com/q/28575510
tags question: http://stackoverflow.com/q/28499419
tags question: http://stackoverflow.com/q/28583642
tags question: http://stackoverflow.com/q/28440721
tags question: http://stackoverflow.com/q/28509552
tags question: http://stackoverflow.com/q/28500118
tags question: http://stackoverflow.com/q/28507414

http://stackoverflow.com/comment/45488137
type: Comment
has text: OK... I have a couple hours left. I'll be waiting.
score: 1
comment on: http://stackoverflow.com/q/28590002
type: QuestionComment

http://stackoverflow.com/comment/45386511
comment on: http://stackoverflow.com/q/28536112
type: QuestionComment
score: 1
has text: To automatically restart after crashes, you can use a process manager like [forever](https://www.npmjs.com/package/forever) – but don’t just ignore the errors. Fix them!
type: Comment

http://stackoverflow.com/a/28695864
downvote count: 0
type: Answer
upvote count: 1
has body: I had this same issue with 0.12 and io.js 1.3.0, reverting to Node.js 0.10 fixed the issue.
answers question: http://stackoverflow.com/q/28486891
score: 1

http://stackoverflow.com/q/28464452
upvote count: 1
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45255649
type: UnansweredQuestion
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/45255626
has title: syntaxis on matching urls from an array saved on extension storage
score: 1
tagged with: google-chrome
type: Question
linked to: http://stackoverflow.com/q/12433271
has answer: http://stackoverflow.com/a/28464927
tagged with: javascript
has body: I have been going through the Google chrome APIs in order to work on an extension and the processes regarding it. I stumbled upon the chrome.webRequest https://developer.chrome.com/extensions/webRequest#event-onBeforeRequest I have been tinkering with the syntax but I am lost with it because I'm relatively new to programming and using the chrome APIs What I was thinking was using chrome.webRequest.onBeforeRequest.addListener(function callback) and then making it use chrome.tabs.remove to remove the tab is it matches the array but I am not sure how to do that I have this for the removing of the tab using the google chrome match filters var urlArray= ["*://facebook.com/*", "*://example.com/*", "*://google.com/*" ]; chrome.tabs.onCreated.addListener(function (tab) { for (var i = 0, len = urlArray.length; i &lt; len; i++) { if (tab.url.indexOf(urlArray[i]) &gt; -1) { chrome.tabs.remove(tab.id); alert("things"); break; } } });

http://stackoverflow.com/comment/45395500
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28540895
has text: check the value of `submit` button in `isOK()` function.and also in the `PHP` program.

http://stackoverflow.com/a/49822492
score: 15
upvote count: 15
has comment: http://stackoverflow.com/comment/110356613
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28454203
has body: For me, the bug was in DataTables itself; The code for sorting in DataTables 1.10.9 will not check for bounds; thus if you use something like order: 1, 'asc' with an empty table, there is no row idx 1 -> this exception ensures. This happened as the data for the table was being fetched asynchronously. Initially, on page loading the dataTable gets initialized without data. It should be updated later as soon as the result data is fetched. My solution: // add within function _fnStringToCss( s ) in datatables.js // directly after this line // srcCol = nestedSort[i][0]; if(srcCol &gt;= aoColumns.length) { continue; } // this line follows: // aDataSort = aoColumns[ srcCol ].aDataSort;

http://stackoverflow.com/comment/45211098
has text: capture the value you want to assign to drop-down do `x.value="capturedvalue"` instead of `x.value = ""`
type: Comment
comment on: http://stackoverflow.com/a/28440276
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45247782
has text: You don't need to use prototype here and you can combine all three functions into one.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28460760

http://stackoverflow.com/q/28575807
has body: There is jQuery event handler for windows resize. $(window).resize(function () { // code here }); Is it possible to resize current window of browser using jQuery or JavaScript? What I am doing now is, open window in new screen like following: window.open('http://google.com?screenWidth=400,left=10,top=10,resizable=no'); I want to resize in current browser rather than new windows. Is it possible? Thanks in advance.....
tagged with: javascript
duplicate of: http://stackoverflow.com/q/7452040
type: Question
has title: How to resize browser's window?
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45463216
linked to: http://stackoverflow.com/q/7452040
answer count: 0
type: UnansweredQuestion
upvote count: 1
score: 1

http://stackoverflow.com/q/28556461
upvote count: 1
type: Question
tagged with: internet-explorer
has title: Layout issue using jQuery floatThead plugin(1.2.10) in IE10
has body: I'm using jQuery floatThead plugin(version 1.2.10) to float header while scrolling the contents of a table but experiencing layout issues in IE10(works fine in chrome). Here's my code... HTML: Student Name Course Name Is Completed Grade John Science Yes A Maths Yes B Literature Yes A Peter Science Yes C Maths Yes B Literature Yes A Helen Science Yes C Maths Yes B Literature Yes A Rob Science Yes C Maths Yes B Literature Yes A Dave Science Yes C Maths Yes B Literature Yes A Tyson Science Yes C Maths Yes B Literature Yes A Danny Science Yes C Maths Yes B Literature Yes A Aahna Science Yes C Maths Yes B Literature Yes A Javascript: var $demo1 = $('#tblDemo'); $demo1.floatThead({ scrollContainer: function () { return $demo1.closest('div'); } }); CSS: .scrollable-wrapper { height: 200px; overflow: auto; } table{ width:100%; } The resulting layout when viewed in IE10 has the row with student name "John" shifted to header row and hence invisible. This works fine in chrome. The issue seems to be due to row having only one TD with colspan set to 4 for printing student name. How can I fix it in IE10? Here's the JSFiddle for above code.
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28668804
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
favorite count: 0
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28668804
score: 1

http://stackoverflow.com/comment/45234424
type: QuestionComment
has text: Are you sure your d3 library is being loaded by your browser?
comment on: http://stackoverflow.com/q/28447944
score: 0
type: Comment

http://stackoverflow.com/comment/116398165
score: 1
has text: gregdev to the rescue! Same here.
comment on: http://stackoverflow.com/a/61024952
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45206509
type: Comment
type: QuestionComment
has text: @Shahar And then make a javascript that reads it?
comment on: http://stackoverflow.com/q/28438078
score: 0

http://stackoverflow.com/a/28498208
score: 0
type: Answer
has body: Working fiddle solution HTML: more more more more JS: var button = document.getElementById('button'); button.addEventListener('click', function(){ alert('only 1 button clicked'); window.location = 'about-us.html'; }); var buttons = document.querySelectorAll('.btn'); for(var i = 0; i < buttons.length; i++){ buttons[i].addEventListener('click', function(){ alert('each button clicked'); window.location = 'about-us.html'; }); }
answers question: http://stackoverflow.com/q/28497796

http://stackoverflow.com/q/28506225
type: AnsweredQuestion
tagged with: package.json
tagged with: npm
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45331859
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/50924934
type: Question
accepted answer: http://stackoverflow.com/a/28510959
has comment: http://stackoverflow.com/comment/45337102
tagged with: javascript
score: 0
answer count: 1
has body: I'm trying to create my first yeoman generator and I'm getting the following error when I run yo to create my project. npm ERR! install Couldn't read dependencies npm ERR! Darwin 14.0.0 npm ERR! argv "node" "/usr/local/bin/npm" "install" npm ERR! node v0.10.35 npm ERR! npm v2.1.14 npm ERR! file /Users/derek/Development/personal_projects/stylus-generator/work/package.json npm ERR! code EJSONPARSE npm ERR! Failed to parse json npm ERR! Unexpected token } npm ERR! File: /Users/derek/Development/personal_projects/stylus-generator/work/package.json npm ERR! Failed to parse package.json data. npm ERR! package.json must be actual JSON, not just JavaScript. npm ERR! npm ERR! This is not a bug in npm. npm ERR! Tell the package author to fix their package.json file. JSON.parse npm ERR! Please include the following file with any support request: npm ERR! /Users/derek/Development/personal_projects/stylus-generator/work/npm-debug.log I've validated the package.json file using jsonlint. I've also performed npm cache clean. The package.json file can be found here: https://github.com/dereksnow/generator-simple-stylus/blob/master/package.json Any suggestions?
favorite count: 0
has answer: http://stackoverflow.com/a/28510959
linked to: http://stackoverflow.com/q/5644410
has comment: http://stackoverflow.com/comment/50915357
has title: Receive parse error for package.json. Validates as valid json
tagged with: node.js

http://stackoverflow.com/comment/45359380
comment on: http://stackoverflow.com/q/28520838
has text: I expect *Math.ceil* to be faster as I've always found the conditional operator (`? :`) to be slower than the equivalent if..else loop, however it can be much more readable for simple expressions.
score: 0
type: Comment
type: QuestionComment

java
tags question: http://stackoverflow.com/q/28471458
tags question: http://stackoverflow.com/q/28584812
tags question: http://stackoverflow.com/q/28578119
tags question: http://stackoverflow.com/q/28475139
tags question: http://stackoverflow.com/q/28450290
tags question: http://stackoverflow.com/q/28553309
tags question: http://stackoverflow.com/q/28562120
tags question: http://stackoverflow.com/q/28477070
tags question: http://stackoverflow.com/q/28447618
tags question: http://stackoverflow.com/q/28438178
tags question: http://stackoverflow.com/q/28579909
tags question: http://stackoverflow.com/q/28566492
tags question: http://stackoverflow.com/q/28518813
tags question: http://stackoverflow.com/q/28451286
tags question: http://stackoverflow.com/q/28453909
tags question: http://stackoverflow.com/q/28499818
tags question: http://stackoverflow.com/q/28481230
tags question: http://stackoverflow.com/q/28459642
tags question: http://stackoverflow.com/q/28495929
tags question: http://stackoverflow.com/q/28460761
tags question: http://stackoverflow.com/q/28457114
tags question: http://stackoverflow.com/q/28584823
tags question: http://stackoverflow.com/q/28574453
tags question: http://stackoverflow.com/q/28506654
tags question: http://stackoverflow.com/q/28583907
tags question: http://stackoverflow.com/q/28459725
tags question: http://stackoverflow.com/q/28456457
tags question: http://stackoverflow.com/q/28583875
tags question: http://stackoverflow.com/q/28576874
tags question: http://stackoverflow.com/q/28514123
tags question: http://stackoverflow.com/q/28486573
tags question: http://stackoverflow.com/q/28579518
tags question: http://stackoverflow.com/q/28438078
tags question: http://stackoverflow.com/q/28553205
tags question: http://stackoverflow.com/q/28448499
tags question: http://stackoverflow.com/q/28515362
tags question: http://stackoverflow.com/q/28523492
tags question: http://stackoverflow.com/q/28538406
tags question: http://stackoverflow.com/q/28521616
tags question: http://stackoverflow.com/q/28511453
tag name: java
tags question: http://stackoverflow.com/q/28513439
tags question: http://stackoverflow.com/q/28484846
tags question: http://stackoverflow.com/q/28470828
tags question: http://stackoverflow.com/q/28444209
tags question: http://stackoverflow.com/q/28559851
tags question: http://stackoverflow.com/q/28457571
tags question: http://stackoverflow.com/q/28443966
tags question: http://stackoverflow.com/q/28527710
tags question: http://stackoverflow.com/q/28462774
tags question: http://stackoverflow.com/q/28440070
tags question: http://stackoverflow.com/q/28508423
tags question: http://stackoverflow.com/q/28482535
tags question: http://stackoverflow.com/q/28559648
tags question: http://stackoverflow.com/q/28510047
tags question: http://stackoverflow.com/q/28559491
tags question: http://stackoverflow.com/q/28454823
type: Tag
tags question: http://stackoverflow.com/q/28485293
tags question: http://stackoverflow.com/q/28578137
tags question: http://stackoverflow.com/q/28473567
tags question: http://stackoverflow.com/q/28505518
tags question: http://stackoverflow.com/q/28536233
tags question: http://stackoverflow.com/q/28584160

http://stackoverflow.com/q/28495309
score: 1
has answer: http://stackoverflow.com/a/28496216
type: Question
tagged with: javascript
tagged with: jquery
has title: jQuery add class when clicked and remove when clicked on another
has answer: http://stackoverflow.com/a/28495375
upvote count: 1
has answer: http://stackoverflow.com/a/28495404
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
favorite count: 0
accepted answer: http://stackoverflow.com/a/28495369
downvote count: 0
has comment: http://stackoverflow.com/comment/45310879
possible better answer: http://stackoverflow.com/a/28495375
has answer: http://stackoverflow.com/a/28495369
type: AnsweredQuestion
has body: I have the markup like this Lessons Edit Profile Your Library Lessons text here 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 profile text here 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 here, content here', making it look like readable English. library text here Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, and the JS like this $('div#profile').show(); $('body').on('click','a.personal-menu-item', function(e) { e.preventDefault(); var selectedItem = $(this).attr('data-menu-item'); if(selectedItem == 'lessons') { $('div#lessons').show(); $('div#profile').hide(); $('div#library').hide(); } if(selectedItem == 'profile') { $('div#lessons').hide(); $('div#profile').show(); $('div#library').hide(); } if(selectedItem == 'library') { $('div#lessons').hide(); $('div#profile').hide(); $('div#library').show(); } }); so here I want that when I click on the lessons then only lessons content will be shown , like this when I click on profile and library then only profile and library will be shown. Here its working fine but I wanted to know how to add a class active when one item is clicked within that anchor tag. Lets say I click on lessons then one active class should be added to the lessons anchor tag and when I click on profile then the active class should be remove from lessons anchor tag and it should add class active in profile anchor tag. Here is my fiddle so far

http://stackoverflow.com/q/28558649
has comment: http://stackoverflow.com/comment/45429075
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28558902
possible better answer: http://stackoverflow.com/a/28558805
has answer: http://stackoverflow.com/a/28558805
has answer: http://stackoverflow.com/a/28558898
downvote count: 0
has body: I know very little about jQuery, but I would like to perform something like this in html: to have a nested structure Some content Some content Some content and to give some instructions about special so that the content inside does not appear immediately, but only after clicking on the title, and that dissapears again if the title is clicked again. It would be nice to have an effect like the one in accordion, but the point is to have the same result not clicking another box, but the same box. I suppose it must be done somewhere, but I just do not know the suitable key word. Any idea or reference to a done example will be very helpful and welcome.
favorite count: 0
has answer: http://stackoverflow.com/a/28558815
answer count: 5
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45429220
tagged with: css
has answer: http://stackoverflow.com/a/28558965
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28558902
score: 1
has title: Appearing and dissapearing div content by clicking on title
upvote count: 1
type: Question
tagged with: jquery-ui

http://stackoverflow.com/comment/45217845
comment on: http://stackoverflow.com/q/28443827
score: 0
type: QuestionComment
has text: @johnnyutah no error. when I click the checkbox on/off, I just get nothing.
type: Comment

http://stackoverflow.com/comment/45359228
comment on: http://stackoverflow.com/a/28521252
type: Comment
has text: I have the latest one. I downloaded 1.3.13 earlier today.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45404089
comment on: http://stackoverflow.com/q/28545365
score: 0
has text: Actually, that sounds like coordinates 0,0!!
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28562137
tagged with: javascript
has title: WebGL and Chrome: high resolution makes for bad performance
has comment: http://stackoverflow.com/comment/46062559
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45468581
has comment: http://stackoverflow.com/comment/45468632
type: UnansweredQuestion
has body: I have an application created with LibGDX. I can run the application on the desktop and it runs at 90 fps @1080p. On Firefox it runs at 40-50 fps @1080p (maximized window). On Chrome it runs at 30 fps @1080p (maximized window). However on Chrome, if I lower the resolution, the performance doubles (to 60fps). On Firefox this does not happen. What can be the cause of this? I am using webkitRequestAnimationFrame. As shown, I know my PC can handle the resolution fine. Edit I'm trying to apply the tips below, although they seem aimed at mobile GPUs mostly. Source: https://wiki.mozilla.org/Platform/GFX/MobileGPUs#Memory_Bandwidth Always call glClear immediately after glBindFramebuffer See the Adreno 200 document, section 3.2.1: "it is imperative to (a) use clears when switching Frame Buffer Objects (FBOs) to avoid having the driver tries to save/restore GMEM contents, and (b) always clear the depth-buffer at the start of a frame." That makes sense, so we should always do it. Concretely, this means that we should do a glClear after every glBindFramebuffer call, ideally right after it, or at least before any draw-call. Framebuffer bindings are expensive Changing the framebuffer binding forces immediately resolving the rendering of the current framebuffer. Therefore it is important to sort rendering to minimize framebuffer bindings. The Adreno 200 document, Section 3.2.4, has a useful explanation. Edit The above did not make a notable difference. Edit I have a feeling this problem arises due to the GLSL compiler. I don't have a lot of knowledge on the subject, but I believe GLSL for OpenGL ES is compiled to regular GLSL, with some browser specific code. It could be that Chrome compiles less than optimal and causes fragment shading to slow the program down at higher resolutions. If someone has some tips on how to make sure that this compilation is optimalized, I could try that out and see if it fixes the problem. Edit The problem doesn't seem prevalent in Chrome on Windows wi…
has comment: http://stackoverflow.com/comment/47094876
has comment: http://stackoverflow.com/comment/45460992
has comment: http://stackoverflow.com/comment/45458908
has answer: http://stackoverflow.com/a/29922474
tagged with: webgl
has comment: http://stackoverflow.com/comment/46053396
tagged with: google-chrome
downvote count: 1
type: Question
upvote count: 27
has comment: http://stackoverflow.com/comment/45451874
tagged with: libgdx
score: 26

http://stackoverflow.com/comment/138858881
type: AnswerComment
has text: As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
type: Comment
comment on: http://stackoverflow.com/a/78758130
score: 0

http://stackoverflow.com/comment/45440220
comment on: http://stackoverflow.com/q/28564921
has text: Sure it will work. You can then use those variables to display the date as you wish. Have a look here to see all methods you can use with a Date object (edited to change reference from W3Schools to MDN): see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28546945
favorite count: 0
has answer: http://stackoverflow.com/a/28550113
tagged with: angularjs
linked to: http://stackoverflow.com/q/14201899
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28547894
has comment: http://stackoverflow.com/comment/45407070
score: 1
tagged with: angularjs-scope
type: Question
tagged with: angularjs-routing
tagged with: angularjs-service
tagged with: javascript
linked to: http://stackoverflow.com/q/24410141
accepted answer: http://stackoverflow.com/a/28547894
has title: Trying to persist data across controllers using Angular rootScope, but always getting undefined
has comment: http://stackoverflow.com/comment/45408010
linked to: http://stackoverflow.com/q/25152366
answer count: 3
has comment: http://stackoverflow.com/comment/45406964
has body: I have an administrator login page. When a user successfully logs in as an admin, I want to display at the top of all pages the user visits: &lt;!-- nav bar --&gt; &lt;div&gt; &lt;span ng-show="$root.isAdmin"&gt;(ADMIN)&lt;/span&gt; &lt;/div&gt; I tried using $rootScope to accomplish this, but I keep getting undefined: // controller for logging in app.controller('AdminLoginCtrl', [ '$rootScope', '$scope', 'stateParams', 'loginService', function($rootScope, $scope, $stateParams, loginService) { loginService.success(function() { $rootScope.isAdmin = true; console.log($rootScope.isAdmin); // returns true $location.path("/login_success"); }); }]); // some other controller AFTER user is logged in as admin app.controller('BlahCtrl', ['$rootScope', '$scope', function($rootScope, $scope) { console.log($rootScope.isAdmin); // returns 'undefined' }); There have been some other similar topics, but don't apply to me: (I don't have an injection problem): $rootscope value undefined in Controller (My other controller is definitely being called AFTER login, so $rootScope.isAdmin should be set): AngularJS - Cannot access RootScope (I don't have an ordering problem): Angular $rootScope.$on Undefined The other solution could be to not use $rootScope at all, and just use a service to hold shared data. But if I have 10+ controllers, is it acceptable to do this in each: app.controller('...', ['$scope', 'checkAdminService', function($scope, checkAdminService) { $scope.isAdmin = checkAdminService.getIsAdmin() }]); Then: &lt;span ng-show="isAdmin"&gt;(ADMIN)&lt;/span&gt; Is this acceptable or more cumbersome? And for completeness sake, why doesn't $rootScope solution work at all?
has answer: http://stackoverflow.com/a/41027401
downvote count: 0
possible better answer: http://stackoverflow.com/a/28550113

http://stackoverflow.com/comment/45426358
score: 0
has text: Got it working. I needed to do this: "gulp-ng-annotate": "^0.5.2" and not "gulp-ng-annotate": "~0.5.2".
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28527288

http://stackoverflow.com/a/28514174
score: 0
type: Answer
has body: First of all, the order of injections you make is not right. It must be fixed, as shown below: app.controller('loginController', ['$scope', '$http' , function($scope, $http) { ... }]); ('ctrlName', ['A', 'B', function(A, B) ...
answers question: http://stackoverflow.com/q/28514115

http://stackoverflow.com/comment/45286452
comment on: http://stackoverflow.com/a/28467169
type: AnswerComment
has text: The snippet with the Id pony was a left over of a previous attempt at using the ID to change the image. It wasn't working and I had removed the ID but forgot to remove the reference to the ID in script. It wasn't working due to some CSS errors and incorrect linking of an image.
score: 0
type: Comment

http://stackoverflow.com/comment/45435333
has text: @serjoscha oops, you're right. it's obviously too early in the morning for me.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28562303

http://stackoverflow.com/q/28500432
score: 0
has title: using for loop for number of similar methods
tagged with: methods
has answer: http://stackoverflow.com/a/28504426
tagged with: for-loop
has answer: http://stackoverflow.com/a/28500569
tagged with: javascript
type: UnansweredQuestion
has body: I have the following code and i want to use these methods inside for loop. Is it possible? if yes, then how? tree(student0,0); tree(student1,1); tree(student2,2);
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45321663

http://stackoverflow.com/q/28494814
has answer: http://stackoverflow.com/a/28495142
tagged with: css
type: AnsweredQuestion
has title: How to implement notification number on buttons in jquery mobile?
has body: I am making a jquery mobile app. I want to add a notification number to a button defined like this. Resources Basically I want it so that, if the number is > 0, then it should look like this: And if its = 0, then the number icon should not show at all. How can I implement this? Thanks
possible better answer: http://stackoverflow.com/a/28494993
type: Question
upvote count: 4
has answer: http://stackoverflow.com/a/28494993
accepted answer: http://stackoverflow.com/a/28495142
tagged with: jquery-mobile
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 4
answer count: 3
has answer: http://stackoverflow.com/a/28495031
tagged with: http://stackoverflow.com/tag/html
favorite count: 0

http://stackoverflow.com/a/28478374
type: Answer
has comment: http://stackoverflow.com/comment/116578413
downvote count: 0
has comment: http://stackoverflow.com/comment/45279440
has comment: http://stackoverflow.com/comment/45279830
answers question: http://stackoverflow.com/q/28477304
score: 3
has comment: http://stackoverflow.com/comment/45280316
has comment: http://stackoverflow.com/comment/45279698
has comment: http://stackoverflow.com/comment/116571511
has body: Follow through the comments in code - step by step showing one way of solving your problem. // Function shell. Accepts a parameter userDate, returns a value function formatDate(userDate) { // Step 1: attempt to convert parameter to a date! var returnDate = new Date(userDate); // Step 2: now that this is a date, we can grab the day, month and year // portions with ease! var y = returnDate.getFullYear(); var m = returnDate.getMonth() + 1; // Step 6 var d = returnDate.getDate(); // Step 3: The bit we did above returned integer values. Because we are // *formatting*, we should really use strings y = y.toString(); m = m.toString(); d = d.toString(); // Step 4: The value of our month and day variables can be either 1 or 2 // digits long. We need to force them to always be 2 digits. // There are lots of ways to achieve this. Here's just one option: if (m.length == 1) { m = '0' + m; } if (d.length == 1) { d = '0' + d; } // Step 5: combine our new string values back together! returnDate = y + m + d; // Step 6: did you notice a problem with the output value? // The month is wrong! This is because getMonth() returns a value // between 0 and 11 i.e. it is offset by 1 each time! // Look back up at Step 2 and see the extra piece of code // Step 7: Looks pretty good, huh? Well, it might pass you your quiz // question, but it's still not perfect. // Do you know why? // Well, it assumes that the parameter value is // a) always an actual date (e.g. not "dave") // b) our Step1 correctly converts the value (e.g. the client, where // the JS is run, uses the date format m/d/y). // I am in the UK, which doesn't like m/d/y, so my results will // be different to yours! // I'm not going to solve this here, but is more food for thought for you. // Consider it extra credit! return returnDate; } // Display result on page --> document.getElementById("result").innerText += formatDate("1/1/2015"); Result:
has comment: http://stackoverflow.com/comment/45279297
upvote count: 3
has comment: http://stackoverflow.com/comment/45280265

http://stackoverflow.com/comment/45276306
has text: Is there any way you can control tooltip direction?
comment on: http://stackoverflow.com/q/28476159
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45231251
type: QuestionComment
comment on: http://stackoverflow.com/q/28450459
score: 0
has text: @ArtjomB. Improved my question with the fact that bytes above 0x7f will output to two different bytes.
type: Comment

http://stackoverflow.com/a/28517981
answers question: http://stackoverflow.com/q/28517869
has body: ^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z\d]{6,}$ For consecutive number check public boolean isValid(final String userName,final String password) { for(int i=0;(i+2)&lt;userName.length();i++) if(password.indexof(userName.substring(i,i+2))!=-1) return false; return true; }
score: 0
has comment: http://stackoverflow.com/comment/45353351
type: Answer

http://stackoverflow.com/comment/45245069
type: Comment
comment on: http://stackoverflow.com/q/28455222
has text: indeed, you should warn us that there is ~10minutes of load in your question. The result is awesome! Unfortunately, no idea for Chrome frenzy
score: 0
type: QuestionComment

http://stackoverflow.com/a/28457888
upvote count: 2
type: Answer
score: 2
has body: No, triggering a form submit does not block or return anything useful. It merely tells the browser to create a request which will render a new page. However, with an iframe the onload event can be used to handle the response from the form submit after it has loaded. iframedoc = iframe.contentDocument; iframe.onload = function(e) { alert('frame loaded'); // read its url, content, etc... }; iframedoc.getElementsByTagName('form')[0].submit(); // immediately returns undefined and your code proceeds Since JavaScript runs in a single thread, you won't see the 'frame loaded' alert until all of your subsequent code has completed, the browser submits the form, and the onload event triggers.
answers question: http://stackoverflow.com/q/28457690
downvote count: 0

http://stackoverflow.com/a/28461036
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28460951
has body: What you have to do is see if there is a parameter being passed to the url and then hide based on that. So here is a javascript function to get the parameter and the check for it: &lt;script&gt; $(document).ready(function() { var eventid = getParamterByName('event_id'); if ( eventid != "" ) { $('.details').hide(); } else { $('.details').show(); } }); function getParameterByName(name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new RegExp("[\\?&amp;]" + name + "=([^&amp;#]*)"), results = regex.exec(location.search); return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); } &lt;/script&gt;
upvote count: 1
type: Answer

http://stackoverflow.com/a/28551638
has comment: http://stackoverflow.com/comment/45467958
type: Answer
has comment: http://stackoverflow.com/comment/45429460
score: 1
has comment: http://stackoverflow.com/comment/45440705
answers question: http://stackoverflow.com/q/28551350
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28551350
has comment: http://stackoverflow.com/comment/45440767
has body: It seems that your current solution gives you some false results. If you type in the letter a, your loop will show 5 results, but 0 options will display. indexOf() is counting javascript, java, visual basic, chapel, and charm. So instead of using indexOf(), change it to use charAt(0). With charAt() we'll compare the first letter of the search input to the first letter of the possible options. if (options[i].value.charAt(0) === this.value.charAt(0)) This gives you an accurate &amp; reliable count to the number of options that will show. Here is your updated fiddle. I tested in Chrome &amp; IE. You get the same results. Update - bug found Search Results Options a 0 h 1 html j 2 javascript, java javascript 2 javascript So we can see the last result is incorrect. So we'll want to use your original solution &amp; mine. This will prevent the final scenario in the above table. if (options[i].value.charAt(0) === this.value.charAt(0) &amp;&amp; options[i].value.indexOf(this.value) !== -1) Updated solution
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45440366

http://stackoverflow.com/comment/45439755
score: 0
comment on: http://stackoverflow.com/q/28564561
type: Comment
has text: Compiler is expecting `LocaleConverter.convertLocale("fr-FR")` to be C# code, not javascript
type: QuestionComment

http://stackoverflow.com/comment/45235842
type: Comment
comment on: http://stackoverflow.com/q/28454304
type: QuestionComment
has text: What is your jQuery version?
score: 0

python
tags question: http://stackoverflow.com/q/28438630
tags question: http://stackoverflow.com/q/28472212
tags question: http://stackoverflow.com/q/28499274
tags question: http://stackoverflow.com/q/28562189
tag name: python
tags question: http://stackoverflow.com/q/28580973
tags question: http://stackoverflow.com/q/28487044
tags question: http://stackoverflow.com/q/28438448
tags question: http://stackoverflow.com/q/28519677
tags question: http://stackoverflow.com/q/28503589
tags question: http://stackoverflow.com/q/28461001
tags question: http://stackoverflow.com/q/28592558
tags question: http://stackoverflow.com/q/28570586
type: Tag
tags question: http://stackoverflow.com/q/28521858
tags question: http://stackoverflow.com/q/28566714

http://stackoverflow.com/a/28478663
score: 2
has body: You can clone the element, and remove the children. Then get the text of the cloned element. $('.title').on('click', '.button', function() { var title = $(this).parent().clone().children().remove().end().text(); alert(title); }); Title Text Button
answers question: http://stackoverflow.com/q/28478588
type: Answer
upvote count: 3
downvote count: 1

http://stackoverflow.com/q/28460543
downvote count: 8
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/45262634
has answer: http://stackoverflow.com/a/28460599
type: Question
score: -6
has comment: http://stackoverflow.com/comment/45257487
has comment: http://stackoverflow.com/comment/45247029
possible better answer: http://stackoverflow.com/a/28460625
has body: i need to create an event listener. but i dont want to use any framework Jquery: $(".element").on('click', function(){}); How to make it without jquery???
has answer: http://stackoverflow.com/a/28460625
answer count: 2
accepted answer: http://stackoverflow.com/a/28460599
linked to: http://stackoverflow.com/q/2695793
tagged with: javascript
favorite count: 0
has title: i need to create an event listener. but i dont want to use any framework

http://stackoverflow.com/a/28476944
accepted answer of: http://stackoverflow.com/q/28476711
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28476711
type: Answer
has body: One way I can think of is to bind a function on input value change and set a flag var flag = false; $('#uploaderForm input[type="file"]').bind('change', function(event){ if(event &amp;&amp; event.target &amp;&amp; event.target.files[0]){ flag = true; } });
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45277001

http://stackoverflow.com/comment/45440467
type: Comment
has text: No, the documentation is correct. The point is you must pass in a function object that Chai will call. In your example, you are calling the function, and passing the result to `expect()`.
comment on: http://stackoverflow.com/a/28564989
score: 0
type: AnswerComment

http://stackoverflow.com/a/28564855
has body: Provided that it's intranet page, can you just identify user's own printer from LDAP, etc.? Do you have print server(s) in the network? If so, send it directly from PHP to the print server. It may be tricky however to print .doc or .docx from PHP script without external calls to MS Office or LibreOffice. If the above is not possible, try to use Java of Flash applet to print from the browser. It may be useful to convert the documents to PDF before.
has comment: http://stackoverflow.com/comment/45440493
downvote count: 0
answers question: http://stackoverflow.com/q/28564611
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/q/28485543
has comment: http://stackoverflow.com/comment/45294191
has title: How to find reactJS errors?
type: Question
tagged with: debugging
has comment: http://stackoverflow.com/comment/45293963
upvote count: 5
tagged with: javascript
tagged with: reactjs
score: 5
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has body: I have been learning ReactJS a couple of days now but Im often ending up on a Server Error in '/' Application page that dont really point out where to lock for the problem. For example, this is a error I get right now : Server Error in '/' Application. In file "~/Scripts/Grid.jsx": Parse Error: Line 106: Adjacent XJS elements must be wrapped in an enclosing tag (at line 106 column 58) Line: 52 Column:3 Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: React.Exceptions.JsxException: In file "~/Scripts/Grid.jsx": Parse Error: Line 106: Adjacent XJS elements must be wrapped in an enclosing tag (at line 106 column 58) Line: 52 Column:3 Source Error: Line 8: { Line 9: Index Line 10: @Html.React("GridBox", new Line 11: { Line 12: tableClass = "GridTest", Source File: c:\Development\Bradspel_v2\Bradspel_v2\Views\Home\Index.cshtml Line: 10 The code looks like this : var data1 = {"Columns":[{"Title":"Title1","HTMLClass":"g1_Title"},{"Title":"Title2","HTMLClass":"g2_Title"},{"Title":"Title3","HTMLClass":"g3_Title"}],"Rows":[{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]},{"Cells":["Cell0","Cell1","Cell2"]}]}; var GridRow = React.createClass({ render: function() { var data = [], columns; i…
has answer: http://stackoverflow.com/a/28486053

http://stackoverflow.com/q/28556559
has answer: http://stackoverflow.com/a/28556622
has title: Show element on mouseover hide on mouseleave
type: AnsweredQuestion
has body: I am having trouble with this feature. I want #login to appear after I mouseover #pink and to remain visible when I am hovering over #login but disappear when I hover over #green, #yellow, #purple or outside my #buttons container. My problem is that when I hover over #green, #yellow, and #purple; #login still remains visible which don't want. jsfiddle
possible better answer: http://stackoverflow.com/a/28556612
has answer: http://stackoverflow.com/a/28556654
has answer: http://stackoverflow.com/a/28556612
has answer: http://stackoverflow.com/a/28556638
type: Question
upvote count: 0
score: -2
accepted answer: http://stackoverflow.com/a/28556622
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45425324
tagged with: http://stackoverflow.com/tag/html
answer count: 7
has answer: http://stackoverflow.com/a/28556660
favorite count: 0
has answer: http://stackoverflow.com/a/28556646
downvote count: 2
has answer: http://stackoverflow.com/a/28556640
tagged with: css

http://stackoverflow.com/comment/45353971
score: 0
type: AnswerComment
has text: Wow that's so simple. Thanks so much! Seems like either answer here's going to work. I'll try both!
type: Comment
comment on: http://stackoverflow.com/a/28511560

http://stackoverflow.com/q/28472959
favorite count: 0
has answer: http://stackoverflow.com/a/28473001
tagged with: promise
tagged with: angularjs
has body: So I have a few functions that all make async calls to a service. I wan't them all to execute after the previous one is complete but only if the previous one didn't fail. It looks something like this: var fn1 = function() { var promise = aService.fn1(); var successCallback = function(response) { return true; }; var errorCallback = function() { return false; }; return promise.then(successCallback, errorCallback); }; var fn2 = function() { var promise = aService.fn2(); var successCallback = function(response) { return true; }; var errorCallback = function() { return false; }; return promise.then(successCallback, errorCallback); }; var fn3 = function() { var promise = aService.fn3(); var successCallback = function(response) { return true; }; var errorCallback = function() { return false; }; return promise.then(successCallback, errorCallback); }; fn1().then(function(resp){ if (resp) { fn2().then(function(resp){ if (resp) { fn3().then(function(resp){ if (resp) { // all functions have been called in order were successful } }); } }); } }); The execution at the end looks pretty bad the more function are added to this chain. I wan't to know if there is another way I can structure this in way so it behaves the same but doesn't create a huge tree of chained async calls. If I can keep it on the same indentation that would be great. Thank you!
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28473071
answer count: 2
accepted answer: http://stackoverflow.com/a/28473071
downvote count: 0
has title: Promise chaining (angular javascript)
tagged with: chaining
tagged with: asynchronous
possible better answer: http://stackoverflow.com/a/28473001

http://stackoverflow.com/comment/45208143
comment on: http://stackoverflow.com/q/28439177
has text: just remove eval and change it to if(document.getElementById('supplies'))
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45256948
type: QuestionComment
score: 0
has text: Where you do `states[Connection.UNKNOWN] = 'Unknown connection';`. Shouldn't be `states[Connection.UNKNOWN] = "Unknown connection";`? And then, you should compare `String` with `.equals()`, not `==`.
comment on: http://stackoverflow.com/q/28465524
type: Comment

http://stackoverflow.com/comment/45644872
score: 0
type: AnswerComment
has text: Create a resize() function that contains the code I gave you that triggers after your search filter is done. You can then call the resize() on the initial table load and after each filter. By the way, have you checked out datatables.net? It would be a lot easier then having to do all that on your own.
type: Comment
comment on: http://stackoverflow.com/a/28585691

http://stackoverflow.com/comment/108632770
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/44007054
has text: doesn't works when in time hour and minute is 00:00 i.e 1. 2020-04-25 00:00:01 2. 2020-04-25 00:00:21 will always give false so it doesn't work for one minute can't rely on that

http://stackoverflow.com/q/28508369
has body: I've been experimenting with Node.JS and C++ addons and found that populating an Int32Array is considerably slower when using the C++ addon rather than directly doing so in Node.JS / JavaScript. Node.JS: 133 ~ ms C++: 1103 ~ ms Does anyone know why this is? My test code consists of a fairly large array and for loops containing if statements. I suspect I'm populating the array incorrectly in my C++ addon. (?) JavaScript: var testArray = new Int32Array(36594368); var i = 0; for (var xi = 0; xi &lt; 332; xi++) { for (var yi = 0; yi &lt; 332; yi++) { for (var zi = 0; zi &lt; 332; zi++) { if ((xi + yi + zi) % 62 == 0) testArray[i] = 2; else if (yi &lt; 16) testArray[i] = 2; else if (yi == 16) testArray[i] = 1; else testArray[i] = 0; i++; } } } C++ Addon: Local&lt;Int32Array&gt; testArray = Int32Array::New(ArrayBuffer::New(isolate, 4 * 36594368), 0, 36594368); int i = 0; for (int xi = 0; xi &lt; 332; xi++) { for (int yi = 0; yi &lt; 332; yi++) { for (int zi = 0; zi &lt; 332; zi++) { if ((xi + yi + zi) % 62 == 0) testArray-&gt;Set(i, Integer::New(isolate, 2)); else if (yi &lt; 16) testArray-&gt;Set(i, Integer::New(isolate, 2)); else if (yi == 16) testArray-&gt;Set(i, Integer::New(isolate, 1)); else testArray-&gt;Set(i, Integer::New(isolate, 0)); i++; } } } EDIT: Just to add, the functions I'm using in my C++ code are V8 functions and weren't defined by myself. Is there another way to set values in an Int32Array without using these?
has comment: http://stackoverflow.com/comment/45335744
favorite count: 0
tagged with: node.js
tagged with: c++
score: 14
type: AnsweredQuestion
tagged with: performance
upvote count: 14
type: Question
has title: Node.JS performance vs native C++ addon when populating an Int32Array
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/31259094
accepted answer: http://stackoverflow.com/a/31259094
has comment: http://stackoverflow.com/comment/45338648

http://stackoverflow.com/comment/45474745
score: 0
has text: @dfsq Actually I did, it did not work on chrome console. Am I missing something?
type: Comment
comment on: http://stackoverflow.com/a/28583634
type: AnswerComment

http://stackoverflow.com/comment/45300395
type: QuestionComment
has text: Oops, that was a mistake, sorry.
score: 0
comment on: http://stackoverflow.com/q/28489140
type: Comment

http://stackoverflow.com/q/28516101
possible better answer: http://stackoverflow.com/a/32029740
has answer: http://stackoverflow.com/a/28516214
accepted answer: http://stackoverflow.com/a/28516214
downvote count: 0
tagged with: javascript
tagged with: variables
favorite count: 0
upvote count: 8
has answer: http://stackoverflow.com/a/28516219
tagged with: templates
score: 8
has answer: http://stackoverflow.com/a/32029740
has body: The concept comes from this http://www.prepbootstrap.com/bootstrap-template/real-estate-list-map-dynamic I enable 2 blocks in a django template, left blockshows device info (device name and location info),right block shows device map location.When user can click on left panels, the right map will change by passing Django template variable to Javascript routine. It seems the passed variable is not accepted by init_map. when user click on left column, the right map will switch according to latlon, which is passed by onclick routine. template page is as follows: {% block content %} {% for device in devices %} {{device.name}} {{device.coordinates }} {{ device.coordinates }} {{ device.coordinates }} {% with lat_lon=device.coordinates %} new is {{ lat_lon }} {% endwith %} {% endfor %} {% endblock content %} {% block extra_js %} {% endblock %} if I enabled "center: new AMap.LngLat(116.342659, 39.946275)," the map will show up, while with "center: new AMap.LngLat(lat,lon)," , no map show up.
tagged with: django
type: Question
linked to: http://stackoverflow.com/q/298772
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45350708
has title: django: how to pass template variable to javascript onclick routine?
has comment: http://stackoverflow.com/comment/45349612
has answer: http://stackoverflow.com/a/56825270
answer count: 6
has answer: http://stackoverflow.com/a/65476212
has answer: http://stackoverflow.com/a/28517483
has comment: http://stackoverflow.com/comment/45349500

http://stackoverflow.com/comment/64673474
has text: Could you add zoom, mapTypeId, or other options as well?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28500306
type: Comment

http://stackoverflow.com/comment/45225712
type: Comment
comment on: http://stackoverflow.com/q/28448620
score: 0
has text: Very good, thanks for point
type: QuestionComment

http://stackoverflow.com/comment/45384998
comment on: http://stackoverflow.com/q/28535226
score: 0
type: QuestionComment
type: Comment
has text: @ArunprasanthKV could you show me how I could make that work in my code?

http://stackoverflow.com/q/28550738
tagged with: match
has comment: http://stackoverflow.com/comment/45415046
has comment: http://stackoverflow.com/comment/45415138
type: Question
tagged with: if-statement
tagged with: javascript
has comment: http://stackoverflow.com/comment/45415194
has comment: http://stackoverflow.com/comment/45415120
has answer: http://stackoverflow.com/a/28551089
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45415128
tagged with: nested
tagged with: string
has body: I am trying to input strings queries and from them use string.match to pick out necessary information to perform metric conversions. After a good deal of experimenting, I keep getting this as output: "There are 0 inches in null centimeters" I am wondering if there is something wrong with the logic in my if statements. Here is an example of one: var metric = string.match(/centimeters|liters|grams/); var english = string.match(/inches|quarts|pounds/); var ind = string.indexOf(metric); var ind2 = string.indexOf(english); if (string.match(/centimeters/) &amp;&amp; string.match(/inches/)){ if (ind &lt; ind2) { var string = document.getElementById("box1").value; var num = string.match(/\d+$/); parseInt(num); var conNum = num * 2.54; document.getElementById("unit").innerHTML = "There are " + conNum + " centimeters in " + num + " inches."; } if (ind2 &lt; ind) { var string = document.getElementById("box1").value; var num = string.match(/\d+$/); parseInt(num); var conNum = num/2.54; document.getElementById("unit").innerHTML = "There are " + conNum + " inches in " + num + " centimeters."; }
has answer: http://stackoverflow.com/a/28551036
type: UnansweredQuestion
has title: javascript trouble with nested if

ios
tags question: http://stackoverflow.com/q/28541893
tags question: http://stackoverflow.com/q/28541693
tags question: http://stackoverflow.com/q/28510047
type: Tag
tags question: http://stackoverflow.com/q/28535831
tags question: http://stackoverflow.com/q/28447204
tags question: http://stackoverflow.com/q/28489380
tags question: http://stackoverflow.com/q/28564868
tags question: http://stackoverflow.com/q/28564973
tags question: http://stackoverflow.com/q/28585102
tags question: http://stackoverflow.com/q/28445596
tags question: http://stackoverflow.com/q/28576265
tags question: http://stackoverflow.com/q/28515237
tag name: ios
tags question: http://stackoverflow.com/q/28557949
tags question: http://stackoverflow.com/q/28593303
tags question: http://stackoverflow.com/q/28472935
tags question: http://stackoverflow.com/q/28526184
tags question: http://stackoverflow.com/q/28507763
tags question: http://stackoverflow.com/q/28523169
tags question: http://stackoverflow.com/q/28592170
tags question: http://stackoverflow.com/q/28550811
tags question: http://stackoverflow.com/q/28562336
tags question: http://stackoverflow.com/q/28553205
tags question: http://stackoverflow.com/q/28577399
tags question: http://stackoverflow.com/q/28463001
tags question: http://stackoverflow.com/q/28469852
tags question: http://stackoverflow.com/q/28551822
tags question: http://stackoverflow.com/q/28438309
tags question: http://stackoverflow.com/q/28462266
tags question: http://stackoverflow.com/q/28577286
tags question: http://stackoverflow.com/q/28557754

http://stackoverflow.com/comment/45784529
type: AnswerComment
comment on: http://stackoverflow.com/a/28532791
type: Comment
has text: @Crash54Fox If this answer helped you, please accept it by clicking on the check mark in the top left corner.
score: 0

http://stackoverflow.com/a/28555966
downvote count: 0
has body: Sometimes vendors exclude the optional main property in their bower.json file which, I believe, wiredep uses to compile the array of sourcefiles. Check the bower.json file within the bower_components/socket.io/ folder to see if they've included that. If not, maybe you can do a pull request to socket.io or at least raise an issue?
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28555668
type: Answer

http://stackoverflow.com/a/28524780
type: Answer
answers question: http://stackoverflow.com/q/28524673
score: 0
has body: function getDistanceFromLatLonInKm(lat1,lon1,lat2,lon2) { var R = 6371; // Radius of the earth in km var dLat = deg2rad(lat2-lat1); // deg2rad below var dLon = deg2rad(lon2-lon1); var a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.sin(dLon/2) * Math.sin(dLon/2) ; var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); var d = R * c; // Distance in km return d; } function deg2rad(deg) { return deg * (Math.PI/180) } call your function getDistanceFromLatLonInKm(lat1,lon1,lat2,lon2) then check which is the lowest. Reffered from Calculate distance between two latitude-longitude points? (Haversine formula)

http://stackoverflow.com/q/28559197
tagged with: handlebarshelper
has comment: http://stackoverflow.com/comment/45484788
answer count: 0
has comment: http://stackoverflow.com/comment/45470141
has title: Handlebars Partials and Grunt: partial cannot be found
type: Question
has comment: http://stackoverflow.com/comment/45490817
tagged with: javascript
tagged with: gruntjs
score: 0
has comment: http://stackoverflow.com/comment/45452084
has body: for my small single page app i'm using handlebars and Grunt.js in order to compile files. I found a grunt modules which scan a specified folder and generate a file with the specific Handlebars.registerPartial but when i compile my files I got Uncaught Error: The partial templates/partials/footer could not be found and I'm afraid i'm messing up with order to call different function but I cannot understand how it works. My index.html My app My app.js [here I include handlebars.js] var ai = {}; (function () { // init part var source = $("#main-template").html(); var template = Handlebars.compile(source); $(document.body).append(template()); })(); And here is the generated file from the module which I don't include in my app.js module.exports = function (Handlebars) { function setup() { Handlebars.registerPartial("templates/partials/footer", require("./templates/partials/footer.hbs")); } return { setup: setup }; }; Gruntfile.js: module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-register-hbs-partials'); grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jshint: { //check error in js files files: ['Gruntfile.js', 'javascript/scripts/*.js'], options: { globals: { jQuery: true } } }, concat: { //concat js files options: { separator: '\n/**********/\n' }, dist: { src: ['javascript/libs/*.js', 'javascript/scripts/*.js'], dest: 'javascript/app.js' } }, uglify: { //minify js files dist: { files: { 'javascript/app.min.js': ['javascript/app.js'] } } }, register_partials: { //register hbs files as hbs partials default_options: { options: { extension: '.hbs' }, files: { 'templates/partials_default.js': [ 'templates/partials/footer.hbs', 'templates/partials/header.hbs'] }, } }, watch: { files: ['javascript/scripts/*.js'], tasks: ['jshint', 'register_partials'] } }); grunt.registerTask('dev'…
type: UnansweredQuestion
tagged with: handlebars.js
has comment: http://stackoverflow.com/comment/45488116

http://stackoverflow.com/a/28538094
has comment: http://stackoverflow.com/comment/45400680
has comment: http://stackoverflow.com/comment/45393267
has comment: http://stackoverflow.com/comment/45401027
accepted answer of: http://stackoverflow.com/q/28537598
type: Answer
answers question: http://stackoverflow.com/q/28537598
has comment: http://stackoverflow.com/comment/45417842
has comment: http://stackoverflow.com/comment/45392698
upvote count: 1
has comment: http://stackoverflow.com/comment/45391818
score: 1
has body: Looks to me like you aren't actually adding any classes on the first click...just adding the click-event that will add classes on subsequent events. function applySubmitFeedback(activatedClass) { $('#submit').click(function() { // &lt;--- this click event isn't bound until you click submit at least once var self = this; $(this).addClass(activatedClass); setTimeout(function() { $(self).removeClass(activatedClass); }, 1000); }); } I think the question is: where are you getting your 'activatedClass' variable prior to the completion of $.post()? When you're ajax finishes, you're script tells the button to do a specific function the next time someone clicks it. You can't know the activated class until you run the ajax. The solution might be to either (1) remove the activatedClass parameter from the click event, or (2) create a default activatedClass value.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45414383
comment on: http://stackoverflow.com/a/28489929
type: AnswerComment
has text: I am marking this one correct. It is the closest to what I implemented. I ended up editing the code I provided above to this and seems to work every time window.onload = function() { *CODE here* };
score: 1
type: Comment

http://stackoverflow.com/comment/45432761
comment on: http://stackoverflow.com/a/28560075
has text: For some reason, it stops at `posting.done(function( data ) {` Any idea why?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28557294
tagged with: api
answer count: 1
has title: How can i parse a user object to return a screen name and move on to my next step?
has body: I'm on code-cademy and i'm in Step 2 of learning twittr api in rubygem (i think its called)... I did Step 1 easy. This is what the second lesson reads... The response from the verify_credentials.json endpoint contains a JSON-encoded representation of the authenticating user for successful requests. Now you will parse the API response and print out the current user's screen name. Add code to decode the HTTP response into a Ruby object. To do this: Instructions (these are their instructions) Add a dependency for the json package (Which json package?) Access the HTTP response body (How do i do this?) Decode the JSON-encoded response Make sure to assign the parsed response to the user variable! ? (I even read the hint they gave me...here it is below) Hint Dependencies can be added by adding require '' to the top of the source file. (What package am i supposed to be adding?) The response variable will have a property named body which contains the text of the HTTP response. You can call JSON.parse to decode a JSON-encoded string. This method returns a decoded object. I tried what I thought was the correct code, but that ended up being incorrect. What do I need to enter in order for my lesson to be successful? Here is the code they gave me below: require 'rubygems' require 'oauth' # Parse a response from the API and return a user object. def parse_user_response(response) user = nil # Check for a successful request if response.code == '200' # Parse the response body, which is in JSON format. # ADD CODE TO PARSE THE RESPONSE BODY HERE user = # Pretty-print the user object to see what data is available. puts "Hello, #{user["screen_name"]}!" else # There was an error issuing the request. puts "Expected a response of 200 but got #{response.code} instead" end user end # All requests will be sent to this server. baseurl = "https://api.twitter.com" # Verify credentials returns the current user in the body of the response. address = URI("#{baseurl}/1.1/account/verify_credentials.js…
accepted answer: http://stackoverflow.com/a/28793416
type: AnsweredQuestion
tagged with: rubygems
score: 0
tagged with: http://stackoverflow.com/tag/json
tagged with: twitter
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28793416

http://stackoverflow.com/comment/52802410
type: QuestionComment
comment on: http://stackoverflow.com/q/28578155
has text: i have this but the header still doesn't disappear
score: 0
type: Comment

http://stackoverflow.com/a/32703745
answers question: http://stackoverflow.com/q/28511207
has comment: http://stackoverflow.com/comment/105937002
type: Answer
has body: Why not: onItemClick: function (event) { event.currentTarget.style.backgroundColor = '#ccc'; }, render: function() { return ( Component 1 ); } And if you want to be more React-ive about it, you might want to set the selected item as state of its containing React component, then reference that state to determine the item's color within render: onItemClick: function (event) { this.setState({ selectedItem: event.currentTarget.dataset.id }); //where 'id' = whatever suffix you give the data-* li attribute }, render: function() { return ( Component 1 Component 2 Component 3 ); }, You'd want to put those s into a loop, and you need to make the li.on and li.off styles set your background-color.
downvote count: 2
score: 104
upvote count: 106

http://stackoverflow.com/comment/45395387
has text: Provide your code with your different submit first. Then, I think you can perform this by using their `Id` and `switch`ing on the `Id` value for example.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28540895

http://stackoverflow.com/q/28503199
has answer: http://stackoverflow.com/a/28503284
has body: I want to add two script to my cshtml page. But my Jquery functions wasnt working. Also tought putting my } I tought @section Scripts was to avoid repeat code along the different pages, but dont understand why my tag doesnt work outside the @section.
tagged with: javascript
upvote count: 1
answer count: 1
favorite count: 0
tagged with: asp.net-mvc-4
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28503284
downvote count: 0
score: 1
has title: MVC Script Section
type: Question

http://stackoverflow.com/a/28959550
has comment: http://stackoverflow.com/comment/46171646
has body: thats probably a Problem while saving? are you using something like the tinyMCE oder CKeditor? Check the configuration of those.
has comment: http://stackoverflow.com/comment/46172426
has comment: http://stackoverflow.com/comment/46171512
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28458288
accepted answer of: http://stackoverflow.com/q/28458288
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/a/28469703
type: Answer
answers question: http://stackoverflow.com/q/28469060
downvote count: 0
has body: In a generic manner; I suppose you're after a weighted random number generator: function weightedRandomNumber(weights) { var sum = 0; for (var w in weights) { w = weights[w]; sum += w.weight; } var rand = Math.random() * sum; for (var w in weights) { w = weights[w]; if (rand &lt; w.weight) { return w.value; } rand -= w.weight; } return weights[weights.length - 1].value; } Test: var config = [ { weight: 25, value: 1 }, { weight: 25, value: 2 }, { weight: 50, value: 3 } ]; var test = { 1: 0, 2: 0, 3: 0 }, max = 10000; for (var i = 1; i &lt; max; i += 1) { test[weightedRandomNumber(config).toString()] += 1; } alert('From ' + max + ' rounds; results: ' + JSON.stringify(test));
score: 1
upvote count: 1

http://stackoverflow.com/comment/45479685
comment on: http://stackoverflow.com/q/28585823
score: 0
type: Comment
type: QuestionComment
has text: So each `$(".songs."+data[j].ArtistNumber)` is a ` ` that you hardcoded beforehand? Each one with a `class="songs 1"`, `class="songs 2"`, `class="songs 3"` etc? So you append one ` ` to every ` `. So if you get 150 results, you must have hardcoded 150 ` ` manually beforehand, each one with their classes, and each one containing one ` `. Does that sound good to you?

http://stackoverflow.com/comment/45298714
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28465522
score: 0
has text: So we are using the request below. Our issue is that most accounts will not properly pull the "user_about_me" field.

http://stackoverflow.com/comment/45236141
comment on: http://stackoverflow.com/a/28450196
type: Comment
score: 0
type: AnswerComment
has text: Thanks, this is good if eventually I need only expect, as is the case here. But would there be a way to export multiple vars, making really a file exposing many modules needed by others? Because if I do a require per file/module, I will gain very little reusability :)

ithit-webdav-server
tags question: http://stackoverflow.com/q/28502871
tag name: ithit-webdav-server
type: Tag

http://stackoverflow.com/a/28475797
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45281470
type: Answer
accepted answer of: http://stackoverflow.com/q/28475696
has body: The problem is this: var text = this.evaluate(myfunc()); Functions in JavaScript are first class citizen. You can pass them into other functions. But that's not what you are doing here. You call the function and pass the result into evaluate, but the result is not a function. Also casper.evaluate() is the page context, and only the page context has access to the document. When you call the function (with ()) essentially before executing casper.evaluate(), you erroneously try to access the document, when it is not possible. The difference to casper.evaluate(function(){...}); is that the anonymous function is defined and passed into the evaluate() function. There are cases where a function should be called instead of passed. For example when currying is done, but this is not applicable to casper.evaluate(), because it is sandboxed and the function that is finally run in casper.evaluate() cannot use variables from outside. It must be self contained. So the following code will also not work: function myFunc2(a){ return function(){ // a is from outer scope so it will be inaccessible in `evaluate` return a; }; } casper.echo(casper.evaluate(myFunc2("asd"))); // null You should use var text = this.evaluate(myfunc); to pass a previously defined function to run in the page context. It's also not a good idea to use reserved keywords like del as variable names.
has comment: http://stackoverflow.com/comment/45282482
answers question: http://stackoverflow.com/q/28475696

http://stackoverflow.com/a/28540519
has body: Try to calculate, If the mouse is reaching the bottom, If mouse position is at bottom then set top value as needed. Below is the code .style("top",function(){ if(current_position[1]+70 &gt; 500){ return current_position[1]-50+"px"; }else{ return current_position[1]+100+"px" } }) Hope you got it, If not ask me for more...
type: Answer
has comment: http://stackoverflow.com/comment/45398238
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/28536367
answers question: http://stackoverflow.com/q/28536367
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28449297
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28449423
has body: I've got a html file, in which I am dynamically loading data using AJAX and PHP. They are no big deal, as they work fine, but I still have got a Problem. I have (for showing purposes) created two divs, which are showing literally the same in DOM, but one is also shown in the source code. (The one div is loaded dynamically, in the other one I've loaded the results already from the start.) Like this: <!-- Here is some data which is shown correct -- > I've already looked after some similar things, but nothing helped me solve my Problem, as my request for the "result" is function kommissionsakte(o, s) { $("#result").empty(); var xmlHttp = {}; xmlHttp = ajaxHandler(xmlHttp); // Wenn das Objekt erfolgreich erzeugt wurde var url = "ajax/getKommissionsakten.php"; suchwert = escape($("#suchwert").val()); var params = "o=" + o + "&s=" + s + "&suchwert=" + suchwert; if (suchwert != '') { $("#suchwert").css("border-color", "#31ae1c"); loading(); xmlHttp.open("POST", url, true); //Headerinformationen für den POST Request xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.setRequestHeader("Content-length", params.length); xmlHttp.setRequestHeader("Connection", "close"); xmlHttp.onreadystatechange = function () { if (xmlHttp.readyState == 4) { $("#result").html(xmlHttp.responseText); closeLoading(); } }; xmlHttp.send(params); } else { $("#suchwert").focus(); $("#suchwert").css("border-color", "#b20e10"); } } My idea was to somehow get #result not as div id but INTO the div, but I am bad, so I have no idea how. EDIT: Okay Long Explanation: I try to load a Filetree using jquery into a page, that is already loaded. The Code creating the tree is working fine, it just doesn't work when I try to load it into this page. I've read that jquery is using DOM and not source code, so it should work properly, but it doesn't. I can search for a keyword in a search function and the file tree is showing them. In the manually created div, is the Code, which creat…
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45226803
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45227324
score: -2
has comment: http://stackoverflow.com/comment/45227249
tagged with: php
has comment: http://stackoverflow.com/comment/45227960
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45227097
has comment: http://stackoverflow.com/comment/45227257
has comment: http://stackoverflow.com/comment/45227175
has comment: http://stackoverflow.com/comment/45226824
downvote count: 2
has answer: http://stackoverflow.com/a/28449423
type: Question
has title: Jquery only working with source code?
has comment: http://stackoverflow.com/comment/45226701
has comment: http://stackoverflow.com/comment/45226796
has comment: http://stackoverflow.com/comment/45226698
has comment: http://stackoverflow.com/comment/45227375
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45228101

http://stackoverflow.com/comment/99568031
score: 2
has text: window.btoa(s) didnt work in my application, replacing this base64 = btoa(str.replace(/[\u00A0-\u2666]/g, function(c) { return '&#' + c.charCodeAt(0) + ';'; }));
type: AnswerComment
comment on: http://stackoverflow.com/a/28450879
type: Comment

http://stackoverflow.com/q/28584315
has comment: http://stackoverflow.com/comment/45477228
has body: I want to send some message from a javascript running program to a C++ program. in sender program (javascript) I used this: xmlHttp = new XMLHttpRequest(); xmlHttp.open( "GET", "http://localhost:55555/?msg=" + message, false ); xmlHttp.send( null ); in receiver program (C++) I used This: printf("\nInitialising Winsock..."); if (WSAStartup(MAKEWORD(2,2),&amp;wsa) != 0) { printf("Failed. Error Code : %d",WSAGetLastError()); return 1; } printf("Initialised.\n"); //Create a socket if((s = socket(AF_INET , SOCK_STREAM , 0 )) == INVALID_SOCKET) { printf("Could not create socket : %d" , WSAGetLastError()); } printf("Socket created.\n"); //Prepare the sockaddr_in structure server.sin_family = AF_INET; server.sin_addr.s_addr = INADDR_ANY; server.sin_port = htons( 55555 ); //Bind if( bind(s ,(struct sockaddr *)&amp;server , sizeof(server)) == SOCKET_ERROR) { printf("Bind failed with error code : %d" , WSAGetLastError()); exit(EXIT_FAILURE); } puts("Bind done"); Now I want to get http argument (message after '?' sign in url) but I don't know how. Help me please...
tagged with: javascript
type: UnansweredQuestion
has title: getting HTTP get argument using C++
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45477080
favorite count: 0
type: Question
tagged with: sockets
has answer: http://stackoverflow.com/a/28590021
tagged with: xmlhttprequest
has comment: http://stackoverflow.com/comment/45512823
tagged with: c++
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45478041

http://stackoverflow.com/comment/45480449
has text: Ah... The outer one is called an Immediately Invoked Function Expression or **IIFE** for short. It keeps the global scope from being polluted and avoids naming collisions. The one inside the for loop is to capture the current value of `i`. JavaScript has only function level scope and so without that, the value of `i` would be subject to change. The function creates a new scope and therefore preserves the **current** value.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28564274
score: 0

http://stackoverflow.com/q/28514091
type: Question
has comment: http://stackoverflow.com/comment/45368805
tagged with: javascript
has body: I have a view DialogView which is actually a popup as follows : var DialogView = Backbone.View.extend({ events : { 'click a._save' : '_save', 'change input._adjust' : '_calculateAdjustedPrice' }, initialize : function(options) { this.realModel = options.model; this.model = (this.realModel).clone(); }, save : function() { this.model = this.realModel; } return DialogView; }); In another view, on click of alink the following code executes to open the popup : var dialogView = new DialogView({ model : dialogModel }); IN this DialogView , there are some events fired based on which the model passed to view is changed. There is a button, save on view, which when clicked should keep the changed model as it is(Nothing to do, since model values are changed on events, on clicking of save i have the changed model). But if the DialogView is closed without clicking on save, then the changes made in model should not persist and it should revert to its original state. I used Backbone's model.clone() method as shown above in DialogView code. But it seems clone() is not creating a copy of original model but simply referring to the same model. Whenever value in this.model change, value in realModel also change. I want that when events are fired then values get changed in the model of DialogView but the original model which was sent to DialogView remain as it is so that if i close the DialogView without saving then the values in model passed to this view remain unchanged. As per BAckbone documentaion, clone creates a new Instance of a model but my research above seems to give different results. Am i understanding something wrong here?
upvote count: 2
tagged with: single-page-application
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45368730
has answer: http://stackoverflow.com/a/28526598
favorite count: 0
tagged with: backbone.js
tagged with: model
has title: Backbone model Clone creating a reference to the original model
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45346844
score: 2
tagged with: clone

http://stackoverflow.com/a/28480482
answers question: http://stackoverflow.com/q/28479771
upvote count: 1
type: AcceptedAnswer
type: Answer
has body: Ok, here is a working snippet. I've modified an already existing code, where you were able to increase and decrease numerical values. The main changes are happening here - Converting a char to int currentVal = currentVal.charCodeAt(currentVal); INCREMENT: Checking if currentValue is not undefined or less 90 (ASCII for Z) true - Use String.fromCharCode(currentVal+1)) to increase the integer and convert it to char. false - Set the value of your input field to "A" if (!isNaN(currentVal) &amp;&amp; currentVal &lt; 90) { // Increment $('input[name=' + fieldName + ']').val(String.fromCharCode(currentVal + 1)); } else { // Otherwise put a A there $('input[name=' + fieldName + ']').val("A"); } DECREMENT: Checking if currentValue is defined or greater 65 (ASCII for 'A') true - Same as increment, just decrement false - Same as increment, just set "Z" as value if (!isNaN(currentVal) &amp;&amp; currentVal &gt; 65) { // Decrement one $('input[name=' + fieldName + ']').val(String.fromCharCode(currentVal - 1)); } else { // Otherwise put a Z there $('input[name=' + fieldName + ']').val("Z"); } jQuery(document).ready(function() { // This button will increment the value $('.qtyplus').click(function(e) { // Stop acting like a button e.preventDefault(); // Get the field name fieldName = $(this).attr('field'); // Get its current value var currentVal = $('input[name=' + fieldName + ']').val(); currentVal = currentVal.charCodeAt(currentVal); // If is not undefined or its less 90 if (!isNaN(currentVal) &amp;&amp; currentVal &lt; 90) { // Increment $('input[name=' + fieldName + ']').val(String.fromCharCode(currentVal + 1)); } else { // Otherwise put a A there $('input[name=' + fieldName + ']').val("A"); } }); // This button will decrement the value till Z $(".qtyminus").click(function(e) { // Stop acting like a button e.preventDefault(); // Get the field name fieldName = $(this).attr('field'); // Get its current value var currentVal = $('input[name=' + fieldName + ']').val(); currentVal = c…
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28479771

http://stackoverflow.com/comment/45307962
type: Comment
has text: thanks phillip100 I just did this https://jsfiddle.net/k7xn88zd/4/embedded/result/
type: QuestionComment
comment on: http://stackoverflow.com/q/28492380
score: 0

http://stackoverflow.com/q/28468323
has comment: http://stackoverflow.com/comment/45262060
upvote count: 2
has comment: http://stackoverflow.com/comment/45262127
tagged with: php
tagged with: laravel
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45262078
has answer: http://stackoverflow.com/a/28468398
has answer: http://stackoverflow.com/a/28468401
answer count: 2
possible better answer: http://stackoverflow.com/a/28468398
downvote count: 0
tagged with: javascript
has body: I have a checkbox that should check all checkboxes. The checkbox works as it should by checking all the checkbox's, however angular doesnt think they have been checked? The only way angular knows if they are checked is if i manually check each one. (The brackets and for loop are blade php from laravel) &lt;label class="checkbox-inline"&gt; &lt;input type="checkbox" ng-model="everyoneCheck"/&gt; Everyone &lt;/label&gt; @foreach($company-&gt;users as $tagIndex =&gt; $user) &lt;label class="checkbox-inline"&gt; &lt;input type="checkbox" ng-checked="everyoneCheck" ng-model="newDiscussion.notify_partners[{{$tagIndex}}]" ng-true-value="{{$user-&gt;id}}" /&gt; {{ $user-&gt;first_name }} {{ $user-&gt;last_name }} &lt;/label&gt; @endforeach upon click of the submit button i proceed to $http.post to my server, i just pass in an object to the post function, this is the object. var discussionData = { 'title': $scope.newDiscussion.title, 'discussion': $scope.newDiscussion.summary, 'company_id': company_id, 'notify_partners': $scope.newDiscussion.notify_partners }; for some reason when i use the check all approach, nothing gets put into notify_partners, however when i manually click each checkbox, they will get entered and submitted properly. Any help? I feel like its some sort of binding issue, where i just need to tell angular, hey its updated!
has title: How to check all checkboxs with angular
accepted answer: http://stackoverflow.com/a/28468401
tagged with: angularjs
tagged with: checkbox
favorite count: 0
score: 2

http://stackoverflow.com/q/28520842
type: UnansweredQuestion
has body: I'm using lightbox javascript to enlarge an image when its clicked on. I am adding multiple images. If I remove the id attribute associated from the image, it still works when I test it out with firefox v25. To save on room, can I remove the images id attribute? If I have to keep it, should I name each image a different id name?
has answer: http://stackoverflow.com/a/28521719
tagged with: image
type: Question
answer count: 2
tagged with: lightbox
tagged with: javascript
score: 0
has title: Are id attributes required for lightbox enlarging images?
has answer: http://stackoverflow.com/a/28521023

http://stackoverflow.com/q/28482874
upvote count: 1
has comment: http://stackoverflow.com/comment/45287921
has comment: http://stackoverflow.com/comment/45289389
has body: Lets say I have this element: &lt;div id="transform"&gt; &lt;/div&gt; Css is : #transform { left:0px; top:0px; position: relative; width: 200px; height: 200px; background-color: green ; border-radius: 0px; } I want to animate border radius from 0 to 100 and back to 0 and its former position: $("#transform").click(function () { $(this).animate({ left:500, borderRadius:100 },1000,function () { $(this).animate({ left:0, borderRadius:0 },1000); }) }); First function works well and animates movement and changing border radius over one second to 100px, but the other one immediately changes border radius to 0 and then moves back to its former position over one second. Shouldn't border radius as well change to zero over one second? Isn't it logical? So I changed second function to : $("#transform").click(function () { $(this).animate({ left:500, borderRadius:100 },1000,function () { $(this).animate({ left:0, borderTopLeftRadius:0, borderTopRightRadius:0, borderBottomLeftRadius:0, borderBottomRightRadius:0 },1000); }); }); And everything worked well and over one second. Can someone tell me why is this required when changing border radius to 0 only and not when changing to some other value as well?
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45288917
has comment: http://stackoverflow.com/comment/45288283
downvote count: 0
has comment: http://stackoverflow.com/comment/45288221
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45289260
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 0
has comment: http://stackoverflow.com/comment/45289658
score: 1
has title: Why does animating border radius to zero requires that all four values be equal to zero?

http://stackoverflow.com/comment/45394550
type: Comment
type: QuestionComment
has text: The first alert is empty because the alert triggers **before** the value has been pasted into the input field.. the second time you do it, the value is there. See [**this**](http://jsfiddle.net/2095ooep/1/). How are you intending to pass on the value to another function?
score: 0
comment on: http://stackoverflow.com/q/28540283

http://stackoverflow.com/a/28524440
has body: Add just translate to the keywords, it works fine. There's no reason to add ( to it (translate( is not a valid JavaScript function name!) and there's even less reason to do it inconsistently for only some of the keywords, but not others. Finally, xgettext's parser won't recognize i18n. namespacing, so adding that has no effect. You may want to reconsider the use of Jed, though, unless you have very simple needs. Looking at the crazy (in Jed terminology: “sane”) API, there's no way xgettext could parse its way of doing contexts and plurals. There's no custom tool included with Jed to deal with it, so it seems you'd be reduced to create PO(T)s manually if you wanted contexts/plurals — something that goes against the entire concept of gettext.
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/45371204
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28520038
answers question: http://stackoverflow.com/q/28520038

http://stackoverflow.com/comment/45326065
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28503450
type: AnswerComment
has text: thanks for this code... this is the code what I'm trying to say.. thanks a lot..

http://stackoverflow.com/q/28557579
upvote count: 1
tagged with: dart
answer count: 1
favorite count: 0
has title: Dart and third party library integration
type: AnsweredQuestion
downvote count: 0
has body: I have simple example of usage of some map library How am I supposed to integrate this in Dart. I feel myself weak in javascript so I'm seeking any option how to get rid of javascript use, but I always fail when integrate with 3rd part libraries. I tried with GWT, the last version is using backbone, but it is mess. So I'm giving Dart a chance now, but it is hopeless so far. I tried something like this var stred = context['SMap']['Coords'].callMethod('fromWGS84', [14.41, 50.08]); var element = context['JAK'].callMethod('gel', 'mapa'); var mapa = new JsObject(context['SMap'],[[element], [stred], 10]); First line seems to make it, but after it stops, undefined and usual javascript madness, debuging dart.js is like javascript hell squared.
score: 1
accepted answer: http://stackoverflow.com/a/28557792
tagged with: integration
type: Question
has answer: http://stackoverflow.com/a/28557792
tagged with: javascript

http://stackoverflow.com/a/28498945
has body: var new_row=' save '; $("#hiddenRow tbody tr:last").after(new_row); Add this code on add new row button and Write code for save data
has comment: http://stackoverflow.com/comment/45318714
score: 0
has comment: http://stackoverflow.com/comment/45317478
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45319615
type: Answer
accepted answer of: http://stackoverflow.com/q/28498775
answers question: http://stackoverflow.com/q/28498775

http://stackoverflow.com/comment/45278036
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28477687
score: 1
has text: Please post your html code.

http://stackoverflow.com/a/32965749
score: 6
type: Answer
upvote count: 6
downvote count: 0
has body: var maillist = [ '****.sharma3@****.com', '****.bussa@****.com', '****.gawri@****.com', ]; maillist.toString(); var msg = { from: "******", // sender address to: maillist, subject: "Hello ✔", // Subject line text: "Hello This is an auto generated Email for testing from node please ignore it ✔", // plaintext body cc: "*******" // html: "Hello world ✔" // html body }
answers question: http://stackoverflow.com/q/28527561

http://stackoverflow.com/comment/45423119
has text: That's what documentation, comments, and explicit variable names are for. Unfortunately, you're right - options doesn't scream `function` to me. It would seem you'll need to look at Router or Server and see how they're using options. It might clearer there. Also, http is a pretty standard node module. Documentation online seems alright. http://nodejs.org/api/http.html#http_http_createserver_requestlistener
comment on: http://stackoverflow.com/q/28555234
type: QuestionComment
type: Comment
score: 3

npm
tags question: http://stackoverflow.com/q/28469311
tags question: http://stackoverflow.com/q/28573508
tags question: http://stackoverflow.com/q/28511332
type: Tag
tags question: http://stackoverflow.com/q/28442033
tags question: http://stackoverflow.com/q/28527420
tags question: http://stackoverflow.com/q/28543573
tags question: http://stackoverflow.com/q/28570013
tags question: http://stackoverflow.com/q/28572433
tags question: http://stackoverflow.com/q/28526372
tags question: http://stackoverflow.com/q/28583866
tags question: http://stackoverflow.com/q/28545106
tag name: npm
tags question: http://stackoverflow.com/q/28506225
tags question: http://stackoverflow.com/q/28533110
tags question: http://stackoverflow.com/q/28508061

http://stackoverflow.com/q/28577578
favorite count: 0
has comment: http://stackoverflow.com/comment/45467810
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/47532824
score: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I am using datatables to show tables. There is a single button an on it's click i want to delete all the selected rows during that time. Below is my code. var anSelected = fnGetSelected( oTable ); $(anSelected).remove(); $(document).ready(function() { var oTable = $('#example').DataTable({ "dom": 'T&lt;"clear"&gt;lfrtip', "tableTools": { "sSwfPath": "extensions/TableTools/swf/copy_csv_xls_pdf.swf", "sRowSelect": "multi", "aButtons": [ "copy", "print", "csv", "pdf", { "sExtends": "collection", "sButtonText": "Save", "aButtons": [ "csv", "xls", "pdf" ] } ] } }); $('#button').click(function () { var anSelected = fnGetSelected( oTable ); $(anSelected).remove(); }); });
has comment: http://stackoverflow.com/comment/47615124
tagged with: datatables
answer count: 1
has answer: http://stackoverflow.com/a/30223466
has title: Unable to delete multiple rows in datatables jquery

http://stackoverflow.com/q/28540498
tagged with: mobile
tagged with: javascript
has comment: http://stackoverflow.com/comment/45400521
answer count: 1
tagged with: regex
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28570721
accepted answer: http://stackoverflow.com/a/28570721
has body: I've written a very simple regular expression to ensure that some user input is alpha numeric with a single space as follows: Postcode is too short. Must contain a space. Postcode is too long. When I test this in chrome on the desktop it works a charm. I get a validation error if my input does not contain a space. The error clears when I enter a space. eg "AB12 3CD" passes and "AB123CD" fails which is as I would expect. If I open the same page on a mobile device (I've tested with iPhone 5 & 6 and a Windows Phone 8.1) the pattern always fails regardless of input. eg both "AB12 3CD" and "AB123CD" fail.
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/45450972
downvote count: 0
has title: AngularJS validation with ng-pattern works in desktop browser but not mobile
type: Question
upvote count: 2

http://stackoverflow.com/comment/45230897
score: 0
type: Comment
has text: Due to another functionality. The code which you are posted is not working. No need to add #id in options.
type: AnswerComment
comment on: http://stackoverflow.com/a/28451489

http://stackoverflow.com/comment/137268260
score: 0
has text: Does this answer your question? [Are JavaScript DOM event handlers called in order of registration?](https://stackoverflow.com/questions/2706109/are-javascript-dom-event-handlers-called-in-order-of-registration)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28480982

http://stackoverflow.com/comment/45444500
type: QuestionComment
has text: @Halcyon thanks for the information. My main issue now is getting to see the votes after a user has clicked on an answer.
comment on: http://stackoverflow.com/q/28566868
score: 0
type: Comment

http://stackoverflow.com/comment/45631979
score: 0
has text: i still don't think anything would correctly handle modern pages that use stuff like `body.mobile h1 {}`, `:target {}`, `input:invalid{}`, even just `:hover`s...
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28497156

http://stackoverflow.com/q/28449873
type: Question
has comment: http://stackoverflow.com/comment/45262492
tagged with: javascript
score: 0
has title: Web Audio API localfiles?
tagged with: http://stackoverflow.com/tag/html
has body: I have this error: XMLHttpRequest cannot load file:///home/......../Web/Sykbox/undefined. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource. I know is because the Same-origin policy, but I was wondering if there is a method for load localfiles. This is my code: HTML: &lt;html&gt; &lt;head&gt; &lt;title&gt; Sykbox &lt;/title&gt; &lt;link href="styles/syk.css" rel="stylesheet" type="text/css" /&gt; &lt;/head&gt; &lt;body&gt; &lt;input type = "button" onclick = "loadDog();" value = "Play" /&gt; &lt;script src = "scripts/sykAudio.js"&gt;&lt;/script&gt; &lt;/body&gt; JS: var audioCtx; var bufferDog; var url = "../data/TaktofWind.ogg"; window.addEventListener('load', init, false); function init() { try { window.AudioContext = window.AudioContext || window.webkitAudioContext; audioCtx = new AudioContext(); } catch(e) { alert("Web Audio API no es soportado por tu navegador"); } } function loadDog(url) { var request = new XMLHttpRequest(); request.open('GET', url, true); request.responseType = 'arraybuffer'; request.onload = function() { audioCtx.decodeAudioData(request.response, function(buffer) { bufferDog = buffer; playSound(bufferDog); }, function(error) { console.error("decodeAudioData error", error); } ); }; request.send(); } function playSound(buffer) { var source = audioCtx.createBufferSource(); source.buffer = buffer; source.connect(audioCtx.destination); source.start(0); }
tagged with: web-audio-api
linked to: http://stackoverflow.com/q/7141280
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45227852

http://stackoverflow.com/comment/45408303
type: AnswerComment
type: Comment
has text: excellent write-up. You've pretty much nailed it up until the last section. The `party` property is being correctly assigned, and the hard-coded 0-index is intentional - that is, when you use `getValues()` a 2d array is returned (rows, columns) but in this case there is only 1 row so I keep the row-index at 0 to iterate through the columns, in turn gathering the parties. If you see in first half of the log, each party is being correctly assigned each time. The problem is that once it pushes to `cliAllow`, all of the object pushed before it with similar properties are overwritten.
comment on: http://stackoverflow.com/a/28510998
score: 0

http://stackoverflow.com/comment/45244015
type: AnswerComment
has text: @Ben, you are awesome! This core concept finally snapped into place for me, and makes perfect sense now. Man, I love this place.
type: Comment
comment on: http://stackoverflow.com/a/28449976
score: 1

http://stackoverflow.com/q/28590467
possible better answer: http://stackoverflow.com/a/28590813
upvote count: 0
has comment: http://stackoverflow.com/comment/45487543
has body: I'm looking for a way to fade out a div when you hover over it and then display text on top of that div. I can accomplish the fade out a number of ways; however, I'm struggling to find a way to combine the fade out with displaying the additional text. Here's what I have as far as the fade out: HTML Lorem ipsum dolor sit amet CSS .myDiv{ width: 200px; } .myDiv:hover{ opacity: .3; -webkit-transition: all .5s ease-in-out; -moz-transition: all .5s ease-in-out; -o-transition: all .5s ease-in-out; transition: all .5s ease-in-out; } a{ text-decoration:none; color: #000000; } Here is a fiddle: JSFiddle I want the whole div to be a hyperlink to another page, and when the user hovers over the div, the main text fades out and text such as "Click here to view more" displays on top of the faded text. Thanks in advance for any suggestions.
has answer: http://stackoverflow.com/a/28590813
tagged with: javascript
answer count: 6
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
has title: Fade div on hover and display additional text on top
has comment: http://stackoverflow.com/comment/45487778
has answer: http://stackoverflow.com/a/28590784
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45488210
has answer: http://stackoverflow.com/a/28590848
has answer: http://stackoverflow.com/a/28590625
has answer: http://stackoverflow.com/a/28595348
score: -1
has answer: http://stackoverflow.com/a/28590778
accepted answer: http://stackoverflow.com/a/28590848
type: Question

http://stackoverflow.com/q/28582436
tagged with: d3plus
has title: Disable D3plus width change animation
has answer: http://stackoverflow.com/a/28583133
has body: I have to change dynamically the width of a D3plus chart, the problem is that the change in width is not instantaneous but there is an animation that scales the chart down or up accordingly, is there any way to disable this animation or all the eventual animation in general in D3plus? This is the code i use: var visualization = d3plus.viz() .container('#' + id) .data(data) .type('tree_map') .id('name') .size('value') .width($(window).width() - 85) .draw(); $(window).on('orientationchange', function () { window.setTimeout(function () { visualization.width($(window).width() - 85).draw(); }, 200); });
type: Question
has answer: http://stackoverflow.com/a/29216130
tagged with: width
tagged with: javascript
score: 0
answer count: 2
type: UnansweredQuestion
tagged with: animation

http://stackoverflow.com/comment/45415046
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28550738
has text: What are the strings that you're feeding to this code? It looks like it expects strings of the form `inches centimeters 5` - is that right?

http://stackoverflow.com/comment/45262632
has text: What is the generated code? Also, this is happening on Safari for Windows, right?
comment on: http://stackoverflow.com/q/28467941
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28520539
has comment: http://stackoverflow.com/comment/45357902
has comment: http://stackoverflow.com/comment/45358132
has comment: http://stackoverflow.com/comment/45358214
has comment: http://stackoverflow.com/comment/45358309
has comment: http://stackoverflow.com/comment/45363124
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45358046
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45358310
has body: Forgive me for my novelty with Angular but I can't find what the problem to this seemingly simple program. Instead of the $scope displaying "Jonathan" which is defined LoginController, it displays {{logins.username}} in login.html. If I move the controller in the index.html, it works fine. When I move it to app.js file, it does not work. Any help or direction would be greatly appreciated. Focusing on LoginController, below is my code: Index.html AngularJS Project Home Login Register login.html Login Page Username: <input type="text" placeholder="Username" ng-model="logins.username" Password: <input type="text" placeholder="Password" ng-model="logins.password" Your Username is {{ logins.username }} app.js var millersFormalsApp = angular.module('millersFormalsApp', ['ngRoute']); //** Route Provider takes care of routing functionality based //** upon what has been selected millersFormalsApp.config(function ($routeProvider){ $routeProvider .when('/', { controller: 'HomeController', templateUrl: 'Views/home.html' }) .when('/login', { controller: 'LoginController', templateUrl: 'Views/login.html' }) .when('/register', { controller: 'RegisterController', templateUrl: 'Views/register.html' }) .otherwise({redirectTo: 'home.html'}); }); //** Controllers are called by the Route Provider to specifically execute //** the selected item millersFormalsApp.controller('HomeController', function ($scope) { $scope.homePage = "This is Miller's Home Page"; }); millersFormalsApp.controller('LoginController', function ($scope) { $scope.logins = {username: "Jonathan", password: ""}; console.log($scope); }); millersFormalsApp.controller('RegisterController', function ($scope) { $scope.register = { firstname: "", lastname: "" }; console.log($scope); });
has comment: http://stackoverflow.com/comment/45358171
has comment: http://stackoverflow.com/comment/45358098
has comment: http://stackoverflow.com/comment/45358349
answer count: 0
has comment: http://stackoverflow.com/comment/45357875
has comment: http://stackoverflow.com/comment/45358185
has comment: http://stackoverflow.com/comment/45357911
type: Question
has comment: http://stackoverflow.com/comment/45358030
has comment: http://stackoverflow.com/comment/45358282
tagged with: javascript
has title: AngularJs $Scope not Binding
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/45357986
has comment: http://stackoverflow.com/comment/45358069
score: 0

http://stackoverflow.com/comment/45544210
type: Comment
has text: Again, the server is not one I control. I can't change the code on the server.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28620685

http://stackoverflow.com/comment/45294510
has text: @bvx89 you can't change it directly because the `click` handler doesn't take two methods, unlike `hover` which does. You'll have to re-write the handler to toggle between the states.
type: AnswerComment
comment on: http://stackoverflow.com/a/28485967
score: 0
type: Comment

http://stackoverflow.com/a/28442720
score: 11
has comment: http://stackoverflow.com/comment/50729703
has comment: http://stackoverflow.com/comment/50627633
accepted answer of: http://stackoverflow.com/q/28442178
type: AcceptedAnswer
downvote count: 0
has body: here is the result after I tried it, hopefully it helps: Enter Room's Name Create Chat Room
type: Answer
answers question: http://stackoverflow.com/q/28442178
upvote count: 11

http://stackoverflow.com/q/28454062
upvote count: 5
has comment: http://stackoverflow.com/comment/45235681
tagged with: javascript
has comment: http://stackoverflow.com/comment/45237457
type: AnsweredQuestion
downvote count: 0
tagged with: dom-events
accepted answer: http://stackoverflow.com/a/28455764
favorite count: 0
tagged with: stoppropagation
has comment: http://stackoverflow.com/comment/45235125
possible better answer: http://stackoverflow.com/a/74546308
type: Question
score: 5
has answer: http://stackoverflow.com/a/74546308
has body: For example we have a page with a link that has onclick event listener on it. But handler makes stopPropagation. How I can handle that click event was made, if it's not bubble to root anymore? e.g. document.addEventListener('click', function(e) {console.log(e);}); a.onclick = function(e) {e.stopPropagation();};
has title: How to catch event that was stopPropagation
answer count: 2
linked to: http://stackoverflow.com/q/4616694
has answer: http://stackoverflow.com/a/28455764

http://stackoverflow.com/q/28576812
score: 2
tagged with: virtual-keyboard
answer count: 0
type: Question
tagged with: javascript
has title: Inject JavaScript on iFrame to get virtual keyboard functionality
has body: Is it possible to inject our own JavaScript in the iFrame on a external domain ex) xyz.com ? (The original objective is to get the Virtual Keyboard functionality working on an iFrame that has a link to an external webapp.
downvote count: 0
favorite count: 0
upvote count: 2
tagged with: frontend
type: UnansweredQuestion

http://stackoverflow.com/q/28587604
answer count: 1
tagged with: meteor
has answer: http://stackoverflow.com/a/28587886
type: UnansweredQuestion
tagged with: handlebars.js
has body: I currently am trying to apply an array of images to my template HTML. var z = [...jpg,...,jpg,...jpg]; var x = ["text","text","text"]; These arrays are stored globally in my file. Here is my template helper function and I'm just using a sample index to see if it would be display in the HTML but it isn't working properly. Template.stop.helpers({ 'thumb': function(){ return z[1]; }, 'snippet': function(){ return x[1]; } }); Here is my html template reference Do you like this product? {{title}} {{snippet}} and here is where it's referenced in a div in my body {{> stop}} I want these images displayed in a table in my HTML but I'm not even able to display one. Any ideas?
has title: How to apply array of images to a template helper in Meteor.js
has comment: http://stackoverflow.com/comment/45482454
type: Question
tagged with: arrays
tagged with: javascript
score: 0

http://stackoverflow.com/q/28506305
tagged with: javascript
score: 0
tagged with: ruby-on-rails-4
answer count: 1
tagged with: stripe-payments
tagged with: ruby
has answer: http://stackoverflow.com/a/28506348
type: UnansweredQuestion
has title: How do I access a variable created in CoffeeScript in my rails model?
has body: I'm creating customer accounts on a rails 4 application, using stripe. Essentially, I know that my coffeescript code to capture cc info (below) is successfully communicating with Stripe, as the token is being created for a card (I'm able to print it to screen once it's created). As well, I have a method in my model to create the customer object in Stripe. It connects and shows up in stripe, and when I try to hardcode the credit card info (i.e. passing a block with pre-set parameters), the card information shows up in stripe. However, I can't figure out how to pass the card token from my coffeescript code to my model (or controller, or anywhere I can actually use it really). If someone could help me out, or point me to some docs on it that'd be amazing! Here's my coffeescript code, where the token is saved as "#subscription_stripe_card_token": handleStripeResponse: (status, response) -&gt; if status == 200 $('#subscription_stripe_card_token').val(response.id) $('#stripe_error').text(response.id) $('#new_subscription')[0].submit() else $('#stripe_error').text(response.error.message) $('input[type=submit]').attr('disabled', false) Here's my model, where I'm attempting (unsuccessfully) to access it (in the save_with_payment method, calling Stripe::Customer.create, is where I'm trying to pass the card info): class Subscription include Mongoid::Document belongs_to :user field :plan, type: String field :stripe_customer_token, type: String attr_accessor :stripe_card_token def save_with_payment(plan, email, name) if valid? customer = Stripe::Customer.create(description: name, email: email, plan: plan, card: stripe_card_token) write_attribute(:stripe_customer_token, customer.id) save! end rescue Stripe::InvalidRequestError =&gt; e logger.error "Stripe error while creating customer: #{e.message}" errors.add :base, "There was a problem with your credit card." false end Again, everything else works. At the moment I'm assuming its passing a "nil" value, and I can't figure out how…
linked to: http://stackoverflow.com/q/2943232
tagged with: coffeescript
type: Question
duplicate of: http://stackoverflow.com/q/2943232

http://stackoverflow.com/a/28438384
has comment: http://stackoverflow.com/comment/45207218
answers question: http://stackoverflow.com/q/28437397
type: Answer
has body: If it is sliding, then it might be a width issue. Try adding this line of code into your CSS and see if it works. html { max-width:100% }
score: 0

http://stackoverflow.com/comment/45370943
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28526824
has text: @AlexandreNucera I also updated my answer, I included a new plunker to do the same thing without the directive. If it helps.. :)
score: 0

http://stackoverflow.com/comment/45287190
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28482501
has text: What are you putting in for x when it doesn't run? ".length" only works on arrays or certain collections.
score: 1

http://stackoverflow.com/comment/45226326
type: Comment
type: QuestionComment
has text: What's inside startDateString?
comment on: http://stackoverflow.com/q/28449114
score: 0

http://stackoverflow.com/comment/45487570
comment on: http://stackoverflow.com/a/28589523
type: Comment
has text: It's normally indicated the file and line number where the error occurred. What does it say?
score: 0
type: AnswerComment

http://stackoverflow.com/a/28494129
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 3
has body: The issue with your jsfiddle was the fact that your javascript function was wrapped by an anonymous function, causing you to have scope issues. You can see what was acutaly being executed here &lt;script type="text/javascript"&gt;//&lt;![CDATA[ window.onload=function(){ function toggleCPRgt(){ var cpRgt = document.getElementById("cpRgt"); cpRgt.style.height = window.innerHeight - 60+"px"; if(cpRgt.style.right == "0px"){ cpRgt.style.right = "300px"; } else { cpRgt.style.right = "0px"; } } }//]]&gt; &lt;/script&gt; You can either change the type of execution using the jsfiddle options, or if the same issue applies in your code, you can fix it by applying the function to the global scope like shown below. Basically to access the function, it needs to be able to see the function. &lt;script type="text/javascript"&gt;//&lt;![CDATA[ window.onload=function(){ window.toggleCPRgt = function(){ alert('here'); //... }//]]&gt; &lt;/script&gt;
upvote count: 3
answers question: http://stackoverflow.com/q/28493993
accepted answer of: http://stackoverflow.com/q/28493993

http://stackoverflow.com/q/28574066
downvote count: 0
type: UnansweredQuestion
has body: Consider the following example, where one element is included statically into the directive definition, and other one is added later (using jQuery): angular.module('test', []).directive('transcludeThis', [function () { return { restrict: 'E', transclude: true, replace: true, template: ' ' }; }]); $(function() { angular.bootstrap(document, ['test']); $('#transcluded').append(' Dynamic (jQuery): ').find('*').each(function() { var $this = $(this); $this.append(angular.element($this).scope().$id); }); }); Static: Why is the dynamic element not in the transcluded scope?
type: Question
score: 1
has answer: http://stackoverflow.com/a/28574162
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: angularjs
has title: Why do dynamic elements under a directive have a wrong scope if added after transclusion?

http://stackoverflow.com/comment/45378355
comment on: http://stackoverflow.com/a/28528900
score: 0
type: AnswerComment
has text: Happens all the time - I suspect that is what the question is all about. Why would OP need to add an frame to a completely empty page?
type: Comment

http://stackoverflow.com/comment/52905640
score: 1
comment on: http://stackoverflow.com/a/29292494
type: AnswerComment
has text: I found the discussion while googling the difference of `extend` and `merge`. In the case, we can use your code or call `angular.merge` if we have angular 1.4.x.
type: Comment

http://stackoverflow.com/comment/45837896
has text: So far this is the besteht answer. But my app is move based and i think that implement a physic engine is much too complicated for that use case. Instead I have written my own code to detect next neighbor meshes.
type: AnswerComment
comment on: http://stackoverflow.com/a/28457796
score: 0
type: Comment

web-services
type: Tag
tags question: http://stackoverflow.com/q/28503933
tags question: http://stackoverflow.com/q/28501793
tags question: http://stackoverflow.com/q/28582122
tags question: http://stackoverflow.com/q/28591273
tags question: http://stackoverflow.com/q/28582872
tags question: http://stackoverflow.com/q/28516554
tags question: http://stackoverflow.com/q/28505690
tags question: http://stackoverflow.com/q/28495929
tags question: http://stackoverflow.com/q/28536527
tag name: web-services
tags question: http://stackoverflow.com/q/28464626

http://stackoverflow.com/a/28487779
answers question: http://stackoverflow.com/q/28485231
upvote count: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45332133
score: 1
has body: I didn't read through all of your code, but you can't kick off an asynchronous activity and then busy-wait for it to complete, because JavaScript is single threaded. No matter what's happened, the asynchronous function won't be executed until the script completes its current processing. In other words, asynchronous does not imply concurrent. Generally speaking, if task A is to be performed after asynchronous task B completes, you should execute A from the completion callback for B. That's the straightforward, safe way to do it. Any shortcut, to achieve better responsiveness or to simplify the code, is going to have dependency or race-condition problems, and will require lots of horsing around to get right. Even then, it will be hard to prove that the code operates correctly on all platforms in all circumstances.
accepted answer of: http://stackoverflow.com/q/28485231
has comment: http://stackoverflow.com/comment/45335477

http://stackoverflow.com/a/28502150
answers question: http://stackoverflow.com/q/28446753
has body: Thanks I had a look around and used the code from here http://jsfiddle.net/bonamico/cAHz7/ and merged it with my code. HTML file: {{row.day}} {{row.open}} {{row.close}} JS file: myApp.directive('contenteditable', function() { return { require: 'ngModel', link: function(scope, elm, attrs, ctrl) { // view -> model elm.bind('blur', function() { scope.$apply(function() { ctrl.$setViewValue(elm.html()); }); }); // model -> view ctrl.render = function(value) { elm.html(value); }; elm.bind('keydown', function(event) { console.log("keydown " + event.which); var esc = event.which == 27, el = event.target; if (esc) { console.log("esc"); ctrl.$setViewValue(elm.html()); el.blur(); event.preventDefault(); } }); } }; });
upvote count: 12
has comment: http://stackoverflow.com/comment/51588579
score: 12
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/50127966
accepted answer of: http://stackoverflow.com/q/28446753
type: Answer

http://stackoverflow.com/comment/45521967
score: 0
type: Comment
type: QuestionComment
has text: In most cases, this is kind of behavior from an unsuccessful connection to the database server. It would be good if we could also see the `sql` statement.
comment on: http://stackoverflow.com/q/28591499

http://stackoverflow.com/a/28477510
type: Answer
has body: See this thread that shows how it can be done with plain CSS only, without any JavaScript / jQuery. Special credit for @Pinal who helped me to make it work on Firefox.
answers question: http://stackoverflow.com/q/28472901
score: 0

http://stackoverflow.com/q/28502639
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45325242
accepted answer: http://stackoverflow.com/a/28502908
upvote count: 1
has title: Convert string loaded from text file to an array object in JavaScript
type: Question
has comment: http://stackoverflow.com/comment/45324572
tagged with: javascript
has comment: http://stackoverflow.com/comment/45324765
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45325229
favorite count: 0
has body: I have the following object { value: 20, color:"#878BB6" }, { value : 40, color : "#4ACAB4" } loaded from a text file abc.txt in my local directory in the server. I want to convert this into an array object. I tried doing var string = "{ value: 20, color:"#878BB6" }, { value : 40, color : "#4ACAB4" }" var array = JSON.parse("[" + string + "]"); alert(array); Nothing happens unfortunately. Help appreciated !
has answer: http://stackoverflow.com/a/28502908

http://stackoverflow.com/a/28535994
has comment: http://stackoverflow.com/comment/45458428
answers question: http://stackoverflow.com/q/28522910
has comment: http://stackoverflow.com/comment/45419567
has comment: http://stackoverflow.com/comment/45414388
has comment: http://stackoverflow.com/comment/45453374
score: 5
has body: Add '_' to function name. -s EXPORTED_FUNCTIONS="['_pf']"
has comment: http://stackoverflow.com/comment/45458349
has comment: http://stackoverflow.com/comment/45453392
type: Answer
has comment: http://stackoverflow.com/comment/45414664
upvote count: 5
downvote count: 0

http://stackoverflow.com/q/28584887
has comment: http://stackoverflow.com/comment/45477891
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28599286
upvote count: 1
has answer: http://stackoverflow.com/a/28585363
has body: I have created generic ajax function to work with REST API. I have written below code and it is working fine for at a time a single call. but if i make two different call then my success callback is overwrite with latest callback. var ajax = { parameters: { url: '', dataType: 'json', data: {}, contentType: 'application/json', loading: false, crossDomain: true, async: true, timeout: 30000, otherData: {} }, callback: { success: null, error: null }, get: function () { this.send('GET'); }, post: function () { this.send('POST'); }, del: function () { this.send('DELETE'); }, send: function (type) { self = this; if (!navigator.userAgent.match(/iPad|iPhone|iPod|android|blackberry|IEMobile/i)) { this.loadingIcon.show(); if (this.isUndefined(this.parameters.dataType)) this.parameters.dataType = 'json'; if (this.isUndefined(this.parameters.contentType)) this.parameters.contentType = 'application/json'; if (this.isUndefined(this.parameters.loading)) this.parameters.loading = false; if (this.isUndefined(this.parameters.crossDomain)) this.parameters.crossDomain = true; if (this.isUndefined(this.parameters.async)) this.parameters.async = true; if (this.isUndefined(this.parameters.timeout)) this.parameters.timeout = 30000; if (this.isUndefined(this.callback.error)) this.callback.error = this.defaultError; return $.ajax({ type: type, url: this.parameters.url, dataType: this.parameters.dataType, data: JSON.stringify(this.parameters.data), contentType: this.parameters.contentType, crossDomain: this.parameters.crossDomain, async: this.parameters.async, timeout: this.parameters.timeout, success: function (data) { var args = arguments[2]; if (!self.isUndefined(self.callback.success)) { if (self.isUndefined(self.parameters.otherData)) self.callback.success.call(this, data, args.statusText, args); else self.callback.success.call(this, data, args.statusText, args, self.parameters.otherData); } self.loadingIcon.hide(); }, error: function (xhr, ajaxOptions, thrownError) { xhrServerObj = xhr; …
type: Question
answer count: 2
has title: Generic AJAX function callback is not working as expected
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
tagged with: ajax

dice
tags question: http://stackoverflow.com/q/28553474
type: Tag
tag name: dice

http://stackoverflow.com/comment/45432886
has text: I have actually solved my problem now, and was an error so embarrassing I'm not going to share it. Could you expand on how reading the observable creates the dependency? Would that be happening in the ko.unwrap(val.dt) line? So KO runs all the bindings and makes a note of when any observable was called from one to add to a dependency 'table' or something? If you could give be a bit more detail as an answer I will be happy to mark it as the answer; I still don't feel I have any kind of grasp on how KO creates dependencies and I don't like magic :)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28559970

http://stackoverflow.com/q/28499361
has answer: http://stackoverflow.com/a/28499403
accepted answer: http://stackoverflow.com/a/28501555
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28499455
has answer: http://stackoverflow.com/a/28499394
has answer: http://stackoverflow.com/a/28499443
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28499394
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: maxlength
has answer: http://stackoverflow.com/a/28501555
has title: maxlength=5 not working if input type=number
answer count: 5
has body: This is frustrating! When the input type is text and I gave maxlength as 5, it is not allowing me to enter more than 5 characters &lt;input type="text" maxlength="5" /&gt; If I gave input type as number and I gave maxlength as 5, it is allowing more than 5 digits? &lt;input type="number" maxlength="5" pattern="[0-9]*" /&gt; Am I missing something? PS: This is for mobile responsive site!

http://stackoverflow.com/comment/45391403
comment on: http://stackoverflow.com/q/28538596
has text: `new Fx. Accordion` I think there's an extra space here.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28479581
tagged with: polymer
tagged with: javascript
has body: Suppose I have the following element: How can I supply the content with templates like so: Woof Meow As of now, it appears the content selectors are evaluated before the templates; so there's no h1's in the DOM when tries to find them. I suspect there's a way for me to do this (even if it requires some hacking). Or perhaps I'm just doing something wrong.
has comment: http://stackoverflow.com/comment/45291777
score: 0
tagged with: templates
tagged with: shadow-dom
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45354583
has title: How do I use templates and content selectors together?
answer count: 0
type: Question

http://stackoverflow.com/comment/45457138
has text: Can you talk about your own reasoning so we can help you better? From what context / why are you asking this? What do you think will perform betteR?
comment on: http://stackoverflow.com/q/28573803
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/59365993
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28515726
score: 4
has body: If you are using version 5, you can use the beginHole() and endHole() methods. function createHollowCircle(radius, x_coordinate, y_coordinate) { let circle = new Graphics(); circle.beginFill(color); circle.drawCircle(0, 0, radius); circle.beginHole(); circle.drawCircle(0, 0, radius - 0.1); circle.endHole(); circle.endFill(); circle.x = x_coordinate; circle.y = y_coordinate; return circle; } Hollow Circles
upvote count: 4

http://stackoverflow.com/comment/45474741
score: 0
type: Comment
has text: I think this one simple and easier. i used it before somehow it didnt give me output but now its working
comment on: http://stackoverflow.com/a/28583378
type: AnswerComment

http://stackoverflow.com/q/28496178
upvote count: 2
has answer: http://stackoverflow.com/a/28496275
linked to: http://stackoverflow.com/q/14853779
answer count: 4
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28496489
has comment: http://stackoverflow.com/comment/45312013
has title: How to create html elements in a form, without reloading the page?
has body: I'm looking for a way to add html elements to a form by using for example a button. I've been looking on a few examples out there but they are very big (like 3+ times the size of the actual form I want to build) so I'm wondering if there is a better way of fixing this. My idea is something like this: &lt;form action='blabla.php' method='post'&gt; &lt;!-- Insert button here to add a new element --&gt; &lt;input type='text' name='desc_1'&gt; &lt;/form&gt; And by clicking the button, the following should be rendered: &lt;form action='blabla.php' method='post'&gt; &lt;!-- Insert button here to add a new element --&gt; &lt;input type='text' name='desc_1'&gt; &lt;input type='text' name='desc_2'&gt; &lt;/form&gt; I want a new input field to be created, without the page having to reload and loose ev data entered in the form. Guessing this is something I should achieve through javascript or even jquery. I know how to edit an existing input field but I have no clue on how to create a new one and make it follow its numberrange. Anyone have an idea on how to apporoach this with a javascript function? Or should I invest in some time researching jquery for a smoother solution?
type: Question
has answer: http://stackoverflow.com/a/28496273
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28496489
downvote count: 0
possible better answer: http://stackoverflow.com/a/28496443
favorite count: 0
has answer: http://stackoverflow.com/a/28496443

http://stackoverflow.com/comment/45395506
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28541006
score: 3
has text: *"I used explode but..."* Well, `explode` is a PHP function, but this is JavaScript. Did you try any *JavaScript* functions?

http://stackoverflow.com/comment/45320811
has text: please add the SignalR version and how soon you try to send to the group; also, try returning `base.OnConnected()` from OnConnected, then in JoinToSpokeGroup: `await Groups.Add(...)` and send to the same group right after that; does that arrive? if so, how long does it take?
score: 0
comment on: http://stackoverflow.com/q/28475230
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28583282
has body: The console runs asynchronously. It also keeps a reference to your object. Your code is running just fine. When you look at the object in the console, it shows you the current way it looks, not how it was at the time of the log. If you replace console.log(keyVals); with console.log(keyVals.slice());, you should see the proper objects, because we copy them as-is.
answers question: http://stackoverflow.com/q/28583124
score: 0
type: Answer

http://stackoverflow.com/a/28539096
answers question: http://stackoverflow.com/q/28538920
score: -1
downvote count: 1
has body: The html5 download attribute could help here. I haven't tested it personally but this blogpost says adding download should force a download on the browser side. Example code: Download
type: Answer
upvote count: 0
has comment: http://stackoverflow.com/comment/45392446
has comment: http://stackoverflow.com/comment/45392391

http://stackoverflow.com/a/28456910
has comment: http://stackoverflow.com/comment/45274806
has comment: http://stackoverflow.com/comment/45273788
type: Answer
has comment: http://stackoverflow.com/comment/45274156
answers question: http://stackoverflow.com/q/28456833
has body: You can use this lookahead based regex: /^(?=(.*?\d){8})(?=(\S* ){2}).+$/gm RegEx Demo First lookahead is to make sure there are at least 8 digits and 2nd one is to make sure there are at least 2 spaces.
score: 0

http://stackoverflow.com/comment/45378274
comment on: http://stackoverflow.com/a/28530478
type: AnswerComment
score: 0
type: Comment
has text: Thanks! I had just confirmed that it is the xml output of the PHP file myself, and your plunker confirmed it as well. I will look into my get_provinces.php to determine why it is not being parsed correctly by the response XML command.

http://stackoverflow.com/comment/45229755
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28450673
has text: Why do you need to use javascript for openning a new tab instead of a simple link with target blank ?
score: 0

header
type: Tag
tag name: header
tags question: http://stackoverflow.com/q/28591494

http://stackoverflow.com/comment/45255308
type: QuestionComment
comment on: http://stackoverflow.com/q/28464767
score: 0
has text: @APAD1 If you do that, it will escape the `?` character, so it won't be treated as the parameter delimiter.
type: Comment

http://stackoverflow.com/comment/45488119
comment on: http://stackoverflow.com/a/28576142
type: Comment
type: AnswerComment
has text: I must be missing something small on here. Here is the jfiddle and its the same issue. I won't be normally referencing cnn im just using it at a placer for the fiddle
score: 0

security
tags question: http://stackoverflow.com/q/28524262
tags question: http://stackoverflow.com/q/28533599
tags question: http://stackoverflow.com/q/28556309
tags question: http://stackoverflow.com/q/28538408
tags question: http://stackoverflow.com/q/28556881
tags question: http://stackoverflow.com/q/28515795
tags question: http://stackoverflow.com/q/28473305
tags question: http://stackoverflow.com/q/28458392
tags question: http://stackoverflow.com/q/28471556
tags question: http://stackoverflow.com/q/28570108
type: Tag
tag name: security

http://stackoverflow.com/comment/45250315
type: Comment
type: QuestionComment
has text: Sparky can you answer my comments please
comment on: http://stackoverflow.com/q/28439237
score: 0

http://stackoverflow.com/a/28550380
score: 1
answers question: http://stackoverflow.com/q/28549923
type: AcceptedAnswer
downvote count: 0
has body: I'm getting a 401 error when using your token: Failed to load resource: the server responded with a status of 401 (Unauthorized) When i use your code with Mapbox's example token and map (note, you should be using your own token and map) it's perfectly fine: L.mapbox.accessToken = 'pk.eyJ1IjoicGF1bC12ZXJob2V2ZW4iLCJhIjoiZ1BtMWhPSSJ9.wQGnLyl1DiuIQuS0U_PtiQ'; var map = L.mapbox.map('mapbox', 'examples.map-i86nkdio', { 'center': [0, 0], 'zoom': 1 }); Working example on Plunker: http://plnkr.co/edit/wrlC7AAHLBWsDgzk8PRw?p=preview I'de double check your accounttoken and map id.
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28549923

http://stackoverflow.com/q/28459887
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/45247977
has comment: http://stackoverflow.com/comment/45248083
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45246016
has title: Issue with running parent jQuery function from iFrame
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45246252
tagged with: css
has body: Running into an issue here. I have an iFrame that on click needs to open up another page within a separate iframe on the same parent page (two iframes on a single parent page on frame 1 links open in frame 2). The UX function requires that the second iframe fade in from hiding. We are able to get the frame to load but the problem is that the .fadeIn does not work with .click(). jQuery Code on iframe 1: $(".frame-link").click(function() { $('#node-frame', window.parent.document).fadeIn(); }); It works fine without the click function if the iframe 1 script is simply: $('#node-frame', window.parent.document).fadeIn(); When we attempt to do an on click command no luck. Anyone know what we might be missing? Note: #node-frame css set to hidden on parent css
tagged with: iframe
has comment: http://stackoverflow.com/comment/45248557
type: Question
has comment: http://stackoverflow.com/comment/45248044

http://stackoverflow.com/q/28582086
accepted answer: http://stackoverflow.com/a/28582205
upvote count: 0
score: -2
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/20596551
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: How to edit the inside of a div with jquery
has body: On my tumblr page 8fuuntvtest.tumblr.com, which is just the testing page at the moment, I have a list on the right with videos, and when you click on the name of the video it appears to the left. Aesthetically, though, I don't like to have the play button and the header thing on the player list. So I want to target the iframe inside the div .postList and hide the play button (.ytp-large-play-button) and the header (.html-info-bar). I am not sure how to approach this though as nothing seems to edit the inside of the iframe.
tagged with: iframe
downvote count: 2
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28582205

http://stackoverflow.com/q/28578668
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45465778
score: 0
has comment: http://stackoverflow.com/comment/45465743
has title: Javascript error when using bundles
has comment: http://stackoverflow.com/comment/45465719
tagged with: jquery
has body: I have the following bundles. bundles.Add(new ScriptBundle("~/bundles/scripts").Include( "~/Scripts/jquery-2.1.3.min.js", "~/Scripts/bootstrap.js", "~/Scripts/respond.js")); bundles.Add(new ScriptBundle("~/bundles/description").Include( "~/Scripts/dropzone/dropzone.min.js", "~/Scripts/jquery-validate.js", "~/Scripts/form-validation.js", "~/Scripts/fancybox.min.js", "~/Scripts/elements.js", "~/Scripts/descriptionPage.js" )); on my LayoutPage I have the following which renders the relevant scripts @Scripts.Render("~/bundles/scripts") @RenderSection("scripts", required: false) now inside my View which is located in an area I then register the description bundle as so @section scripts{ @Scripts.Render("~/bundles/description") } now when I view source I see the following Everything is there as expected, problem is jquery-2.1.3.min.js is colored red when viewing source and the error I get when using firebug is and when mousing over the script tag whilst viewing source is stray start tag 'script' So I decided to start commenting out js files to find the file and it turns out its dropzone.min.js commenting this out the error goes away, can anyone tell me or help me figure this out?
tagged with: asp.net-mvc-areas
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/28478670
has comment: http://stackoverflow.com/comment/45280137
has comment: http://stackoverflow.com/comment/45280079
has comment: http://stackoverflow.com/comment/45280440
has comment: http://stackoverflow.com/comment/45280263
upvote count: 4
downvote count: 0
answers question: http://stackoverflow.com/q/28478588
score: 4
type: Answer
has comment: http://stackoverflow.com/comment/45280028
has body: Try this, $('.title').on('click', '.button', function() { var $item = $(this).parent(); var title = $item.contents().get(0).nodeValue; alert(title); }); Working Demo
has comment: http://stackoverflow.com/comment/45280372

http://stackoverflow.com/q/28530383
has body: Is there a way to have an event triggered when you drag an item to a certain place, or drag it a certain amount? For example, with a slider you can have an event happen when you drag the slider like this: $( '.slider' ).slider( { slide : function(){}, change : function(){} }); is there anything like this with a draggable element using jquery ui?
accepted answer: http://stackoverflow.com/a/29041701
tagged with: draggable
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45375785
type: Question
tagged with: jquery-ui
has answer: http://stackoverflow.com/a/29041701
tagged with: javascript
tagged with: jquery
has title: Events triggered on jquery dragging
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/28530409
has answer: http://stackoverflow.com/a/28530510
has answer: http://stackoverflow.com/a/28530409

http://stackoverflow.com/a/28511546
upvote count: 16
type: AcceptedAnswer
downvote count: 0
has body: You can set ignoreSynchronization to be false once your verification is done. However, note that ignoreSynchronization is synchronous while everything else (click/get/etc) is asynchronous, so you need to be careful with that. Probably the safest way is to set it to true in beforeEach and false in afterEach, and just test that single logo click in that test.
accepted answer of: http://stackoverflow.com/q/28511013
answers question: http://stackoverflow.com/q/28511013
has comment: http://stackoverflow.com/comment/45341963
type: Answer
has comment: http://stackoverflow.com/comment/45342016
score: 16

http://stackoverflow.com/comment/45434972
has text: All that the PHP page does is to read the JSON and print it on get_lightnings.php. Nothing else. That way, when you query this page with AJAX, it returns what it on `http://www.lightningmaps.org/live/` so that you can parse the data client side (javascript).
comment on: http://stackoverflow.com/a/28538934
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/28471472
has comment: http://stackoverflow.com/comment/45271716
has comment: http://stackoverflow.com/comment/45287183
type: Answer
has body: Query strings won't work because you are using jQuery's $.post call which means that your data is sent in the body of the request, as opposed to a query string which is what a GET uses. For JSON you do indeed want to use a POST. As for what's going wrong, you need to decode your JSON into a PHP array using json_decode. Unfortunately it can't simply handle JSON how it is. So most likely you'll want to do: // now a poorly named variable $tableJSON = json_decode($_POST['table']); Also, looking at your Ajax, $.post does accept a .fail() listener, but it doesn't pass any error data as part of the callback. So if you want to be able to handle incoming response errors you'll need to use $.ajax: $.ajax({ type: "POST", url: "/your/url.php", dataType: "json", error: errorCallback }); Finally, looking at how your code is structured, if you're actually trying to save to file, you're going to need some more logic. Right now, you're just rendering that table, and then returning it as a response which will show up in your done function. You're going to add some more logic in order to make it actually download. This question entails your exact problem. Good luck!
has comment: http://stackoverflow.com/comment/45267571
has comment: http://stackoverflow.com/comment/45267775
has comment: http://stackoverflow.com/comment/45302790
has comment: http://stackoverflow.com/comment/45299206
has comment: http://stackoverflow.com/comment/45268319
answers question: http://stackoverflow.com/q/28471323
score: 0
has comment: http://stackoverflow.com/comment/45342364

http://stackoverflow.com/comment/45524236
score: 0
type: AnswerComment
has text: Thanks for your reply, even my issue was on the wrong keyword, I need to do fromJSON as how I was receiving the object. Thanks!
type: Comment
comment on: http://stackoverflow.com/a/28491955

http://stackoverflow.com/q/28449885
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/28450551
upvote count: 3
has body: I'm trying to progressively enhance links in the PJAX style. I was planning on layering it on top of some regular prefetch &lt;link&gt;s: &lt;link rel="prefetch" href="next.html"/&gt; If the browser has already downloaded next.html, the PJAX request should just hit the cache, and no harm done. But of course, since the actual fetching of prefetch links is completely up to the browser, I can't know when that will be. I'd hate to subject users to a double download, so I've considered just taking the &lt;link&gt; off. But browsers have started preloading/rendering on the &lt;link rel="next"/&gt; tag too, which complicates things. If XMLHttpRequest hits an "in-flight" download, what kind of browser behaviors can I expect? I'm trying to do my own research, but it's fraught with race conditions and other nastiness.
downvote count: 1
type: Question
tagged with: javascript
tagged with: prefetch
has answer: http://stackoverflow.com/a/28450551
answer count: 1
has title: What happens if I XMLHttpRequest for a currently downloading file?
favorite count: 0
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28447618
tagged with: drop-down-menu
favorite count: 0
has title: Bootstrap dropdown menu doen't work
type: UnansweredQuestion
tagged with: spring-mvc
tagged with: twitter-bootstrap
tagged with: java
has comment: http://stackoverflow.com/comment/45223977
upvote count: 1
has body: I am trying to use a simple bootstrap dropdown menu but the menu doesn't dropdown when clicking on it. (I am working with java spring mvc 4) TEST Home Profile Messages Dropdown Profile Messages It works fine when testing it: enter link description here. I have tried many suggestions but nothing solve the problem. Thanks, Mike
downvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28449258
has comment: http://stackoverflow.com/comment/45223917
score: 0
answer count: 1

http://stackoverflow.com/comment/45426025
has text: @AndreiNikolaenko, that a good comment, please make it as answer and I will accept it.
score: 0
comment on: http://stackoverflow.com/q/28556762
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45414972
score: 0
type: AnswerComment
type: Comment
has text: download the file and take a look if you can please :D
comment on: http://stackoverflow.com/a/28549205

http://stackoverflow.com/comment/45217214
type: QuestionComment
has text: Please define "it doesn't work".
score: 3
comment on: http://stackoverflow.com/q/28443814
type: Comment

http://stackoverflow.com/comment/45228935
type: Comment
type: QuestionComment
has text: Possible duplicate of http://stackoverflow.com/questions/5448545/how-to-retrieve-get-parameters-from-javascript
comment on: http://stackoverflow.com/q/28450483
score: 0

http://stackoverflow.com/q/28588946
answer count: 3
tagged with: transform
tagged with: javascript
type: UnansweredQuestion
tagged with: kendo-ui
has answer: http://stackoverflow.com/a/35569025
has answer: http://stackoverflow.com/a/32062708
has title: How to change pointer length in Kendo radial gauge
type: Question
has body: You can change the width of the pointer by setting the cap:size value, but I need to change the length of the pointers so that they are in a tiered fashion representing 5 different points in time. How can this be done? function createGauge() { $("#gauge").kendoRadialGauge({ pointer: [{ value: 10, color: "#c20000", cap: { size: 0.19 } }, { value: 70, color: "#ff7a00", cap: { size: 0.15 } }, { value: 140, color: "#ffc700", cap: { size: 0.11 } }, { value: 350, color: "#ffe700", cap: { size: 0.07 } }, { value: 313, color: "#fff700", cap: { size: 0.03 } }], scale: { minorUnit: 5, startAngle: 90, endAngle: 450, max: 360 } }); } $(document).ready(function() { createGauge(); $("#example .slider").each(function() { $(this).kendoSlider({ min: 0, max: 360, showButtons: true, change: function() { var id = this.element.attr("id"); var pointerIndex = id.substr(id.length - 1); var gauge = $("#gauge").data("kendoRadialGauge"); gauge.pointers[pointerIndex].value(this.value()); } }); }); $("#getValues").click(function() { alert("All values: " + $("#gauge").data("kendoRadialGauge").allValues().join(", ")); }); $("#setValues").click(function() { var values = $("#newValues").val().split(","); values = $.map(values, function(val) { return parseInt(val); }); $("#gauge").data("kendoRadialGauge").allValues(values); }); $(document).bind("kendo:skinChange", function(e) { createGauge(); }); }); #gauge { width: 33em; height: 33em; //margin: 0 auto 0; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="http://cdn.kendostatic.com/2014.3.1411/js/kendo.all.min.js"&gt;&lt;/script&gt; &lt;div id="gauge-container"&gt; &lt;div id="gauge"&gt;&lt;/div&gt; &lt;/div&gt;
tagged with: kendo-gauge
has answer: http://stackoverflow.com/a/67725305
tagged with: css
score: 0

http://stackoverflow.com/comment/45274282
type: QuestionComment
comment on: http://stackoverflow.com/q/28475247
score: 0
type: Comment
has text: Can't believe I overlooked something so simple like that. My directive for file uploads was set to 2M -_-. Thank you Kai, you should post your comment as an answer and I will accept.

http://stackoverflow.com/comment/45338569
has text: The second will work if the parameter of the method is named `id` and your using the default route. If the parameter is named `parameterId` then you need to define a route that has `url: "{controller}/{action}/{parameterId}",`
comment on: http://stackoverflow.com/q/28509647
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28539925
accepted answer of: http://stackoverflow.com/q/28538872
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28538872
has body: First, run npm install This will install the required dependencies. You can then use npm test See here: https://github.com/node-opcua/node-opcua/blob/master/package.json#L15 That will run the tests using Mocha.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45396842
has comment: http://stackoverflow.com/comment/45395515
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45395208

http://stackoverflow.com/a/29793384
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28489248
has body: You can choose any name you want for your variable: foo = new Layer ({ height:40, width:40 }) console.log(foo.height) If you already have a variable with a layer, you can store it in a different one: var test2=test;

http://stackoverflow.com/a/28513766
has comment: http://stackoverflow.com/comment/45345622
has comment: http://stackoverflow.com/comment/45345914
has comment: http://stackoverflow.com/comment/45345788
upvote count: 1
has comment: http://stackoverflow.com/comment/45345899
has comment: http://stackoverflow.com/comment/45345729
answers question: http://stackoverflow.com/q/28513498
has comment: http://stackoverflow.com/comment/45345579
accepted answer of: http://stackoverflow.com/q/28513498
has comment: http://stackoverflow.com/comment/45345683
has comment: http://stackoverflow.com/comment/45345654
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45345720
score: 1
has comment: http://stackoverflow.com/comment/45345999
has comment: http://stackoverflow.com/comment/45345857
has body: If all you are wanting to know is if it can be done. Yes it is doable. In both CasperJS and PhantomJS. For that matter it can be done in vanilla Javascript. this.fillSelectors('form#contact', { 'input[name = name ]' : 'John Doe', 'input[name = email ]' : 'xyz@email.com', 'input[name = phone ]' : '123456789' }); CasperJS provides four functions to fill by name, CSS3 selector, label or XPath expression.
type: Answer

http://stackoverflow.com/comment/45481314
type: Comment
comment on: http://stackoverflow.com/a/28546080
has text: What does not work about the example I put forth above?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45293230
comment on: http://stackoverflow.com/q/28485526
has text: Start by studying the simple example given in: http://www.w3schools.com/jsref/event_onclick.asp
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45386578
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28535300
type: AnswerComment
has text: There wasn't any changes to the JavaScript code right? (no difference that I could spot). I did reset the CSS styles in my actual website (but didn't do so in the fiddle), so I guess that's not the problem.

http://stackoverflow.com/q/28585541
tagged with: asp.net-mvc-4
type: AnsweredQuestion
has title: Why does MVC4 validate js auto adds number validation to datetime?
has answer: http://stackoverflow.com/a/28601841
type: Question
tagged with: asp.net-mvc
tagged with: javascript
has answer: http://stackoverflow.com/a/28589024
has body: I've recently upgraded to MVC 4 and use validate.js and validate.unobtrosive.js for client side validation. Since MVC 4 I notice the html ouput has changed. MVC3: &lt;input class="dutchDate date_datepicker hasDatepicker" id="FirstDate" name="FirstDate" type="text" value="18-02-2015"&gt; MVC4: &lt;input class="dutchDate date_datepicker hasDatepicker" data-val="true" data-val-number="Waarde moet numeriek zijn" id="FirstDate" name="FirstDate" type="text" value="18-02-2015"&gt; So now the datetime field gets validated by my custom validation AND by the number validation. I don't understand why the number validation is being added to the input tag. Has some experienced the same? I don't want number validation on my date input. Model: public class TripFilter : IResultFilter { ... [DataType(DataType.Date)] [DisplayFormat(DataFormatString = "{0:dd-MM-yyyy}", ApplyFormatInEditMode = true)] public DateTime? FirstDate { get; set; } [DataType(DataType.Date)] [DisplayFormat(DataFormatString = "{0:dd-MM-yyyy}", ApplyFormatInEditMode = true)] public DateTime? UntilDate { get; set; } ... } Renderering: @Html.TextBox("", dt.ToString("dd-MM-yyyy"), new { @class = ViewData["class"] + " dutchDate date_datepicker", @type = "text" } Edit After some checking in the Global asax I've noticed the following line: ModelValidatorProviders.Providers.Add(new ClientNumberValidatorProvider()); Which does the following: public class ClientNumberValidatorProvider : ClientDataTypeModelValidatorProvider { public override IEnumerable&lt;ModelValidator&gt; GetValidators(ModelMetadata metadata, ControllerContext context) { bool isNumericField = base.GetValidators(metadata, context).Any(); if (isNumericField) yield return new ClientSideNumberValidator(metadata, context); } } public class ClientSideNumberValidator : ModelValidator { public ClientSideNumberValidator(ModelMetadata metadata, ControllerContext controllerContext) : base(metadata, controllerContext) { } public override IEnumerable&lt;ModelValidat…
score: 0
accepted answer: http://stackoverflow.com/a/28601841
answer count: 3
tagged with: validation
possible better answer: http://stackoverflow.com/a/28587188
has answer: http://stackoverflow.com/a/28587188

http://stackoverflow.com/q/28445431
tagged with: function
tagged with: javascript
tagged with: variables
score: 0
has answer: http://stackoverflow.com/a/28445460
answer count: 4
has answer: http://stackoverflow.com/a/28445445
has answer: http://stackoverflow.com/a/28445501
has answer: http://stackoverflow.com/a/28445503
has comment: http://stackoverflow.com/comment/45220278
has title: Javascript function will not work
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28445503
type: Question
has body: Everytime I run the script, it says: party is undefined Here's what I got: party() var party = function (name){ alert("You must find your way into the party and kill the VIP") }; It won't run on any js website. What should I do?
accepted answer: http://stackoverflow.com/a/28445460

http://stackoverflow.com/comment/45468829
type: QuestionComment
has text: Your code is working fine...? https://jsfiddle.net/f71L1esa/1/
comment on: http://stackoverflow.com/q/28580298
score: 1
type: Comment

http://stackoverflow.com/comment/45361737
type: QuestionComment
comment on: http://stackoverflow.com/q/28521993
has text: @miro You're right but so am I^^ The incrementation is part of the `$('#anc_add_more').click(...)` event handler. But the decrementation part is in a function that isn't called by the dynamically added inputs - that's what I've missed... :|
score: 0
type: Comment

http://stackoverflow.com/comment/79854304
score: 0
type: Comment
comment on: http://stackoverflow.com/a/44258565
type: AnswerComment
has text: Thanks @eric ... I have edited the code as suggested to allow an infinite number of focus fields.

http://stackoverflow.com/q/28591922
accepted answer: http://stackoverflow.com/a/28598148
type: AnsweredQuestion
score: -1
tagged with: knockout.js
type: Question
tagged with: durandal-2.0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I want to load my page based on default item selected in the combobox and reload on changing selected item (knockout). Currently what I am doing is loading the form on click of a button. Here is my code. Please suggest me as I am very new to knockout. html: Load employee js: var filterVM = function () { this.employeeList = ko.observableArray(); this.selectedEmployeeList = ko.observable(); }; dataService.getEmployeeLists(this.viewData.EmployeeId).then(loadEmployeeLists).then(enableControls); filterVM.prototype.load = function () { var selectedEmployeeList = this.selectedEmployeeList(); var self = this; if (selectedEmployeeList) { disableControls(); dataService.getEmployeeByEmployeeList(this.viewData.employeeId, selectedEmployeeList.id) .done(loadPEmployeeSpread); } };
has title: Load Spread based on default item selected in the combobox and reload on changing selected item (knockout)
upvote count: 0
downvote count: 1
has answer: http://stackoverflow.com/a/28598148

http://stackoverflow.com/q/28467855
tagged with: javascript
has title: Swipe menu nav cordova
score: 0
answer count: 1
tagged with: angularjs
has body: I make my first app with cordova/Angularjs. I trying to do a swipe menu nav like the YouTube app, Tinder app etc. Who when you swipe, the menu follow your finger. Not the simply swipe. Is it possible with angular without Jquery? Thanks.
type: AnsweredQuestion
tagged with: cordova
accepted answer: http://stackoverflow.com/a/28468125
type: Question
has answer: http://stackoverflow.com/a/28468125

http://stackoverflow.com/a/44621275
type: Answer
answers question: http://stackoverflow.com/q/28527561
has body: A good way to do it asynchronously would be to use the each function in the async module: https://caolan.github.io/async/docs.html#each var async = require("async"); async.each(maillist, function(to, callback){ msg.to = to; smtpTransport.sendMail(msg, function (err) { if (err) { console.log('Sending to ' + to + ' failed: ' + err); callback(err); } else { console.log('Sent to ' + to); callback(); } }); }, function(err){ if(err){ console.log("Sending to all emails failed:" + err); } //Do other stuff or return appropriate value here });
upvote count: 4
downvote count: 0
score: 4

http://stackoverflow.com/comment/45327006
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28503795
has text: Thanks guys I solved the problem: first of all in my markup code I should have "input data-bind=value" and not "input data-bind=text" and second I must call ko.applyBindings(obj); after ko.track(obj); Now every seems to work
type: Comment

http://stackoverflow.com/q/28483969
has answer: http://stackoverflow.com/a/28483988
possible better answer: http://stackoverflow.com/a/28483988
accepted answer: http://stackoverflow.com/a/28484045
type: AnsweredQuestion
score: 0
has title: jquery function on event
type: Question
answer count: 2
has body: I have this short piece of code, it should be executed when loading the page and not on the attached event. I can't figure out how to do that. Can someone help me out ? $("#set_strokes_show input").on('click touchstart', function(e) { live.tiles.strikes_toggle($("input[name='set_strokes_shw']:checked").val() == '1'); });
has comment: http://stackoverflow.com/comment/45289918
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28484045

http://stackoverflow.com/comment/45393949
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28501974
has text: Page.error returns this: `Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file:///usr/lib/node_modules/casperjs/bin/bootstrap.js. Domains, protocols and ports must match.`
score: 0

http://stackoverflow.com/comment/45482464
type: Comment
comment on: http://stackoverflow.com/a/28587716
score: 0
type: AnswerComment
has text: @BenDiamant - not at all clean! Mathew, your controller is now aware of the View - it should be View-agnostic

http://stackoverflow.com/comment/45267557
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28471661
has text: Real data is too large. Anyway I am posting.

http://stackoverflow.com/comment/45458382
comment on: http://stackoverflow.com/a/28562398
score: 0
type: AnswerComment
has text: This is awesome! Thanks so much. The only problem now is that if I hover over an item with a tooltip too close to the edge of the screen then it makes the tooltip display too small. Is there a way to get around that? Perhaps putting the tooltip below the cursor would help?
type: Comment

http://stackoverflow.com/comment/45287853
type: QuestionComment
has text: Check my answer. you're not passing anything in for x and y on the second call to `checkNumbers`
comment on: http://stackoverflow.com/q/28482501
score: 1
type: Comment

http://stackoverflow.com/comment/45362777
has text: I really don't understand your requirements. How do you know that `RAC -` is an artist name?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28523051

http://stackoverflow.com/comment/45366605
score: 0
type: QuestionComment
has text: I don't understand how to handle it then?
type: Comment
comment on: http://stackoverflow.com/q/28525319

http://stackoverflow.com/comment/45484979
has text: Looks like this should be an answer @FrankvanPuffelen
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28561758
score: 0

http://stackoverflow.com/q/28522075
has title: JavaScript function always run bottom code
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28522283
tagged with: function
accepted answer: http://stackoverflow.com/a/28522197
tagged with: jquery
has body: I have this partially working code. What it suppose to do is to check for existing email address in database. If no email exist then return true; $(document).ready(function() { var email_check = 0; var checking_html = '&lt;img src="http://i.imgur.com/Y8wXAZp.gif" /&gt; Checking...'; var characters_error = 'Minimum amount of chars is 6'; //when button is clicked $('.register').click(function(){ //run the character number check if($('#email').val().length &lt; 1){ $('#email_result').html(characters_error); return false; } else{ //else show the cheking_text and run the function to check $('#email_result').html(checking_html); alert(check_email_availability()); } }); }); //function to check email availability function check_email_availability(){ //get the email var email = $('#email').val(); //use ajax to run the check $.post("check_email.php", { email: email }, function(result){ email_check = 0; //if the result is 1 if(result == 1){ //show that the email is available email_check = 1; }else{ email_check = 0; } }); if (email_check == 1){ return true; }else{ return false; } } Now, the problem is if current state is false, when I enter an email that is not available in the db and click button, I still get false alert, and when the next time I click button I get true alert. For some reason the function execute bottom code first (checking email_check value) and after that it execute the function. Why is that? What is wrong with my code? How can I make it execute function and then check the email_check value whether 1 or not?
has comment: http://stackoverflow.com/comment/45360900
has answer: http://stackoverflow.com/a/28522197
has comment: http://stackoverflow.com/comment/45360920
type: AnsweredQuestion
type: Question
possible better answer: http://stackoverflow.com/a/28522283
tagged with: javascript

http://stackoverflow.com/q/28537892
has body: we register our Services in a base page : protected void RegisterService(string path) { ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference(path)); } and then in the client side ( javascript ) - we address them with : Invoice.{serviceName}.{functionName} the "Invoice" is the name space , without the SSL ( without https:// ) there is no problem addressing the WCF from the js file , with the SSL - it doesn't recognize our services - notice that the web.config is set to https , also when trying to approach them directly : https://domain.com/{serviceName}.svc it works fine. any ideas ?
tagged with: ssl
tagged with: javascript
tagged with: webforms
score: 0
has comment: http://stackoverflow.com/comment/45389788
has comment: http://stackoverflow.com/comment/45391253
tagged with: asp.net
has title: problems with accessing services via jquery with ssl / https
tagged with: wcf
type: UnansweredQuestion
answer count: 0
type: Question

http://stackoverflow.com/comment/45344566
comment on: http://stackoverflow.com/q/28513078
has text: Edit: Progress https://jsfiddle.net/m19aojmu/5/ (I'm new in the website, so I can't post more than 2 links in a post because of my reputation, that's why I use a comment)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28579682
type: Answer
has comment: http://stackoverflow.com/comment/45471117
score: 1
upvote count: 1
has body: Try this: header("location: http://example.com"); exit(); exit() is must, else the codes after header will be executed.
downvote count: 0
has comment: http://stackoverflow.com/comment/45468871
answers question: http://stackoverflow.com/q/28579646

http://stackoverflow.com/comment/45456726
type: Comment
comment on: http://stackoverflow.com/a/28569892
has text: @omega, it should work no matter how you navigate. The ui.toPage will be the page you are going to no matter the direction...
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45261497
score: 0
type: Comment
has text: How does this work within {{#each portfolioItems}} {{> portfolioItem}} {{/each}}
comment on: http://stackoverflow.com/a/28467625
type: AnswerComment

http://stackoverflow.com/a/28483841
has comment: http://stackoverflow.com/comment/45290052
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28483599
answers question: http://stackoverflow.com/q/28483599
has body: jsfiddle demo you need to parse the value to an integer otherwise it get treated as a string so it will concatenate instead of add together. count = parseInt($('#book-qty').val()); Also you need to specify a default value for your inputs like stated by Mex.
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/q/28582804
type: UnansweredQuestion
tagged with: sockets
has body: I want to do a task with node js console application which follows the following algorithm: Connect datacard via code (Get a new static IP) Do some operations via that IP On call back of the above operation disconnnect the data card Loop back to step 1 Is there any way I can accomplish this via Node.js?? I've found the solutions for C/C++ and C# but not for node js.. Can anyone please help??
tagged with: node.js
score: 2
has comment: http://stackoverflow.com/comment/45602262
upvote count: 3
has comment: http://stackoverflow.com/comment/45601964
downvote count: 1
linked to: http://stackoverflow.com/q/1056784
type: Question
has answer: http://stackoverflow.com/a/28687142
has title: Connect and disconnect data card using node JS
tagged with: javascript
has comment: http://stackoverflow.com/comment/45602463
answer count: 1
has comment: http://stackoverflow.com/comment/45601936
has comment: http://stackoverflow.com/comment/45600889
favorite count: 0

http://stackoverflow.com/a/28494993
downvote count: 0
has body: HTML 3 CSS #icon { height:100px; width:100px; background-color:#bbb; position:relative; } #not { position:absolute; top:-10px; right:-10px; background-color:#f00; width:20px; height:20px; color:#fff; border-radius:20px -moz-border-radius:20px; -webkit-border-radius:20px; text-align:center; border:2px solid #fff; } JQuery $(document).ready(function(){ if($("#not").html()=="0") $("#not").hide(); }); Attached Fiddle
type: Answer
has comment: http://stackoverflow.com/comment/45309892
upvote count: 3
answers question: http://stackoverflow.com/q/28494814
score: 3
has comment: http://stackoverflow.com/comment/45309861
has comment: http://stackoverflow.com/comment/45309911

http://stackoverflow.com/comment/45212762
has text: You have to add information. Where is your HTML and the rest of the CSS?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28441505

http://stackoverflow.com/a/36743370
answers question: http://stackoverflow.com/q/28478945
has comment: http://stackoverflow.com/comment/79319657
has body: This is one of the top hits on Google for "React Component not updating", so although the answer has been well accepted, I think it could be misleading. The checkbox type doesn't require the onChange. I am not sure if this has changed since the answer was posted (current version of React is v15 - 2016-04-20). See the following example of it working without an onChange handler (see JSBIN): class Checky extends React.Component { render() { return ( ); } } class App extends React.Component { constructor(props) { super(props); this.state = { checked: true }; } render() { return ( { this.setState({ checked: !this.state.checked }); }}>Toggle <Checky checked={this.state.checked} /> ); } } React.render(<App />, document.body); Another side note - a lot of answers (for similar questions) simply recommend "defaultChecked" - although this works, it is usually a half measure.
downvote count: 0
type: Answer
score: 8
upvote count: 8
has comment: http://stackoverflow.com/comment/79315450

http://stackoverflow.com/comment/45348653
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28515403
has text: Why do you want sort array on update? You sort it when you push it to client, in DB it isnt sorted

http://stackoverflow.com/q/28475700
tagged with: node.js
tagged with: c++
downvote count: 0
answer count: 0
type: UnansweredQuestion
score: 2
tagged with: http://stackoverflow.com/tag/c
has title: wrap a x86 C dll symbols into nodejs javascript
type: Question
upvote count: 2
tagged with: javascript
has body: I have a dll compiled with mingw gcc toolchain (32bits). I want to wrap a symbol into a javascript function. I did the following code : binding.gyp { "targets": [ { "target_name": "hellomod", "sources": [ "hellomod.cc" ], "include_dirs": [ "&lt;!(node -e \"require('nan')\")" ], "libraries": [ "C:\\juan\\repos\\sandbox\\node\\dll_module\\hello_lib\\hello.lib" ] } ] } hellomod.cc #include &lt;nan.h&gt; extern "C" { __declspec( dllimport ) void hello(char *name); } using namespace v8; NAN_METHOD(Method) { NanScope(); hello("Juan"); NanReturnValue(String::New("Hello world")); } void Init(Handle&lt;Object&gt; exports) { exports-&gt;Set(NanSymbol("hello"), FunctionTemplate::New(Method)-&gt;GetFunction()); } NODE_MODULE(hellomod, Init) package.json { "name": "hello", "version": "0.0.1", "description": "Mon premier package dll", "main": "index.js", "scripts": { "test": "node index.js" }, "author": "Juan", "license": "MIT", "dependencies": { "nan": "^1.6.1" }, "gypfile": true } When I do the command node-gyp rebuild I get the following error : hellomod.obj : error LNK2001: unresolved external symbol __imp_hello [c:\juan\r epos\sandbox\node\dll_module\hello\build\hellomod.vcxproj] c:\juan\repos\sandbox\node\dll_module\hello\build\Release\hellomod.node : fatal error LNK1120: 1 unresolved externals [c:\juan\repos\sandbox\node\dll_module\h ello\build\hellomod.vcxproj] Note: The project works well on a windows xp 32bits with visual studio 2010, and not on windows 7.1 with visual studio 2012. You can have a look at https://github.com/JuanTrochez/sandbox/tree/master/node/dll_module for the exact code. Thanks.
favorite count: 0
tagged with: node-gyp

http://stackoverflow.com/comment/45375489
score: 0
type: Comment
has text: Yes will reply within 24 hours.
comment on: http://stackoverflow.com/a/28460328
type: AnswerComment

http://stackoverflow.com/q/28508955
tagged with: drupal-theming
tagged with: zurb-foundation
score: 1
type: UnansweredQuestion
upvote count: 1
tagged with: drupal
type: Question
tagged with: drupal-7
has answer: http://stackoverflow.com/a/28509121
has body: I try to load Foundation in my new "player" theme. It is a theme I make from scratch. For now I am trying to load foundation.min.js in a preprocess : function player_preprocess_page(&amp;$variables, $hook) { $options = array('scope' =&gt; 'footer', 'weight' =&gt; 1000 ); drupal_add_js(drupal_get_path('theme', 'player') . '/js/foundation.min.js', $options); $foundation='jQuery(document).foundation();'; $options['type']='inline'; drupal_add_js($foundation, $options); } When I load my site, I have two Uncaught ReferenceError: jQuery is not defined errors (once for the foundation.min.js, once for jQuery(document).foundation(); ) First I thought that is because jQuery is loaded after jQuery(document).foundation(); but it seems default files, including jQuery, are loaded in the header (I did a var_dump to check.) And my script are laoded in the footer 'misc/drupal.js' 'misc/jquery.js' 'misc/jquery.once.js' 'sites/all/themes/player/js/theme.js' 'sites/all/themes/player/js/uikit.js' 'misc/jquery.cookie.js' 'misc/jquery.form.js' 'misc/progress.js' 'misc/ajax.js' 'misc/ui/jquery.ui.core.min.js' 'misc/ui/jquery.ui.widget.min.js' 'misc/ui/jquery.ui.mouse.min.js' 'misc/ui/jquery.ui.draggable.min.js' 'misc/ui/jquery.ui.resizable.min.js' 'sites/all/modules/devel_themer/devel_themer.js' 'sites/all/modules/devel/devel_krumo_path.js' 'sites/all/modules/devel/krumo/krumo.js' 'misc/jquery.ba-bbq.js' 'modules/overlay/overlay-parent.js' 'modules/toolbar/toolbar.js' So I don't understand. It surely a common case but I don't find any help resource on the net.
downvote count: 0
answer count: 1
tagged with: javascript
has title: How to order javascript files in Drupal 7 to load Foundation 5
favorite count: 0

http://stackoverflow.com/a/28589897
has body: I assume this should do the trick: var target = new js.JsObject.fromBrowserObject(e)['target'] .callMethod('getContainer', []);
has comment: http://stackoverflow.com/comment/45508975
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45508400
has comment: http://stackoverflow.com/comment/45508313
has comment: http://stackoverflow.com/comment/45508809
accepted answer of: http://stackoverflow.com/q/28584388
upvote count: 2
answers question: http://stackoverflow.com/q/28584388
type: AcceptedAnswer

http://stackoverflow.com/comment/47945335
has text: @Dave was it so hard to comment?
comment on: http://stackoverflow.com/a/28559594
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/45401562
has text: Are you just looking to just remove occurrences in a string, or from the DOM?
type: QuestionComment
comment on: http://stackoverflow.com/q/28544037
score: 0
type: Comment

http://stackoverflow.com/comment/45376371
comment on: http://stackoverflow.com/a/28529469
score: 0
type: AnswerComment
has text: anyway thanks for you're help ;), i will update this thread when i have found a suitable solution
type: Comment

http://stackoverflow.com/comment/45414789
has text: Why i didnt got the bounties :( .
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28540197

http://stackoverflow.com/q/28555275
answer count: 0
has title: Full Calendar + Access Dates via Nested JSON Feed
type: UnansweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
type: Question
tagged with: javascript
tagged with: fullcalendar
has body: I am working on trying to implement Full Calendar via a JSON feed. I am having issues getting the data to derive from a nested object: Data: [{"id":22,"weeks":[{"title":"Testing New Filter","start":"2015-01-19","end":"2015-01-29","url":"http://localhost:3000/campaigns/testing-new-filter"},{"title":"Not this Feed","start":"2015-02-24","end":"2015-03-07","url":"http://localhost:3000/campaigns/not-this-feed"}]},{"id":23,"weeks":[]}] Calendar Implementation: $('#calendar').fullCalendar({ eventSources: [ // your event source { url: parser.pathname + '.json', error: function() { alert('there was an error while fetching events!'); }, color: 'yellow', // a non-ajax option textColor: 'black' // a non-ajax option } // any other sources... ] }); Stuck on how I get the data to pull from the 'weeks' start which is the child element
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/28489891
tagged with: drupal-modules
tagged with: javascript
tagged with: google-maps-api-3
score: 0
has body: I have a Google Maps script that I had to custom create because it has several polygons, event listeners, markers, and infowindows, and from what I read, the Google Maps API module can't handle things that are that complicated. I tried using the gmap module to make a map, and I was able to do that, but I was not able to do all the things I wanted to, so I turned to using JS. Now, I would like this script to populate on either a node that I can promote on the front page, or directly on the front page, but nowhere else. I've searched the internet for how to do this, and most tutorials on adding custom JS onto Drupal have to do with theming, and all the tutorials I have followed on creating a custom module don't work for me. How can I accomplish what I'm looking to do? Help!
answer count: 2
tagged with: google-maps
has answer: http://stackoverflow.com/a/28492555
has answer: http://stackoverflow.com/a/28494728
type: UnansweredQuestion
has title: Drupal 7.x: Using Google Maps JS in a custom module for complex map
type: Question
tagged with: drupal-7

extjs4.1
tags question: http://stackoverflow.com/q/28580190
tag name: extjs4.1
type: Tag
tags question: http://stackoverflow.com/q/28578703

http://stackoverflow.com/comment/45275949
type: Comment
comment on: http://stackoverflow.com/a/28475274
score: 0
type: AnswerComment
has text: @Stephan: please check now, I've updated the code.

http://stackoverflow.com/comment/45428610
has text: I am using uiwebview because all data is coming in HTML format from server. Thats why I am not using available controls
comment on: http://stackoverflow.com/q/28557949
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28449622
score: 7
upvote count: 7
has answer: http://stackoverflow.com/a/28450002
type: Question
answer count: 2
has title: change focus to the next input text with angularjs
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/18086865
accepted answer: http://stackoverflow.com/a/28450002
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has body: I have an object variable in my controller (var myObject), divided into 3 input text in the IHM. I want to change automatically the focus to the next input when the focused one reached the maxLength. var myObject = { part1:"", part2:"", part3:"" } &lt;form&gt; &lt;input type="text" id="part1" ng-model="myObject.part1" maxlength="7"/&gt; &lt;input type="text" id="part2" ng-model="myObject.part2" maxlength="12"/&gt; &lt;input type="text" id="part2" ng-model="myObject.part2" maxlength="12"/&gt; &lt;/form&gt;
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/44258565
has answer: http://stackoverflow.com/a/44258565
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/61478687

http://stackoverflow.com/a/28471519
has body: Add an id to your anchor tag, for example &lt;a id='id001' href='....' then do document.getElementById("id001").addEventListener("click", function() { redirect(subdomain);});
type: Answer
score: 0
accepted answer of: http://stackoverflow.com/q/28471262
answers question: http://stackoverflow.com/q/28471262
type: AcceptedAnswer

http://stackoverflow.com/comment/45435537
type: Comment
has text: Write your version of jQuery, it's pretty straightforward!
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28561929

http://stackoverflow.com/q/28490029
tagged with: jquery
has title: Prevent jQuery action from happening a second time on scroll
has body: I have some code that detects if an element is in the viewport and then fires some code, it does this by calculating the distance from the top on scroll, the issue I'm having is it re-runs the code every time a scroll event happens and the element is above the fold, is there a way to make it so it only fires once? $(document).ready(function(){ $(document).scroll(function(){ var scrollTop = $(window).scrollTop(), elementOffset = $('.numbers').offset().top, distance = (elementOffset - scrollTop); if(distance &lt; $(window).height()){ $('.ones').delay(1000).hide(1000, function(){ $(this).html('6').show(1000, function(){ $(this).delay(15000).hide(1000, function(){ $(this).html('5').show(1000); }); }); }); }else{ return false; } }); });
type: AnsweredQuestion
tagged with: scroll
has answer: http://stackoverflow.com/a/28490067
type: Question
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28490067
answer count: 1

http://stackoverflow.com/comment/45305881
type: Comment
comment on: http://stackoverflow.com/a/28492511
has text: Good question - you should be safe just canceling the string if you'd like, but to check if it's a promise, I guess I would check to see if the object has a function called 'then' attached. I'll update my answer.
score: 1
type: AnswerComment

http://stackoverflow.com/comment/45411191
type: Comment
has text: `x` isn't needed as it can be grabbed from `(/./)["constructor"]`. Unless answers for the last 4 letters pop up, you will most likely get the accepted answer
type: AnswerComment
comment on: http://stackoverflow.com/a/28548667
score: 0

dialog
tag name: dialog
tags question: http://stackoverflow.com/q/28449639
tags question: http://stackoverflow.com/q/28566056
tags question: http://stackoverflow.com/q/28564581
type: Tag

http://stackoverflow.com/q/28479564
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28480061
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/45282059
has comment: http://stackoverflow.com/comment/45282093
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45282063
has comment: http://stackoverflow.com/comment/45281948
has comment: http://stackoverflow.com/comment/45282033
possible better answer: http://stackoverflow.com/a/28480019
has comment: http://stackoverflow.com/comment/45282220
has answer: http://stackoverflow.com/a/28480019
has comment: http://stackoverflow.com/comment/45282071
has title: How to call function only if certain element is loaded and in markup
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45281888
has body: I'm using an external API which builds up a div structure (on page load it adds .build-div) in my markup. I want to modify this structure with JS/jQuery. Question: How can I call a function as soon as the markup is there to manipulate. My attempt: function changeStructure() { $('.build-div').appendTo('.another'); }; window.onload = changeStructure; but it seems that this doesn't work. What works is: function changeStructure() { setTimeout(function() { $('.build-div').appendTo('.another'); }, 500) }; window.onload = changeStructure; but I don't want to hardcode any guessed timeouts in order to make the function work. So how can I detect if an element is there and fire the function as soon as it is possible. Thanks
has answer: http://stackoverflow.com/a/28480028
has comment: http://stackoverflow.com/comment/45281950
type: Question
has comment: http://stackoverflow.com/comment/45282265
has answer: http://stackoverflow.com/a/28480061

http://stackoverflow.com/comment/45340875
has text: +1. Good spot. I also think this is the correct answer. @GirishMahindrakar, you have simply malformed initialization options :)
score: 0
comment on: http://stackoverflow.com/a/28473164
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45314018
comment on: http://stackoverflow.com/q/28497236
type: QuestionComment
has text: may be it works on second click, the value of '<?php echo get_user_name(); ?>' is same always, so not noticeable..? Btw, you didn't show getpassword() function …?
type: Comment
score: 2

http://stackoverflow.com/a/28617563
has comment: http://stackoverflow.com/comment/45629961
upvote count: 2
has comment: http://stackoverflow.com/comment/45646453
has comment: http://stackoverflow.com/comment/45645730
has comment: http://stackoverflow.com/comment/45645816
accepted answer of: http://stackoverflow.com/q/28558855
has comment: http://stackoverflow.com/comment/45643407
answers question: http://stackoverflow.com/q/28558855
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45630054
type: Answer
has body: Not sure what a "strong thing" is, but when someone is disconnected in Strophe, you should get errors from the script and it will update the Strophe.Status connection state. Strophe sends a post every 60 secs (unless otherwise specified). In your code it appears you're trying to check support. You should look for "Strophe.Status.CONNECTED" or "Strophe.Status.ATTACHED" prior to sending if that's your concern. You can also write a handler to manage the errors. In XEP 0184, you must include: &lt;request xmlns='urn:xmpp:receipts'/&gt; So your msg should look like (note, you must include an id per XEP 0184): $msg({ to: tojid, from: fromjid, type: "chat", id: "sometrackingid"}).c('body').t("bodytxt").up().c("request", { xmlns: "urn:xmpp:receipts"}); You will then need to modify you message handler or create a separate handler to manage the receipts.

http://stackoverflow.com/q/28516895
tagged with: asp.net-mvc
has title: Convert text back to HTML in C#
tagged with: javascript
has comment: http://stackoverflow.com/comment/45351231
has comment: http://stackoverflow.com/comment/45351267
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45351175
tagged with: model-view-controller
has body: In my JavaScript code I'm converting some HTML to text, such that I'm able to POST the text to my controller without using attributes such as [Validation(false)] etc. Specifically, I'm doing this in my JavaScript: var emailBody = $('#SomeID').html(); var result = $('#SomeID').html(emailBody).text(); The result value holds around 10 lines of text including line breaks /n etc. I'm POST-ing this by doing: $.post('@Url.Action("ControllerMethod", "Controller")', { formId: formValue, emailBody: result}, function (data) { ... } My controller is able to receive the above text that is being POSTed. However, now that it's in the "backend" of the code, I need to convert this back to HTML somehow. How do I go about doing this? It's not terribly complex HTML that needs to be "restored" mainly &lt;p&gt; &lt;h3&gt; &lt;a href..&gt; tags. Is there a quick way to do this? Otherwise I could escape it on the JavaScript end: function htmlEscape(str) { return String(str) .replace(/&amp;/g, '&amp;amp;') .replace(/"/g, '&amp;quot;') .replace(/'/g, '&amp;#39;') .replace(/&lt;/g, '&amp;lt;') .replace(/&gt;/g, '&amp;gt;'); } and then do a similar inverse function in the backend. I'm not really sure how to handle this problem in the best way.
has answer: http://stackoverflow.com/a/28516993
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/45351172

http://stackoverflow.com/q/28559094
has comment: http://stackoverflow.com/comment/45429975
favorite count: 0
has title: pass one variable from one function to another in javascript
has body: After spending days on the web is still haven't found the answer I was looking for... I need to pass a variable from one function another, function a adds 1 when you click it, and function b substracts 1 from the number given in function a. so lets say I have this: var x = 0; function a() { x + 1; } function b() { x - 1; }
score: -2
has answer: http://stackoverflow.com/a/28559178
has comment: http://stackoverflow.com/comment/45432483
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45429779
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45429915
downvote count: 3
answer count: 2
has comment: http://stackoverflow.com/comment/45429908
tagged with: function
tagged with: javascript
has answer: http://stackoverflow.com/a/28559159
tagged with: jquery
has comment: http://stackoverflow.com/comment/45429831

http://stackoverflow.com/a/28576064
type: Answer
has body: if you are sure that the format is dd-MM-YYYY then split the string and switch it then parse it as a date. var date = '18-02-2015'; var input = date.split("-"); var dateObject = new Date(input[2] +"-"+ input[1] +"-"+ input[0]); console.log(dateObject); var year = dateObject.getFullYear(); //or without parsing simply var year = input[2];
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28575924
upvote count: 2

http://stackoverflow.com/a/28466388
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/28465901
score: 1
has body: The regular expression syntax is wrong, you're matching ( "zero or more" times by quantifying it with the * quantifier. Instead, you can use the . and make it a non-greedy match between. If the format can be repeating, I would place it inside of a group and use anchors. var ipRE = /^\s*(?:\d+\.){3}\d+\(.*?\)(?:,(?:\d+\.){3}\d+\(.*?\))*\s*$/ Note: It's much easier to use a regex literal here instead of a RegExp object.
upvote count: 1

http://stackoverflow.com/q/28577487
upvote count: 2
tagged with: twitter-bootstrap
accepted answer: http://stackoverflow.com/a/28586844
score: 2
type: AnsweredQuestion
tagged with: fullcalendar
type: Question
tagged with: bootstrap-popover
answer count: 1
has body: Code: http://jsfiddle.net/AzmJv/1008/ I am trying to create popover using Bootstrap Popover plugin when hover over an event in the calendar. However, I cannot find a way to bind popover() to a new event DOM after it's being created. I tried to use eventAfterRender event according to the doc, but it seems to be triggered for ALL events in the calendar. http://fullcalendar.io/docs/event_rendering/ HTML: &lt;div id='calendar'&gt;&lt;/div&gt; JS: $(document).ready(function () { $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, defaultDate: '2015-02-12', selectable: true, selectHelper: true, select: function (start, end) { var title = prompt('Event Title:'); var eventData; if (title) { eventData = { title: title, start: start, end: end }; // console.log(eventData); $('#calendar').fullCalendar('renderEvent', eventData, true); // stick? = true } $('#calendar').fullCalendar('unselect'); }, eventAfterRender: function (event, element, view) { console.log('eventAfterRender'); console.log(event); console.log(element); console.log(view); }, editable: true, eventLimit: true, // allow "more" link when too many events events: [{ title: 'All Day Event', start: '2015-02-01' }, { title: 'Long Event', start: '2015-02-07', end: '2015-02-10' }, { id: 999, title: 'Repeating Event', start: '2015-02-09T16:00:00' }, { id: 999, title: 'Repeating Event', start: '2015-02-16T16:00:00' }, { title: 'Conference', start: '2015-02-11', end: '2015-02-13' }, { title: 'Meeting', start: '2015-02-12T10:30:00', end: '2015-02-12T12:30:00' }, { title: 'Lunch', start: '2015-02-12T12:00:00' }, { title: 'Meeting', start: '2015-02-12T14:30:00' }, { title: 'Happy Hour', start: '2015-02-12T17:30:00' }, { title: 'Dinner', start: '2015-02-12T20:00:00' }, { title: 'Birthday Party', start: '2015-02-13T07:00:00' }, { title: 'Click for Google', url: 'http://google.com/', start: '2015-02-28' }] }); }); CSS: body { margin: 40px 10px; padding: 0; font-f…
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28586844
favorite count: 0
has title: Trigger once after event created using fullcalendar.io

http://stackoverflow.com/q/28583542
type: AnsweredQuestion
type: Question
has title: Validating numeric values using JavaScript
has answer: http://stackoverflow.com/a/28583763
has body: I have the following code. It works fine for blank fields, but it doesn't catch the other numeric exceptions. What am I doing wrong? function validateForm() { var a = document.forms["Form"]["percentage"].value; var b = document.forms["Form"]["minutes"].value; if (a == null || b == null || a == "" || b == "") { alert("Please Fill All Required Field"); return false; } else if (isNan(a) == true || isNan(b) == true) { alert("Please enter valid numeric values"); return false; } else if (parseInt(a) &gt; 100) { alert("Percentage can't exceed 100"); return false; } else if (parseInt(b) &lt; 0 || parseInt(a) &lt; 0) { alert("Values can't be negative"); return false; } }
tagged with: javascript
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28583763
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/28533324
downvote count: 0
has comment: http://stackoverflow.com/comment/45384983
has comment: http://stackoverflow.com/comment/45385259
type: Answer
has comment: http://stackoverflow.com/comment/45385434
upvote count: 2
has comment: http://stackoverflow.com/comment/45384717
has comment: http://stackoverflow.com/comment/45384887
answers question: http://stackoverflow.com/q/28525743
has body: Try referencing your js file in [dspace]\webapps\xmlui\themes\Mirage\sitemap.xmap inside the &lt;map:transform type="IncludePageMeta"&gt;. The default value looked like this: &lt;map:transform type="IncludePageMeta"&gt; &lt;map:parameter name="stylesheet.all" value="lib/css/media.css"/&gt; &lt;map:parameter name="javascript" value="lib/js/jquery-ui-1.8.15.custom.min.js"/&gt; &lt;map:parameter name="theme.path" value="{global:theme-path}"/&gt; &lt;map:parameter name="theme.name" value="{global:theme-path}"/&gt; &lt;/map:transform&gt; Change &lt;map:parameter name="javascript" value="lib/js/jquery-ui-1.8.15.custom.min.js"/&gt; to &lt;map:parameter name="javascript#1" value="lib/js/jquery-ui-1.8.15.custom.min.js"/&gt; and then add &lt;map:parameter name="javascript#2" value="lib/js/your-custom-js#1.js"/&gt; &lt;map:parameter name="javascript#3" value="lib/js/your-custom-js#2.js"/&gt; and so on and so forth. The lib/js directory by the way is located inside the Mirage theme folder. I would also suggest that you use firefox's firebug plugin to check for (javascript) errors or google chrome's inpector because you might encounter jquery conflict along the way. Hope this help.
has comment: http://stackoverflow.com/comment/45383883
score: 2

http://stackoverflow.com/comment/45295406
type: Comment
type: QuestionComment
has text: Please use an array literal it's easier and has a better performance. `var questionsArray = ["q1", "q2", "q3"]` and so on
comment on: http://stackoverflow.com/q/28464261
score: 0

http://stackoverflow.com/q/28567737
has comment: http://stackoverflow.com/comment/45448567
has comment: http://stackoverflow.com/comment/45446713
possible better answer: http://stackoverflow.com/a/28568993
has comment: http://stackoverflow.com/comment/45445836
type: AnsweredQuestion
has body: So I've got a unique problem. I've got a site that I can't edit the template for at all, I can only alter the embedded script. This embedded script is injected into the footer of the site in question. The embedded script relies on $(document).ready to kick itself off. The problem is, a script higher up on the page throws an error in it's $(document).ready function which prevents my $(document).ready from ever being called. I tried setting up a try .. catch block, like this, but I believe this will only work if my script is higher up on the page still. My question, is it possible to get my $(document).ready call to run, even if it's lower on the page, and a previous one has errors? In the site above my script: &lt;script type="text/javascript"&gt; jQuery(document).ready(function($) { $('#logo').vAlign(); }); &lt;/script&gt; .vAlign(); is not defined so it's throwing: Uncaught TypeError: undefined is not a function In my embedded js: jQuery(document).ready(function() { console.log('ready!'); }); I never see "ready!" in the console.
tagged with: wordpress
has answer: http://stackoverflow.com/a/28567875
has title: jQuery $(document).ready error blocking footer script
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/1890512
answer count: 2
accepted answer: http://stackoverflow.com/a/28567875
score: 2
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/28568993
favorite count: 0
upvote count: 2
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45295885
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/28487053
has text: This is correct. You would increase overhead if you checked for the class before removing it. This seems short because it is. It's where jQuery shines

http://stackoverflow.com/comment/45716581
type: AnswerComment
comment on: http://stackoverflow.com/a/28545758
has text: Achieved using the following: by.xpath('//*[@id="ID"] [text()[contains(.," here")]]')
type: Comment
score: 0

http://stackoverflow.com/q/28574979
has answer: http://stackoverflow.com/a/28575057
upvote count: 2
possible better answer: http://stackoverflow.com/a/28575057
score: 2
type: AnsweredQuestion
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28575171
has comment: http://stackoverflow.com/comment/45459589
has body: I've been following web development trends for over 10 years now. One of the biggest site optimization techniques i've always stuck to was that JavaScript goes at the bottom of your site. The reasoning i've stuck with was that JavaScript blocks parallel downloads and each hostname may only download two components at a time. This will negatively impact your site load times if added into the header of the document. Now that i'm revisiting all my previous thoughts on site optimization i'm learning that none of this is actually true anymore with modern web browsers. For example as of February 2015, Internet Explorer 11 can now have 13 connections per host name (no longer just two) and JavaScript no longer blocks parallel downloading! This behavior is also true with ALL modern browsers. While it's understandable that if you are not using JavaScript until the user interacts with the page and you should put it at the bottom anyway, is it as important now as it was before? I'm looking through ecommerce sites to see the patterns they are using now: http://us.karenmillen.com/Karen-Millen-texture-knitted-dress/dp/B00TH9FDQG?class=quickView&amp;field_availability=-2&amp;field_browse=6482174011&amp;id=Karen+Millen+texture+knitted+dress&amp;ie=UTF8&amp;refinementHistory=subjectbin%2Ccolor_map%2Cprice%2Csize_name&amp;searchNodeID=6482174011&amp;searchPage=1&amp;searchRank=-product_site_launch_date&amp;searchSize=12 Looking at the architecture almost made me cry. Over 60 external JavaScript files with a lot of them in the header, and almost none in the footer. But looking at the network timeline the majority of all the JavaScript files are being loaded first at such blazing speed it really isn't affecting the rest of the site. You can see all the parallel files being downloaded at the same time. I'm assuming this was done for some particular reason so my long winded question is am I missing something? With modern browsers how necessary is it to stick to our old rules from the past?…
downvote count: 0
tagged with: javascript
tagged with: optimization
has comment: http://stackoverflow.com/comment/45459527
has title: Revisiting site optimization rules of thumb: JavaScript still necessary at the bottom with modern browsers?
accepted answer: http://stackoverflow.com/a/28575171
favorite count: 0

http://stackoverflow.com/q/28542125
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45400733
has answer: http://stackoverflow.com/a/28544376
type: Question
has comment: http://stackoverflow.com/comment/45471899
tagged with: javascript
has body: Im currently working on a simple file-explorer with NW.js Im developing on a linux-machine and there it works fine until now, but i tested it on a windows-system at work and there is a problem with listing all files in a directory. I developed it to work on both systems (i thought) here´s a link to my repo please note the file: js/main.js where i set the seperator-variable to be "\" on windows platforms (in function: getRootDir()). In JS this: alert("\\"); gives me: "\" isnt that the seperator for windows? Any help would be appreciated.
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28544376
has title: node-webkit windows file system seperator?
tagged with: nw.js
has comment: http://stackoverflow.com/comment/45398321
has comment: http://stackoverflow.com/comment/45482660
tagged with: node-webkit

http://stackoverflow.com/a/28474176
downvote count: 0
answers question: http://stackoverflow.com/q/28473889
type: Answer
has body: You can remove the null properties in object 2 before calling the extend. var myApp = angular.module('myApp',[]); var object1 = { "color": "yellow", "size" : null, "age" : 7, "weight" : null } var inside = { "name": "me", "age" : 9, "nothing": null } var object2 = { "color": "blue", "size" : 51, "age" : null, "inside" : inside } function removeNullIn(prop, obj) { var pr = obj[prop]; if(pr === null || pr === undefined) delete obj[prop]; else if(typeof pr === 'object') for (var i in pr) removeNullIn(i, pr); } function removeNull(obj) { for (var i in obj) { removeNullIn(i, obj); } } removeNull(object2); var mergedObject = angular.extend(object1, object2); console.log(mergedObject); &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular.min.js"&gt;&lt;/script&gt;
has comment: http://stackoverflow.com/comment/45303785
score: 12
upvote count: 12

http://stackoverflow.com/comment/45315514
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28498014
score: 0
has text: what is the logo file width and height ?

http://stackoverflow.com/q/28593380
tagged with: javascript
has title: Declaring multiple variable in url using javascript
has comment: http://stackoverflow.com/comment/45493347
tagged with: php
accepted answer: http://stackoverflow.com/a/28593405
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28593427
has answer: http://stackoverflow.com/a/28593405
type: Question
has answer: http://stackoverflow.com/a/28593427
score: 0
has body: I am trying to pass some variables to another page using javascript at present i am passing a single variable in url the url is looks like this var PageToSendTo = '../xxxx/xxxx.php?appid=4&amp;score='+score; In at this script score is a javascript variable it is working fine now i want to pass another variable also along with this script var java_var; How i am trying to do is something like this var PageToSendTo = '../xxxx/xxxxx.php?appid=4&amp;score='+score'&amp;javavar='+java_var; But it is not working properly what is happening here and how to resolve this?.
answer count: 2

http://stackoverflow.com/comment/45483849
has text: Don't write your javascript inline. Write it in a JS file. On click, do your textarea validation and your input validation; if both are correct, submit your form.
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28588332

http://stackoverflow.com/a/28467091
type: Answer
has comment: http://stackoverflow.com/comment/45262506
answers question: http://stackoverflow.com/q/28465524
has comment: http://stackoverflow.com/comment/45263537
has body: It may be a better option to hook on to the 'offline' event and then show your not connected message/alert when the event triggers. You could use this alongside the message you show when 'deviceready' event fires. Make sure you have the org.apache.cordova.network-information plugin installed for any of this to work. The offline event fires when a previously connected device loses a network connection so that an application can no longer access the Internet. It relies on the same information as the Connection API, and fires when the value of connection.type becomes NONE. document.addEventListener("offline", onOffline, false); function onOffline() { // Handle the offline event } Reference: https://github.com/apache/cordova-plugin-network-information/blob/master/doc/index.md#offline
score: 0

ecmascript-harmony
tag name: ecmascript-harmony
type: Tag
tags question: http://stackoverflow.com/q/28548690

http://stackoverflow.com/comment/45489724
type: QuestionComment
comment on: http://stackoverflow.com/q/28590972
has text: That is what i thought,, Just a question: If i set the cron job to run every 10 seconds what will be the impact on the server (if any)?
score: 0
type: Comment

http://stackoverflow.com/a/28486105
answers question: http://stackoverflow.com/q/28482330
type: Answer
upvote count: 3
score: 3
has body: there's no way to get this information from the GeoIP2 database or web service. It would pretty difficult to know what language is appropriate for a given IP address. Many countries use more than one language. Given the country code, you can look up the languages given an appropriate data source, though I don't know of a good JS library for this off-hand.
downvote count: 0

http://stackoverflow.com/comment/45325521
has text: You have two items: {"ID":"1000043","text":"Test "} and {"ID":"1000037","text":"Here we go AGAIN!!"}
type: Comment
comment on: http://stackoverflow.com/a/28503082
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45229793
type: Comment
has text: the height of the div is defined in the CSS right now. This is so that the one who I'm making it for can easily implement it on his website.
comment on: http://stackoverflow.com/q/28450557
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45475940
has text: I could test it on another server and see if it works. But I wanted to be able to work with the demos locally so I can edit them and have the result feedback immediately.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28527453

http://stackoverflow.com/comment/45446921
comment on: http://stackoverflow.com/a/28567467
type: AnswerComment
score: 0
type: Comment
has text: OK, Thanks for this. But changed that now and still not working. How are you debugging this?

http://stackoverflow.com/q/28554110
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I have a "Details" View that I am displaying to the user to find out if any statuses are associated with any projects. When the "GET" for the "Details" view is performed, only a dropdownlist appears asking the user to select an item from the list. In the View, I simply check if the "Model" is null to display the rest of the view or not (the associated projects for that status). During the "POST", a "status" is retrieved with its associated 'projects'. While coming back into the View, I am expecting the Model not to be null (since it found a status and its associated projects). If the Model is not null, I want to display the rest of the View. In the "POST", why is the Model still null? See below code & screenshots. Please copy and paste the screenshot to your favorite image viewer for better viewing. fyi, after looking in the browser with the debugging tool, I can see that there is no html displayed after the dropdownlist????? Model namespace YeagerTechDB.Models { using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; [Serializable, DataContract(IsReference = true)] public partial class Status { public Status() { Projects = new HashSet<Project>(); } [Key] [ScaffoldColumn(true)] [DataMember] public short StatusID { get; set; } [Required] [StringLength(30)] [Display(Name = "Status")] [DataMember] public string StatusDescription { get; set; } [DataMember] public virtual ICollection<Project> Projects { get; set; } } } JS $.ajax({ url: Url, data: JSON.stringify(status_Input), //data: AddAntiCSRFToken(JSON.stringify(status_Input)), dataType: "html", type: "POST", contentType: "application/json; charset=utf-8", async: true, beforeSend: function () { $(' Please wait... ').dialog({ modal: true, resizable: false, height: 'auto', width: 'auto', minHeight: '30px', open: function () { $('.ui-dialog-titlebar').hide(); }, close: function () { $('.ui-dialog-titlebar').show(); $(this).dialog('destroy').remove()…
has answer: http://stackoverflow.com/a/28554261
has title: Getting a NULL value back for a Model when I see it is NOT NULL during debugging
type: Question
tagged with: asp.net-mvc
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery

http://stackoverflow.com/comment/45451311
type: AnswerComment
has text: I'm pretty sure if it was an access key problem that would prompt an invalid access key problem as well (which would be an xml output). I've seen it when I tried to use other methods to do this.
comment on: http://stackoverflow.com/a/28569557
score: 0
type: Comment

http://stackoverflow.com/q/28576693
favorite count: 0
has answer: http://stackoverflow.com/a/30463058
type: UnansweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/45478865
tagged with: owl-carousel
type: Question
has body: I am trying to use owl2 carousel with easyzoom (http://i-like-robots.github.io/EasyZoom/) In this page you can find the result http://www.youdev.net/example/owl-easyzoom.html In the first example there is only easyzoom. On mouseover in the image, the coursor change, the zoom image is loaded and I can move on it. This is the result I want to get. In the second one, there is the basic owl carousel code + easy zoom. On mouseover, the coursour change, the zoom image is loaded but I cannot move on the zoom image, it is always streched. I think that owl carousel always force the dimension of the image, so there is no zoom effect. Does anybody know how to fix this problem?
tagged with: javascript
has title: integration owl carousel + easyzoom
score: 2
answer count: 1
downvote count: 0
tagged with: jquery

http://stackoverflow.com/a/28463937
has body: [WebMethod] [ScriptMethod] public static Dictionary&lt;string, object&gt;[] GetCoords() { DataTable dt = new DataTable(); using (SqlConnection con = new SqlConnection(connectionString)) { using (SqlCommand cmd = new SqlCommand("SELECT TOP 10 * FROM DRAW ORDER BY DrawID DESC;", con)) { con.Open(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(dt); JavaScriptSerializer serializer = new JavaScriptSerializer(); List&lt;Dictionary&lt;string, object&gt;&gt; rows = new List&lt;Dictionary&lt;string, object&gt;&gt;(); Dictionary&lt;string, object&gt; row; foreach (DataRow dr in dt.Rows) { row = new Dictionary&lt;string, object&gt;(); foreach (DataColumn col in dt.Columns) { row.Add(col.ColumnName, dr[col]); } rows.Add(row); } System.Diagnostics.Debug.WriteLine(serializer.Serialize(rows)); return rows.ToArray(); } } } Java script: $.ajax({ type: 'POST', cache: false, url: 'Default.aspx/GetCoords', data: "{}", contentType: 'application/json; charset=utf-8', dataType: 'json', success: function (data) { $.each(data, function(index, value) { var x = value.xCoord; /// do something with it ;) }); var text = JSON.stringify(data); $("#jsonData").html(text); alert(text); }, error: function (xhr, ajaxOptions, thrownError) { alert(xhr.status); alert(thrownError); } });
has comment: http://stackoverflow.com/comment/45254056
has comment: http://stackoverflow.com/comment/45254432
score: 0
has comment: http://stackoverflow.com/comment/45253967
type: Answer
has comment: http://stackoverflow.com/comment/45254047
answers question: http://stackoverflow.com/q/28463622
has comment: http://stackoverflow.com/comment/45254647
upvote count: 1
downvote count: 1

http://stackoverflow.com/q/28549208
has body: Could it be said that prototypical inheritance in JavaScript demonstrates type polymorphism? Or does the weak typing of JavaScript preclude that? function Parent () {} function Child () {} Child.prototype = Object.create(Parent.prototype); Child.prototype.constructor = Child; // Is Child a polymorphic implementation of Parent?
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45412039
tagged with: javascript
has comment: http://stackoverflow.com/comment/45412207
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45412283
tagged with: polymorphism
favorite count: 0
has answer: http://stackoverflow.com/a/28608452
type: UnansweredQuestion
has title: Does prototypical inheritance in JavaScript demonstrate type polymorphism?
tagged with: oop
score: 1

http://stackoverflow.com/comment/45272977
score: 0
has text: Its not the complete code.I have just added what is required
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28474598

http://stackoverflow.com/q/28583466
has answer: http://stackoverflow.com/a/28753349
tagged with: angularjs
has answer: http://stackoverflow.com/a/28583646
answer count: 3
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28584067
has comment: http://stackoverflow.com/comment/45474574
downvote count: 0
has title: The use of 'global' variables on AngularJS
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/45483987
score: 1
tagged with: angularjs-scope
has answer: http://stackoverflow.com/a/28584067
accepted answer: http://stackoverflow.com/a/28583646
upvote count: 1
tagged with: angularjs-service
tagged with: javascript
favorite count: 0
has body: Ok, I went into a heated argument with a colleague about the way of properly using global variables on AngularJS. Here's his reasoning: there's many ways to "do" things. Consider this: var app = angular.module('myApp', []); app.globalVar = []; // this is just to store same data later Then on some directive/service: app.directive('myDirective', function(){ app.globalVar = [23,43,21]; // populating from a json or other source }); app.directive('myDirective2', function(){ var x = app.globalVar; }); I think this is bad but I would like to know, from a technical view, why this is wrong and what's the proper use of 'global' variables in AngularJS. I read about using $rootScope and I also read somewhere that on version 2.0 AngularJS is dropping $scope altogheter so maybe the only way will be using a service/factory?

http://stackoverflow.com/q/28466017
has title: Require JS config and the path for the library files
has body: Can any one explain how we can specify the path from any property inside the require JS config section. We need to pass a property inside the config as shown below: The problem: var SomePathFromPropertyFile = "CDN lib path"; require.config({ waitSeconds: 500, paths: { // Library js files 'jquery': 'js/external/jquery.min', 'angular': 'js/external/angular.min', 'some-name': SomePathFromPropertyFile }, shim: { 'jquery': { exports: '$' }, 'angular': { exports: 'angular' } } }); define('js/common', [ 'jquery', 'angular', 'some-name' ], function($, angular) { return angular; }); How can we achieve this? Currently it gives build error as SomePathFromPropertyFile is not defined.
has comment: http://stackoverflow.com/comment/45259687
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45262284
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/29091129
tagged with: angularjs
type: UnansweredQuestion
tagged with: requirejs
tagged with: r.js

http://stackoverflow.com/q/28506901
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: required
has comment: http://stackoverflow.com/comment/45332953
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45333114
has title: Img onerror validating with html5 form
has body: I have added a form to my HTML file. And it works fine. When I try to submit the required field should be filled in. The next step is the following: I want an image link in my input fields for adding a profile image from source. I also let this work as well. I also built a constraint which check if the image is valid. If it isn't valid it shows only a placeholder image. I've used this small function for that: prevAvatar.onerror = function () { this.src = "images/placeholder.jpg"; }; The next step is to display a message to the user to show that his given image is not a image. I was wondering if it is possible to write some code that shows the same error as an empty field does for HTML5 REQUIRED fields. Does anyone have a smart solution for this? Thanks in advance!
tagged with: image
type: Question
has comment: http://stackoverflow.com/comment/45334075

http://stackoverflow.com/a/28582462
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28565889
has body: I found that putting the javascript inside a js file and importing it in the main page worked. I also used the pageLoad function solution within that file.
type: Answer
answers question: http://stackoverflow.com/q/28565889
score: 0

http://stackoverflow.com/comment/45405125
type: Comment
type: QuestionComment
has text: How can something both "take the full width of the page" and be aligned horizontally. that makes 0 sense whatsoever
comment on: http://stackoverflow.com/q/28545817
score: 0

http://stackoverflow.com/q/28467079
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28467169
has title: mouse over image with innerHTML
tagged with: image
type: Question
has answer: http://stackoverflow.com/a/28467169
tagged with: javascript
tagged with: jquery
tagged with: mouseover
score: 0
has comment: http://stackoverflow.com/comment/45259779
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I need to swap the image out when it's moused over. It should be using innerHTML as well I believe. anime ponies What fandom is better? Choose One /** This is for element changes upon mousesing over of the area */` document.getElementsByClassName("anime")[0].onmouseover= function(){ orangeBorder1(); mouseAnime(); } document.getElementsByClassName("pony")[0].onmouseover= function(){ orangeBorder(); mousePony(); } function mousePony(){ document.getElementById("pony").src="pony1.png"; }

http://stackoverflow.com/q/28493992
possible better answer: http://stackoverflow.com/a/28494019
has body: I have html like this (note -: I included j library on the top of page ) Level of Course to make it not clickable i used jquery like this $(".WIWC_T1 a").click(function(){ return false ; }); i tried this too $(".WIWC_T1 a").off("click"); but onClick="call_levelofcourse();popup('popUpDiv1')" is still working on my page . what is soltuion to do it in very simple way ??
has answer: http://stackoverflow.com/a/28494214
has answer: http://stackoverflow.com/a/28494019
linked to: http://stackoverflow.com/q/825112
has answer: http://stackoverflow.com/a/28494175
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has title: how to make html anchor tag not click able with jquery?
type: Question
has answer: http://stackoverflow.com/a/28494449
accepted answer: http://stackoverflow.com/a/28494449
has comment: http://stackoverflow.com/comment/45308211
has answer: http://stackoverflow.com/a/28494340
tagged with: javascript
answer count: 6
has comment: http://stackoverflow.com/comment/45308149
has comment: http://stackoverflow.com/comment/45308214
score: 0
has answer: http://stackoverflow.com/a/28494239
tagged with: jquery

http://stackoverflow.com/q/28457605
has comment: http://stackoverflow.com/comment/45241914
favorite count: 0
has answer: http://stackoverflow.com/a/28457876
tagged with: angularjs
has title: Calling controller functions from a view in AngularJS
type: UnansweredQuestion
downvote count: 0
score: 1
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45242147
tagged with: javascript
has answer: http://stackoverflow.com/a/28468063
has body: Since I began learning AngularJS I've seen different approaches for calling controller functions from a view. Suppose we have a Todo list application in AngularJS where you can add and remove Todo list items: function TodoListCtrl() { var vm = this; vm.addItem = addItem; vm.removeItem = removeItem; activate(); function activate() { vm.list = []; } function addItem() { vm.list.push(vm.newItem); // reset the form vm.newItem = null; } function removeItem(item) { vm.list.splice(vm.list.indexOf(item, 1)); } } And our HTML: Todo List {{ item }} Remove Add Item Add In this example the addItem function depends on vm.newItem being set in order to add the new list item. However, it could also be re-written as: function addItem(item) { vm.list.push(item); // reset the form vm.newItem = null; } With our HTML updated as so: Add I can see that this makes the function easier to test since we're not dependent on the state of the controller but we don't avoid it completely since we're resetting vm.newItem after an item is added. Are there any best practices for when we should pass parameters from our views and when we can just rely on the internal state of the controller?
upvote count: 1

http://stackoverflow.com/comment/45297406
comment on: http://stackoverflow.com/q/28487545
type: QuestionComment
score: 0
has text: Wait, there is a locale JS file to be included! Argh! ok I think, I know the problem now. Thanks.
type: Comment

http://stackoverflow.com/q/28504105
tagged with: html-table
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28504713
has comment: http://stackoverflow.com/comment/45332162
tagged with: jquery
has title: HTML get data from table footer (dataTable)
has body: I have dataTable with this html: Naziv Povrsina Lokacija Osnov Kultura Seme-sadnice Radnici $ Gorivo $ Inputi $ Ukupno $ Dobit $ ROI % Parcela 5.0607 Lokacija Osnov Kultura 960 1355 1150 3465 17500 405 prva 5.0607 ns vlasnistvo vocnjak Breskva 960 1355 1150 3465 17500 405 % Detalji... How I can get values from table footer (value from columns radnici$, gorivo$, inputi$)? I need this data to create chart with google visualisation... so I need: var data = google.visualization.arrayToDataTable([ ['aaa', 'bbb'], ['Radnici', here I need value from table footer of column radici], ['Gorivo', from column gorivo], ['Inputi', from column inputi], ]); How to get this data? HTML table: Fiddle
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/28504637
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28504637
has comment: http://stackoverflow.com/comment/45328269
score: 0
has comment: http://stackoverflow.com/comment/45327739
has answer: http://stackoverflow.com/a/28504713
tagged with: google-visualization
tagged with: javascript
has comment: http://stackoverflow.com/comment/45327180

http://stackoverflow.com/a/28456654
upvote count: 1
has comment: http://stackoverflow.com/comment/45240947
answers question: http://stackoverflow.com/q/28454611
has comment: http://stackoverflow.com/comment/45242096
type: Answer
has comment: http://stackoverflow.com/comment/45241718
has body: To begin with you need to make a call with valid parameters to the url i.e. http://kayaposoft.com/enrico/json/v1.0/?action=getPublicHolidaysForMonth&amp;month=1&amp;year=2013&amp;country=eng This would return data in the following format: [{"date":{"day":1,"month":1,"year":2015,"dayOfWeek":4},"localName":"New Year's Day","englishName":"New Year's Day"}] It is then a case of translating that data into the format that expects i.e. EventData. This is done by iterating over the date objects returned via the json as follows but setting the properties you need (in the below demo I set the title and start): var items = []; $.each( json, function( key, val ) { items.push({ title : val.localName, start : val.date } ); }); This all needs to be wrapped up in a getJson call i.e. $.getJSON( "http://kayaposoft.com/enrico/json/v1.0/?action=getPublicHolidaysForMonth&amp;month=3&amp;year=2013&amp;country=eng", function( data ) { $.each( data, function( key, val ) { items.push({ title : val.localName, start : val.date } ); }); }); You can the set your calendar items as follows (simplified for demo): $('#calendar').fullCalendar({ events: items }); jsFiddle var items = []; var json = [{"date":{"day":1,"month":1,"year":2015,"dayOfWeek":4},"localName":"New Year's Day","englishName":"New Year's Day"}] $.each( json, function( key, val ) { items.push({ title : val.localName, start : val.date } ); }); $('#calendar').fullCalendar({ events: items }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js"&gt;&lt;/script&gt; &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.2.6/fullcalendar.js"&gt;&lt;/script&gt; &lt;link href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.2.6/fullcalendar.css" rel="stylesheet"/&gt; &lt;div id='calendar'&gt;&lt;/div&gt;
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45254393

http://stackoverflow.com/comment/45249675
score: 0
type: AnswerComment
has text: fileLoader.loadFile().then(function(data) {
comment on: http://stackoverflow.com/a/28461803
type: Comment

http://stackoverflow.com/a/28505563
has body: Another solution without the IIFE (or closure or whatever you want to call it) but that solves the same issue: the function passed to setTimeout creates its own this scope, so first we dereference this.source into a variable. EventStreamSource.prototype.ontimeout = function(func){ var thisSource = this.source; setTimeout(function(){ if(thisSource.readyState == 0){ func()} }, 3000); };
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28477328

http://stackoverflow.com/q/28497566
has comment: http://stackoverflow.com/comment/45314843
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45314599
has comment: http://stackoverflow.com/comment/45314683
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28497766
has body: So, in my application, there is an option for users to enter remarks. I have some validation code written in javascript to remove the double quotes and single quotes from the same, so that it can be saved properly in database. var s2 = document.getElementById("txtMRCommentEntry").value; var result = s2.indexOf('"'); This code works fine if I manually enter the data to the textbox, or paste it from word, pdf etc. I get the index returned properly for validation. But in case of copying the text from outlook and pasting it into the textbox, the indexOf function doesn't work. It returns -1, no matter what text I copy from outlook. I am unsure what the issue is, and if anyone every faced the same.
has comment: http://stackoverflow.com/comment/45314766
has title: index of a character in a js string doesn't work for some strings
type: Question
tagged with: outlook

http://stackoverflow.com/comment/45592422
comment on: http://stackoverflow.com/q/28587085
has text: So, fun tip: RSVP was the problem. I switched out RSVP with Bluebird and everything worked perfectly. I didn't even have to change any syntax (aside from anywhere I referenced RSVP). This was weird.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28545319
favorite count: 0
type: UnansweredQuestion
has body: If you have a mouseenter event, touch-enabled devices will trigger this event when user taps the element. How to distinguish between a genuine (physical) mouse enter event and a tap (mouse enter simulation)?
has title: How to distinguish between mouseenter and tap events?
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28545456
tagged with: javascript
tagged with: dom-events
answer count: 1
downvote count: 0
score: 1

http://stackoverflow.com/comment/45300246
has text: I added in the plugins as : As described on the site, but they didnt help at all.
score: 0
comment on: http://stackoverflow.com/q/28489141
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45214199
comment on: http://stackoverflow.com/q/28442301
type: QuestionComment
has text: I should also note, if I do Inspect Element and edit the elements width, the transition works fine... Odd!
score: 0
type: Comment

http://stackoverflow.com/a/28448725
type: Answer
accepted answer of: http://stackoverflow.com/q/28448649
score: 1
answers question: http://stackoverflow.com/q/28448649
has comment: http://stackoverflow.com/comment/100724618
has body: You can do that by adding this to your favorites: javascript:(function(){document.location.href="http://stackoverflow.com";})() The correct name for this kind of bookmarks is favelets. For some more inspiration check out this collection of favelets.
upvote count: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45340122
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28510474
has text: You are right actually something is wrong with the draw function causing it to give an error but i honestly have no idea what
score: 0

http://stackoverflow.com/comment/45270957
type: Comment
type: QuestionComment
has text: DataTables warning: table id=example - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1
comment on: http://stackoverflow.com/q/28473055
score: 0

http://stackoverflow.com/q/28494269
type: Question
answer count: 2
has body: I have 3 select option that load values depending on each other My first select is Continent it has the value of continent on load second select is Country this select will be loaded on change of continent then last select is City this will be loaded on change of country it works fine Currently because of the onchange event of the the select statement when i load data in the select from database it is not showing the correct data because the one that it is showing is the data when the on change event. My question is how do i stop the onchange event of the 3 select option so that i can load data from database i was thinking that stopping the onchange is the best way to load data from database. If there are any other option to load data on these select i will gladly try it.
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28494439
has title: 3 option select set value from database remove onchange
tagged with: onchange
has comment: http://stackoverflow.com/comment/45308857
upvote count: 1
has comment: http://stackoverflow.com/comment/45308720
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28495062
has answer: http://stackoverflow.com/a/28494439
score: 1
tagged with: select
has answer: http://stackoverflow.com/a/28495062
tagged with: mysql

http://stackoverflow.com/a/28439013
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/45208131
upvote count: 1
has body: var selectedArea = ("#make").val(); should be var selectedArea = $("#make").val(); missing the $
accepted answer of: http://stackoverflow.com/q/28438955
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28438955

http://stackoverflow.com/comment/45290831
type: QuestionComment
has text: Refer here: http://stackoverflow.com/tags/jquery-validate/info
comment on: http://stackoverflow.com/q/28484066
score: 1
type: Comment

http://stackoverflow.com/a/28452109
type: Answer
has body: You can do it simpler: str = str.replace(/[\[\]]/g, ""); var str = "abc def ghi jkl mno"; str = str.replace(/[\[\]]/g, ""); alert( str )
score: 0
answers question: http://stackoverflow.com/q/28452077

http://stackoverflow.com/comment/45470636
type: Comment
type: QuestionComment
has text: @Kartikeya I tried both ways but it still doesn't work.
score: 0
comment on: http://stackoverflow.com/q/28580466

http://stackoverflow.com/q/28471950
type: Question
has answer: http://stackoverflow.com/a/28472130
answer count: 1
tagged with: javascript
has title: I need to have a input box using Angular.js whose value is dependent on a formula
favorite count: 0
upvote count: 0
type: UnansweredQuestion
downvote count: 1
tagged with: angularjs-directive
has body: I need to have a input box using Angular.js whose value is dependent on a formula that includes the value of another text field. Now if I have a value for Field A, then value of Field B should be evaluated, also it should allow the editing of Field B with a value independent of the formula. Can anyone help me with that?
score: -1

http://stackoverflow.com/q/28541174
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45396054
has body: Having searched endlessly for an answer, nothing has so far worked - so here I am hoping someone can assist. I have 2 fields: Action_Date &amp; Deadline The user updates the Action_Date field with the date they worked on the item. I then need to auto-populate the Deadline field with Action_Date + 14 days. I have tried this so far: function testCalc() { var actionDate = new Date(document.getElementById("Action_Date").value); var sla = 14; var deadline = actionDate + sla; document.getElementById("Deadline").value = deadline; } Action_Date calls this function via onblur() The Deadline field auto-populates with the same date as Action_Date, in full format (e.g. Thu Jan 01 2015 00:00:00 GMT+0000(GMT Standard Time)14 Clearly the 14 days are not adding. Additionally I need Deadline to show the result in dd/mm/yy. Any ideas most welcome!
has title: Auto-populate field with date from another field + 14 days
upvote count: 0
type: UnansweredQuestion
type: Question
score: -1
tagged with: date
has answer: http://stackoverflow.com/a/28541440
answer count: 1
downvote count: 1

http://stackoverflow.com/a/44742677
has body: The dropdown menu is not showing because bootstrap requires jquery as a dependency (order of your requires matters in application.js). Putting require bootstrap after require jquery_ujs should fix the problem.
score: 0
answers question: http://stackoverflow.com/q/28532350
type: Answer
has comment: http://stackoverflow.com/comment/76468083

http://stackoverflow.com/a/28559594
upvote count: 1
answers question: http://stackoverflow.com/q/28545343
score: 1
has comment: http://stackoverflow.com/comment/45437115
has comment: http://stackoverflow.com/comment/45446928
has comment: http://stackoverflow.com/comment/45442210
downvote count: 0
has comment: http://stackoverflow.com/comment/47945335
has comment: http://stackoverflow.com/comment/45442142
has body: You can use: chartw.redraw(); After changing the formatter with the code in your question. Here's the DEMO
type: Answer
has comment: http://stackoverflow.com/comment/45509886
has comment: http://stackoverflow.com/comment/45441810

http://stackoverflow.com/q/28586109
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45486908
has comment: http://stackoverflow.com/comment/45480271
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45480554
tagged with: http://stackoverflow.com/tag/html
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45480249
type: Question
has body: I have a list of user-details stored in userList. I am rendering these list of users in a div tag as follows: Now Problem occurs If same userList is used to render users in multiple div tags. i.e. Now If two users are selected/checked in div1, it gets reflected in div2 as well since view.userList is getting updated. One way to solve it is clone userList and assign cloned userList` to div1 and userList`` to div2. But that is causing me performance issues If I load more than 15 or 20 divs. Is there any way we can avoid selecting a user in one div not reflecting in another? Thanks in Advance
has title: AngularJS ng-checked rendering issue

google-apps-script
tags question: http://stackoverflow.com/q/28488777
tags question: http://stackoverflow.com/q/28495566
tags question: http://stackoverflow.com/q/28474725
tags question: http://stackoverflow.com/q/28509299
tags question: http://stackoverflow.com/q/28508287
tags question: http://stackoverflow.com/q/28507485
tags question: http://stackoverflow.com/q/28462125
tags question: http://stackoverflow.com/q/28564126
type: Tag
tags question: http://stackoverflow.com/q/28463482
tag name: google-apps-script
tags question: http://stackoverflow.com/q/28571247
tags question: http://stackoverflow.com/q/28564907
tags question: http://stackoverflow.com/q/28443616
tags question: http://stackoverflow.com/q/28548802
tags question: http://stackoverflow.com/q/28483749
tags question: http://stackoverflow.com/q/28574695
tags question: http://stackoverflow.com/q/28574150
tags question: http://stackoverflow.com/q/28468461
tags question: http://stackoverflow.com/q/28580145
tags question: http://stackoverflow.com/q/28506764
tags question: http://stackoverflow.com/q/28487315

http://stackoverflow.com/a/28437920
has comment: http://stackoverflow.com/comment/45205768
score: -1
answers question: http://stackoverflow.com/q/28437447
has comment: http://stackoverflow.com/comment/45205812
has comment: http://stackoverflow.com/comment/45206526
has body: You have passed this to the function check() so you can access all its attributes of the (input - checkbox) element using .. function check(Obj){ alert(Obj.value); } Please read about this Javascript keyword.
upvote count: 0
type: Answer
downvote count: 1

scala
tags question: http://stackoverflow.com/q/28528780
tags question: http://stackoverflow.com/q/28476339
tag name: scala
tags question: http://stackoverflow.com/q/28579792
type: Tag

http://stackoverflow.com/comment/45364710
type: Comment
has text: So post your better effort instead of teaching noobs poor practises :)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28523670

http://stackoverflow.com/a/28452946
has body: Did you try to use : var data = [[chartDataArray[j]]]; dataset[dataset.length]={ "color" : 'red', "data" : data } Let me know...
type: Answer
answers question: http://stackoverflow.com/q/28452758
score: 0

http://stackoverflow.com/comment/45295264
type: AnswerComment
has text: thanks a lot, that did the trick :) will it also work for other regular URLs as i don't see jpg, png reference here?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28483947

http://stackoverflow.com/q/28476339
has body: I have an exception in my browser when I'm trying to get some data from Scala server. XMLHttpRequest cannot load http://localhost:9000/api/v1/animals. No 'Access-Control-Allow-Origin' header is present on the requested resource. My "CorsFilter.scala" file: package filters import config.{ Global, WebConfig } import play.api.GlobalSettings import play.api.mvc.{ Filter, RequestHeader, SimpleResult } import scala.concurrent.Future object CorsFilter extends Filter with GlobalSettings { lazy val injector = Global.injector lazy val webConfig = injector.getInstance(classOf[WebConfig]) def apply(next: (RequestHeader) =&gt; Future[SimpleResult])(request: RequestHeader): Future[SimpleResult] = { val result = next(request) val origin = request.headers.get("Origin") origin.filter(originString =&gt; originString.endsWith("animal.list") || originString == webConfig.apiDomain).map { validOrigin =&gt; result.map(_.withHeaders( "Access-Control-Allow-Origin" -&gt; validOrigin, "Access-Control-Expose-Headers" -&gt; "Server-Authorization"))(controllers.executionContext) }.getOrElse(result) } } And my function, which send the request: ... PlacesService.getAllAnimals = -&gt; $http.get('http://localhost:9000/api/v1/animals').then (result) -&gt; result.data ... How should I configure the server to fix my problem?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45277527
has answer: http://stackoverflow.com/a/28495571
tagged with: angularjs
type: Question
tagged with: scala
has title: AngularJS web client can't get resource from Scala Play server
score: 0
has comment: http://stackoverflow.com/comment/45279545
tagged with: coffeescript
tagged with: google-chrome
answer count: 1
accepted answer: http://stackoverflow.com/a/28495571
tagged with: javascript

http://stackoverflow.com/q/28503693
downvote count: 0
has title: Knockout-ES5 not working
tagged with: knockout.js
type: Question
upvote count: 2
answer count: 1
tagged with: javascript
has body: I am trying to use Knockout-ES5 along side Knockout in my project. But it seems to not working at all. Here is a very simple sample taken from the official Knockout tutorials. Here is my markup code First name: Last name: And here is my js file $(function () { var obj = { firstName: 'Bert', lastName: 'Bertington' } ko.track(obj); obj.firstName.subscribe(function(v){ alert(v); }); }); The line obj.firstName.subscribe(function) crashes with the exception "Object doesn't support property or methode 'subscribe' (IE10). I cannot seem to understand why this error. Here are the js files am using: I have tried various combinasions: e.g ko.track(obj); ko.applyBindings(obj); but still nothing. Any suggestion toward the right direction would be very much appreciated. Thank you/
has answer: http://stackoverflow.com/a/28503795
tagged with: asp.net
favorite count: 0
type: UnansweredQuestion
score: 2

http://stackoverflow.com/q/28476072
has answer: http://stackoverflow.com/a/28476149
has comment: http://stackoverflow.com/comment/45275551
has comment: http://stackoverflow.com/comment/45275413
tagged with: php
has comment: http://stackoverflow.com/comment/45275673
upvote count: 0
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45275588
tagged with: javascript
score: -1
has title: jQuery DatePicker With Multiple IDs
answer count: 2
has comment: http://stackoverflow.com/comment/45275510
has comment: http://stackoverflow.com/comment/45275529
downvote count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28476142
favorite count: 0
has body: I've got a jQuery date picker control that works fine for once instance, but I'm not sure how to get it to work for multiple instances. &lt;script type="text/javascript"&gt; $(function() { $('#my_date').datepicker(); }); &lt;/script&gt; Without the For Each loop, it works fine, but if there's more than one item in the "MyRecords" collection, then only the first text box gets a date picker (which makes sense since it's tied to the ID). I tried assigning a class to the text box and specifying: $('.my_class').datepicker(); but while that shows a date picker everywhere, they all update the first text box. What is the right way to make this work?

http://stackoverflow.com/comment/45250790
has text: @M4GNV5: OK, I'm glad you found a workaround. I still don't see anything in the snippet you posted where `Parameter` could match the `i` in an `AssignmentStatement` given the input `i = 5;`. If that's just part of the input, it might apply to some other part of the grammar you don't show. I didn't see any other kind of statement which might start with a `parameter`.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28442817
type: AnswerComment

http://stackoverflow.com/q/28461501
score: 2
downvote count: 0
tagged with: templates
favorite count: 0
type: Question
upvote count: 2
answer count: 1
has answer: http://stackoverflow.com/a/30710201
has title: how to get multiple kendo ui templates from external file using jquery in a single call
has body: Hi i have on issue regarding externalizing kendo templates.I have multiple templates (4 to 5 templates) in single html page.I want to load those templates in a single call instead of calling for each template.I want to implement it on jquery code.can any one please suggest me.
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
tagged with: kendo-ui

http://stackoverflow.com/a/28579884
type: AcceptedAnswer
downvote count: 0
has body: This should work: var sound = new Audio('https://mfaucet.com/images/notification2.mp3'); function play(sound) { if(!sound.paused) sound.pause(); sound.currentTime = 0; sound.play(); } Play Press two times Explanation: When the page loads, the Audio variable is created, and the page can load the mp3 beforehand. When the user clicks a button the play-function will: Check if the sound is playing, and pause it if it is. Set the time to 0. Start playing
has comment: http://stackoverflow.com/comment/45468259
type: Answer
has comment: http://stackoverflow.com/comment/45468334
has comment: http://stackoverflow.com/comment/45468120
accepted answer of: http://stackoverflow.com/q/28579701
has comment: http://stackoverflow.com/comment/45468181
upvote count: 9
answers question: http://stackoverflow.com/q/28579701
has comment: http://stackoverflow.com/comment/45468415
score: 9

http://stackoverflow.com/q/28568086
favorite count: 0
has comment: http://stackoverflow.com/comment/45446890
has body: in my page i have a thumnails list of images and a background image, basically what im attempting to do is when one of the thumbnails images are clicked the background image changes. But for i cant figure out why its not change the image. When the thumbnail image is clicked the background image gets faded but it doesnt replace the image for the new one. Above i leave my code: thumb-img id the Thumbnails id and #banner is the wrapper of the background imagem. Example: http://jsfiddle.net/q6h50ejq/6/ $('#thumb-img').click(function(){ $this = $(this); $image = $this.attr('full'); $("#banner").hide().html('&lt;img class="item_image" src="img/newImage.jpg"&gt;').fadeIn(300); }); });
has answer: http://stackoverflow.com/a/28568467
accepted answer: http://stackoverflow.com/a/28568467
type: AnsweredQuestion
score: 1
has title: Change slider image in Click
type: Question
has comment: http://stackoverflow.com/comment/45446346
upvote count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 1

http://stackoverflow.com/comment/45488425
type: Comment
comment on: http://stackoverflow.com/q/28590666
score: 0
has text: Recently, I've seen websites do this on iOS8 Safari by: 1-opening a new window with the same content as the first one (gets focus); 2-replacing the first window's content with an ad (blurred). This gives a similar effect to what you are describing.
type: QuestionComment

http://stackoverflow.com/q/28472946
has comment: http://stackoverflow.com/comment/45276855
type: Question
has comment: http://stackoverflow.com/comment/45269897
has body: I work with JSF2.2 and Richfaces 4 and i try to create a table by using the Datatables of Jquery. Because all my datas are dynamic so i have to use and the too. But it gives me an empty table in the jsf. this is my jsf page: <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j" xmlns:p="http://java.sun.com/jsf/passthrough" xmlns:rich="http://richfaces.org/rich"> <h:head> </h:head> <h:body> <h:form> <h:panelGroup id="tableau"> <a4j:repeat value="#{auditController.findAllEntityList()}" var="entity" rowKeyVar="rowentity"> <a4j:repeat value="#{Controller.findP(entity).entrySet().toArray()}" var="entete1"> <h:outputLabel value="#{entete1.key}" rendered="#{rowentity eq 0 and entete1.key !='class'}" /> </a4j:repeat> <a4j:repeat value="#{Controller.findP(entity).entrySet().toArray()}" var="entete"> <h:outputLabel value="#{entete.value}"/> </a4j:repeat> </a4j:repeat> </h:panelGroup> </h:form> </h:body> Without Jquery it works perfectly.
has comment: http://stackoverflow.com/comment/45275530
tagged with: javascript
tagged with: jquery
has title: Why the Jquery Datatable doesn't work whith richfaces <a4j:repeat>?
has comment: http://stackoverflow.com/comment/45272225
has comment: http://stackoverflow.com/comment/45277697
has comment: http://stackoverflow.com/comment/45271115
score: 0
tagged with: datatables
answer count: 1
has comment: http://stackoverflow.com/comment/45271555
has comment: http://stackoverflow.com/comment/45274383
tagged with: richfaces
accepted answer: http://stackoverflow.com/a/28487499
has answer: http://stackoverflow.com/a/28487499
type: AnsweredQuestion
tagged with: jsf
has comment: http://stackoverflow.com/comment/45274688

http://stackoverflow.com/comment/45383938
score: 0
type: AnswerComment
has text: Unfortunately, same result. Only a few thumbnails showing. :(
type: Comment
comment on: http://stackoverflow.com/a/28524764

http://stackoverflow.com/comment/45229729
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28450786
has text: If you can provide a sample of your page HTML, I can complete the working example below.
score: 0

http://stackoverflow.com/comment/45369793
type: QuestionComment
comment on: http://stackoverflow.com/q/28526898
has text: I can't understand, how I couldn't see it without your help :'D. Well, now only one image is loading, but I seem to understand how make this work :)
score: 0
type: Comment

http://stackoverflow.com/comment/45374617
has text: I get the variables by input values and using document.getElementById
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28529734
type: AnswerComment

http://stackoverflow.com/comment/45400049
type: Comment
type: QuestionComment
has text: I think you should do an initial check on the number of available files -> get these as a JSON and put the count into a Javascript variable -> run a "for" loop of pictures using the count variable -> when the loop is complete re-run the initial check and re-start the loop. Inefficient because it'll re-load the JSON so your request overhead will increase as more and more pictures are added. If your image directories aren't going to change very frequently then I would suggest you just do a single request and when the user refreshes the page (or re-visits later on) do a fresh request.
comment on: http://stackoverflow.com/q/28539341
score: 0

http://stackoverflow.com/comment/45488173
type: AnswerComment
comment on: http://stackoverflow.com/a/28590714
type: Comment
has text: You may want to permit hyphens for negative values
score: 0

http://stackoverflow.com/a/28529115
upvote count: 1
has body: var yt_title, title, artist; //yt_title = 'Ariana Grande - Problem ft. Iggy Azalea &amp; lyrical son'; //this works! yt_title = 'Dafina Zeqiri &amp; Ledri Vula ft. Sardi Dj - Got Ur Back ft. Iggy Azalea &amp; lyrical son'; //yt_title = 'capital t feat. 2po2 &amp; lyrical son - facedown'; //rempve string inside () and [] brackets. yt_title = yt_title.replace(/[(\[].*?[)\]] */g, '').toLowerCase(); artist = yt_title.split(" - ")[0].trim(); title = yt_title.split(" - ")[1].trim(); var separators = [" ft. ", " ft ", " feat ", " feat. ", " &amp; "]; //if it has 'ft or other separators' before ( - ) var artists = ''; var split_title = title.split(new RegExp(separators.join('|'), 'g')); for(var i=1; i&lt;split_title.length; i++) { artists += split_title[i] + ', '; title = split_title[0]; } //if it has 'ft or other separators' after ( - ) var split_artists = artist.split(new RegExp(separators.join('|'), 'g')); for(var i=0; i&lt;split_artists.length; i++) { artists += split_artists[i] + ', '; } document.getElementById('title').innerHTML = title; document.getElementById('artists').innerHTML = artists;
accepted answer of: http://stackoverflow.com/q/28528923
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28528923
score: 1

http://stackoverflow.com/comment/45441653
has text: What did you try? Looks like it's a ' do it for me' question
score: 0
comment on: http://stackoverflow.com/q/28565503
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45369265
type: Comment
comment on: http://stackoverflow.com/a/28526561
has text: so based on start time 0 , what exactly do you want to have happen?
score: 0
type: AnswerComment

http://stackoverflow.com/q/28477068
favorite count: 0
has answer: http://stackoverflow.com/a/28477170
has body: I have been trying to count the total number of tr's located in my nested tbody and I am unable to get the total count. I have tried to get it using the following jQuery code but its returning a big number like 44 rows, where as I am expecting it to return 7 rows. Could you suggest me as to where I am going wrong? var count = $("#rbe_viewTab0 table tbody tr td table tbody tr").length; alert(count); Row 2 I am expecting it to return 7 rows for the total number of rows and index as '1' for Row 2.
tagged with: count
has answer: http://stackoverflow.com/a/28477181
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/28477181
upvote count: 1
tagged with: rows
type: Question
tagged with: html-table
has title: Count the total number of rows in this tbody
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 3
possible better answer: http://stackoverflow.com/a/28477170
has answer: http://stackoverflow.com/a/28477268

http://stackoverflow.com/comment/45292905
type: Comment
comment on: http://stackoverflow.com/q/28485526
score: 0
type: QuestionComment
has text: There is so much wrong with this I don't know where to begin. How about: Why do you think this should do anything at all in response to something being clicked? (You also really, really need to open your browsers developer tools and read the error messages on the console)

http://stackoverflow.com/a/28539644
score: 1
has comment: http://stackoverflow.com/comment/45393707
upvote count: 1
has comment: http://stackoverflow.com/comment/45394776
has body: Your id contains a special character : : You have to escape it if you want to access to your div: htmlUnitDriver.findElementByCssSelector("#j_idt44\\:j_idt45_row_0").click(); Hope that helps.
has comment: http://stackoverflow.com/comment/45393924
has comment: http://stackoverflow.com/comment/45395012
has comment: http://stackoverflow.com/comment/45394476
has comment: http://stackoverflow.com/comment/45393676
downvote count: 0
has comment: http://stackoverflow.com/comment/45395348
has comment: http://stackoverflow.com/comment/45398699
type: Answer
answers question: http://stackoverflow.com/q/28536233
has comment: http://stackoverflow.com/comment/45395687

http://stackoverflow.com/comment/45355557
type: Comment
comment on: http://stackoverflow.com/a/28518999
has text: @Paulpro - my mistake. I will correct. Javascript drives me nuts in that it is not very clear about which array methods modify the array and which ones do not and the names tend to mislead you. Not the first time I've goofed this.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45280009
comment on: http://stackoverflow.com/a/28478452
type: AnswerComment
has text: Yes I agree and you gave a very comprehensive answer.
score: 0
type: Comment

http://stackoverflow.com/q/28448068
has answer: http://stackoverflow.com/a/28450665
tagged with: javascript
tagged with: parse-cloud-code
score: 0
has title: Parse.com: Authenticate user before updating object?
answer count: 1
tagged with: parse-platform
has body: The scenario is similar to Evernote: a user can own multiple notes that can be viewed publicly but cannot be edited by anyone other than himself. (I have implemented creating notes, but now get confused on updating notes. Have read docs of data &amp; security, but it didn't help me much; though I've known ACL.) I tried this in backend: Parse.beforeSave("Notes", function (request, response) { Parse.User.current(); }); But I got error saying null (or undefined? sorry for forgetting the exact error) is not a function. I think that meant there is no Parse.User or Parse.User.current available in Cloud Function. Then according to a question in archive of Parse.com forum I found: Parse.beforeSave("Notes", function (request, response) { var userId = new Parse.User({id : request.params.userId}); }); But it doesn't seem to be like a method of authentication. I mean, by this, I just trust data form client without authenticating it.
type: UnansweredQuestion
type: Question

http://stackoverflow.com/comment/63485136
comment on: http://stackoverflow.com/a/28450879
type: AnswerComment
score: 0
type: Comment
has text: @richardj That would work sometimes i.e. on some content. You'd have to url encode the string to be sure of it working on any content.

http://stackoverflow.com/q/28465118
tagged with: google-chrome-devtools
type: Question
has comment: http://stackoverflow.com/comment/45255976
tagged with: javascript
has body: I've been practicing with NodeJS and RESTful APIs, and after a few days I've decided to try with Chrome Extensions. I've got a form (Chrome Extension) and I want to send the data using HTTP POST to my server through the REST API. I've followed this tutorial The problem is that the following code doesn't do anything. I don't know why. I've followed the tutorial above, but nothing happens... no console.log, nothing... Anyone can help me, please?? Here's my code: popup.js function postLink() { event.preventDefault(); var postUrl = 'http://url.com:port'; var statusDisplay = null; var xhr = new XMLHttpRequest(); xhr.open('POST', postUrl, true); var torrentUrl = encodeURIComponent(document.getElementById('link').value), params = "url=" + torrentUrl; console.log("torrentUrl -> " + torrentUrl); params = params.replace(/%20/g, '+'); // Set correct header for form data xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); xhr.setRequestHeader("Content-length", params.length); xhr.setRequestHeader("Connection", "close"); console.log("params -> " + params); xhr.send(params); // Handle request state change events xhr.onreadystatechange = function() { // If the request completed if (xhr.readyState == 4) { statusDisplay.innerHTML = ''; if (xhr.status == 200) { // If it was a success, close the popup after a short delay statusDisplay.innerHTML = 'Downloading!'; console.log("Everything is alright!"); //window.setTimeout(window.close, 1000); } else { // Show what went wrong statusDisplay.innerHTML = 'Error: ' + xhr.statusText; console.log("Ooouch! U.u"); } } }; // Send the request and set status //xhr.send(params); statusDisplay.innerHTML = 'Preparing...'; } document.addEventListener('load', function(evt) { statusDisplay = document.getElementById('status-display'); document.getElementById('postForm').addEventListener('submit', postLink); }); popup.html Link manifest.json { "manifest_version": 2, "name": "LinkExtension", "description": "BlaBlaBla", "version": "0.1…
score: 0
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/45257179
has title: Post Chrome Extensions don't do anything
type: UnansweredQuestion
tagged with: google-chrome
tagged with: node.js
answer count: 0

http://stackoverflow.com/comment/45254950
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28464122
type: Comment
has text: it makes sense a lot. However, I have just followed your example, but no luck. Please see my updated question based on your approach.

http://stackoverflow.com/comment/45231240
score: 0
comment on: http://stackoverflow.com/a/28450366
type: Comment
has text: Reading from the Parse documentation, this can be called anytime when you are logged in as user.
type: AnswerComment

http://stackoverflow.com/a/28470623
answers question: http://stackoverflow.com/q/28469561
score: 0
type: Answer
has body: Set the onclick property after the mustache template is rendered. getElementById will not find the element if it isn't yet in the DOM. Since the code that sets onclick is just in script tags without any sort of document.ready, it can execute before the page has finished rendering (and you have rendered the template). You don't want to set onclick until after you have rendered your mustache template. I suggest putting this code in a method and calling it after your render code.

http://stackoverflow.com/q/28469279
has title: Angular promise returning incorrect data from JSON API
score: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45263788
has comment: http://stackoverflow.com/comment/45263887
has answer: http://stackoverflow.com/a/28472105
has comment: http://stackoverflow.com/comment/45292130
tagged with: api
answer count: 1
tagged with: arrays
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45263843
has comment: http://stackoverflow.com/comment/45264037
favorite count: 0
has comment: http://stackoverflow.com/comment/45264384
has comment: http://stackoverflow.com/comment/45280107
tagged with: angularjs
upvote count: 1
accepted answer: http://stackoverflow.com/a/28472105
type: Question
has body: Update: 02/12/2015 As mentioned in the comments this was an issue with the object being modified by an Angular module. I was able to track this down using toJSON as mentioned below. I have recently ran into an issue that has be quite boggled. I have a service that is request data from an api via get request. When looking on the network panel in Chrome developer tools the api returns the proper results but they are not show in the response from the angular request. You can note the content section is missing items. And Angular code: Angular Code function getPhotos(){ return $http.get('/photo') .then(getPhotosComplete) .catch(function(err){ //handle errors }); function getPhotosComplete(res){ //Showing incorrect response here console.log("getPhotosComplete", res); return res.data; } } From API { url: "https://dev.amazonaws.com/060a2a5f-8bb7-4ffa-aa7d-e715439271a3.jpg", archive_name: "140809", seedcount: 0, viewcount: 0, live: true, current: false, next: false, createdAt: "2015-02-10T17:48:41.505Z", updatedAt: "2015-02-12T04:11:02.239Z", content: [ "Balloon", "Apartment", "Testing", "Testing 2", "Party", "Inez" ], id: "54da44790eb10b0f00b453a1" } Angular Scope / res.data in service { url: "https://dev.amazonaws.com/060a2a5f-8bb7-4ffa-aa7d-e715439271a3.jpg", seedcount: 0, viewcount: 0, live: true, current: false, next: false, createdAt: "2015-02-10T17:48:41.505Z", updatedAt: "2015-02-12T04:11:02.239Z", content: Array[3] 0: "Balloon", 1: "Apartment", 2: "Party" ]
type: AnsweredQuestion

http://stackoverflow.com/a/28443479
upvote count: 3
answers question: http://stackoverflow.com/q/28443392
score: 3
downvote count: 0
type: Answer
has body: I'm not sure where it would have gotten anything besides a number from. Your base case is missing, it returns undefined. Try function a(n) { if (n &gt; 0) return n*n + a(n-1); else return 0; }

http://stackoverflow.com/a/28455876
has comment: http://stackoverflow.com/comment/45270246
has comment: http://stackoverflow.com/comment/45398157
has comment: http://stackoverflow.com/comment/45241156
score: 0
has comment: http://stackoverflow.com/comment/45239050
answers question: http://stackoverflow.com/q/28455769
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45274529
accepted answer of: http://stackoverflow.com/q/28455769
has body: No if they are in a different domains. Using Javascript you can't get information from another website due the Same Origin Police. It's a security restriction that browsers implements and you can't bypass. Same Origin Police policy permits scripts running on pages originating from the same site – a combination of scheme, hostname, and port number – to access each other's DOM with no specific restrictions, but prevents access to DOM on different sites. If you want to keep updated from another website you may need use a server side language (JAVA, PHP, NodeJS, etc...) to make a request, parse the return HTML from other website and find the information you need. EDIT: If you just need update the iframe every X seconds you can use setInterval: var refreshFrame= function () { var iFrames = document.getElementsByClassName("yourClassName"); for(var i = 0; i &lt; iFrames.length; i++) { if(iFrames[i].className === "yourClassName") { iFrames[i].src = iFrames[i].src; } } } window.setInterval(refreshFrame, 3000); // Time in ms look this FIDDLE
type: Answer
has comment: http://stackoverflow.com/comment/45240109
has comment: http://stackoverflow.com/comment/45240692

http://stackoverflow.com/comment/45278358
has text: @Vohuman, yes I know about that. Technically, I can move the onclick event to the tag, but I think it's redudant if I set the event on each . So I wanna see whether there's another options or not :)
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28477422
score: 0

http://stackoverflow.com/q/28447367
accepted answer: http://stackoverflow.com/a/28461647
upvote count: 3
has title: Minify Inline Javascript in PHP Files with Gulp
has comment: http://stackoverflow.com/comment/45224983
type: Question
score: 3
has comment: http://stackoverflow.com/comment/45228781
tagged with: javascript
has comment: http://stackoverflow.com/comment/45223939
has comment: http://stackoverflow.com/comment/45224162
has body: What I'm trying to do is minify inline javascript &lt;script&gt; within php files using Gulp. The reason why is because I'm trying to condense the overall file size (It does matter in my case). The javascript contains php variables. I've started with the gulp-minify-inline-scripts plugin, but changed it so that it recognizes php files. Unfortunately I haven't successfully been able to output the javascript unless using html files. My thinking is to keep the php variables and just save the contents back to the php file. Not compiling the actual php. Plugin code: var path = require('path'); var gutil = require('gulp-util'); var uglify = require('uglify-js'); var through = require('through2'); var PLUGIN_NAME = 'gulp-minify-inline-scripts'; module.exports = function (options) { return through.obj(function (file, enc, cb) { var self = this; if (file.isNull()) { this.push(file); return cb(); } if (file.isStream()) { this.emit('error', new gutil.PluginError(PLUGIN_NAME, 'Streaming not supported')); return cb(); } var fileName = file.path.split(path.sep).pop(); //html file only if (!/^\.php?$/.test(path.extname(file.path))) { gutil.log(gutil.colors.red('[WARN] file ' + fileName + ' is not a html file')); this.push(file); return cb(); } gutil.log("uglify inline scripts in html file: " + file.path); var html = file.contents.toString('utf8'); var reg = /(&lt;script(?![^&gt;]*?\b(type=['"]text\/template['"]|src=["']))[^&gt;]*?&gt;)([\s\S]*?)&lt;\/script&gt;/g; html = html.replace(reg, function (str, tagStart, attr, script) { try { var result = uglify.minify(script, { fromString: true }); return tagStart + result.code + '&lt;/script&gt;'; } catch (e) { self.emit('error', new gutil.PluginError(PLUGIN_NAME, 'uglify inline scripts error: ' + (e &amp;&amp; e.stack))); } }); file.contents = new Buffer(html); this.push(file); cb(); }); }; PHP Inline Javascript to compress: &lt;?php /* Start: This is a php file ?&gt; &lt;script&gt; &lt;?php $var = 'test'; ?&gt; A.config = { test: '&lt…
downvote count: 0
answer count: 1
tagged with: gulp
favorite count: 0
has answer: http://stackoverflow.com/a/28461647
has comment: http://stackoverflow.com/comment/45228725
tagged with: php
has comment: http://stackoverflow.com/comment/45223710
type: AnsweredQuestion

http://stackoverflow.com/a/28444687
score: 1
accepted answer of: http://stackoverflow.com/q/28444271
has body: You can dynamically calculate the extra space and add this to end of the page. I have created one small code you can look at it and use it according to your need http://jsbin.com/mubugusido/6/edit?html,js
upvote count: 1
has comment: http://stackoverflow.com/comment/45227290
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28444271

http://stackoverflow.com/comment/45218210
comment on: http://stackoverflow.com/q/28444258
score: 0
type: QuestionComment
type: Comment
has text: @zerkms - I know, but he's clearly trying to send JSON, as the contentType is set.

http://stackoverflow.com/q/28438253
upvote count: 1
has comment: http://stackoverflow.com/comment/45244597
has title: reset input type=range when mouse is released
score: 1
has body: I want to make an easy shuttle-style control to control the playback speed of an external device with. the idea: user can pull the knob to whatever speed he likes, every statuschange gets sent to the server. and if i RELEASE the knob, i want it to go back to 0. Should be pretty easy, so i thought. everything works, except the release part. how would you do that? &lt;input id="speed" type="range" min="-16" max="16" value="0" step="1" oninput="changeSpeed(this.value)" onmouseup="resetSpeed()"/&gt; function changeSpeed(speed) { console.log(speed); //emit to device } function resetSpeed() { document.getElementById("speed").value = '0'; } it doesn't work like this. Am I missing something? Thanks
type: Question
has comment: http://stackoverflow.com/comment/45206309
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45211548
favorite count: 0
has comment: http://stackoverflow.com/comment/45206604
has answer: http://stackoverflow.com/a/36827912
tagged with: http://stackoverflow.com/tag/html
tagged with: range
tagged with: input
has comment: http://stackoverflow.com/comment/45207875
type: UnansweredQuestion

http://stackoverflow.com/comment/45290544
type: Comment
type: QuestionComment
has text: Seriously? The effort that went into this question and it gets downvoted? WTF? I need some help here and with Google ridiculously silent, I have nowhere to turn. Thanks SO.
score: 0
comment on: http://stackoverflow.com/q/28481589

http://stackoverflow.com/comment/45462359
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28576636
score: 0
has text: you can use mouseDown and mouseUp event and change the X position of parent container.

http://stackoverflow.com/comment/45334982
score: 1
has text: Was the question edited? `bookmarkParams` is an object, not a string.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28507921

http://stackoverflow.com/a/28479650
has comment: http://stackoverflow.com/comment/45304135
downvote count: 0
has comment: http://stackoverflow.com/comment/45297071
has body: Embed the audio tag and set the autoplay and loop attribute. Try this: &lt;audio src="http://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3" style="display: none" autoplay loop&gt;
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28479361

http://stackoverflow.com/comment/54689751
has text: Worked like a charm for me.
comment on: http://stackoverflow.com/a/28568522
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/q/28467615
downvote count: 0
has answer: http://stackoverflow.com/a/28467865
favorite count: 0
has comment: http://stackoverflow.com/comment/45269504
tagged with: angularjs
type: Question
upvote count: 2
tagged with: requirejs
answer count: 1
accepted answer: http://stackoverflow.com/a/28467865
has body: I started using AngularJS not long ago and am practice to keep the Controller slim. My understanding of AngularJS' dependency injection is that it makes external JS code available in the controller. I am also new to RequireJS, for I want to reduce loading time. I have done some reading but I am still confused. My impression is that AngularJS' dependency injection works similarly to RequireJS - loading functions on the fly when I need them. Am I on the right track or am I completely wrong?
has title: Are AngularJS' dependency injection and RequireJS essentially the same?
tagged with: javascript
score: 2
type: AnsweredQuestion

http://stackoverflow.com/q/28446398
has comment: http://stackoverflow.com/comment/45224185
tagged with: asp.net-mvc
tagged with: javascript
tagged with: jquery
has title: How do I get Bootstrap file input data to controller in MVC 5
score: 0
has comment: http://stackoverflow.com/comment/45222101
has comment: http://stackoverflow.com/comment/45223860
linked to: http://stackoverflow.com/q/3748
tagged with: twitter-bootstrap
type: UnansweredQuestion
has body: I'm using the Bootstrap File Input plugin to upload an image in my ASP.Net MVC 5 application form. I'm not sure what I need to see on the controller or what I need to do in javascript to get this to work. Currently there is an error that is being thrown when I submit my data in the form that says "The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters." Here is my StudentController. [HttpPost] public ActionResult Edit(EditStudentViewModel studentViewModel) { if (ModelState.IsValid) { ...other code left out Here is my javascript $("#input-20").fileinput({ 'type': 'POST', 'cache': false, 'browseClass': 'btn btn-primary btn-block', 'showCaption': false, 'showRemove': false, 'showUpload': false, 'uploadAsync': false, 'maxFileCount': 1, 'allowedFileExtensions': ['jpg', 'png', 'gif'], 'allowedFileTypes': ['image'] 'uploadUrl': '@Url.Action("Edit", "Student")' }); *Are these the correct 'uploadUrl' parameters Here is my form that submits the data to the controller. You can see I'm submitting what in the ViewModel as well as the image. The byte[] that represents the iamge is in the view model @model YogaBandy.DomainClasses.ViewModels.Student.EditStudentViewModel @{ ViewBag.Title = "Edit"; Layout = "~/Views/Shared/_Layout.cshtml"; } @Html.Partial("_MenuPartial") @Html.Partial("_StudentTeacherProfilePartial") @using (Html.BeginForm("Edit", "Student", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { @Html.AntiForgeryToken() @Html.HiddenFor(model => model.StudentId) @Html.HiddenFor(model => model.AspNetUserRefId) @Html.ValidationSummary(true, "", new { @class = "text-danger" }) Student Picture @Html.TextBoxFor(model => model.TestImage, new { @type = "file", @id = "input-20" }) Student Profile @Html.LabelFor(model => model.CatchPhrase, htmlAttributes: new { @class = "control-label col-md-2" }) @Html.EditorFor…
has comment: http://stackoverflow.com/comment/45222367
has comment: http://stackoverflow.com/comment/45224796
answer count: 0
has comment: http://stackoverflow.com/comment/45224852
has comment: http://stackoverflow.com/comment/45222471
has comment: http://stackoverflow.com/comment/45223924
type: Question

http://stackoverflow.com/a/28562849
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28562524
has body: You can always access your multiple list like this: $("*[multiple=multiple]").find("option:selected").each(function(index, item){ console.log($(item).attr("data-img-src")); }); Of course, replace "*[multiple=multiple]" selector with your element identifier, since this way you will get all multiple lists from the page. If you don't want to do it that way, the other way to do this, since image picker plugin is adding "selected" class on div's that are wrapping your images, would be to use that to get all selected images: $(".image-picker").find(".selected img").each(function(index, item){ console.log($(item).attr("src")); });
answers question: http://stackoverflow.com/q/28562524
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2

http://stackoverflow.com/q/28517760
has title: Showdown markdown not replacing string
has comment: http://stackoverflow.com/comment/48036005
score: 0
linked to: http://stackoverflow.com/q/164979
answer count: 1
tagged with: ghost-blog
tagged with: showdown
has comment: http://stackoverflow.com/comment/45352667
has comment: http://stackoverflow.com/comment/45352741
has answer: http://stackoverflow.com/a/29958340
tagged with: regex
tagged with: node.js
type: AnsweredQuestion
has body: I am currently trying to add my own extension to showdown using the ghost blogging platform. I am trying to make it so someone can type map and then a uk postcode and have it rendered to a map, like so [map bh278bf]. I have made sure the maps.js extension has been added and works as I have tested it. However my Regex knowledge is practically non-existent. I have got the RegEx to work here in Regexr.com, but when I run it nothing happens, I have used the same codepen and it also doesn't work and I have no idea what to do. I need some assistance in identifying the string! The Expression: /(\[map )([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]?[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)(\])/igm The extension (maps.js) (function(){ var maps = function(converter) { return [ { type: 'output', filter: function(source) { return source.replace(/(\[map )([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]?[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)(\])$/gim, function(match) { return "Map will go here"; }); } } ]; }; // Client-side export if (typeof window !== 'undefined' && window.Showdown && window.Showdown.extensions) { window.Showdown.extensions.prettify = maps; } // Server-side export if (typeof module !== 'undefined') module.exports = maps; }());
accepted answer: http://stackoverflow.com/a/29958340
type: Question
tagged with: javascript

http://stackoverflow.com/comment/45230806
has text: Doesn't using `Posts.find()' also in helper (you know it's already in Router) make another request to the server? Is it also under control of subscription defined in Router?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28450410
type: AnswerComment

http://stackoverflow.com/q/28482662
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28483574
has body: I'm using grunt to generate sprite SVG image (with PNG fallback) from separated SVG files and a (s)css file for the generated icons. For this process I'm using the grunt-dr-svg-sprites and the template is using Handlebars syntax. The idea of the structure what I would like to achieve is this: @mixin prefix-filename { width: X; height: X; background-position: X X; @include background(); } . . . @mixin prefix-filename { width: X; height: X; background-position: X X; @include background(); } @mixin background() { background-size: X X; background-repeat: no-repeat; background-image: url("sprite-with-its-path.png"); .svg &amp; { background-image: url("sprite-with-its-path.svg"); } } But because I'm not really familiar with Handlebars template syntax the template what I've created is broken and doesn't work. It looks like this: {{~#sizes~}} {{~#items~}} @mixin {{className}} { width: {{unit width ../../../config/cssUnit ../../../config/cssBaseFontSize}}; height: {{unit height ../../../config/cssUnit ../../../config/cssBaseFontSize}}; background-position: {{unit x ../../config/cssUnit ../../config/cssBaseFontSize -1}} {{unit y ../../config/cssUnit ../../config/cssBaseFontSize -1}}; @include background(); } {{/items~}} @mixin background() {{prefix items ""}} { background-size: {{unit width ../../config/cssUnit ../../config/cssBaseFontSize}} {{unit height ../../config/cssUnit ../../config/cssBaseFontSize}}; background-repeat: no-repeat; background-image: url("{{url pngPath ../../cssPath}}"); {{~/sizes~}} .svg &amp; { background-image: url("{{url ../svgPath ../cssPath}}"); } } When I try to build the sprite, I get this error message: Building SVG sprites... Fatal error: Arguments to path.resolve must be strings But anyway the {{className}} at the mixin name also wrong if it's containing the "." (dot) at the beginning and also the background() mixin shouldn't contain any item-name too. In the options I have defined the following attributes: spriteElementPath, spritePath, cssPat…
tagged with: templates
has answer: http://stackoverflow.com/a/28483104
has comment: http://stackoverflow.com/comment/45287786
tagged with: handlebars.js
has answer: http://stackoverflow.com/a/28483574
has comment: http://stackoverflow.com/comment/45287707
has title: HBS template with grunt-dr-svg-sprites
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28483104
type: Question
has comment: http://stackoverflow.com/comment/45287501
tagged with: javascript
tagged with: gruntjs
has comment: http://stackoverflow.com/comment/45287562

http://stackoverflow.com/q/28477569
type: Question
answer count: 5
score: 0
has body: I am creating a form with multiple radio buttons and text boxes. Each Text box is next to radio button like below: Correct Answer 2 There are several radio button and text box pair like above in the form. On click of the radio button, i want to get whatever has been written in the corresponding text box i am trying to use Jquery's next() function like below: $('input[type="radio"]').click(function(){ if ($(this).is(':checked')) { console.log($(this).next('input[type="text"]').val()); } }); But my log shows undefined. What i am doing wrong?
has answer: http://stackoverflow.com/a/28477771
has answer: http://stackoverflow.com/a/28477629
possible better answer: http://stackoverflow.com/a/28477700
has answer: http://stackoverflow.com/a/28477700
has answer: http://stackoverflow.com/a/28477732
tagged with: javascript
tagged with: jquery
has title: Jquery get value of text box next to a radio button
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28477629
has answer: http://stackoverflow.com/a/28477750

http://stackoverflow.com/comment/45375569
comment on: http://stackoverflow.com/a/28530166
has text: Thanks bro but this is still async solution... :) I need to prevent the rest of the code from been executed (loop until iframe ready)
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45241203
type: AnswerComment
type: Comment
has text: seems to not working.
comment on: http://stackoverflow.com/a/28457323
score: 0

http://stackoverflow.com/q/28475796
has comment: http://stackoverflow.com/comment/45283391
tagged with: javascript
has body: My chart is created in backend as object and pushed to twig like "{{ chart(myChart) }}". But I need to update data dynamically in it. So I creating new chart and push only chart->series[0] into through ajax. I've tried update() and setData() methods but have no luck yet, I see "No data to display". Strange thing that if I load same object - data showed. var dchart = $("#myChart").highcharts(); console.log(dchart); var dp = $('body').find(".date-picker"); dp.datepicker(); dp.on('changeDate', function(e) { console.log(e.format('yyyy-m-d')); $.ajax({ url: 'path', type: 'POST', data: { date: e.format('yyyy-m-d') } }).done(function(msg){ dchart.series[0].setData(msg[0].data);}
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28479528
tagged with: php
answer count: 4
has answer: http://stackoverflow.com/a/28483833
score: 1
has answer: http://stackoverflow.com/a/28477123
has title: Add new series[0].data into already existing highchart
upvote count: 1
type: Question
tagged with: highcharts
has answer: http://stackoverflow.com/a/28476579

http://stackoverflow.com/q/28522442
has answer: http://stackoverflow.com/a/28522456
has body: I've been messing around with objects in Javascript and I've come across a problem. Basically I'm trying to print certain properties from objects I've created and it's not working properly. Here's the code: function Hotel(name, rooms, booked) { this.name = name; this.rooms = rooms; this.booked = booked; var CanadaHotel = new Hotel("CanadaIn", 50, 10); var AmericanHotel = new Hotel("AmericanIn", 60, 3); document.write(CanadaHotel.rooms); document.write(AmericanHotel.booked); None of the properties are being displayed and I don't know why.. any help is greatly appreciated. Thank you
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/28522456
score: 0
has title: Multiple objects aren't getting displayed
answer count: 1
tagged with: object
tagged with: javascript

http://stackoverflow.com/comment/45319150
type: Comment
comment on: http://stackoverflow.com/q/28499938
score: 1
has text: use $('#test').html() or document.getElementByID('test').innerHTML,
type: QuestionComment

http://stackoverflow.com/a/28539652
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28537866
has body: Looking at the documentation of https://github.com/feross/simple-peer, there does not seem to be a standard way of doing "Remote Procedure Calls" or receiving an ACKnowledgement of the fact that some data that was previously sent was actually received. So in order to achieve what you want to achieve with simple-peer you need to add a custom "protocol" over the simple-peer channel. Since you have no guarantee over the order in which the remote peer will receive your messages, you need to give an ID to each message. something like this in pseudo code (and considering that peer is a connected simple-peer) pendingJobs = {} function addJob(data, callback) { var id = uuid() // imagine a function giving a uuid pendingJobs[id] = callback peer.send({ id: uuid, payload: data }) } peer.on('data', function(info) { var id = info.id var cb; if (pendingJobs[id] &amp;&amp; info.payload) { cb = pendingJobs[id] cb(info.payload) } }) Of course this pseudo-code solution is very rough, and you would probably need to add some garbage collection of pendingJobs, have error callbacks in case the remote peer never sends the ACK message. you could add a type for each message ('rpc', 'ack', ..)

http://stackoverflow.com/comment/45450170
type: QuestionComment
has text: what about [`date.toISOString()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
comment on: http://stackoverflow.com/q/28570122
score: 0
type: Comment

http://stackoverflow.com/a/28583763
has comment: http://stackoverflow.com/comment/45475245
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28583542
has body: Change this line: else if((isNan(a)==true) ||(isNan(b)==true)){ to this: else if (isNaN(a) || isNaN(b)) { as the function is named #isNaN(). Using == true in conditionals is quite redundant, so I removed them. I have also made a fiddle for you. It contains the fixed code, and it is working well.
accepted answer of: http://stackoverflow.com/q/28583542
score: 0

http://stackoverflow.com/a/28551768
has comment: http://stackoverflow.com/comment/45416991
answers question: http://stackoverflow.com/q/28550944
has comment: http://stackoverflow.com/comment/45417221
has comment: http://stackoverflow.com/comment/94654641
score: 0
has body: You can check if a namespace is "loaded" with a method like this : var isNamespaceDefined = function(moduleName) { var fields = moduleName.split('.'), cur = window; for(var i=0; i&lt;fields.length; i++){ if(typeof cur[fields[i]] === "undefined") return false; cur = cur[fields[i]]; } return true; }; usage : isNamespaceDefined("my.module.function") Combined with a setTimeout to check the loading: var doWhenReady = function(){ if(isNamespaceDefined("my.function")){ // redefining the function; var _myFunction = my.function; my.function = function(){ // do things Before the call _myFunction.apply(null, arguments); // do things After the call }; } else{ setTimeout(doWhenReady , 100); } } A simple solution, but may be added with some time check and error callback
has comment: http://stackoverflow.com/comment/45416732
type: Answer
has comment: http://stackoverflow.com/comment/45416644

http://stackoverflow.com/q/28559970
has comment: http://stackoverflow.com/comment/45432705
has comment: http://stackoverflow.com/comment/45434967
has body: Can someone tell me why this works? &lt;div id="test"&gt; &lt;label data-bind="dateText: TheDate"&gt;&lt;/label&gt; &lt;/div&gt; ko.bindingHandlers.dateText = { update: function(el, f_valueaccessor, allbindings, viewmodel, bindingcontext) { // Get current value of supplied value var val = ko.unwrap(f_valueaccessor()); console.log('dt is ' + (typeof(val.dt) == 'function' ? '' : 'NOT ') + 'observable'); var dt = ko.unwrap(val.dt); $(el).html(dt ? moment(dt).format('DD/MM/YYYY') : ''); } }; function Model(data, mapping) { var _this = this; if(data) ko.mapping.fromJS(data, mapping, _this); this.TheDate = this.TheDate || { dt: ko.observable() } } var model = new Model({ TheDate: { dt: null } }); ko.applyBindings(model); model.TheDate.dt('2001-01-01T01:01:01'); Fiddle: http://jsfiddle.net/qkLzc5u5/2 The reason I ask is that I am having problems making this custom binding work in a real application - there, it displays any initial date fine but updates are not reflected in the text - however the IsDated computed does update, so the label is displayed; just blank. I thought that the problem was that the binding is attached to TheDate, which is not an observable itself; only dt is. However, the code above will in fact fire the update, so the date 01/01/2001 is shown, whereas I was expecting nothing to be displayed due to the null initial value. Now this is actually exactly the behaviour I want, so I don't have a problem with this code - I am hoping to get a bit more of an insight into how the custom bindings know when to fire so I can debug my real world code better. (Note that the object model for passing dates is fixed by a web service that I cannot change)
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45433027
has comment: http://stackoverflow.com/comment/45432886
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/45442299
tagged with: knockout.js
type: Question
tagged with: javascript
has title: Knockout: Rules for custom binding triggers firing update method

http://stackoverflow.com/comment/45235581
type: Comment
comment on: http://stackoverflow.com/a/28451188
has text: my bad, for dropdown it shuld be `select#Q1113_QO3515`. but here id is enough, i have updated my answer please check
score: 0
type: AnswerComment

http://stackoverflow.com/q/28549984
has comment: http://stackoverflow.com/comment/45413986
tagged with: php
accepted answer: http://stackoverflow.com/a/28566760
has comment: http://stackoverflow.com/comment/45413129
type: AnsweredQuestion
has body: I'm working on a project where I'm trying to allow for a user to upload an xlsx file (not preview) for processing by dragging it into a box. I want it to work something like smallpdf's does. I've got the ability to get the filename from the user along with what I think is a binary string using this group of files: if(window.FileReader) { var drop; addEventHandler(window, 'load', function() { var status = document.getElementById('status'); drop = document.getElementById('drop'); var list = document.getElementById('list'); function cancel(e) { if (e.preventDefault) { e.preventDefault(); } return false; } // Tells the browser that we *can* drop on this target addEventHandler(drop, 'dragover', cancel); addEventHandler(drop, 'dragenter', cancel); addEventHandler(drop, 'drop', function (e) { e = e || window.event; // get window.event if e argument missing (in IE) if (e.preventDefault) { e.preventDefault(); } // stops the browser from redirecting off to the image. var dt = e.dataTransfer; var files = dt.files; for (var i=0; i<files.length; i++) { var file = files[i]; var reader = new FileReader(); //attach event handlers here... reader.readAsDataURL(file); addEventHandler(reader, 'loadend', function(e, file) { var bin = this.result; var newFile = document.createElement('div'); newFile.innerHTML = 'Loaded : '+file.name+' size '+file.size+' B'; list.appendChild(newFile); var fileNumber = list.getElementsByTagName('div').length; status.innerHTML = fileNumber < files.length ? 'Loaded 100% of file '+fileNumber+' of '+files.length+'...' : 'Done loading. processed '+fileNumber+' files.'; var img = document.createElement("img"); img.file = file; img.src = bin; list.appendChild(img); }.bindToEventHandler(file)); } return false; }); Function.prototype.bindToEventHandler = function bindToEventHandler() { var handler = this; var boundParameters = Array.prototype.slice.call(arguments); //create closure return function(e) { e = e || window.event; // get window.event if e argument missin…
type: Question
has title: How to Upload Previewed File to PHP from JS
answer count: 2
possible better answer: http://stackoverflow.com/a/28550426
tagged with: javascript
has answer: http://stackoverflow.com/a/28550426
has answer: http://stackoverflow.com/a/28566760
score: 0
linked to: http://stackoverflow.com/q/24168040
has comment: http://stackoverflow.com/comment/45413080
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28495163
score: 0
tagged with: selectoneradio
tagged with: validation
answer count: 0
type: UnansweredQuestion
tagged with: oracle-adf
has body: After some research I found out, that ADF has this bug with validating radio buttons on the page. The problem here is that the validation of the radio groups does not take place at the same time as the input text fields. First the input text fields are validated, then the radio groups. From what I've seen from ADF forums its listed as a bug. The question is following, maybe someone figure out somekind of workaround for this? Is it possible in ADF 11.1.1.7.0 to trigger validation for all required text fields and radio buttons at the same time? In https://community.oracle.com/thread/1033932 Frank Nimphius sad, that validation will work in case, if you use unselectedLabel property and this works for me. But then, additional button (representing unselectedLabel) appears in my radiogroup. Is it possible to make it unvisible somehow leaving other selectItems visible? P.S. Bug id is 13822582
has comment: http://stackoverflow.com/comment/45325710
has title: Validation not triggered on af:selectOneRadio component
tagged with: jsf
type: Question
has comment: http://stackoverflow.com/comment/45324951
tagged with: javascript

http://stackoverflow.com/comment/45250324
has text: Would an array be more efficient than just building a string? If so, how do you check the order of values in an array?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28462157
type: AnswerComment

http://stackoverflow.com/comment/45509626
comment on: http://stackoverflow.com/a/28600649
type: Comment
has text: And for the `gl.vertexAttrib1f` too. He wrote a table and shows the default values for uninitialized fields at the end of second chapter (I read the russian translate of this book). Perhaps I incorrectly understood something. Thank you!
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45218348
has text: @adeneo that was the reason, I thought it would be able to get it current left position, I've given it a left and position relative in the css and its working now. Do you want to add it as an answer
comment on: http://stackoverflow.com/q/28444282
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28452813
has comment: http://stackoverflow.com/comment/45235797
answers question: http://stackoverflow.com/q/28447621
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28447621
has body: The loading problem you see is that the data is fetched after the view has been created. You can delay the loading of the view by using the resolve property of the route: .when('/allStories', { templateUrl : 'app/views/pages/allStories.html', controller: 'AllStoryController', controllerAs: 'story', resolve: { stories: function(Story) { return Story.allStories(); } } }) Angular will delay the loading of the view until all resolve properties have been resolved. You then inject the property into the controller: .controller('AllStoryController', function(socketio, stories) { var vm = this; vm.stories = stories.data; });
downvote count: 0
has comment: http://stackoverflow.com/comment/45235756
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/45352449
comment on: http://stackoverflow.com/a/28512892
has text: And it would be _insane_ to think Chrome will allow to open an arbitrary `file://` URL.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28522910
has body: There is a function in R called pf, the source is here. I'm trying to get this function converted to JavaScript with emscripten. I'm invoking like this: emcc -s EXPORTED_FUNCTIONS="['pf']" nmath/pf.c \ -Ignuwin32/fixed/h/ \ -I/usr/local/Cellar/r/3.1.1/include/ \ -I/usr/local/Cellar/r/3.1.1/R.framework/Versions/3.1/Resources/include/ I get the warning: WARNING root: function requested to be exported, but not implemented: "pf" And, no hint of pf in the output js. Why is this function "not implemented" according to emcc? Edit (according to zakki's answer it should be _pf as in -s EXPORTED_FUNCTIONS="['_pf']" but the problem persists): There is a prior warning about absolute include paths. But, I'm assuming that it can be ignored? Maybe it is crucial though: emcc -s EXPORTED_FUNCTIONS="['_pf']" nmath/pf.c -Ignuwin32/fixed/h/ -I/usr/local/Cellar/r/3.1.1/include/ -I/usr/local/Cellar/r/3.1.1/R.framework/Versions/3.1/Resources/include/ WARNING root: -I or -L of an absolute path "-I/usr/local/Cellar/r/3.1.1/include/" encountered. If this is to a local system header/library, it may cause problems (local system files make sense for compiling natively on your system, but not necessarily to JavaScript). Pass '-Wno-warn-absolute-paths' to emcc to hide this warning. WARNING root: function requested to be exported, but not implemented: "_pf" If I try the other method, adding EMSCRIPTEN_KEEPALIVE, as described here, I get: emcc nmath/pf.c -Ignuwin32/fixed/h/ -I/usr/local/Cellar/r/3.1.1/include/ -I/usr/local/Cellar/r/3.1.1/R.framework/Versions/3.1/Resources/include/ WARNING root: -I or -L of an absolute path "-I/usr/local/Cellar/r/3.1.1/include/" encountered. If this is to a local system header/library, it may cause problems (local system files make sense for compiling natively on your system, but not necessarily to JavaScript). Pass '-Wno-warn-absolute-paths' to emcc to hide this warning. nmath/pf.c:28:28: error: expected ';' after top level declarator double EMSCRIPTEN_KEEPALIVE pf…
type: UnansweredQuestion
tagged with: emscripten
type: Question
tagged with: http://stackoverflow.com/tag/c
score: 4
has answer: http://stackoverflow.com/a/28535994
upvote count: 4
answer count: 1
downvote count: 0
tagged with: javascript
has title: emscripten: "function requested to be exported, but not implemented"
favorite count: 0
tagged with: http://stackoverflow.com/tag/r

http://stackoverflow.com/comment/45427226
comment on: http://stackoverflow.com/q/28557676
score: 0
type: Comment
type: QuestionComment
has text: `JSON.parse(string)`

http://stackoverflow.com/q/28451851
has answer: http://stackoverflow.com/a/28460632
type: UnansweredQuestion
type: Question
tagged with: jquery-mobile
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
has body: In jquery mobile v 1.4.5 dynamically add the table rows with column toogle option. Initially toogle the columns, then add the dynamic rows, this hides the selected rows in UI but the toggle popup elements are checked. First Second third Fourth See this FIDDLE first click the column button enable the fouth and fifth columns, now click the Add row button the fourth and fifth rows are hidden from UI but again click the colum popup the fourth and fifth columns are checked. (Fourth and fifth column are hidden because of table refresh,but if remove the refresh then the toogle is not working for dynamic rows)
has title: Table column toggle UI not refreshing

http://stackoverflow.com/comment/45486973
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28588989
has text: Can you describe what you're expecting to happen with user A and user B. A webSocket connection connects a client to a server - period. If you want a message sent to more than one client from your server, then your server has to explicitly send it to more than one client, either using chat rooms or broadcast or by actually looping through more than one socket to send a message to each.

http://stackoverflow.com/q/28460951
has title: How can I hide a specific span class on a page with a dynamic ID?
type: Question
has comment: http://stackoverflow.com/comment/45248047
has answer: http://stackoverflow.com/a/28461036
accepted answer: http://stackoverflow.com/a/28461051
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45248045
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28461051
has comment: http://stackoverflow.com/comment/45248026
possible better answer: http://stackoverflow.com/a/28461036
has body: I'm trying to hide a class called "details" on all single event pages but not on my main events page. The main event page is demosite.com/events/ The single event pages are demosite.com/events/?event_id=2. I've tried with css pseudo classes but can't get it to work. I'm trying this with javascript but it's not working - as it hides the "details" class on both pages. This is what I've tried so far. $(function(){ var url = document.location.href; if (url.toLowerCase().indexOf('http://demosite.com/events/') &gt;= 0) { $('.details').hide(); } else { $('.details').show(); } });
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45248234

http://stackoverflow.com/a/28518999
answers question: http://stackoverflow.com/q/28518963
upvote count: 8
type: Answer
has comment: http://stackoverflow.com/comment/45355301
has comment: http://stackoverflow.com/comment/45355557
has comment: http://stackoverflow.com/comment/45355119
score: 8
has comment: http://stackoverflow.com/comment/45355435
has comment: http://stackoverflow.com/comment/45363217
has body: JavaScript does not have the ability to pass a reference to the u and v variables themselves. So, no assignment to x or y in your swap() function will change what is assigned to u or v. JavaScript passes a reference to the object that u and v hold. Thus, you can't change the u and v variables from within swap(). You can change the contents of the object that they point to and thus properties of the object that u and v point to can be modified. Since I have a C/C++ background, I think of what JavaScript does when passing objects as "pass by pointer". When you call swap(u, v), what is passed to the swap() function is a pointer to the array that u also points to. So, now you have two variables u and x both "pointing" at the same array. Thus, if you modify that actual array, then since u points at that same array, both will see the modification. But, nothing you do inside the swap() function can change what object u or v actually point to. In JavaScript, the only way to change what object the original variables point to is to make them properties of an object and pass the object like this: function swap(obj, x, y) { var temp = obj[x]; obj[x] = obj[y]; obj[y] = temp; } var container = {}; container.u = [1, 0]; container.v = [0, 1]; swap(container, "u", "v"); console.log(container.u); console.log(container.v); If you don't mind rewriting both arrays from scratch, you can copy all the contents of one array to a temporary, then copy one array over to the other and then copy the temporary array contents back to the first original. This is not very efficient and there is probably a better way to solve your original problem, but it can be done. function swap(x, y) { // remove all elements from x into a temporary array var temp = x.splice(0, x.length); // then copy y into x x.push.apply(x, y); // clear y, then copy temp into it y.length = 0; y.push.apply(y, temp); }
has comment: http://stackoverflow.com/comment/45355118
has comment: http://stackoverflow.com/comment/45355081
has comment: http://stackoverflow.com/comment/45355202
has comment: http://stackoverflow.com/comment/45355544
downvote count: 0

http://stackoverflow.com/a/28464535
upvote count: 7
type: Answer
has body: LocalStorage does exactly that. Use it like this : localStorage.setItem('myCat', 'Tom'); console.log(localStorage.getItem('myCat')); // Tom Use can use it to store stringify-ed objects as well : var obj = { a : 1, b : 2}; localStorage.setItem('myObj', JSON.stringify(obj)); var obj2 = JSON.parse(localStorage.getItem('myObj'));
has comment: http://stackoverflow.com/comment/45254949
answers question: http://stackoverflow.com/q/28464449
has comment: http://stackoverflow.com/comment/45255169
downvote count: 2
score: 5

http://stackoverflow.com/q/28460437
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28460938
score: 0
has title: Pull working PHP file (with scripts) into div using JavaScript without iframes
type: Question
has comment: http://stackoverflow.com/comment/45247761
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45246986
has answer: http://stackoverflow.com/a/28460938
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45251041
tagged with: loading
has comment: http://stackoverflow.com/comment/45246896
has comment: http://stackoverflow.com/comment/45248254
has body: Working within system constraints, I needed a way to put working code from a local .php or .html into a target div without additional libraries, jfiddle, iframes, etc. (jquery was fine) Here are my failed attempts. First part of file This is some page! A pretty good page... I like this page Later in file (after Expand01 function declared) Attempt 1 Attempt 2 Attempt 3 Attempt 4

http://stackoverflow.com/comment/45490406
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28591865
has text: Welcome. Go out and have a blast now! :P
type: Comment

http://stackoverflow.com/comment/45424022
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28555285
has text: thanks axel for reply

http://stackoverflow.com/comment/45450067
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28570119
has text: is the server responding successfully?
type: Comment

http://stackoverflow.com/q/28437587
possible better answer: http://stackoverflow.com/a/28437865
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: php
type: AnsweredQuestion
has title: Automatically updating a PHP variable when a radio button or dropdown menu item is selected
score: 1
has answer: http://stackoverflow.com/a/28437889
upvote count: 1
has comment: http://stackoverflow.com/comment/45205046
type: Question
has body: My classmates and I are building a small submission form in which a user submits shipping and billing information for their order. The two main factors that effect the order price are the type of shipping the user selects ( $shippingType ) and the price of the item ( $initialPrice ). The variable $totalPrice is then defined which adds $shippingPrice and $initialPrice. What we are working towards is having $totalPrice update when $shippingPrice is changed without the user having to resubmit the form. Can this be solved using php? Or would we have to use a jquery event to update the page in realtime.
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28437865
has comment: http://stackoverflow.com/comment/45205100
answer count: 2
accepted answer: http://stackoverflow.com/a/28437889

http://stackoverflow.com/comment/45244750
comment on: http://stackoverflow.com/a/28459031
score: 0
type: AnswerComment
type: Comment
has text: i'm not getting you. both on canvas ?

http://stackoverflow.com/comment/45211912
comment on: http://stackoverflow.com/a/28440414
type: Comment
has text: Looks great, I will try it out as soon as I can. But why are you using duble i? (ii)
score: 0
type: AnswerComment

grunt-contrib-copy
type: Tag
tags question: http://stackoverflow.com/q/28466039
tag name: grunt-contrib-copy

http://stackoverflow.com/comment/45250528
score: 0
has text: Have you included the jQuery library? like this
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28462280

angular-promise
tags question: http://stackoverflow.com/q/28527592
tags question: http://stackoverflow.com/q/28527810
tags question: http://stackoverflow.com/q/28477650
tags question: http://stackoverflow.com/q/28544542
tags question: http://stackoverflow.com/q/28446869
tag name: angular-promise
tags question: http://stackoverflow.com/q/28497318
tags question: http://stackoverflow.com/q/28526316
type: Tag

http://stackoverflow.com/comment/45429014
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28558637
has text: You want to show the second image when user hover the first image right ?

http://stackoverflow.com/q/28576388
accepted answer: http://stackoverflow.com/a/28576475
tagged with: google-maps-api-3
score: 0
tagged with: google-maps-markers
answer count: 1
has body: I just want to ask I am using google map and MarkerWithLabel for V3 1.1.10,before it works fine,but now it suddenly have this errors InvalidValueError: setIcon: in property rotation: not a number Updated I found out that this is the causes of error rotation: heading[i] this works fine before when I am using googple api v3.17 marker = new MarkerWithLabel({ map: map, labelClass: "themarkersclass", labelStyle: {opacity: 1.0}, labelContent: 'labelcontent here', icon: { path: carauto, scale: .6, strokeColor: 'white', strokeWeight: .7, fillOpacity: 0.8, fillColor: 'red', offset: '5%', rotation: heading[i], anchor: new google.maps.Point(10, 50) }, id: com_name[i] });
type: AnsweredQuestion
has title: InvalidValueError: setIcon: in property rotation: not a number
tagged with: maps
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28576475

http://stackoverflow.com/comment/45492289
type: Comment
comment on: http://stackoverflow.com/a/28586468
type: AnswerComment
score: 0
has text: Thank you. This explanation makes most sense to me. I'm having a hard time really understanding the formula.

http://stackoverflow.com/q/28467294
type: AnsweredQuestion
has body: I have to check for if(x == "An" || x == "Apple" || x == "A" || x == "Day" || x == "Keeps" || x == "The"....and so on){ return true; } else{ return false; } Is there a better way to write the if statement for large number of || conditions?
possible better answer: http://stackoverflow.com/a/28467314
has answer: http://stackoverflow.com/a/28467314
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45260118
has answer: http://stackoverflow.com/a/28467318
score: 0
tagged with: language-agnostic
has title: Alternative to multiple or statements in an if block in Javascript
has answer: http://stackoverflow.com/a/28467394
has answer: http://stackoverflow.com/a/28504397
accepted answer: http://stackoverflow.com/a/28467318
answer count: 4

http://stackoverflow.com/q/28566032
tagged with: javascript
type: UnansweredQuestion
tagged with: ajax
has comment: http://stackoverflow.com/comment/45442401
has title: javascript: Ajax XMLHttpRequest - File not gettin loaded on the Chrome and IE8
score: 1
has comment: http://stackoverflow.com/comment/45442442
favorite count: 0
type: Question
linked to: http://stackoverflow.com/q/21012385
has comment: http://stackoverflow.com/comment/45442906
upvote count: 1
has comment: http://stackoverflow.com/comment/45442716
has body: Regarding this error [in image], I surfed the internet and applied all the techiniques such as Error in Chrome only: XMLHttpRequest cannot load file URL No 'Access-Control-Allow-Origin' header is present on the requested resource, still, it is not working in my local. Am just trying to get the JSON file from system local [D:/somefolder]. Any help? please Get message
has comment: http://stackoverflow.com/comment/45442592
has comment: http://stackoverflow.com/comment/45442488
has comment: http://stackoverflow.com/comment/45442387
has comment: http://stackoverflow.com/comment/45442429
tagged with: google-chrome
tagged with: internet-explorer-8
has comment: http://stackoverflow.com/comment/45442336
answer count: 0
downvote count: 0

http://stackoverflow.com/comment/45477338
comment on: http://stackoverflow.com/q/28581994
score: 0
type: Comment
type: QuestionComment
has text: It looks like Collection2 is modifying the `data` object in-place, without making a defensive clone... try sending `{$set: EJSON.clone(data)}` instead of `{$set: data}` and see if makes any difference.

http://stackoverflow.com/comment/45304560
comment on: http://stackoverflow.com/q/28491592
type: Comment
has text: I never understand why people don't paste the actual code rather than something with typos in it...
score: 0
type: QuestionComment

http://stackoverflow.com/a/28822052
type: Answer
answers question: http://stackoverflow.com/q/28590132
has body: To be less succinct and more specific, I want to call another function, no real need to alert. The other function will do a .load and write values to a database. So should this work? ;cause it doesn't pass the updated value of the global variable :( for instance ... var bVar = "value"; window.onbeforeunload = function() { dosomethingelse( bVar ); } function dosomethingelse( bVar ) { $("#id").val( bVar ); }
score: 0

http://stackoverflow.com/a/28486677
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28486573
has comment: http://stackoverflow.com/comment/45295089
has comment: http://stackoverflow.com/comment/45295138
has body: Typescript introduces a compile-time type checking system, which can warn you about errors before runtime. TS does not compile into a binary representation like Java, it simply transpiles into Javascript which is later interpreted (or compiled) and run by the browser. What Typescript does offer, of particular value for large codebases, is essentially a layer of static analysis prior to runtime. In TS' case, that's centered around publishing type expectations and the contracts those types provide, then verifying they are met from all visible code.
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28486573

http://stackoverflow.com/comment/45371272
type: AnswerComment
has text: This will result in an exception being thrown.It makes no sense to use `JSON.parse()` on an instantiated JavaScript object.
type: Comment
comment on: http://stackoverflow.com/a/28527898
score: 0

http://stackoverflow.com/comment/45382272
score: 0
type: Comment
type: QuestionComment
has text: Thanks for your participation, I searched and tried many script found here in OS! but still couldn't figure it out.
comment on: http://stackoverflow.com/q/28533636

http://stackoverflow.com/comment/45397185
type: Comment
comment on: http://stackoverflow.com/a/28540497
score: 0
type: AnswerComment
has text: Yes you can do this directly on the str, their wont be any issue :-)

http://stackoverflow.com/q/28466312
score: 3
downvote count: 1
linked to: http://stackoverflow.com/q/19467287
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/45258677
has comment: http://stackoverflow.com/comment/45258448
tagged with: javascript
has comment: http://stackoverflow.com/comment/45258296
has body: If the user has the javascript disabled in her browser, Does Stripe degrades gracefully or just breaks?
has comment: http://stackoverflow.com/comment/45258255
answer count: 1
tagged with: stripe-payments
favorite count: 0
has comment: http://stackoverflow.com/comment/45258429
has title: What happens with stripe when javascript is disabled
has answer: http://stackoverflow.com/a/28466518
type: UnansweredQuestion

http://stackoverflow.com/q/28495929
has title: Getting all States/Region/Cities when passing Country name
tagged with: java
accepted answer: http://stackoverflow.com/a/28496144
downvote count: 2
type: Question
upvote count: 4
tagged with: javascript
tagged with: api
answer count: 1
linked to: http://stackoverflow.com/q/4013606
has answer: http://stackoverflow.com/a/28496144
favorite count: 0
has body: i am creating a web application in java using spring where i have to populate all states/region/cities in a drop down when choosing a country. Is there any api, web-service or javascript for achieving the same.
tagged with: web-services
score: 2
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/6659269

http://stackoverflow.com/q/28554352
type: Question
tagged with: greasemonkey
answer count: 1
downvote count: 0
tagged with: url
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/16065937
tagged with: regex
duplicate of: http://stackoverflow.com/q/16065937
has title: How can I replace a segment of the URL and reload the page?
linked to: http://stackoverflow.com/q/24984576
linked to: http://stackoverflow.com/q/3232992
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28554399
upvote count: 1
has body: I need to write a script for Greasemonkey that will check the URL, replace a section of it when certain conditions are met, and reload the page. The URLs in question will always be in this format: https://optionA.example.com/ab/first/second/tonsOfMetadata https://optionB.example.com/ab/first/second/tonsOfMetadata I need the script to check for the "first/second" segment and then replace it with "third/fourth." These will always be the same. The only thing that will change from URL to URL is the metadata and the subdomain which will either be A or B. This is the code I'm trying to get working: var url = window.location.host; var regex = /^(https?:\/\/)([^.]+\.)(example\.com\/ab\/)first\/second(\/.+)$/i; if (url.match(regex) != null){ url = window.location.href; url = url.replace(regex,"$1$2$3third/fourth$4"); return; } console.log(url); window.location.replace(url); } I'm sure I'm missing something obvious, but my experience with coding is limited. I've adapted the code from here: Replace parts of a URL in Greasemonkey and from here: Rewrite parts of a URL in Greasemonkey and FireFox. Any help will be much appreciated, thanks in advance!
score: 1

http://stackoverflow.com/comment/45360343
type: QuestionComment
type: Comment
score: 0
has text: Well one div is simply a picture, and the other is three lines of information : user, date, time. Which would you recommend?
comment on: http://stackoverflow.com/q/28521104

http://stackoverflow.com/comment/45306407
has text: how can i send you the whole code?may you check the whole?
type: Comment
comment on: http://stackoverflow.com/a/28492670
score: 0
type: AnswerComment

http://stackoverflow.com/q/28505750
type: UnansweredQuestion
has body: I am designing a simple game using VRML V2.0. But there is a problem. I need to create an avatar and allow this avatar to move. Then create walls and exhibit the avatar from crossing the walls using collision detection and prevention. But how to detect and prevent such collisions? What is available is to detect collisions by the viewers and the shapes using the Collision node which does not satisfy my requirements. I need to detect collisions between a shape and a shape so I will move a shape and if it hit another shape, collision occur.
tagged with: augmented-reality
type: Question
tagged with: graphics
has title: VRML: Prevent avatar from collision
tagged with: javascript
score: 0
answer count: 1
tagged with: vrml
has answer: http://stackoverflow.com/a/32759918
tagged with: virtual

webrtc
tags question: http://stackoverflow.com/q/28490150
type: Tag
tags question: http://stackoverflow.com/q/28514212
tags question: http://stackoverflow.com/q/28518557
tag name: webrtc
tags question: http://stackoverflow.com/q/28508302

http://stackoverflow.com/comment/45384226
score: 0
type: AnswerComment
type: Comment
has text: It would have to be done in a controller because you have to add references etc in .NET as far as I know. I only have experience in the .NET MVC realm
comment on: http://stackoverflow.com/a/28534833

http://stackoverflow.com/q/28442880
has answer: http://stackoverflow.com/a/28450847
tagged with: javascript
upvote count: 3
has comment: http://stackoverflow.com/comment/45448350
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45327221
has body: I am new to Mongo Node.js driver. My problem is, I have set up a timestamp (in miliseconds) field in Mongo, and now I try to group it by seconds. Timestamp is a number (Int64), I want to have it grouped and counted with division by 1000. My MongoDB Shell query works fine: db.default.group( { keyf: function(doc) { var secs = (doc.timestamp/1000).toFixed(); return {'data':secs}; }, cond: {source:1}, initial: {count:0}, reduce: function(obj, prev) {prev.count++;} }) My problem is I can't get to work my Node.js query: var keyf = function(doc) { var secs = (doc.timestamp/1000).toFixed(); return {'data': secs}; }; collection.group(keyf, {}, {"count":0}, "function(obj, prev){prev.count++;}", false, function(err,results) { console.log(results); }); It looks as if group never noticed keyf function. Any ideas?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45444245
has title: MongoDB Node.js group by calculated key
tagged with: node.js
score: 3
downvote count: 0
type: Question
tagged with: mongodb
has comment: http://stackoverflow.com/comment/45373358

http://stackoverflow.com/q/28577678
downvote count: 0
tagged with: jquery
score: 1
favorite count: 0
type: Question
has title: "/" Get Removed from the URL When onclick Event
accepted answer: http://stackoverflow.com/a/28577928
has body: I change current url of the webpage using window.history.replaceState() without refreshing the page. so that I can append to current url YouTube VideoID when ever user clicks on the video which are listed on this page and plays the same video in the same page. Let us assume sample urls are - Default Video page http://www.domain.com/video/ After User clicks on video URL changes to removing the last / http://www.domain.com/video#Se1y2R5QRKU I want url to remain with / http://www.domain.com/video/#wckLzQDTm6s Here is the script I am using but I am not sure what is remove last / from the url var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&amp;\?]*).*/; var match = URL.match(regExp); if (match &amp;&amp; match[7].length == 11) { //console.log(match[7]); currentURL = document.URL; // alert(currentURL.slice(0, currentURL.lastIndexOf('#'))); console.log(currentURL.slice(0, currentURL.indexOf('#'))); var sliceURL = currentURL.slice(0, currentURL.indexOf('#')); var newURL = sliceURL + '#' + match[7]; window.history.replaceState(null, "Video Gallery", newURL); return match[7]; } else { //alert("Could not extract video ID."); }
upvote count: 1
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28577928
type: AnsweredQuestion

http://stackoverflow.com/comment/45295571
has text: Right.. So the path isn't correct. What about ```templateUrl: 'yourmainfolder/views/modal.html'```?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28461579

http://stackoverflow.com/comment/45321371
score: 0
type: Comment
type: QuestionComment
has text: if you want to trust only on js you have to do spaghetti code, hard to read and modify and you can also monitor if core functions in your app are changing but that's not solving your problem imo, because if you won't validate it on server side someone can do just a save result request with best score
comment on: http://stackoverflow.com/q/28500967

http://stackoverflow.com/comment/45395992
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28539265
has text: You've confused the path of the file and the URL for the file. AJAX works by submitting data to a live *url*, not the server path of the file.
score: 0

http://stackoverflow.com/comment/45471701
has text: Have you verified if this element exists? Because your code works for me with another address and element.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28581791

http://stackoverflow.com/comment/45273870
has text: I suppose its not necessary in this case, but if I had another class to bind when hasSubAllocations = false it would go after that colon.
comment on: http://stackoverflow.com/q/28470659
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45333387
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28507074
has text: I was wondering the same thing. No idea.
score: 0

http://stackoverflow.com/q/28444209
tagged with: javascript
upvote count: 2
has title: angularJs isArray: false or true
has comment: http://stackoverflow.com/comment/45220657
has comment: http://stackoverflow.com/comment/45218161
has body: I try to get data from database by spring rest and AngularJS but I get this error: when make isArray : true "Error: [$resource:badcfg] Error in resource configuration. Expected response to contain an array but got an object and when try to solve this error by make 'query': { method: 'GET', isArray: false} I get this error [$rootScope:inprog] $digest already in progress http://errors.angularjs.org/1.2.26/$rootScope/inprog?p0=%24digest this is my code @RequestMapping(value = "/rest/assets", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public List<Asset> getAll() { log.debug("REST request to get all Assets"); List<Asset> assets=assetService.getAllOrderByIdDesc(); return assetService.getAllOrderByIdDesc(); } rout.js adapApp .config(function ($routeProvider, $httpProvider, $translateProvider , USER_ROLES) { $routeProvider .when('/asset', { templateUrl: 'views/assets.html', controller: 'AssetController', resolve:{ resolvedAsset: ['Asset', function (Asset) { return Asset.query().$promise; }] }, access: { authorizedRoles: [USER_ROLES.all] } }) }); service.js adapApp.factory('Asset', function ($resource) { return $resource('app/rest/assets/:id', {}, { 'query': { method: 'GET', isArray: false}, 'get': { method: 'GET'} }); }); Controller adapApp.controller('AssetController', function ($scope, resolvedAsset , Asset ) { $scope.assets = resolvedAsset; }); html page {{asset.id}} {{asset.assetName}} {{asset.locations[0]}} {{asset.airport.iatacode}} {{asset.lastupdateUserid}} {{asset.lastupdateDateTime}} {{asset.domainName}}
favorite count: 0
tagged with: rest
tagged with: angularjs
type: UnansweredQuestion
tagged with: spring-mvc
score: 2
answer count: 0
downvote count: 0
tagged with: java
has comment: http://stackoverflow.com/comment/45218049
type: Question

http://stackoverflow.com/comment/45479983
type: QuestionComment
has text: try to simplify your example and reduce all the irrelevant clutter. Here's a reduced version that works: http://plnkr.co/edit/zf4KWJbiVGRz5iFAu3OT?p=preview
comment on: http://stackoverflow.com/q/28585833
score: 0
type: Comment

http://stackoverflow.com/comment/45438830
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28563623
has text: I am using angular in the front end and c# backend

http://stackoverflow.com/comment/45356232
type: QuestionComment
has text: sorry for that. Changed it.
score: 0
comment on: http://stackoverflow.com/q/28519492
type: Comment

http://stackoverflow.com/comment/45343906
comment on: http://stackoverflow.com/a/28493173
score: 0
type: AnswerComment
has text: Sorry for my late reply @Prah, went out with friends to a pub last night and got back pretty late, did some experimentation and solved my own problem. I did some research and discovered that you can't actually specify widths, but some forum some people had some alternate ideas. I didn't really understand the alternate idea, so I created my own through trial and error. Here is the forum thread: http://stackoverflow.com/questions/2295311/css-list-item-width-height-does-not-work
type: Comment

http://stackoverflow.com/comment/45273788
comment on: http://stackoverflow.com/a/28456910
type: AnswerComment
score: 0
type: Comment
has text: @nu11p01n73R and anubhava: thanks for your help, but in my regex it doesn't work. Can you tell me why? I have a very long regex, that almost works perfectly. Now I want to exclude the matches without white spaces and with less than 8 digits. So I added (?=(.*?\d){8,}) in front of my whole regex, but it also matches +33 (33) 3 if there are some more numbers following. And the exclusion of numbers containing no white space doesn't work either (its not in my example regex). [Demo](https://regex101.com/r/rS6qM7/1)

http://stackoverflow.com/q/28465555
has answer: http://stackoverflow.com/a/28465694
score: 0
tagged with: image
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Hovering over an image in one div container to have an img or background appear in or over top of a different container
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: So I'm fairly new as far as coding goes, just so everyone knows. I'm trying to accomplish two simultaneous things 1. The first is, I would like be able to hover over an image in one container and have another image in a different container appear. Even if that means having an image that technically overlaps the container and just happens to have the same dimensions (which are width: 350px and height: 205px, by the way). If another solution is to have the initial image be a clickable link to open the second image, that would be fine too. In fact, that'd be preferable. 2. I need to do this multiple times, each with different initial and secondary images, with float:right or a similar css function involving setting the sets of initial images being wrapped to the right of my first div container. 3. I need to maintain the set of initial images (buttons), in two rows, with overlap-y: hidden and overlap-x: scroll. My css for the button images is this, and must either stay this way or have a similar effect: div.img { margin: 10px; **padding: 5px;** **height: 38px;** **width: 38px;** float: right; display:inline;} div.img img { **height: 38px** **width: 38px** display: inline; float:right; margin: 10px; **border: 12px solid #ffffff;** **border-radius: 8px;** **box-shadow: 3px 3px 1px #888888;** I put all the key points of the css that I need to keep (or display in a similar fashion) in bold. The part in question is the display: inline function. I need my set of images to be in two rows, wrapping to the right side of the container (or at least scrolling horizontally), but instead they are displaying as two rows of three, then one vertical column that is no longer aligned with the two rows of three. To see the type of solution I'm looking for, here's the page: http://hellothisismelody.tumblr.com/codeconstruction/ As you can see, it's set up like a Nintendo 3DS. I'm looking to make functioning buttons on the bottom screen that make an image appear in the top screen, and looking…
type: UnansweredQuestion

http://stackoverflow.com/comment/45337468
type: Comment
comment on: http://stackoverflow.com/q/28508915
has text: @tymeJV - That seems to be the issue! If you could set it as an answer I could accept it as the correct answer.
score: 0
type: QuestionComment

http://stackoverflow.com/q/28570786
has comment: http://stackoverflow.com/comment/45451468
has comment: http://stackoverflow.com/comment/45451436
score: 2
type: AnsweredQuestion
downvote count: 0
has title: 3rd Level Dot Notation With Angular?
type: Question
tagged with: http://stackoverflow.com/tag/json
upvote count: 2
has body: I'm rather new to Angular and I am losing my mind trying to find information on how to access the third level of a controller. Below you'll see a simplified version of my code. I would expect the expression to resolve as "2". Instead, it produces nothing. My code is working fine otherwise. For instance, when I, instead, use thisDatasheet.settings, the page renders the array as expected... I just can't access that grand-child level. Oddly, elsewhere in my code, when I have inner loops, I am able to access the 3rd level by referencing the parent loop. Is there some kind of wrapping I need to do? I would hate to have to wrap this in an outer loop for no reason... that seems a little messy to me. I'm sure there's some fundamental practice which I'm missing here that hasn't been covered in any of the online tutorials I have done. Thanks in advance! {"datasheets":[ { "title":"Thing 1", "settings":[ { "topdisplay":"columns", "bottomcolumns":"2" } ] }, { "title":"Thing 2", "settings":[ { "topdisplay":"stacked", "bottomcolumns":"2" } ] } ]} &lt;div data-ng-repeat="thisDatasheet in datasheets"&gt; &lt;div class="columns-{{thisDatasheet.settings.bottomcolumns}}"&gt; My content goes here! &lt;/div&gt; &lt;/div&gt;
has answer: http://stackoverflow.com/a/28570866
accepted answer: http://stackoverflow.com/a/28570866
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45451481

http://stackoverflow.com/comment/45314484
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28497431
type: AnswerComment
has text: Awesome! Thank you very much, Sir! I'm sorry I am not able to upvote coz I have less reputation.

http://stackoverflow.com/comment/45312196
type: QuestionComment
has text: I think your external javascript doesn't load properly. First answer for this question can help you: http://stackoverflow.com/questions/14897849/load-external-script-without-cache-using-javascript
comment on: http://stackoverflow.com/q/28496087
score: 0
type: Comment

http://stackoverflow.com/a/28468146
answers question: http://stackoverflow.com/q/28468099
has body: You are trying to access person as if it were a global variable. person is defined on the scope, which can be accessed the same way as in the html: template: "Got count {{person.addresses.length}}"
has comment: http://stackoverflow.com/comment/45262850
type: Answer
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28468099
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28537679
favorite count: 0
has body: I have to check the IndexedDB availability for the Firefox browser only. Currently I do the trick with this : var IDB_SUPPORTED = 'indexedDB' in window; Simple. But if I disable IndexedDB in about:config (with the dom.indexedDB.enabled parameter), IDB_SUPPORTED is still true. How can I check the real availability of IndexedDB in Firefox without any third-party library like Modernizr?
has answer: http://stackoverflow.com/a/28537869
accepted answer: http://stackoverflow.com/a/28537869
score: 2
type: AnsweredQuestion
upvote count: 2
has title: Check the real availability of IndexedDB in Firefox
type: Question
tagged with: indexeddb
tagged with: firefox
answer count: 1
downvote count: 0
tagged with: javascript

iteration
tags question: http://stackoverflow.com/q/28482994
tags question: http://stackoverflow.com/q/28442009
tags question: http://stackoverflow.com/q/28456134
type: Tag
tags question: http://stackoverflow.com/q/28553946
tag name: iteration

http://stackoverflow.com/comment/45374878
type: AnswerComment
has text: if you want to search for ` ` but also allow other characters between them, then you are not searching for ` `, but for something different. E.g. regexp ` \s* ` or maybe you are searching for `<html[^>]+>\s*<body[^>]+>`. Anyway you need to decide what you are searching for, to have a chance to find it.
type: Comment
comment on: http://stackoverflow.com/a/28529469
score: 0

http://stackoverflow.com/comment/45345999
score: 0
has text: Node.js is often used with Phantom. But I am not all that familiar with using it that way. Sorry. Maybe this will help http://code4node.com/snippet/web-scraping-with-node-and-phantomjs
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28513766

http://stackoverflow.com/comment/45254427
comment on: http://stackoverflow.com/q/28464276
score: 0
type: Comment
type: QuestionComment
has text: are you using Html5Mode? if you are, you need a route in express to handle it; if not, then your angular route is `#/home`, where the `#` suppresses the browser reload and call to the server for a non-existent page. if you have a Get in your browser for `/home`, you tried to request that from the server, which the server can't respond to.

http://stackoverflow.com/a/28560315
has comment: http://stackoverflow.com/comment/45433570
has comment: http://stackoverflow.com/comment/45432409
type: Answer
has comment: http://stackoverflow.com/comment/45432318
has body: Instead, pass the value and the onKeyDown in the second argument. You could even include maxlength that works with text areas so you don't need to use your JavaScript function. $options = array( "value" =&gt; 0, "onKeyDown" =&gt; "limitText(age, 10)", "maxlength" =&gt; 10 //only include if you want this instead of javascript ); echo form_textarea('age', $options);
has comment: http://stackoverflow.com/comment/45432127
upvote count: 1
answers question: http://stackoverflow.com/q/28560213
score: 1
has comment: http://stackoverflow.com/comment/45432677
has comment: http://stackoverflow.com/comment/45433840
downvote count: 0

http://stackoverflow.com/comment/45411952
type: Comment
comment on: http://stackoverflow.com/a/28509684
has text: alert(parseInt('08')); shows a diferent value in mozilla (8) and a diferent value in safari (0). and because of this , in safari i recived a non valid date from the compareDate function. we had to use : parseInt(str1.split(sep)[1], 10);
score: 0
type: AnswerComment

http://stackoverflow.com/q/28575628
has answer: http://stackoverflow.com/a/28575695
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/45795777
accepted answer: http://stackoverflow.com/a/28575728
type: Question
has comment: http://stackoverflow.com/comment/45460877
possible better answer: http://stackoverflow.com/a/28575695
tagged with: internet-explorer
score: -2
tagged with: javascript
has answer: http://stackoverflow.com/a/28575728
has comment: http://stackoverflow.com/comment/45460848
has title: javascript function not working in IE and firefox
downvote count: 2
answer count: 3
has answer: http://stackoverflow.com/a/28575696
tagged with: firefox
has body: I have a function written in javascript as follows, &lt;script&gt; function newPopup(url) { popupWindow = window.open(url,'popUpWindow','height=700,width=1300,left=480,top=190,resizable=no,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=yes').focus(); } &lt;/script&gt; And Its called like this within the href of a button document.getElementById('user-help').href = 'Javascript:newPopup("&lt;spring:message code="user.help.dashboard"&gt;&lt;/spring:message&gt;")'; This works in Chrome and Opera. But doesn't work in IE and Firefox.In firefox just a blank page appears while in IE error called page cannot be displayed. Can someone please give me a solution for this. I have searched, but did not find a favorable solution.
has comment: http://stackoverflow.com/comment/45460604
favorite count: 0

http://stackoverflow.com/comment/45447781
comment on: http://stackoverflow.com/q/28567965
type: Comment
type: QuestionComment
score: 0
has text: @isherwood you can have a look at the wordpress admin demo here https://demos1.softaculous.com/WordPress/wp-login.php username: admin password: pass

http://stackoverflow.com/comment/45311102
score: 0
comment on: http://stackoverflow.com/a/28495577
type: AnswerComment
has text: While I do agree that str.charAt() may be more readable and generally better, I don't like the "not cross-browser compatible" argument in this case. It may not work in IE7 or previous, but if we keep supporting them, the users will have no reason to get rid of it, and we will need to support it forever. Of course, if the bracket notation is not part of the ECMAscript standard, it shouldn't be used. I don't know if it is.
type: Comment

http://stackoverflow.com/a/28527393
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28521616
has body: There are 3 things u r doing wrong - 1 - getElementsById its getElementById which will return you only single element not a collection of it. There is no method getElementsById as far as i know. 2 - you are missing return in your executeScript method. 3 - There is no src attribute attached to div element whose id you have passed. src is attached to only img attribute. So finally your code should be something like: String imgeJs = jse.executeScript("return document.getElementById('sc859').childNodes[1].getAttribute('src')").toString(); or you can also achieve it by: WebElement element = driver.findElement(By.cssSelector("#sc859" &gt; img.alc-img)); String imgeJs = jse.executeScript("return arguments[0].getAttribute('src')", element).toString(); Or else follow rest of the answers where you can simply get it done by element.getAttribute("src") method of WebElement interface.

slick.js
tag name: slick.js
tags question: http://stackoverflow.com/q/28589445
tags question: http://stackoverflow.com/q/28546163
type: Tag

http://stackoverflow.com/a/28590579
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28588653
answers question: http://stackoverflow.com/q/28588653
has body: Your code realy didn't return a Promise: return deferred.reject(new Error('itemId is a required field')); It return undefined. So, fix it next way: return Promise.reject(new Error('itemId is a required field'));
score: 0

http://stackoverflow.com/comment/45276789
score: 0
type: AnswerComment
has text: This has the opposite effect: The parent still works when clicked on the child, but not the child.
type: Comment
comment on: http://stackoverflow.com/a/28476017

http://stackoverflow.com/comment/45414114
has text: @jdphenix I agree. OP should really consider using modern techniques, regardless of the so far absent reason as to why they are using code from the nineties. Two immediate things come to mind, (1) future proofing, and, (2) for their own learning - it would not be productive to learn & spend time on framesets and documentwrite.
score: 0
comment on: http://stackoverflow.com/q/28550264
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28495678
has body: I have upgraded full calendar from version 1.6.4 to version 2.0.0 and i have also integrated Google Calendar in it. During upgradation, I have replaced fullcalendar.min.js, jquery-ui.custom.min.js, moment.js and fullcalendar.js. After that i noticed that format of date has been changed. for example. First issue in date format Previously Start/End value in eventSources = Sun Feb 15 2015 08:30:00 GMT+0530 (India Standard Time). Now Start/end value = 2015-09-25 Second issue in date format In eventClick: function(calEvent, jsEvent, view) { } function, value of jsEvent is also not same. I tried to play with timezone but it was unsuccessful. If i upgrade to full calendar latest version 2.2.7 then Google calendar integration does not work. Main problem: date format changed with upgradation of full-calendar. I have not specified any time zone. It might be other problem but i did not able to figure out it.
score: 0
has title: How to get correct date time format after upgrading full calendar API
favorite count: 0
answer count: 0
type: UnansweredQuestion
tagged with: google-calendar-api
has comment: http://stackoverflow.com/comment/45325827
upvote count: 1
tagged with: php
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45311983
tagged with: javascript
tagged with: fullcalendar
tagged with: jquery

http://stackoverflow.com/a/28564459
score: 1
has comment: http://stackoverflow.com/comment/45440514
answers question: http://stackoverflow.com/q/28564313
upvote count: 1
has body: Example from AngularJS Phonecat tutorial Is this not working for you? phonecatControllers.controller('PhoneDetailCtrl', ['$scope', '$routeParams', function($scope, $routeParams) { $scope.phoneId = $routeParams.phoneId; }]); In your case it would be $routeParams.appId. Remember to include $routeParams in your controller. However ['$scope', '$routeParams' is not required. Just nice to have if you're minifying.
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/45439986

http://stackoverflow.com/comment/45471763
comment on: http://stackoverflow.com/q/28581799
has text: See how different the 2 answers you have are? Your question is not clear enough. What I understand : You only want one item per line, on any screen size?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28544299
has comment: http://stackoverflow.com/comment/110544067
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28543821
score: 28
has body: By doing this: arr = bufferString.split('\n'); you will have an array containing all rows as string ["fname, lname, uid, phone, address","John, Doe, 1, 444-555-6666, 34 dead rd",...] You have to break it again by comma using .split(','), then separate the headers and push it into an Javascript Object: var jsonObj = []; var headers = arr[0].split(','); for(var i = 1; i &lt; arr.length; i++) { var data = arr[i].split(','); var obj = {}; for(var j = 0; j &lt; data.length; j++) { obj[headers[j].trim()] = data[j].trim(); } jsonObj.push(obj); } JSON.stringify(jsonObj); Then you will have an object like this: [{"fname":"John", "lname":"Doe", "uid":"1", "phone":"444-555-6666", "address":"34 dead rd" }, ... }] See this FIDDLE
accepted answer of: http://stackoverflow.com/q/28543821
type: Answer
downvote count: 0
upvote count: 28
has comment: http://stackoverflow.com/comment/45402587
has comment: http://stackoverflow.com/comment/45402713

http://stackoverflow.com/comment/115203657
type: Comment
comment on: http://stackoverflow.com/q/28546182
has text: Possibly useful: https://stackoverflow.com/q/52512309/28324
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45314485
type: Comment
has text: the classSet function takes a normal javascript object so, I don't think it needs documentation...
comment on: http://stackoverflow.com/a/28497467
score: 0
type: AnswerComment

http://stackoverflow.com/a/28584733
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45477752
type: Answer
upvote count: 1
has body: You need to use spawn instead of exec. Spawn sends the data back as a stream, so you can tap into it with stdout.on(fn). var spawn = require('child_process').spawn; var proc = spawn(executableFile); proc.stderr.on('data', function(stderr) { console.log('exec error: ' + stderr); }); proc.stdout.on('data', function(stdout) { $('#console-output').append('stdout: ' + stdout.toString() + '&lt;br/&gt;'); });
accepted answer of: http://stackoverflow.com/q/28583620
score: 1
answers question: http://stackoverflow.com/q/28583620
has comment: http://stackoverflow.com/comment/45477913

http://stackoverflow.com/q/28547270
score: 0
answer count: 1
tagged with: quickblox
has title: Quickblox sigBytes error - authentication for chat
tagged with: cordova
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28547451
has body: Another quickblox question - I am getting the following error when trying to run my application: Uncaught TypeError: Cannot read property 'sigBytes' of undefinedquickblox.js:10707 c.HMAC.i.extend.initquickblox.js:10703 i.Hasher.a.extend._createHmacHelperquickblox.js:101 signMessagequickblox.js:35 createSessionquickblox.js:867 QuickBlox.createSessionchat.html:122 (anonymous function) This error prevents successful authentication of the user. The code being executed is below(insecure as hell - proof of concept only!): var chatToUser = window.localStorage.getItem("chatToUser"); var username = window.localStorage.getItem("user"); var password = window.localStorage.getItem("pwd"); var params = {login:username,password:password}; console.log("PARAMS: ",params); $(document).ready(function(){ var chatService = new QBChat(params); }); // JavaScript SDK initialization QB.init(QBAPP.appID, QBAPP.authKey, QBAPP.authSecret); // QuickBlox session creation QB.createSession(params, function(err, result) { if (err) { console.log("ERROR:", err.detail); } else { chatUser = { id: result.user_id, pass: params.password }; connectChat(); } }); function connectChat() { chatService = new QBChat({ onConnectFailed: onConnectFailed, onConnectSuccess: onConnectSuccess, onConnectClosed: onConnectClosed, onChatMessage: onChatMessage }); console.log("Chat Service: ", chatService); console.log("Chat User: ", chatuser); // connect to QB chat service chatService.connect(chatUser); } /* Callbacks ------------------------------------------------------*/ // Connection is failed function onConnectFailed() { alert("We're having some difficulty talking to the server. Please try again later, or get in touch if th eproblem persists.") } // Connection is success function onConnectSuccess() { //green dot - live - status alert("Connected.") } // Connection is closed function onConnectClosed() {} What do i need to do differently in order to successfully log the user in for chat? If it helps, I have previously ge…
tagged with: javascript

http://stackoverflow.com/a/28577674
has body: This was a stupid Robo Mongo Setup Issue. In the Robo Mongo Window, Go To Options. Select Display Dates IN. Choose Local Time Zone. You are sortedd then! Cheers and Thanks!
type: Answer
answers question: http://stackoverflow.com/q/28570122
score: 0

http://stackoverflow.com/a/28561930
has comment: http://stackoverflow.com/comment/90883067
accepted answer of: http://stackoverflow.com/q/28490700
has body: Here's how you'd implement such an operator using existing operators. There is one snag you need to think about. Because your filter operation is async, it is possible for new items to arrive faster than your filter operation can process them. What should happen in this case? Do you want to run the filters sequentially and guarantee that the order of your items is maintained? Do you want to run the filters in parallel and accept that your items may come out in different order? Here are the 2 versions of the operator // runs the filters in parallel (order not guaranteed) // predicate should return an Observable Rx.Observable.prototype.flatFilter = function (predicate) { return this.flatMap(function (value, index) { return predicate(value, index) .filter(Boolean) // filter falsy values .map(function () { return value; }); }); }; // runs the filters sequentially (order preserved) // predicate should return an Observable Rx.Observable.prototype.concatFilter = function (predicate) { return this.concatMap(function (value, index) { return predicate(value, index) .filter(Boolean) // filter falsy values .map(function () { return value; }); }); }; Usage: var predicate = Rx.Observable.fromNodeCallback(someAsynCheckFunc); someObservable.concatFilter(predicate).subscribe(...);
answers question: http://stackoverflow.com/q/28490700
type: AcceptedAnswer
upvote count: 17
type: Answer
has comment: http://stackoverflow.com/comment/45466465
has comment: http://stackoverflow.com/comment/53121269
downvote count: 0
score: 17

http://stackoverflow.com/comment/45228879
type: Comment
comment on: http://stackoverflow.com/q/28450459
has text: I think so. Does it produce strange results when you do?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/53242225
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28517910
type: QuestionComment
has text: check mine, though I'm using alt as flux implementation of flux, alt can bootstrap react-router history and map it on the server. https://github.com/syarul/isoblog

http://stackoverflow.com/q/28540199
has answer: http://stackoverflow.com/a/28544235
accepted answer: http://stackoverflow.com/a/28544235
type: Question
tagged with: javascript
has body: $(document).on("click", "[id*=lnkView]", function () { $("#resultId").html($(".ResultId", $(this).closest("tr")).html()); **//$("#name").html($(".Name", $(this).closest("tr")).html()); //$("#description").html($(".Description",$(this).closest("tr")).html());** $("#dialog").dialog({ title: "Analyze Result", buttons: { Ok: function () { $(this).dialog('close'); } }, modal: true }); return false; }); &lt;/script&gt; This is my script. How do I link it to the database ? I am completely new to javascript.
score: 0
tagged with: modal-dialog
answer count: 1
tagged with: asp.net
linked to: http://stackoverflow.com/q/5316697
has title: Show Modal on click of linkButton
has comment: http://stackoverflow.com/comment/45395933
type: AnsweredQuestion

http://stackoverflow.com/comment/45251260
comment on: http://stackoverflow.com/a/28460038
score: 0
type: AnswerComment
has text: In prettyprint, I look for settimeout in the scatter default file; `setTimeout(function() { var b = c.length, a = ""; for (label in g) a += ", " + label; for (; b--; ) f(c[b].labels.toString() + " UNFIRED; " + a.substr(2) + " DONE", "", "", "unfired_label") }, 2E4); var h = function() { QWait("quizlib", function() { QLoad("dom"); QLoad("onload") }) };` how will i use this?
type: Comment

http://stackoverflow.com/comment/45334506
has text: they probably fire an event when it changes, or you could use a plain old html _input_ event to update the model or at least call the validation routine...
comment on: http://stackoverflow.com/q/28507763
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28479557
upvote count: 1
has comment: http://stackoverflow.com/comment/45281549
answers question: http://stackoverflow.com/q/28474483
accepted answer of: http://stackoverflow.com/q/28474483
has comment: http://stackoverflow.com/comment/47785502
type: AcceptedAnswer
downvote count: 0
has body: You simply need to remove or replace track by $index. Tracking by $index will give you the following behavior: There is an array of max 10 length that represents the items to show. The first item will have index 0. You go to the next page and the items in the array are replaced. The first item in the array will still have index 0. Since you are tracking by index and the index has not changed, AngularJS will not recreate the DOM node representing the item. Since the DOM node isn't recreated, the directive will not execute this time and the rating will not update. If you go from page 3 to page 2, the directive will execute for the 7 last elements on page 2, since they didn't exist on page 3, so they are considered new this time. If you really need to use track by you should use a property that is actually related to the object (and unique), for example: dir-paginate="asset in assets | itemsPerPage: 10 track by asset.name" Demo: http://plnkr.co/edit/A80tSEliUkG5idBmGe3B?p=preview
type: Answer
score: 1

http://stackoverflow.com/comment/45397393
score: 0
comment on: http://stackoverflow.com/a/28541685
type: AnswerComment
type: Comment
has text: @JsIsAwesome: Okay, I've added one, but catching exceptions and using `setTimeout` are both really basic.

http://stackoverflow.com/q/28475604
accepted answer: http://stackoverflow.com/a/28475780
possible better answer: http://stackoverflow.com/a/28475679
has answer: http://stackoverflow.com/a/28475679
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45274583
score: 0
answer count: 3
has title: HTML tables getting specific table row using id
has answer: http://stackoverflow.com/a/28475684
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45274515
has answer: http://stackoverflow.com/a/28475780
has body: i have two rows with same id in two different tables , i need both of these rows.i can get first using getElementById , but not able to get second. i have both table id's and row ids , is there any way to get that row directly by by using its table reference ?
linked to: http://stackoverflow.com/q/4789859
type: AnsweredQuestion

http://stackoverflow.com/q/28509103
possible better answer: http://stackoverflow.com/a/28509428
tagged with: javascript
has comment: http://stackoverflow.com/comment/45337312
has answer: http://stackoverflow.com/a/28509428
has comment: http://stackoverflow.com/comment/45337418
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/28509146
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28509123
has comment: http://stackoverflow.com/comment/45337382
type: AnsweredQuestion
tagged with: audio
has title: HTML5 audio player. Cannot change the src element
has comment: http://stackoverflow.com/comment/78642808
linked to: http://stackoverflow.com/q/9421505
has answer: http://stackoverflow.com/a/28509146
type: Question
has body: I am trying to dynamically change the value of the src of my HTML audio player and for some reason I can't change it and it stuck on it's placeholder value. This is my HTML element: &lt;audio controls preload="none" style="width:480px;"&gt; &lt;source id="mp3" src="placeholder" type="audio/mp3" /&gt; &lt;/audio&gt; And this is my Javascript: var tempMp3 = "http://www.someurl.org/somefile.mp3"; $("#mp3").attr("src", tempMp3); Anybody knows what silly mistake am i doing here? Cheers

http://stackoverflow.com/q/28531123
type: Question
tagged with: c#
has body: I am starting my own Angular web application. I have experience coding in c# and angular but I have never had to set up my own project/solution. In this case, I would like to set up an ASP.NET Web API that will communicate to an Angular SPA front end in JSON (although it should be agnostic to the front end, any application that speaks JSON should be able to communicate with it). Additionally, I have heard good things about grunt and so I would like to incorporate it into the project (at the very least to compile LESS and minify and combine my angular files). I am working with visual studio professional 2013. I began by creating a Web API project and downloading the WebEssentials plugin. I am just a little confused on how to continue here. Should I split out my angular into a separate project in the same solution? How do I include grunt? How do I use grunt in the context of visual studio to include my angular files in my index.html file? The project comes with a Scripts folder and a Views folder. I know that it is preferable to structure the angular files by function so that the controllers and views are housed together. Should I be including my views in the scripts folder? How does that affect my build procedure? I realize these may be very naive questions. Please bear with me, I am a complete beginner when it comes to these kinds of tasks. All I have done in the past is basically code.
tagged with: javascript
downvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28531338
tagged with: asp.net
favorite count: 0
tagged with: angularjs
score: 2
type: AnsweredQuestion
has title: How to set up a ASP.NET API / AngularJS project
upvote count: 2
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28531338

http://stackoverflow.com/comment/45228894
comment on: http://stackoverflow.com/q/28450297
type: QuestionComment
has text: as i mentioned you need to be more specific, you can't do a query to your server in javascript without some service in the middle. are you using .net MVC, or php in the middle or all your project based on client side ?
type: Comment
score: 0

http://stackoverflow.com/q/28485298
downvote count: 1
type: Question
has body: I'm struggling with porting this function to PHP. SomeString.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); To be honest I don't even know what exactly it does. I tried using at least the expression with preg_replace but got preg_match(): Compilation failed: missing terminating ] for character class at offset 25 when using something like preg_match('/([.*+?^=!:${}()|\\[\\]\\/\\])/', $string, $matches);
possible better answer: http://stackoverflow.com/a/28485374
tagged with: javascript
tagged with: replace
score: 0
has answer: http://stackoverflow.com/a/28485955
answer count: 2
favorite count: 0
tagged with: preg-replace
tagged with: php
tagged with: regex
has title: translate regex to PHP
accepted answer: http://stackoverflow.com/a/28485955
type: AnsweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/28485374

http://stackoverflow.com/q/28465442
has comment: http://stackoverflow.com/comment/45258284
accepted answer: http://stackoverflow.com/a/28474878
type: Question
has body: I'm trying to animate a custom modal directive using ng-show, following the example shown on the Angular website (example is at the very bottom of the page). However, I haven't had any luck getting it to work. I'm using Angular 1.3.x with Bootstrap 3.3.x. I'm not using Angular UI Bootstrap because a custom modal directive is more flexible for my needs. Here's what I've got so far: Modal.js: angular.module('plunker', []) .directive('myModal', function() { return { restrict: 'E', transclude: true, replace: true, templateUrl: 'modal.html', controller: 'ModalCtrl', link: function(scope, element, attrs) { scope.showModal = false; if (attrs.title === undefined) { scope.title = 'Modal Title Placeholder'; } else { scope.title = attrs.title; } scope.$watch('showModal', function(isHidden) { if (isHidden) { } else { } }); } }; }).controller('ModalCtrl', ['$scope', function($scope) { $scope.$open = function() { $scope.showModal = true; }; $scope.$close = function() { $scope.showModal = false; }; } ]); modal.html: {{title}} modal.css: .modal-fade { opacity: 1; display: block !important; } .modal-fade .ng-hide-add .ng-hide-add-active, .modal-fade .ng-hide-remove .ng-hide-remove-active { -webkit-transition: all linear 1s; -moz-transition: all linear 1s; transition: all linear 1s; } .modal-fade .ng-hide { opacity: 0; display: none; } index.html: Some text Close Open Modal Everything else works fine, i.e. the Modal shows up and can be closed, but there's no animation. Here's a Plunkr link to the code.
score: 2
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45262986
favorite count: 0
tagged with: css
has answer: http://stackoverflow.com/a/28474878
has title: Cannot Animate Custom Directive with ngShow
tagged with: ng-animate
tagged with: angularjs
upvote count: 2
tagged with: twitter-bootstrap
type: AnsweredQuestion

http://stackoverflow.com/a/28468734
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/135327557
type: Answer
has comment: http://stackoverflow.com/comment/45262760
has comment: http://stackoverflow.com/comment/45303314
accepted answer of: http://stackoverflow.com/q/28468449
answers question: http://stackoverflow.com/q/28468449
downvote count: 0
score: 6
has body: Since both files are on same server, so you dont have cross domain issue, You can try following solution: Main Html Iframe Code [iframe.html]:
upvote count: 6
has comment: http://stackoverflow.com/comment/45264626
has comment: http://stackoverflow.com/comment/45303335

http://stackoverflow.com/comment/45461581
comment on: http://stackoverflow.com/q/28575980
score: 0
has text: Expected a Duplicate question link here :/ But two answers
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45460237
type: Comment
has text: This doesn't strike me as a particularly constructive comment. Maybe try offering an answer that explains how a proper memoize function is supposed to work?
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28575315

http://stackoverflow.com/a/28448857
has comment: http://stackoverflow.com/comment/45226549
has comment: http://stackoverflow.com/comment/45226383
has body: Place your code in the bottom of the page, like so: Select Country Because you are running Angular code and binding elements which at that point aren't even created in the DOM. Probably because of some caching mechanisms - the code works the 2nd time around, but it's not how you want to do it. EDIT: I updated the script.
score: 0
has comment: http://stackoverflow.com/comment/45226823
type: Answer
has comment: http://stackoverflow.com/comment/45227087
has comment: http://stackoverflow.com/comment/45225987
answers question: http://stackoverflow.com/q/28448826

http://stackoverflow.com/comment/45243088
has text: If that was my problem, i would use my answer =)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28457790
score: 0

http://stackoverflow.com/q/28497283
tagged with: momentjs
type: Question
has title: Format a date at a given precision
tagged with: javascript
tagged with: date
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28498037
type: UnansweredQuestion
has body: Formatting dates in JavasScript has been made really easy through moment.js. But I was wondering if there is a simple way to format a date for a given precision (with or without this library). Say: var date = new Date(); assert.equal(format(date, 'days'), '2015-02-13') assert.equal(format(date, 'minutes'), '2015-02-13 11:14') I can easily imagine a switch case for the different cases, and can understand the output formats are standard only in my point of view, but still.

http://stackoverflow.com/comment/45382679
score: 0
comment on: http://stackoverflow.com/q/28534003
type: Comment
type: QuestionComment
has text: #jewellery1 { border-radius:50%; background:#FFF; width:97px; height:97px; margin-left:auto; margin-right:auto; margin-top:60px; box-shadow:0px 6px 3px #000; -ms-box-shadow:0px 6px 3px #000; -o-box-shadow:0px 6px 3px #000; -moz-box-shadow:0px 6px 3px #000; -webkit-box-shadow:0px 6px 3px #000; }

http://stackoverflow.com/q/28499324
has comment: http://stackoverflow.com/comment/45365923
has answer: http://stackoverflow.com/a/28500290
type: AnsweredQuestion
has body: Have code structure like this : SkillEidt.js (Javascript File): var SkillEdit = ({ _designtemplate: ["", "input", "dropdownlist", "checkbox"], _designTemplateData: {}, readValue: function() { /* when try to read value from customer.Html it's null */ return this._designTemplateData;; }, RequestResponse: function (data) { /* able to get and set value from ajax call */ this._designTemplateData = data; }, ajaxCall : function() { $.ajax({ url: "/VendorDetails/GetVendorDetails", type: "POST", async: true, contentType: "application/json; charset=utf-8", dataType: "json", error: function (result) { alert(result.statusText); }, success: function (result) { requestReponse(result); } }); }); SkillEdit.ajaxCall() /* very important to set _designTemplateData data */ Customer.Html (page): &lt;script src="~/Scripts/SkillEdit.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function SomeBuuttonClickEvent() { var notAbleToGetValue = SkillEdit.readValue(); } &lt;/script&gt; ------------------------------------------------------------------------ When debug and see SkillEdit.ajaxCall() will call ajaxCall() method and on success will call RequestResponse and set _designTemplateData. But When i click Button (SomeBuuttonClickEvent) on Customer.Html page readValue is returning null value. How can i set the _designTemplateData data. .. Have added $.ajax function. How to slove the problem by using any of the solution What code to be added What code need to be written inside : RequestResponse: function (data) or ajaxCall : function()
has comment: http://stackoverflow.com/comment/45318290
possible better answer: http://stackoverflow.com/a/28499848
has comment: http://stackoverflow.com/comment/45317896
type: Question
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/45318008
tagged with: jquery-mobile
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28500290
score: 0
answer count: 2
duplicate of: http://stackoverflow.com/q/14220321
tagged with: jquery
linked to: http://stackoverflow.com/q/14220321
has answer: http://stackoverflow.com/a/28499848
has title: Javascript Object Initialization not working

http://stackoverflow.com/a/28489998
has comment: http://stackoverflow.com/comment/45301698
has body: In your body you could wrap the SVG in a div first off. As you may have quite a big CSS and jQ file for the rest of your document, you could set up a CSS and jQuery file specifically for your loader and put them into your header so that they load first (as they will be small in size). This would be better practice than placing the CSS/jQ inline. Set up your CSS loader file with whatever is needed and set the z-index to be higher than the other elements on the page, e.g. #loader { background: #FAFAFA; z-index: 1000; } Then set up your jQ file so that once everything else is loaded in the page you will remove the loader div, e.g. $(window).load(function() { $('#loader').css({'display':'none'); }); UPDATE Instead of using display none you could do it less abruptly by using this : $(window).load(function() { $('#loader').hide("slow"); });
type: Answer
has comment: http://stackoverflow.com/comment/45312363
has comment: http://stackoverflow.com/comment/45301950
has comment: http://stackoverflow.com/comment/45301566
has comment: http://stackoverflow.com/comment/45302365
accepted answer of: http://stackoverflow.com/q/28489009
has comment: http://stackoverflow.com/comment/45301474
has comment: http://stackoverflow.com/comment/45302332
answers question: http://stackoverflow.com/q/28489009
has comment: http://stackoverflow.com/comment/45301808
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/28565481
score: 0
linked to: http://stackoverflow.com/q/28561758
tagged with: validation
has title: Firebase - using TIMESTAMP as a priority and validating its not in the future
tagged with: jscript
type: UnansweredQuestion
has body: I am using firebase.server.TIMESTAMP as a priority (as pre previous question Firebase - 'pushWithPriority' - and validation ) var ref = window.lastref.child("Offers").push(); ref.setWithPriority(spaceof.data, Firebase.ServerValue.TIMESTAMP,function (data) { $("body").prepend(data); } This appears to work, setting the priority correctly. However, I am adding a rule to ensure the timestamp is not set to a future time. Using this code:- ,"Offers" : { ".read" : "true" ,"$offerid" : { ".write" : "now >= newData.getPriority()" This always fails. I have tried ".write": "true" // this works and ".write" : "newData.getPriority()>=0" // this fails and ".write" : "newData.getPriority()<0" // this fails So I am starting to suspect the priority hasn't been resolved from the placeholder to a number yet? Any suggestions??
has comment: http://stackoverflow.com/comment/45500173
has comment: http://stackoverflow.com/comment/45486182
tagged with: firebase
answer count: 0
type: Question
tagged with: javascript

http://stackoverflow.com/a/28488066
score: 1
has body: If you define TinyMCE like that: tinymce.init({selector:'textarea'}); that code should do what you need: Some Contents Example here: http://jsfiddle.net/n9djp4u2/
has comment: http://stackoverflow.com/comment/45298157
downvote count: 0
answers question: http://stackoverflow.com/q/28487878
type: AcceptedAnswer
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45298045
accepted answer of: http://stackoverflow.com/q/28487878

debugging
tags question: http://stackoverflow.com/q/28445885
tags question: http://stackoverflow.com/q/28559881
tag name: debugging
tags question: http://stackoverflow.com/q/28485543
type: Tag
tags question: http://stackoverflow.com/q/28469311
tags question: http://stackoverflow.com/q/28459672
tags question: http://stackoverflow.com/q/28449430
tags question: http://stackoverflow.com/q/28574350
tags question: http://stackoverflow.com/q/28443616

http://stackoverflow.com/comment/45267230
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28471278
has text: @amitthk why you making it so complicated unnecesarily when it is easily achievable with 5 lines of AJAX?

http://stackoverflow.com/comment/45368308
type: AnswerComment
comment on: http://stackoverflow.com/a/28526318
has text: `$("...").on("eventName", function(){...})` why should we use this if other function do the same job, like `.click(...)`?
type: Comment
score: 0

http://stackoverflow.com/q/28442598
answer count: 2
has body: I found this awesome link with a scroll-to-top button that I'd like to add to my web page. Can someone tell me how to implement the javascript part? I tried inserting it at the bottom of my html page in script tags, but it doesn't seem to be working. http://jsfiddle.net/yeyene/J3zyq/3/ $(document).ready(function() { $(window).scroll(function() { if($(this).scrollTop() &gt; 100){ $('#goTop').stop().animate({ top: '20px' }, 500); } else{ $('#goTop').stop().animate({ top: '-100px' }, 500); } }); $('#goTop').click(function() { $('html, body').stop().animate({ scrollTop: 0 }, 500, function() { $('#goTop').stop().animate({ top: '-100px' }, 500); }); }); }); Otherwise I know how to style and configure the HTML and CSS. Thanks!
has answer: http://stackoverflow.com/a/28444389
score: -2
has answer: http://stackoverflow.com/a/28442675
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45214716
downvote count: 3
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has title: Can someone tell me how to implement this Javascript? HTML CSS
possible better answer: http://stackoverflow.com/a/28444389
has comment: http://stackoverflow.com/comment/45214768
tagged with: css
has comment: http://stackoverflow.com/comment/45214849
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28442675
has comment: http://stackoverflow.com/comment/45214734
has comment: http://stackoverflow.com/comment/45215622
type: Question

http://stackoverflow.com/a/42259885
answers question: http://stackoverflow.com/q/28567549
type: Answer
has comment: http://stackoverflow.com/comment/109078687
has comment: http://stackoverflow.com/comment/109139575
score: 12
upvote count: 12
has body: You could also use a ternary (inline if/else) statement. It might look like this: row = this.props.cells.map(function(cell, i) { return (cell.URL != null && cell.URL.length > 0) ? ( {cell.Text} ) : ( {cell.Text} ) }.bind(this)); or es6 row = this.props.cells.map((cell, i) => (cell.URL != null && cell.URL.length > 0) ? ( {cell.Text} ) : ( {cell.Text} ) ); but, for readability, I would suggest nilgun's answer. Although I would remove the else statement, since it is redundant. You could also remove the curly brackets, this is a matter of preference. row = this.props.cells.map(function(cell, i) { if(cell.URL != null && cell.URL.length > 0) return {cell.Text} ; return {cell.Text} ; }.bind(this));
downvote count: 0

http://stackoverflow.com/q/28441201
tagged with: javascript
upvote count: 1
has body: &lt;audio id="message_notification" preload="auto"&gt; &lt;source src="http://domain/sounds/message_notification.mp3" type="audio/mpeg"&gt; &lt;source src="http://domain/sounds/message_notification.ogg" type="audio/ogg"&gt; &lt;source src="http://domain/sounds/message_notification.aac" type="audio/aac"&gt; &lt;/audio&gt; ... function verifyMessages(){ $.ajax({ type:"POST", ifModified: false, cache: false, url: (domain + pathSeparator + pathToPHP), async: true, success: function (data, textStatus, jqXHR) { if( parseInt(data) &gt; messagesCounterFromPage ){ $("#new_messages_counter").text("Сообщения: " + data); // it's work document.getElementById("message_notification").play(); // it isn't work messagesCounterFromPage = data; } } }); } This works in Firefox and does not work in the latest Chrome. Audio files are small, issue tracker write that bug with playing small files fixed. I still make the file more from 228 kilobytes, but nothing has changed. It's really a bug or am I a fool? In the bug tracker is something similar with autoplay, but not confirmed.
has comment: http://stackoverflow.com/comment/45248043
favorite count: 0
type: UnansweredQuestion
has title: Audio.play() isn't working in latest Chrome. It's bug or am I fool?
tagged with: audio
answer count: 0
downvote count: 0
tagged with: html5-audio
score: 1
tagged with: google-chrome
type: Question

http://stackoverflow.com/q/28571682
type: Question
has answer: http://stackoverflow.com/a/28572000
tagged with: javascript
has title: Angular directive using isolated scopes
has comment: http://stackoverflow.com/comment/45453465
linked to: http://stackoverflow.com/q/16653004
tagged with: angularjs-ng-transclude
answer count: 2
has answer: http://stackoverflow.com/a/28571973
downvote count: 0
favorite count: 0
tagged with: angularjs
has body: I'm trying to make an Angular directive which takes some data and modifies a scope variable based on the input, but I can't get it to work. Here is a simplified version of my JS: var module = angular.module('myapp', []); module.directive('checkDirective', function() { return { restrict: 'E', scope: { line: '@' }, transclude: true, controller: function($scope) { $scope.newLine = $scope.line; }, template: '&lt;div ng-transclude&gt;&lt;/div&gt;' }; }); And here is my HTML: &lt;div ng-app="myapp"&gt; 0 &lt;check-directive line="..."&gt; a{{line}}b{{newLine}}c &lt;/check-directive&gt; 1 &lt;/div&gt; A fiddle for it is here: http://jsfiddle.net/k66Za/60/ Any help would be appreciated!
type: UnansweredQuestion
score: 1
upvote count: 1

http://stackoverflow.com/comment/45267291
score: 0
comment on: http://stackoverflow.com/q/28471240
type: Comment
type: QuestionComment
has text: @ArunPJohny return `1`

http://stackoverflow.com/a/68857555
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/121695563
has body: its Not document.getElementsById function its document.getElementById try it
answers question: http://stackoverflow.com/q/28520173

http://stackoverflow.com/comment/45281716
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28478511
score: 0
has text: thanks @epascarello for your reply. safari 5.1.7 is the latest version on windows 7. and it partially supports the filereader because it successfully enters in e.pf block but we have issue in r.onload.

http://stackoverflow.com/q/28499113
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28499292
tagged with: jquery
score: 0
type: UnansweredQuestion
has title: Dynamic window width in JQuery (mobile rotator)
has body: I have a JQuery rotator in my website with a slides images and I want to make the website responsive. I'm using CSS media queries to do it. I want to change the slide width (which defines in JS) when the windows width is less than 800px. So long, I did something like this: var responsiveSlideWidth; if ($(window).width() &lt; 800) { responsiveSlideWidth = 700; } else { responsiveSlideWidth = 960; } var defaults = { container: '.rotatorWrapper', animationduration: 1000, slideWidth: responsiveSlideWidth }; The problem is that it is working just after page reload. Thats means: if I resize the window size its is not working well until I reload the page.

http://stackoverflow.com/q/28591126
accepted answer: http://stackoverflow.com/a/28591214
score: 0
tagged with: meteor
has comment: http://stackoverflow.com/comment/45488832
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28591214
linked to: http://stackoverflow.com/q/14184379
tagged with: http
type: Question
has body: I am trying to set: body{ background-image: url('/assets/bg.png') } But Im getting this warning: Resource interpreted as Image but transferred with MIME type text/html Not sure how to fix it.
has title: Content type of stylesheet in Meteoor
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/45425274
type: Comment
comment on: http://stackoverflow.com/q/28556372
has text: @Arun P Johny , it's not working showing both alerts one by one
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45261007
comment on: http://stackoverflow.com/q/28467708
type: QuestionComment
type: Comment
score: 1
has text: BTW, you don't need `else if(thenumber != 1 && thenumber != 0)`, just use `else`. That's just the opposite of the `if` condition, and the `else` is only executed when the `if` is false.

http://stackoverflow.com/comment/45399488
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28542638
has text: You are only checking if the media query matches _once_ – you need to call `matchMedia` again after a resize if you want an updated result.
score: 0

http://stackoverflow.com/q/28484995
has body: I know that I have gone about this the wrong way and very honestly it could be because I am handling the recursion incorrectly, but if so I am unsure where I have gone wrong. Here is the link to the example. Here is the JavaScript - function propertyTest(currentObject, key) { for (var property in currentObject) { if (typeof currentObject[property] === "object") { propertyTest(currentObject[property], property); } else { // this is only to test the output $('#method1').append((property == 'value' &amp;&amp; key ? key : property) + ' -- ' + currentObject[property] + '&lt;br /&gt;'); propertyKey = (property == 'value' &amp;&amp; key ? key : property); propertyValue = currentObject[property]; var arrayJSON = []; arrayJSON.push(propertyKey); arrayJSON.push(propertyValue); } } var JSONString = JSON.stringify(arrayJSON); console.log(JSONString); return JSONString; } Here is the original JSON - var oarsObject = [{ "coordinateReferenceSystem": "26782,15851", "positionReferenceType": "geogWgs84", "geogWgs84": { "latitude": { "value": 0.50507158458214041 }, "longitude": { "value": -1.604064725846865 }, "height": { "value": 0.0 } } }, { "coordinateReferenceSystem": "26782,15851", "positionReferenceType": "geogWgs84", "geogWgs84": { "latitude": { "value": 0.50509265195620767 }, "longitude": { "value": -1.5961047836759397 }, "height": { "value": 0.0 } } }, { "coordinateReferenceSystem": "26782,15851", "positionReferenceType": "geogWgs84", "geogWgs84": { "latitude": { "value": 0.4963464715653228 }, "longitude": { "value": -1.5960947041991222 }, "height": { "value": 0.0 } } }, { "coordinateReferenceSystem": "26782,15851", "positionReferenceType": "geogWgs84", "geogWgs84": { "latitude": { "value": 0.49632551101280209 }, "longitude": { "value": -1.604015267530267 }, "height": { "value": 0.0 } } }] The JSON is sent to the function as you would expect - propertyTest(oarsObject); Here is the evidence of where it goes off of the rails, a snippet from the console - ["latitude",0.505071584…
upvote count: 4
has comment: http://stackoverflow.com/comment/45292244
answer count: 2
has title: JSON.stringify does not convert arrays
tagged with: stringify
possible better answer: http://stackoverflow.com/a/28591168
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/28591168
favorite count: 0
has comment: http://stackoverflow.com/comment/45292344
has comment: http://stackoverflow.com/comment/45292302
has comment: http://stackoverflow.com/comment/45292074
has comment: http://stackoverflow.com/comment/45476313
has comment: http://stackoverflow.com/comment/45292634
has comment: http://stackoverflow.com/comment/45292685
has comment: http://stackoverflow.com/comment/45292223
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28577518
has comment: http://stackoverflow.com/comment/45292217
has comment: http://stackoverflow.com/comment/45454265
has comment: http://stackoverflow.com/comment/45292133
has comment: http://stackoverflow.com/comment/45292754
downvote count: 1
has comment: http://stackoverflow.com/comment/45452934
type: Question
score: 3
has comment: http://stackoverflow.com/comment/45292709
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45292310
has comment: http://stackoverflow.com/comment/45463259
accepted answer: http://stackoverflow.com/a/28577518

http://stackoverflow.com/a/28537673
type: AcceptedAnswer
downvote count: 0
score: 1
has body: Since this is your URL that you work on: localhost/LogViewerPortal/Query/Index, your AJAX should fire to the same URL. Also, change Success to success: if ((x[i].nodeName).toUpperCase() == "MESSAGE" ) { //alert(childnd.nodeValue); $.ajax({ type: "POST", data: { message : childnd.nodeValue }, url: "/LogViewerPortal/Query/DecryptMessage", success: function (result) { if (result) { stringDetails = stringDetails + ' Value:' + result + ' '; } }) } And if you want to return a string from your controller, you could change to: [HttpPost] public ActionResult DecryptMessage(string message) { string decryptedMessage= Encryption.DecryptData(message); return Content(decryptedMessage); }
type: Answer
answers question: http://stackoverflow.com/q/28536472
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28536472

http://stackoverflow.com/comment/45221311
has text: Why do you have calculateHelper method in quotes?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28445994

http://stackoverflow.com/comment/45355018
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28518949
has text: That's ok, I figured it out beforehand, see the answer.

http://stackoverflow.com/a/28580020
has comment: http://stackoverflow.com/comment/45468957
has comment: http://stackoverflow.com/comment/45469151
answers question: http://stackoverflow.com/q/28579959
has body: you have missed to define ng-app, it should be ng-app='myModule', only using &lt;body style="font-family: tahoma;" ng-app&gt; will try to find global controller named quickReportController, ehich is not global. Replace with this: &lt;body style="font-family: tahoma;" ng-app='myModule'&gt; Also You are trying to define ng-module and nd ng-app, so read this https://stackoverflow.com/a/22865917/3556874
accepted answer of: http://stackoverflow.com/q/28579959
score: 1
has comment: http://stackoverflow.com/comment/45468757
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0

http://stackoverflow.com/comment/81991950
type: QuestionComment
comment on: http://stackoverflow.com/q/28498286
score: 2
has text: I don't understand why this question is downvoted
type: Comment

http://stackoverflow.com/comment/45295215
comment on: http://stackoverflow.com/a/28486717
score: 0
type: Comment
has text: Thanks for your response. I do remember reading about the differences but admit I don't fully understand so will read up on that more. However, changing to service instead of factory results in the same errors.
type: AnswerComment

http://stackoverflow.com/a/28565744
type: Answer
accepted answer of: http://stackoverflow.com/q/28565503
answers question: http://stackoverflow.com/q/28565503
has body: All in JS: apples oranges bananas
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/28484641
tagged with: perl
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45291392
tagged with: progress-bar
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28988953
has title: jQuery and perl: progress bar based on state of "pipeline file", dynamic ajax
has body: I would like to build a small pipeline that allows the user to choose a file and then runs several scripts using this file as an input. As some of these scripts run for several minutes (exact time depends on the input file's size) I would like to show a progress bar that is based on how many scripts of this pipeline have been finished. The problem is that I don't know how to update this progress bar based on the status of the pipeline and would appreciate some help with that. I show the files I use first and then explain the problem in more detail. My html form: The pipeline script main.pl: #!/usr/bin/perl use CGI; use strict; #use warnings; my $q = CGI->new; my $fileName = $q->param('fileName'); my $progressPerc = 0; my $numJobs = 3; #in actual script much more my $count = 1; system('perl', './file1.pl', $fileName); $progressPerc = $count/$numJobs*100; #here I want to pass $progressPerc to the progress bar $count += 1; system('perl', './file2.pl', $fileName); $progressPerc = $count/$numJobs*100; #here I want to pass $progressPerc to the progress bar $count += 1; system('perl', './file3.pl', $fileName); $progressPerc = $count/$numJobs*100; #here I want to pass $progressPerc to the progress bar I found a good working progress bar on http://jqueryui.com/progressbar/#label which looks as follows (I post the entire file although I would only need the .js-part): http://jqueryui.com/progressbar/#label Loading... Is there any easy way to pass $progressPerc from main.pl to the function progress() every time it changes its value? If there was only one call, this could be done using ajax, however, I don't know how to use ajax for several calls i.e. dynamically; by 'dynamic' I mean that once a perl script in main.pl is finished, this should be reported to the progress bar which is then updated. If there is no easy way to do this: Can one somehow introduce an if clause that checks every x minutes (using setTimeout) whether the output files produced by these perl scripts in main…
upvote count: 2
accepted answer: http://stackoverflow.com/a/28988953
score: 2
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45291963

http://stackoverflow.com/q/28534200
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45382960
tagged with: event-listener
type: Question
tagged with: javascript
has title: Javascript: "Cannot read property 'addEventListener' of null" error when trying to remove child
has body: Very new to javascript. I'm building a very simple website to showcase someone's portfolio. In the HTML, I have a link with the ID 'chocolate-link'. When I click the link, the addVideo function runs as expected. I'm having trouble with the dismissVideo function. I want to be able to click the "close X" link in the video variable to remove the elChocolate variable. When the page loads, I get a "Cannot read property 'addEventListener' of null" error in the console. Any help is appreciated. Here's the javascript: var video = ' close X '; video += ' '; var elChocolate = document.createElement('div'); elChocolate.setAttribute('id', 'video'); elChocolate.innerHTML = video; function addVideo() { document.body.appendChild(elChocolate); elAdd.className = "active"; } var elAdd = document.getElementById('chocolate-link'); elAdd.addEventListener('click', addVideo, false); function dismissVideo() { document.body.removeChild(elChocolate); } var elClose = document.getElementById('close'); elClose.addEventListener('click', dismissVideo, false);
has answer: http://stackoverflow.com/a/28534228
upvote count: 1
accepted answer: http://stackoverflow.com/a/28534228
answer count: 1
tagged with: removechild
favorite count: 0
type: AnsweredQuestion

http://stackoverflow.com/q/28570467
downvote count: 1
type: Question
has body: I want to modify the getSecret function to enable the private variable 'secret' to be accessed from outside the 'bestfriends' class. Any ideas? function bestfriends(name1, name2) { this.friend1 = name1; this.friend2 = name2; var secret = "Hakuna Matata!"; console.log (this.friend1 + ' and ' + this.friend2 + ' are the best of friends! '); } bestfriends.prototype.getSecret = function() { return secret } var timon_pubmaa = bestfriends('timon', 'pumbaa'); var timon_pumbaa_secret = getSecret(); console.log(timon_pumbaa_secret);
has comment: http://stackoverflow.com/comment/45450838
upvote count: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28570575
favorite count: 0
has comment: http://stackoverflow.com/comment/45456305
score: -1
has title: modify function to access private variable from outside a class
type: UnansweredQuestion

http://stackoverflow.com/q/28585175
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28585493
tagged with: http://stackoverflow.com/tag/html
has title: Problems with position:fixed and responsive / adaptive Layout
tagged with: css
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: less
type: Question
accepted answer: http://stackoverflow.com/a/28585493
tagged with: javascript
has body: First look at this website: http://irismediainfo2.lili.de/spip.php?article4924 On my screen it looks like on this screenshot: chrome - full window - desktop resolution: 1440x900 I think for most of you it will look diferent but thats part of the problem... The main div with the gray border is inside an other div with id="page". #page { width: 560px; margin: 50px auto 0px auto; position:relative; } I created a new div with id="toolbar", that looks like it sticks to this #page-div, but it does not scroll with the page. On the website I linked above u can see the #toolbar as a dummy-box (grey with some Text). At the moment the I use position:fixed in #toolbar. When I position it at the side of #page so that it LOOKS like it is attached to it, and I resize the browser window... the two divs dont move the same way because the position of #page is calculated from the middle (by margin:auto) and the position of #toolbar is calculated from the side of the browser window (by position:fixed). So it is not attatched anymore in any other windowsizes. I tried to make the #page float, to make the #toolbar appear at the side but that destroys the "margin:auto" of the #page so it is not centered anymore. I also tried #toolbar { position: fixed; center: 0px; } Because I hoped there could be a way to calculate the position for position:fixed from the center. Nothing worked, I hope you know a solution. Actually everything I want is something like: #page { width: 560px; margin: 50px auto 0px auto; position:relative; } #toolbar { position: fixed; center: 0px 280px 0px 0px; } I would like to do this with minimal code and resources because I don't want to make the loading speed worse because of a little toolbar. If you need more specific code from my css or html please tell me. I hope the target and the problem is clear.

http://stackoverflow.com/comment/45416110
comment on: http://stackoverflow.com/a/28550410
type: Comment
type: AnswerComment
has text: I apologize. It appears that I also have to attach to the load of the actual twitter as well. I've updated the answer again, and this should work for you.
score: 0

webdriver
tags question: http://stackoverflow.com/q/28569447
tags question: http://stackoverflow.com/q/28457571
tags question: http://stackoverflow.com/q/28452332
tags question: http://stackoverflow.com/q/28589045
tags question: http://stackoverflow.com/q/28592558
tags question: http://stackoverflow.com/q/28538306
tags question: http://stackoverflow.com/q/28454823
type: Tag
tags question: http://stackoverflow.com/q/28456457
tag name: webdriver
tags question: http://stackoverflow.com/q/28438553

http://stackoverflow.com/a/28483433
has body: You need to find the rows, evaluate the cells in each row and apply a hide class if the row meets your criteria:&nbsp;&nbsp;&nbsp;JSFiddle Demo var tbl = document.getElementById('table'); //find the table var rows = tbl.querySelectorAll('tbody tr'); //find all rows in the table body for(i = 0; i &lt; rows.length; i++) { //iterate through the rows var cells = rows[i].querySelectorAll('td'); //find all of the cells in the row var flag = true; //set flag prior to cell evaluation for(j = 2; j &lt; cells.length; j++) { //iterate through the cells (starting with the cell at position 2) if (cells[j].innerHTML != '0') { //check if the cell contains '0' (set flag to false if cell is not '0') flag = false; } } if(flag) { rows[i].classList.add('hide'); //hide the row if the falg remained true (i.e. none of the cells contained a value other than '0' } }
score: 4
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28483222
type: Answer
upvote count: 4
accepted answer of: http://stackoverflow.com/q/28483222
downvote count: 0

http://stackoverflow.com/q/28572292
has title: Firefox breaking page; not displaying images or CSS styles
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28572542
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28572542
upvote count: 0
tagged with: firefox
tagged with: javascript
score: -1
answer count: 3
favorite count: 0
possible better answer: http://stackoverflow.com/a/28572447
has body: For whatever reason, Firefox isn't liking my code. Looking at some related posts, I think it may be a Javascript issue, but I'm not sure exactly what it is. The devtools suggest that it's not having a problem actually downloading the files, but for whatever reason it's not displaying them correctly. My test site is http://labs.halfbake.me/wp-smooth/ It works great in Chrome and Safari, haven't tested IE but I'm sure it's somehow worse than Firefox. Any ideas what could be causing the problems with Firefox?
has answer: http://stackoverflow.com/a/28572447
has answer: http://stackoverflow.com/a/28572592

http://stackoverflow.com/q/28439237
answer count: 2
has comment: http://stackoverflow.com/comment/45209026
has comment: http://stackoverflow.com/comment/45209227
has body: How can I submit a form through AJAX while using verify.js? I want verify.js to only validate the login form: &lt;form role="form" method="post" id="login" action="auth/login" &gt;
has comment: http://stackoverflow.com/comment/45249001
has comment: http://stackoverflow.com/comment/45209415
tagged with: jquery
favorite count: 0
tagged with: ajax
possible better answer: http://stackoverflow.com/a/34599792
has title: Submit form through ajax using verify.js
has answer: http://stackoverflow.com/a/34599792
has answer: http://stackoverflow.com/a/28440026
has comment: http://stackoverflow.com/comment/45208460
type: AnsweredQuestion
upvote count: 2
score: 1
accepted answer: http://stackoverflow.com/a/28440026
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45250315
tagged with: verify
tagged with: javascript

http://stackoverflow.com/comment/45332501
type: AnswerComment
type: Comment
has text: @MarianRick - the code you provided indicated the `mouseenter` event was on the `li` not the `ul`. code has been updated
comment on: http://stackoverflow.com/a/28506385
score: 0

http://stackoverflow.com/comment/45354397
type: Comment
comment on: http://stackoverflow.com/q/28518624
score: 0
type: QuestionComment
has text: It's the second if condition : 'if (player.image.x == player.x && player.image.y == player.y)' => "If the image position has arrived to the div position"

http://stackoverflow.com/q/28572449
tagged with: javascript
tagged with: couchdb
has comment: http://stackoverflow.com/comment/45460020
favorite count: 0
upvote count: 3
tagged with: map-function
downvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28708856
tagged with: nosql
score: 3
has title: Passing values to a map function - CouchDB
has body: I was wondering whether its possible to pass values to a map function in couchDB design document. For Example: In the code below is it possible to pass a value that has been entered by the user and use that value to run the map function. Maybe I can pass users UserName when they login and then display the view based on the map function. function(doc) { if(doc.name == data-Entered-By-User) { emit(doc.type, doc); } } Thank you in advance. Regards
tagged with: mapreduce
type: Question
answer count: 1

http://stackoverflow.com/comment/45392969
comment on: http://stackoverflow.com/q/28539165
type: QuestionComment
has text: if deal is indeed an array of objects, your code should work fine.
score: 0
type: Comment

http://stackoverflow.com/comment/45417097
comment on: http://stackoverflow.com/a/28551848
type: AnswerComment
has text: Try to check type of your response. Maybe you should use string, but get json from your server. You can try to manually set `datos` in your `success` function to string data from your example `[['Doctorado', 91.86],['Maestría', 6.98],['Licenciatura', 1.16]]`
score: 0
type: Comment

http://stackoverflow.com/q/28483222
has comment: http://stackoverflow.com/comment/45288816
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45288490
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
upvote count: 2
score: 0
downvote count: 2
has answer: http://stackoverflow.com/a/28483433
type: Question
has comment: http://stackoverflow.com/comment/45288600
tagged with: javascript
has comment: http://stackoverflow.com/comment/45288502
has body: Essentially what i'm looking to do is to iterate through a table row and check to see if all except the first column are equal to zero. If so then hide the row. Player Move 1 Move 2 Move 3 Move 4 Move 5 John 0 0 0 0 0 James 0 5 3 4 0 So in the above table the first row would be hidden and the second row would be displayed. Any help would be much appreciated! Update : Example : http://jsfiddle.net/3rnbk6s5/ $('#table tr td').each(function() { if ($(this).text() === '0'){ $(this).css('color', 'red'); } });
has title: Check if cells in a table row equal 0 and hide row if so
accepted answer: http://stackoverflow.com/a/28483433
answer count: 1

http://stackoverflow.com/q/28559851
has comment: http://stackoverflow.com/comment/45431980
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has body: I needed to implement double list box control in struts 1.2 . As OptionTransferSelect control is not available in Struts 1.2 and I know Struts 1.x support is EOL but I need to change in current environment :( , I made the Two List box from struts UI tag and transfer the element with help of Javascript Code &lt;td align="left" style="height:40" width="30%"&gt;Select Site:&amp;nbsp;&amp;nbsp;&lt;/td&gt; &lt;td align="right" width="58%"&gt; &lt;html-el:select name="myForm" property="city" size="10" multiple="true"&gt; &lt;html-el:option value=""&gt;&amp;nbsp;&lt;/html-el:option&gt; &lt;html-el:option value="ALL"&gt;-- ALL --&lt;/html-el:option&gt; &lt;html-el:options collection="cityList" property="itemValue" labelProperty="itemDescription"/&gt; &lt;/html-el:select&gt; &lt;/td&gt; &lt;td valign="middle"&gt; &lt;a href="#" onclick="listbox_moveacross('selectedSiteId', 'destinationID')"&gt;&gt;&gt;&lt;/a&gt; &lt;br/&gt; &lt;a href="#" onclick="listbox_moveacross('destinationID', 'selectedSiteId')"&gt;&lt;&lt;&lt;/a&gt; &lt;/td&gt; &lt;td align="right" style="height:40" width="30%"&gt;Selected Site:&amp;nbsp;&amp;nbsp;&lt;/td&gt; &lt;SELECT id="destinationID" size="10" multiple&gt; &lt;OPTION value="a"&gt;-----Select Value From city----&lt;/OPTION&gt; &lt;/SELECT&gt; &lt;/td&gt; &lt;tr&gt; &lt;td align="left" style="height:40" width="30%"&gt;&lt;/td&gt; &lt;html-el:submit styleClass="standardButton" property="submitAction"&gt; &lt;bean-el:message key="save Button"/&gt; &lt;/html-el:submit&gt; &lt;br /&gt; &lt;br /&gt; &lt;/td&gt; &lt;/tr&gt; My Java script code is working fine ,But I want If user select Submit button , then selected List from destinationID List will go to form and I can use it . But I am not able to set the destinationID List into FOrm Bean. My JavaScript Code function listbox_moveacross(sourceID,destID){ var src=document.getElementById(sourceID); var dest=document.getElementById(destID); var picked1 = false; for(var count=0;count&lt;src.options.length;co…
has title: How to retrieve right listbox and submit the form in struts 1.2
answer count: 0
score: 1
tagged with: java
upvote count: 1
tagged with: struts-1
type: Question
tagged with: jakarta-ee
has comment: http://stackoverflow.com/comment/45432061
has comment: http://stackoverflow.com/comment/45432247
tagged with: javascript
tagged with: struts

http://stackoverflow.com/comment/45483368
type: Comment
score: 1
has text: Link to the momentjs documentation on this subject: http://momentjs.com/docs/#/parsing/string-format/
comment on: http://stackoverflow.com/a/28588125
type: AnswerComment

http://stackoverflow.com/q/28440676
upvote count: 10
type: Question
has comment: http://stackoverflow.com/comment/46758371
tagged with: ios8
has comment: http://stackoverflow.com/comment/45331393
tagged with: javascript
has body: I have a web app that's triggering what appears to be an iOS8 bug in Safari, and I'm looking for clues into what's setting it off and how to work around it. The bug is characterized by "A problem occurred with this webpage so it was reloaded" appearing at the top of the page after the user has spent enough time navigating in Safari. It looks like something is crashing behind the scenes, and Safari is simply doing a really good job of gracefully recovering. Reading the crash log revealed this: Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x00000000 Triggered by Thread: 0 Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 JavaScriptCore 0x2d4291d4 0x2d24a000 + 1962452 1 JavaScriptCore 0x2d50e166 0x2d24a000 + 2900326 2 JavaScriptCore 0x2d2bc88c 0x2d24a000 + 469132 ... Research hinted that instances of translate3d and keyframe in the CSS files might be to blame. While getting rid of them seemed to make the bug less likely to recur, the bug nevertheless still exists. Likewise, reducing the size of the (very, very large) CSS file associated with the pages most likely to trigger the bug seemed to help but not make it go away. My company handles a bunch of mobile-optimized commerce-oriented web apps, and this is the only one that seems to be running afoul of this bug; I have no idea what's making this particular app such an angry little special snowflake, but I'd like to figure it out and correct it. Does anybody have any ideas about what might be triggering the bug and how we can work around it?
has answer: http://stackoverflow.com/a/28517529
has comment: http://stackoverflow.com/comment/45327770
answer count: 3
downvote count: 0
score: 10
has answer: http://stackoverflow.com/a/28750363
favorite count: 0
type: UnansweredQuestion
has title: Web page triggering EXC_BAD_ACCESS / KERN_INVALID_ADDRESS crash in Safari
has comment: http://stackoverflow.com/comment/45322489
has comment: http://stackoverflow.com/comment/45300982
tagged with: css
tagged with: safari
has comment: http://stackoverflow.com/comment/45322255
has answer: http://stackoverflow.com/a/28712904
tagged with: mobile-safari
linked to: http://stackoverflow.com/q/3971218

http://stackoverflow.com/comment/45457636
has text: @asmeltseg this replacement should be done server-side before the user sees anything
score: 1
comment on: http://stackoverflow.com/q/28573893
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28565770
has comment: http://stackoverflow.com/comment/45442634
score: -1
downvote count: 2
has comment: http://stackoverflow.com/comment/45443587
upvote count: 1
answers question: http://stackoverflow.com/q/28565715
type: Answer
has body: Due to jQuery's popularity, I've responded using jQuery methods. Once you've included jQuery to your HTML webpage, all you need to do is change your script to this: &lt;script type="text/javascript"&gt; $(document).ready(function(){ function customizeNavbar() { $('#navwrap').addClass('container'); $('#navhead').addClass('container'); } customizeNavbar(); }); &lt;/script&gt; For more information, take a look at the $( document ).ready() documentation. Using the above code, you don't even need the onclick part of your code. In my opinion, it saves time.

http://stackoverflow.com/comment/45339688
comment on: http://stackoverflow.com/q/28510268
score: 0
type: Comment
has text: move `$("#mp3").attr("src", myFile)` into the success function
type: QuestionComment

http://stackoverflow.com/a/28495838
score: 0
has body: It's a very broad question, but here is a basic example to get you going. You should utilise some floated columns, that each have boxes within them. Demo - http://codepen.io/anon/pen/MYQjvQ HTML: CSS: .wrapper{ width: 1000px; margin: 0 auto; } .col { float: left; width: 49%; } .block { width: 100%; height: 110px; background: #ccccff; margin-bottom: 20px; } .block-l { width: 100%; height: 180px; background: #ccccff; margin-bottom: 20px; } .col-last { float: right!important; } .cf { clear: both; }
type: Answer
answers question: http://stackoverflow.com/q/28495013

http://stackoverflow.com/comment/45363809
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28523458
has text: Wow that is complex. Can you create a jsfiddle so I can play around with it?

http://stackoverflow.com/q/28482840
type: Question
has answer: http://stackoverflow.com/a/28482862
accepted answer: http://stackoverflow.com/a/28482862
tagged with: javascript
has body: Following this tutorial: http://www.w3schools.com/angular/angular_http.asp i can parse a json perfectly but i've got a problem.. I have a php with a json in which inside there is a json something like this: {"item":[ { "Name" : "Alfreds Futterkiste", "City" : "Berlin", "Country" : "Germany" }, { "Name" : "Berglunds snabbköp", "City" : "Luleå", "Country" : "Sweden" }]} As you can see there is a JSONObject (item).. actually to parse a json without JSONObject i do this function inside my controller: $http.get(JSONUrl) .success(function(response) { $scope.names = response; }); and then Nome Ver Code {{item.Name}} {{item.City}} {{item.Country}} But in my case i display nothing becase i have that "item" as JSONObject.. Any solution?
score: 0
answer count: 1
tagged with: angularjs
tagged with: php
has title: Read json with JSONObject in angularjs
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/a/28582633
has body: In order to apply hover effect only on currently hovered image and not on the other images, use $(this) as shown below :- $("img").hover(function () { $(this).addClass("transition"); }, function () { $(this).removeClass("transition"); });
type: Answer
has comment: http://stackoverflow.com/comment/45473459
has comment: http://stackoverflow.com/comment/45473712
score: 4
accepted answer of: http://stackoverflow.com/q/28582597
upvote count: 4
answers question: http://stackoverflow.com/q/28582597
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45243973
score: 0
comment on: http://stackoverflow.com/q/28444452
type: Comment
has text: @jfriend00 Hey,even the DRY tag return to StackExchange,I'll give it a try :)
type: QuestionComment

http://stackoverflow.com/comment/45364685
comment on: http://stackoverflow.com/q/28524277
type: Comment
score: 0
type: QuestionComment
has text: Yes, I've thought of that but I want to practice my regex skills.

http://stackoverflow.com/q/28439495
linked to: http://stackoverflow.com/q/5045053
has comment: http://stackoverflow.com/comment/45211303
has comment: http://stackoverflow.com/comment/45208814
type: AnsweredQuestion
upvote count: 0
accepted answer: http://stackoverflow.com/a/28440860
tagged with: javascript
tagged with: jquery
favorite count: 0
type: Question
has body: I'm using javascript and php to set and get cookies across pages. I have a script that puts a value in a cookie variable on one page and I would like to retrieve it on another page. Let's say that my first page is called page1.html. In page1 I use a script to store a cookie value like this: ...now let's say that I have a page called page2.php. In page2.php I have an include statement that loads page1.html like this: include('page1.html'); Note: Page1.html does one thing only... it has a dropdown list of countries. If I point my browser directly to page1.html and select a country, the cookie variable is set. However, I if use the dropdown list via page2.php, the cookie variable is not set. I check the cookie list in my browser settings to varify. What is preventing the script from running if it's being used in an include statement from another page? UPDATED FOR CLARITY: Page1.php: <?php session_start();?> Select Country Afghanistan Page2.php <script type="text/javascript" <?php include ("page1.php"); ?>
tagged with: http://stackoverflow.com/tag/html
score: -2
downvote count: 2
tagged with: php
answer count: 1
has comment: http://stackoverflow.com/comment/45208773
has title: Why does a jquery script not run if it's being used in a php include statement from another php page?
has answer: http://stackoverflow.com/a/28440860
has comment: http://stackoverflow.com/comment/45211342

http://stackoverflow.com/comment/45234839
type: AnswerComment
has text: the jsfiddle i provide with your initial code work perfectly with jquery 1.8
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28453399

http://stackoverflow.com/a/28504571
score: 2
accepted answer of: http://stackoverflow.com/q/28504350
answers question: http://stackoverflow.com/q/28504350
has comment: http://stackoverflow.com/comment/45328608
has comment: http://stackoverflow.com/comment/45328492
has comment: http://stackoverflow.com/comment/45328825
has body: This should work, if I understand your question correctly: @model Boolean @{if(Model){ //Reload × } else if(!Model){ //Do not reload × } } and in your JS: $(function () { $(document).on('click', 'button[data-dismiss]', function (e) { if($(this).attr('data-reload') == 'yes') location.reload(); else $(this).parents('.modal').first().modal('hide'); }); });
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45328894
downvote count: 0
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/45328648

http://stackoverflow.com/comment/45244179
has text: @GameAlchemist I have placed the onload handler before the src now, it still seems to function the same way, what is the reason for it?
comment on: http://stackoverflow.com/q/28458052
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28469990
has comment: http://stackoverflow.com/comment/45264769
has answer: http://stackoverflow.com/a/28470586
downvote count: 1
has comment: http://stackoverflow.com/comment/45264909
has comment: http://stackoverflow.com/comment/45264845
type: Question
has answer: http://stackoverflow.com/a/28470426
has comment: http://stackoverflow.com/comment/45265100
has comment: http://stackoverflow.com/comment/45264935
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
answer count: 6
linked to: http://stackoverflow.com/q/14355655
possible better answer: http://stackoverflow.com/a/28470042
has comment: http://stackoverflow.com/comment/45264889
has comment: http://stackoverflow.com/comment/45264923
has answer: http://stackoverflow.com/a/28470367
accepted answer: http://stackoverflow.com/a/28470586
has answer: http://stackoverflow.com/a/28470042
has body: I'm getting a ParseError even though my JSON validates on jsonlint.com. Here is the jQuery code: $.ajax({ url: path, type: 'GET', data: {}, cache: false, dataType: 'json', contentType: 'application/json; charset=utf-8', success: function (data) { var a = 'breakpoint here doesn't activate'; }, error: function (x, y, z) { var b = 'code execution stops at a breakpoint here.'; } }); Here is the PHP code that is being called: function getAllAnswersToHitViaAjax($theJobName) { $testData[0] = 'testing123'; $encodedData = json_encode($testData); echo $encodedData; return; } This comes back to a breakpoint set in the error: function of my .ajax call. Parameter Y is set to "parseerror", and x.responseText = ["testing123"] I've been looking into this for hours so far. I've looked at many relevant StackOverflow posts, but none have solutions that work in this case. How can I get a success response from this .ajax call? Thanks very much in advance to all for any info.
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/45264912
has title: jQuery .ajax Call Returns JSON ParseError Even Thought JSON Appears to be Correct?
has comment: http://stackoverflow.com/comment/45264838
has comment: http://stackoverflow.com/comment/45264892
has answer: http://stackoverflow.com/a/28470677
tagged with: php
has comment: http://stackoverflow.com/comment/45265164
has comment: http://stackoverflow.com/comment/45264774
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45265150
upvote count: 3
has answer: http://stackoverflow.com/a/28470195
has comment: http://stackoverflow.com/comment/45265278

http://stackoverflow.com/comment/45884838
comment on: http://stackoverflow.com/a/28774445
has text: Hi @Artem Amirbekov. Thx for the answer, that makes sense, i guess i'm not used to see functions/methods as arguments. Tested and working ;)
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28539669
answers question: http://stackoverflow.com/q/28539421
type: Answer
downvote count: 0
score: 1
has body: $('#dateTimeStart').datetimepicker({ dateFormat: 'yy-dd-mm' timeFormat: "hh:mm:ss" });
upvote count: 1

http://stackoverflow.com/q/28458453
downvote count: 0
has body: I'm working on a site with a Accordion "function" based on this: http://jqueryui.com/accordion/#collapsible My only problem is that the first Section is open by default and I want every Section to be closed until the visitor presses them. Someone know how to solve this? Code: Section 1 Section 2 Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna. Section 3 Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. List item one List item two List item three Section 4 Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est. Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
has answer: http://stackoverflow.com/a/28458495
type: AnsweredQuestion
has title: Accordion - How to not have first item expanded?
tagged with: jquery-ui-accordion
score: 1
has answer: http://stackoverflow.com/a/28458540
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28458481
type: Question
upvote count: 1
accepted answer: http://stackoverflow.com/a/28458477
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28458477
has answer: http://stackoverflow.com/a/28458481
answer count: 4

http://stackoverflow.com/comment/45339610
type: Comment
comment on: http://stackoverflow.com/a/28467031
has text: Hmm. I just ran it and it did exactly what I said it would do: https://jsfiddle.net/maapxgoL/1/. The only issue I can see is that it console-logs the index of the array item rather than the string--I edited so that it console logs the name of the item, too. Your solution, while workable for the specific problem isn't able to tackle deeply nested arrays (like the one you originally posted). As a programmer you should strive to make reusable code that can be reapplied when the magnitude and nature of your input changes.
type: AnswerComment
score: 0

http://stackoverflow.com/a/28591168
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28484995
upvote count: 1
has body: You may want to scope the result array outside your recursive function as Sheepy stated. Using forEach when it is an array value and for when it is an object of objects. This way you are only processing a push of one object and not having to maintain the array. Example jsFiddle var arrayJSON = []; function propertyTest(currentObject, key) { if (Array.isArray(currentObject)) { currentObject.forEach(propertyTest); } else { for (var returnKey in currentObject) { if (typeof currentObject[returnKey] === 'object') { propertyTest(currentObject[returnKey], returnKey); } else { var newKey = (returnKey === 'value' &amp;&amp; key) ? key : returnKey; var newObj = {}; newObj[newKey] = currentObject[returnKey]; arrayJSON.push(newObj); $('#method1').append( newKey + ' -- ' + currentObject[returnKey] + '&lt;br /&gt;'); } } } } propertyTest(oarsObject); console.log(JSON.stringify(arrayJSON););
type: Answer

http://stackoverflow.com/q/28496373
possible better answer: http://stackoverflow.com/a/28497084
has answer: http://stackoverflow.com/a/28497084
has comment: http://stackoverflow.com/comment/45313119
type: Question
tagged with: performance
has answer: http://stackoverflow.com/a/28497293
accepted answer: http://stackoverflow.com/a/28497990
tagged with: javascript
has title: Running into AngularJS performance issues with web workers, fast timers, and $scope.$apply()
has body: I have a timer that runs in a web worker with a 10 millisecond interval. Each time the timer ticks, a function is called in the controller which increments a variable. This variable is used by a bootstrap progress bar on my page. The problem that I'm encountering is that the progress bar doesn't update unless I call $scope.$apply() in the function call where the value gets updated. Meanwhile, I have an array with a bunch of complex objects in them (100+ objects) that are on the $scope. Since I need to call $scope.$apply() in order to have the view take the changes every time my timer ticks, it's also updating this list of objects (every 10ms), which is slowing down my application. Does anyone have any ideas as to how I could potentially resolve this issue? Please let me know if I can provide additional details.
tagged with: web-worker
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/45329479
tagged with: angularjs
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/28497990
type: AnsweredQuestion

http://stackoverflow.com/a/28517065
has comment: http://stackoverflow.com/comment/78726139
accepted answer of: http://stackoverflow.com/q/28516951
type: Answer
has comment: http://stackoverflow.com/comment/45380037
has body: Essentially you are asking your client side script to directly call a function on your Node server script. The only other choice other than an Ajax POST AFAIK is Socket.io This similar stackoverflow question should help you out. edit: I made a simple example spanning multiple files: /test/app.js: var express = require('express'); var app = express(); app.post('/LEDon', function(req, res) { console.log('LEDon button pressed!'); // Run your LED toggling code here }); app.listen(1337); /test/clientside.js $('#ledon-button').click(function() { $.ajax({ type: 'POST', url: 'http://localhost:1337/LEDon' }); }); /test/view.html LED on To run it: node app.js in terminal, and open view.html on your browser. Try pressing the button and check out your terminal. Hope this helps.
answers question: http://stackoverflow.com/q/28516951
upvote count: 15
has comment: http://stackoverflow.com/comment/45351923
score: 15
has comment: http://stackoverflow.com/comment/50688226
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45352278

http://stackoverflow.com/comment/64139320
comment on: http://stackoverflow.com/q/28469853
has text: does jsplumb still exist? the website seems down
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28474433
type: Question
accepted answer: http://stackoverflow.com/a/28477054
answer count: 2
tagged with: button
downvote count: 0
tagged with: jsp
tagged with: javascript
favorite count: 0
has title: How could I pass foreach button single value to javascript?
has answer: http://stackoverflow.com/a/28477054
upvote count: 1
possible better answer: http://stackoverflow.com/a/28474540
has answer: http://stackoverflow.com/a/28474540
tagged with: foreach
type: AnsweredQuestion
score: 1
has body: My Javascript and Jsp code : var questionNum = $('#questionNum').val(); &lt;c:forEach var="i" begin="1" end="${examPaper.number_of_questions}"&gt; &lt;input type="button" name="question_num" id="questionNum" value="&lt;c:out value="${i}"/&gt;" onclick="doAjaxPost(this.id);" class="startTest"/&gt; &lt;/c:forEach&gt; but in the java script, I am getting value as 0. Anyone help me to get the value.
has comment: http://stackoverflow.com/comment/45272718

http://stackoverflow.com/comment/45309905
score: 0
type: AnswerComment
type: Comment
has text: Thanks for the answer `$templateCache.get('snippet1.html')[0]` doesn't have value, getting undefined..I believe while accessing first DOM we always do `element[0]` why same thing not applied here?
comment on: http://stackoverflow.com/a/28494966

http://stackoverflow.com/q/28518119
has comment: http://stackoverflow.com/comment/45367246
has comment: http://stackoverflow.com/comment/45367400
has comment: http://stackoverflow.com/comment/45367209
has answer: http://stackoverflow.com/a/28518777
score: 0
has comment: http://stackoverflow.com/comment/45353772
answer count: 3
linked to: http://stackoverflow.com/q/111102
tagged with: function
has comment: http://stackoverflow.com/comment/45354274
tagged with: javascript
has body: Here's a code (function(x){ // Some code here })(1); The code above is IIFE so this means that it will be executed just once. Qustion: why would anybody need to pass parameter into this function (whick is 1 in example below)? I can just create variable inside function, like below (function(){ var x = 1; // Some code here })(); This question is not about how closures work but about why and when to use first code pattern and when the second one.
linked to: http://stackoverflow.com/q/134572
tagged with: iife
has comment: http://stackoverflow.com/comment/45367446
has answer: http://stackoverflow.com/a/28518196
has answer: http://stackoverflow.com/a/28518837
has comment: http://stackoverflow.com/comment/45367255
has comment: http://stackoverflow.com/comment/45368588
has comment: http://stackoverflow.com/comment/45367156
tagged with: syntax
type: UnansweredQuestion
has title: IIFE and parameter
linked to: http://stackoverflow.com/q/750486
type: Question
has comment: http://stackoverflow.com/comment/45354786
has comment: http://stackoverflow.com/comment/45367473

http://stackoverflow.com/comment/45374689
has text: But all the `oninput` handlers are not identical so this doesn't handle that. I thought that was a key part of the problem here. They are similar, but not identical.
comment on: http://stackoverflow.com/a/28529734
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/28485046
score: 7
has answer: http://stackoverflow.com/a/28485870
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/53938014
favorite count: 0
upvote count: 7
has title: d3 append() with function argument
has body: This works: // A d3.select("body").selectAll(".testDiv") .data(["div1", "div2", "div3"]) .enter().append("div") .classed("testDiv", true) .text(function(d) { return d; }); The following snippet is identical except that the argument for append, instead of being "div" as above, is a function(d) that simply returns "div": // B d3.select("body").selectAll(".testDiv") .data(["div1", "div2", "div3"]) .enter().append(function(d) { return "div"; }) .classed("testDiv", true) .text(function(d) { return d; }); B, however, does not work, and instead returns the error message "Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'." How is "div" as an argument for append() different from function(d) { return "div"; }?
tagged with: d3.js
type: UnansweredQuestion

http://stackoverflow.com/a/28578507
has comment: http://stackoverflow.com/comment/45465805
answers question: http://stackoverflow.com/q/28578280
has body: You can try this Regex: parseFloat(str.replace(/.*?(\-?)(\d*\.\d+)[^\d\.]*/, '$1$2')); But its better to match the number than replace the other characters: var matches = /(\-?\d*\.(?:\d+)?)/.exec(str); if (typeof matches != 'undefined' &amp;&amp; matches.length &gt; 0) { var num = parseFloat(matches[1]); }
has comment: http://stackoverflow.com/comment/45466197
score: 0
type: Answer

http://stackoverflow.com/comment/50622283
comment on: http://stackoverflow.com/a/30597322
score: 0
type: Comment
has text: In jsfiddle `return map["webmetro.com"];` this code maps to root domain. Can I include root domain in graph also, which is not find in the current graph?
type: AnswerComment

http://stackoverflow.com/comment/45346036
type: QuestionComment
comment on: http://stackoverflow.com/q/28513901
has text: Sure, on resize, nothing is happening.
score: 0
type: Comment

http://stackoverflow.com/q/28551889
has comment: http://stackoverflow.com/comment/45416884
type: Question
has comment: http://stackoverflow.com/comment/45417030
tagged with: javascript
linked to: http://stackoverflow.com/q/4989537
score: 0
has body: I am working on some js code that is called from a button click, starts some asynchronous action that may result in a window that needs to be opened. To prevent popup-blockers I need to make sure the window.open call is done from the button-click. I have been playing around with setTimeout and setInterval to check every 100ms or so if the async action is done and open the window if needed. I simulate this in my jsfiddle by calling a function via setInterval n times, the n-th call calls window.open. Javascript: // in chrome this only works with n = 1, otherwise the open-call is blocked var n = 2 var timer function tst1() { console.log('tst1.start ' + n) if (--n == 0) { clearInterval(timer) window.open('http://google.com/', '_blank') } console.log('tst1.done') } function tst() { timer = setInterval(tst1, 1000) } Html: Click me Problem is, this only works first time (n=1 on first line in js code), when n is set to 2 or more, it works in Firefox but not in chrome. Any idea how to make this work in all modern browsers? Rob
tagged with: popup-blocker
tagged with: asynchronous
has title: Preventing popup-blocker when using window.open from interval
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45416905
has comment: http://stackoverflow.com/comment/45425064
has comment: http://stackoverflow.com/comment/45416934
answer count: 0

http://stackoverflow.com/q/28574928
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28611338
upvote count: 1
type: Question
has body: I have a web application using Zurb Foundation5.3.3 and would like to intergrate the off-canvas functionality. For some reason I can't get it to work, nothing happens when the activation link is clicked Please see this http://jsfiddle.net/v1880qb7/1/ My off canvas code is here: Calendar This is test content.
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28611338
tagged with: zurb-foundation
downvote count: 0
answer count: 1
favorite count: 0
has title: Foundation5 Off-canvas not working
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28475315
tagged with: ruby-on-rails
answer count: 1
tagged with: heroku
tagged with: javascript
type: UnansweredQuestion
tagged with: ruby-on-rails-4
tagged with: ajax
has answer: http://stackoverflow.com/a/28476091
type: Question
has body: Everything in my local environment works fine, but in production on heroku, ajax links which render content at vanity urls ex. /t/tags instead of /atags/1 render an error concerning a lack of id: ActionView::Template::Error (No route matches {:action=&gt;"show", :controller=&gt;"atags", :id=&gt;nil} missing required keys: [:id]): This makes even less sense, because if I navigate into production to '/t/tags' for example, the page loads fine. So ajax at the route is broken while the same route via a regular rendered view is functional. What could be causing this error and discrepancy between development and production environments? I checked routes on heroku and locally and they are identical. The js that is rendering the view is: $("#tag_posts").html("&lt;%= escape_javascript(render @atag) %&gt;"); So I wonder if it has something to do with @atags path being interpreted differently in production for some reason or what? The links that are broken are being constructed by: link_to(piece.downcase, atag_path(Atag.find_by(tag:piece[1..-1].downcase)), :class =&gt; 'post_hashtag', :remote =&gt; true, :onclick =&gt; "location.href='#top'") And these links constructed by that same code work fine in production minus the remote:true and :onclick =&gt; "location.href='#top'" at rendering regular pages. link_to(piece.downcase, atag_path(Atag.find_by(tag:piece[1..-1].downcase)), :class =&gt; 'post_hashtag') And just to note again, both of these types of links work fine in development, just only the latter in production. Any insight into this oddity would be greatly appreciated! Thanks! EDIT: I think I've almost narrowed it down. In the atags controller in show I defined: @atag = Atag.find_by_tag(params[:id]) Where/how would I make an equivalent definition for other views? That might solve the problem in production. Thanks!
has title: What could cause a discrepancy between local/development and production routing in rails?
score: 0

http://stackoverflow.com/comment/45216374
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28442313
has text: @jfriend00 I'm not very familiar with asynchronous programming and as far as I know, synchronous testing would make it a lot easier.
score: 0

http://stackoverflow.com/comment/45363116
type: QuestionComment
comment on: http://stackoverflow.com/q/28523210
has text: @latheefitzmeontv can you please provide a code example?
score: 0
type: Comment

http://stackoverflow.com/comment/45248727
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28461268
has text: Shouldn't `innertext` work in this context?

http://stackoverflow.com/comment/45209107
type: QuestionComment
has text: Have look at this answer. I believe this is what you need http://stackoverflow.com/questions/23024831/android-shared-preferences-example
comment on: http://stackoverflow.com/q/28439771
score: 0
type: Comment

http://stackoverflow.com/q/28575939
has answer: http://stackoverflow.com/a/28575993
tagged with: arrays
has answer: http://stackoverflow.com/a/28576008
has title: How can you find and delete a section of an array with a parameter of a string?
has answer: http://stackoverflow.com/a/28576022
has answer: http://stackoverflow.com/a/28576003
type: Question
linked to: http://stackoverflow.com/q/5767325
has comment: http://stackoverflow.com/comment/45461251
accepted answer: http://stackoverflow.com/a/28575993
score: 0
has answer: http://stackoverflow.com/a/28576401
has comment: http://stackoverflow.com/comment/45461361
tagged with: javascript
answer count: 5
has body: How can you find a section of a JS array and delete it? What I mean is a function that can find a string, looks at an array, sees if one of the "sections" are exactly like the string, and deletes that "section". Here's what I have: var array = ['a1','f4']; function findAndDelete(string){ delete array.find('a1'); } When I try it, nothing happens. It seems that there's a syntax error. How do I fix this?
possible better answer: http://stackoverflow.com/a/28576008
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45461290

http://stackoverflow.com/comment/45240325
type: Comment
comment on: http://stackoverflow.com/q/28456851
score: 4
has text: If you don't want to POST or GET when clicking the buttons, you'll have to do AJAX.
type: QuestionComment

http://stackoverflow.com/a/28440570
type: Answer
accepted answer of: http://stackoverflow.com/q/28440529
upvote count: 9
answers question: http://stackoverflow.com/q/28440529
has body: Yes, you can use the ngNonBindable directive For example: Ignored: {{1 + 2}}
score: 9
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45255976
comment on: http://stackoverflow.com/q/28465118
score: 0
type: Comment
type: QuestionComment
has text: Check the console for errors by right-clicking the browser action and selecting "Inspect popup"

http://stackoverflow.com/comment/45406590
type: Comment
has text: Its currently done on click in the php code -> session_start(); if ($_POST["cpoll"]) { $_SESSION["tusername"] = $_POST['ttuser'];
type: QuestionComment
comment on: http://stackoverflow.com/q/28545720
score: 0

http://stackoverflow.com/a/28554012
has body: My guess would be you are using absolute urls incorrectly. Since, you didn't prefix your form post action with http://www. it is attempting to post it to the local relative path. Try this: action="http://www.sportsboard.netai.net/page.php?page=register&amp;&amp;do=register&amp;&amp;formdisplay=false"
answers question: http://stackoverflow.com/q/28553960
type: AcceptedAnswer
type: Answer
score: 0
accepted answer of: http://stackoverflow.com/q/28553960

http://stackoverflow.com/comment/45309022
type: Comment
has text: function urFunName(){ if(urCon){ $(".WIWC_T1 a").removeAttr('onclick');}else{ $(".WIWC_T1 a").attr('onclick','call_levelofcourse();popup('popUpDiv1');');}}
comment on: http://stackoverflow.com/a/28494239
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45421223
type: QuestionComment
has text: when you try to make it work, where did you get stuck?
comment on: http://stackoverflow.com/q/28554221
score: 0
type: Comment

http://stackoverflow.com/comment/45268056
score: 0
type: Comment
type: QuestionComment
has text: sorry, updated the question.
comment on: http://stackoverflow.com/q/28471886

http://stackoverflow.com/a/28534564
has comment: http://stackoverflow.com/comment/45384303
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/45384251
score: 6
has body: You can use setInterval without using a for loop. function readBook() { var array = $("#offscreen_text").text().toString().split(/[\s\n]+/); var i=0; setInterval(function(){ $("#word").text(array[i]); i++; },1000); } Demo : http://jsfiddle.net/sywzno5p/ Edit Fiddle with clearInterval() : http://jsfiddle.net/gn6eh7t1/
upvote count: 6
accepted answer of: http://stackoverflow.com/q/28534470
answers question: http://stackoverflow.com/q/28534470
type: AcceptedAnswer

ruby
tags question: http://stackoverflow.com/q/28552199
tags question: http://stackoverflow.com/q/28584395
tags question: http://stackoverflow.com/q/28567630
tag name: ruby
tags question: http://stackoverflow.com/q/28475994
tags question: http://stackoverflow.com/q/28570707
tags question: http://stackoverflow.com/q/28506305
tags question: http://stackoverflow.com/q/28570938
tags question: http://stackoverflow.com/q/28441821
tags question: http://stackoverflow.com/q/28563042
tags question: http://stackoverflow.com/q/28480742
tags question: http://stackoverflow.com/q/28496661
tags question: http://stackoverflow.com/q/28469438
tags question: http://stackoverflow.com/q/28472980
tags question: http://stackoverflow.com/q/28582025
tags question: http://stackoverflow.com/q/28530212
tags question: http://stackoverflow.com/q/28440497
type: Tag

http://stackoverflow.com/a/28577945
score: 1
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45479774
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45466325
answers question: http://stackoverflow.com/q/28577679
has body: If all you want to do is get movements over these elements, I would do the below. If you need to listen for more stuff it could be worked in from there. $(document).on({ mouseenter: function(){ $(this).addClass("highlighted"); }, mouseleave: function(){ // other stuff if you want } }, '.td'); // down here you pass the selector you wish to target See this Working Fiddle
type: Answer
accepted answer of: http://stackoverflow.com/q/28577679

http://stackoverflow.com/comment/56399519
type: AnswerComment
type: Comment
has text: ...wow. From graph paper flow charts to a complex OSR V8 SSAIR optimization graph thing. This seemed like such a simple question, yet this is one of the most complicated answers I have ever seen. +1
comment on: http://stackoverflow.com/a/28500922
score: 0

http://stackoverflow.com/comment/45443607
comment on: http://stackoverflow.com/q/28566545
score: 0
has text: All right I will give it a try then
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28545148
has answer: http://stackoverflow.com/a/28545278
type: Question
has title: Element Changes when another it transformed
answer count: 1
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45403492
has body: I've encountered a strange behavior that maybe a bug in Chrome. The issue is that when I animate the gallery transform property, an image below looses it's border radius ?! Here's the full website on my test server: http://chelefoto.com.192-198-106-143.vanilla.websavers.ca/ Here's an example of how I'm animating the gallery: $('.arrow-container.right').click(function(){ var i = $('.arrow-container.right').index($(this)); divScroll[i].pos -= scrollSpeed; // prevent scrolling past width of gallery // if (divScroll[i].pos <= -(divScroll[i].width - galleryWidth) ){ divScroll[i].pos = -(divScroll[i].width - galleryWidth); } var container = $(this).siblings('.gallery-scroll').children('.gallery-container'); container[0].style.transform = "translate3d("+ divScroll[i].pos +"px,0, 0)"; }); This happens even if I change the transform value in the dev tools of Chrome. This does not happen in IE or FireFox. I think it is a Chrome bug, but I thought I'd check with the community here to see if anyone can see a reason in my code for this behaviour.
type: UnansweredQuestion

ffmpeg
tags question: http://stackoverflow.com/q/28570622
tag name: ffmpeg
type: Tag

http://stackoverflow.com/a/28466938
has comment: http://stackoverflow.com/comment/45259448
has comment: http://stackoverflow.com/comment/45259428
answers question: http://stackoverflow.com/q/28466510
score: 2
accepted answer of: http://stackoverflow.com/q/28466510
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45259520
has comment: http://stackoverflow.com/comment/45259443
type: Answer
has comment: http://stackoverflow.com/comment/45259653
has body: It depends on your scenario. If there is a ton of data being refreshed often, you would want to do an in place edit. If you just refresh when clicked and the data is insubstantial, just rebuild the table the way you originally did. An example of this (although it's not quite working): http://jsfiddle.net/xg7cr0g4/78/ var build = function(){ //...build the grid/accordion here on demand (load,reload,programmatically) }; var refresh = function(){ //update json build(); //rebuild; }; $(document).ready(function(){ // build on load build(); }); jQuery UI accordion needs to be destroyed on rebuild: re-initialize jquery accordion on callback Here is the working fiddle: http://jsfiddle.net/xg7cr0g4/79/ You can also organize your code better and avoid global functions by following the module pattern: var Grid = function(){ var self = this; this.build = function(){ ... }; this.rebuild = function(){ ... }; this.init = function(){ ... this.build(); $('#refresh').on('click', this.refresh); ...etc }; $(this.init); }; var grid = new Grid(); grid.rebuild(); To answer your other question, just add an additional method: this.setHeader = function(header){ // similar to rebuild, change the json using param x[...] = header; this.build(); };
upvote count: 2
has comment: http://stackoverflow.com/comment/45259622

http://stackoverflow.com/comment/45350603
score: 0
type: AnswerComment
has text: How about trying to stick with the automatic mocking and configure the mock in the test? Something like `var i18n = require('i18n'); i18n.t.mockReturnValue('My return string')
type: Comment
comment on: http://stackoverflow.com/a/28516589

window.open
tags question: http://stackoverflow.com/q/28479773
tag name: window.open
type: Tag

http://stackoverflow.com/a/28813369
type: Answer
answers question: http://stackoverflow.com/q/28553320
accepted answer of: http://stackoverflow.com/q/28553320
has body: To stop Groups from participating in layouts, in your groupTemplate you can set isLayoutPositioned: false on the Group. But if you want all nodes to be affected by the same layout, instead of just top-level nodes (nodes that are not in groups) then you will have to do something like this: var layout = $(go.ForceDirectedLayout); layout.doLayout(myDiagram.nodes); Instead of setting the Diagram's layout. That way the layout will use the entire set of nodes, not just the top-level nodes. Here's a simple example: function init() { if (window.goSamples) goSamples(); // init for these samples -- you don't need to call this var $ = go.GraphObject.make; // for conciseness in defining templates myDiagram = $(go.Diagram, "myDiagram", // create a Diagram for the DIV HTML element { initialContentAlignment: go.Spot.Center, // center the content "undoManager.isEnabled": true // enable undo &amp; redo }); // define a simple Node template myDiagram.nodeTemplate = $(go.Node, "Auto", // the Shape will go around the TextBlock $(go.Shape, "RoundedRectangle", // Shape.fill is bound to Node.data.color new go.Binding("fill", "color")), $(go.TextBlock, { margin: 3 }, // some room around the text // TextBlock.text is bound to Node.data.key new go.Binding("text", "key")) ); myDiagram.groupTemplate = $(go.Group, "Vertical", { isLayoutPositioned: false, selectionObjectName: "PANEL", // selection handle goes around shape, not label ungroupable: true }, // enable Ctrl-Shift-G to ungroup a selected Group $(go.TextBlock, { font: "bold 19px sans-serif", isMultiline: false, // don't allow newlines in text editable: true // allow in-place editing by user }, new go.Binding("text", "text").makeTwoWay(), new go.Binding("stroke", "color")), $(go.Panel, "Auto", { name: "PANEL" }, $(go.Shape, "Rectangle", // the rectangular shape around the members { fill: "rgba(128,128,128,0.2)", stroke: "gray", strokeWidth: 3 }), $(go.Placeholder, { padding: 10 }) // represents where the members are ) ); // create the mod…
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/57037127
type: QuestionComment
comment on: http://stackoverflow.com/q/28557754
score: 1
type: Comment
has text: Try increasing the setTimeout from 1 to 1000 and see if the problem persists. It feels to me like the webview is not fully loaded when you try it for the first time.

http://stackoverflow.com/comment/45477085
has text: If I answered your original question you can mark my answer :) Anyhow, I didn't forget you.
type: AnswerComment
comment on: http://stackoverflow.com/a/28580948
score: 0
type: Comment

http://stackoverflow.com/a/28515234
has body: You can do this easily with jQuery. To move the div by increasing it's margin use : function go_next(){ var firstDiv=$('#first_ltr'), secondDiv=$('#second_ltr'), thirdDiv=$('#third_ltr'); //Rest of your code.To move with margins : firstDiv.animate({"margin-left":"+= 2.75px"},1000); secondDiv.animate({"margin-left":"+= 2.75px"},1000); thirdDiv.animate({"margin-left":"+= 2.75px"},1000); }
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45349660
has comment: http://stackoverflow.com/comment/45350388
has comment: http://stackoverflow.com/comment/45350788
type: Answer
accepted answer of: http://stackoverflow.com/q/28515129
answers question: http://stackoverflow.com/q/28515129
has comment: http://stackoverflow.com/comment/45348174
has comment: http://stackoverflow.com/comment/45349820
has comment: http://stackoverflow.com/comment/45349889

http://stackoverflow.com/q/28587136
has body: I have the following code: HTML: &lt;span data-test="15, 17"&gt; JavaScript / JQuery: $value = [ $(object).data('test') ] The $value variable now contains an array with one element. This element has the value "15, 17". I want to change the value of data-test in HTML in a way that $value will contain an array with two elements "15" and "17". In my environment I can only change the data-test attribute of the span. I can not change the JavaScript. jsFiddle how the result currently looks like: ["15, 17"] But I need it to be: ["15", "17"] Is there any way? Edit 1: I want to highlight the following part again: I can not change the JavaScript, only the HTML Edit 2: I guess from the answers and comments below that with these requirements it is not possible to achieve the result I aimed for.
possible better answer: http://stackoverflow.com/a/28587177
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28587680
has answer: http://stackoverflow.com/a/28587177
has comment: http://stackoverflow.com/comment/45481394
has answer: http://stackoverflow.com/a/28587284
score: 2
upvote count: 2
has title: How to write HTML5 Data Attribute as JavaScript Array Elements
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28587680
type: Question
answer count: 3
has comment: http://stackoverflow.com/comment/45481618
tagged with: arrays
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45482144

http://stackoverflow.com/a/28579412
has comment: http://stackoverflow.com/comment/45467182
answers question: http://stackoverflow.com/q/28579347
score: 0
has body: Are you looking for this in jquery: var elem = $('.container').find('[data-bind]');
type: Answer

http://stackoverflow.com/a/28469048
type: Answer
has body: The preserveViewport option is a KmlLayers option, not a google.maps.Map option. Note that if you use preserveViewport for both of the KmlLayers, you need to set the two mandatory options for the map (zoom and center). working fiddle working code snippet: function initialize() { var myLatlng = new google.maps.LatLng(35.3, -120.3); var mapOptions = { maxZoom: 12, minZoom: 7, center: myLatlng }; var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var kmlLayer = new google.maps.KmlLayer({ url: 'http://www.slocleanair.org/air/AQI_III/AQI_2015_yy_yy.kml', suppressInfoWindows: true, map: map, // preserveViewport: true }); var myLatlng2 = new google.maps.LatLng(34.9, -120.5); var mapOptions2 = { maxZoom: 18, minZoom: 8, zoom: 9, center: myLatlng2 }; var map2 = new google.maps.Map(document.getElementById('map-canvas2'), mapOptions2); var kmlLayer2 = new google.maps.KmlLayer({ url: 'http://www.slocleanair.org/air/AQI_III/AQI_2015_yy_yy.kml', suppressInfoWindows: true, map: map2, preserveViewport: true }); } initialize(); #map-canvas { width: 260px; height: 180px; padding: 10px; border: 2px solid #999; float:left; } #map-canvas2 { width: 260px; height: 180px; padding: 10px; border: 2px solid #999; } Test KML Layers Big Map
has comment: http://stackoverflow.com/comment/45338208
answers question: http://stackoverflow.com/q/28467447
accepted answer of: http://stackoverflow.com/q/28467447
score: 0
has comment: http://stackoverflow.com/comment/45331785
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45329194

http://stackoverflow.com/q/28553681
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28561172
downvote count: 1
has answer: http://stackoverflow.com/a/28561172
has title: Javascript Countdown to stop at 0:00
favorite count: 0
upvote count: 0
accepted answer: http://stackoverflow.com/a/28554453
type: AnsweredQuestion
has body: I've found this countdown script and made some basic formatting changes but I can't figure out how to get the timer to stop at 0:00 instead of going into minus figures. Any help would be appreciated :) Countdown You have : to claim your free game.
score: -1
has answer: http://stackoverflow.com/a/28554453
type: Question
answer count: 2

http://stackoverflow.com/q/28551603
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: mapbox
has title: Change the placeholder text of an input field after initializing
possible better answer: http://stackoverflow.com/a/59724662
type: AnsweredQuestion
upvote count: 3
has comment: http://stackoverflow.com/comment/45423919
has answer: http://stackoverflow.com/a/28551646
accepted answer: http://stackoverflow.com/a/28551646
type: Question
score: 3
has body: I am working with an input field that is generated on a map. I would like to change the placeholder text of the input field from "Search" to "Search for Location". The input field does not have a class or id but its parents do. I tried changing after initializing using jQuery below to no avail. $('.leaflet-control-mapbox-geocoder-form input').attr("placeholder","Search for Location"); Below is a fiddle with the input field visible. I am happy to continue using jQuery or via pure JS. http://jsfiddle.net/teraw600/
tagged with: placeholder
has answer: http://stackoverflow.com/a/59724662
tagged with: javascript

http://stackoverflow.com/comment/45400221
has text: do you get any message in the console ?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28543325

http://stackoverflow.com/comment/45244798
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28444648
has text: Thanks! I didn't want to go into too much details but your point is valid.
type: AnswerComment

xlink
type: Tag
tags question: http://stackoverflow.com/q/28451878
tag name: xlink

http://stackoverflow.com/q/28515981
accepted answer: http://stackoverflow.com/a/28516022
answer count: 2
has body: I am working on a jsp application. I have a bean user. In javascript I have the user id. I want to send it to javascript. With the getter method of id - getId() I have tried the following thing but it not working - &lt;script type="text/javascript"&gt; var userId = '&lt;% getId()%&gt;'; alert("User Id is: " + userId); &lt;/script&gt; Am I doing something wrong? Can any one help me. Thanks
score: 0
has title: Can not pass jsp value to javascript
has answer: http://stackoverflow.com/a/28516022
tagged with: jsp
tagged with: javascript
has answer: http://stackoverflow.com/a/28516241
type: Question
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28516241

http://stackoverflow.com/a/28579098
has comment: http://stackoverflow.com/comment/45467984
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28577829
has body: No unfortunately. PNG encoding is a relative slow process in itself (you can see this with large images saved in apps such as Photoshop too). The only efficient way to speed up things is to reduce the size of the canvas bitmap you want to encode - the browser is not the optimal tool for large data handling such as a large image files (dimension wise) and they where never meant to do these sort of things. Breaking it down in slices can help you unblocking the UI. But since you cannot encode them in parallel, and there is overhead in producing the Base-64 encoded data-uri, you would need to use async setTimeout to give the browser some time to parse the event queue between each slice, and of course, you would have to piece them together at some point, somewhere, so this would make it slower, more error prone and more complex all-in-all (complex isn't necessary a bad thing though in cases such as these). It's probably your best bet though if reducing bitmap size is not an option. And as Max points out, there is size limits for data-uris. You could dump the raw buffer using getImageData() but then you would end up with a raw sized buffer which has a chain of other implications. Shared web workers could in theory do the encoding in parallel but would very likely be much slower than letting the browser do it in compiled code. You would have to provide code to do the encoding too... And as with many of the new things it does not have full or complete support yet.

http://stackoverflow.com/a/28569340
answers question: http://stackoverflow.com/q/28564545
has body: You have to do it the other way around : call Ajax first and then display the response in fancybox within the success setting like : $(document).on('click', '#table td a', function (e) { e.preventDefault(); var hcall = e.currentTarget.toString(); var cURL = hcall; ax(); $.ajax({ url: 'mypage.php?u=' + encodeURIComponent(cURL), crossDomain: true, cache: false, beforeSend: function (xhr) { xhr.setRequestHeader("Access-Control-Allow-Origin", "*"); }, success: function (data) { cx(); // create a new HTML element and place response on it var _content = $('&lt;div /&gt;', { id: "newId" }).html(data); $.fancybox({ content: _content, // this is where you display ajax result // other API options width: 800, height: 650, // type: 'iframe', // you don't need this, is AJAX remember? autoScale: 'true', openEffect: 'elastic', closeEffect: 'elastic' }); // fancybox } }); // ajax }); Notice we are creating a new HTML element and adding the response to it using the .html() method, but it not may be necessary. In most cases (depending on the type of ajax response) you could pass the response as first parameter in the fancybox method like : $.ajax({ // Ajax params success: function (data) { cx(); $.fancybox(data, { // API options }); } }); // ajax
score: 0
type: Answer

http://stackoverflow.com/q/28592025
has title: Generating AngularJS UI templates from dynamic data
has answer: http://stackoverflow.com/a/28790278
type: Question
accepted answer: http://stackoverflow.com/a/28790278
tagged with: javascript
has body: I'm new to Angular and the front end development and trying to learn Angular and create something with it. I've gone through the basics and more advanced stuff and know my way around and created a few sample apps and now starting to build something useful. I have a data model defined on the server side and I want to present them in the front end. Apparently the usual approach is to create the html templates, bind the fields and then glue them all through something like ui-router which works but I'm thinking of building something more dynamic that can present the data without first creating the templates. I'm not sure if this is doable or even a good idea though so that's my question. Is there something out there than can build these partial templates based on the data model (my preference is runtime but design time is good as well)? Thanks in advance.
upvote count: 1
answer count: 1
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
downvote count: 0
score: 1

http://stackoverflow.com/q/28443352
has comment: http://stackoverflow.com/comment/45243998
tagged with: javascript
has title: Display HTML table inside a DIV using Javascript switch statement
has comment: http://stackoverflow.com/comment/45216572
has comment: http://stackoverflow.com/comment/45216736
has comment: http://stackoverflow.com/comment/45245171
has comment: http://stackoverflow.com/comment/45216890
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45216608
has comment: http://stackoverflow.com/comment/45216671
has comment: http://stackoverflow.com/comment/45216387
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45216838
tagged with: php
score: 2
upvote count: 2
tagged with: rendering
has answer: http://stackoverflow.com/a/28443789
has body: I am working on displaying a table that lists things based on what state was selected in HighMaps during drill down: Code Snippet: switch (e.point.name) { case 'California': $('#table').html(''); break; case 'Virginia': $('#table').html(''); break; default: $('#table').html(''); break; } The table is dynamically generated by taking data from DB for each state using PHP. Table structure looks like this: Company List - State Company Name County Details Company 1 Test County Company details. Company 2 Test County Company details. Company 3 Test County Company details. The generated table output that does inside .html('') looks like this: $('#table').html(' Company List - California Company Name County Details Company 1 Test County Company details are available to ACMA members only. Company 2 Test County Company details are available to ACMA members only. Company 3 Test County Company details. '); Everything works well when the list of companies is small. Once The number of companies per state gets bigger and the generated table code becomes longer things stop working. I tested it out. If I take the part of generated code that is too long and delete half of it then everything starts working again. Is there a limit on how many characters can go inside .html(); ? Is there a more efficient way to display these tables?
has comment: http://stackoverflow.com/comment/45216705
type: Question
tagged with: highmaps

http://stackoverflow.com/q/28560214
type: Question
tagged with: type-safety
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28562818
answer count: 2
score: 2
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28560273
has body: I read that someone claims JSON is type-safe. I know that plain Javascript is not. But how could a representation format like JSON can be type-safe ?
has title: Why is JSON type-safe?
upvote count: 2
type: UnansweredQuestion

http://stackoverflow.com/comment/45255588
comment on: http://stackoverflow.com/a/28459991
has text: See [how to lazy load templates on demand in Meteor](https://stackoverflow.com/a/28334315/1269037).
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45239516
has text: 'showPriority': function(priority) { return Priorities.findOne({name: 'priority.show'}); } Was what I tried in my Meteor.methods object. My template still didn't render the title of a priority =(
type: Comment
comment on: http://stackoverflow.com/a/28446575
score: 0
type: AnswerComment

http://stackoverflow.com/q/28529268
score: 1
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
type: AnsweredQuestion
has body: i have setup ace to render html code let's say for example that he renderer the following code 1 &lt;html&gt; 2 &lt;body&gt; 3 &lt;table&gt; 4 &lt;tr&gt; 5 &lt;td&gt; 6 test 7 &lt;/td&gt; I would like to get the line number for a given fragment of my code, so for example if i search "&lt;html&gt;&lt;body&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;" i would like to move the cursor and higlight line 6. Unfortunately ace built in find function only seems to find code that are at the same line so ace.find('&lt;html&gt;', options) work and highlight line 1 but ace.find('&lt;html&gt;&lt;body&gt;', options) doesn't find anything at all. Could you explain me why or give me a workaround ? Thanks by advance ;)
tagged with: ace-editor
has answer: http://stackoverflow.com/a/28529469
accepted answer: http://stackoverflow.com/a/28529469
has title: ace editor find code snippet
upvote count: 1
type: Question

http://stackoverflow.com/comment/45473196
score: 0
type: AnswerComment
type: Comment
has text: @collapsar Can you please correct the code for me? I put the ` ` inside the ` ` tag!
comment on: http://stackoverflow.com/a/28582321

http://stackoverflow.com/comment/45251843
type: QuestionComment
has text: Angular doesn't inject a factory. Angular injects a service instance created by the factory function. So, I don't understand what you mean by "perform task upon injection". Can you give an example of what you are trying to achieve?
score: 0
comment on: http://stackoverflow.com/q/28462955
type: Comment

size
type: Tag
tag name: size
tags question: http://stackoverflow.com/q/28564334

http://stackoverflow.com/q/28483406
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45289948
score: 1
accepted answer: http://stackoverflow.com/a/28484721
upvote count: 1
type: Question
has title: HighChart Stacked Column label issue
tagged with: jsfiddle
has comment: http://stackoverflow.com/comment/45314993
tagged with: highcharts
tagged with: javascript
tagged with: jquery
tagged with: label
has body: I have a chart with values that are uneven, ie: First value is 1315 and second value is 1, and so on, and when displaying the chart the labels are being overlapped. I have already searched in multiple forums but no one had the exact same problem. Here's a fiddle to see the problem: http://jsfiddle.net/6LutjLc3/ $(function () { $('#container').highcharts({ chart: { type: 'column' }, title: { text: 'Stacked column chart' }, xAxis: { categories: ['Issue'] }, yAxis: { min: 0, title: { text: 'Total fruit consumption' }, stackLabels: { enabled: true, style: { fontWeight: 'bold', color: (Highcharts.theme &amp;&amp; Highcharts.theme.textColor) || 'gray' } } }, legend: { align: 'right', x: -30, verticalAlign: 'top', y: 25, floating: true, backgroundColor: (Highcharts.theme &amp;&amp; Highcharts.theme.background2) || 'white', borderColor: '#CCC', borderWidth: 1, shadow: false }, tooltip: { formatter: function () { return '&lt;b&gt;' + this.x + '&lt;/b&gt;&lt;br/&gt;' + this.series.name + ': ' + this.y + '&lt;br/&gt;' + 'Total: ' + this.point.stackTotal; } }, plotOptions: { column: { stacking: 'normal', dataLabels: { enabled: true, color: (Highcharts.theme &amp;&amp; Highcharts.theme.dataLabelsColor) || 'white', style: { textShadow: '0 0 3px black' } } } }, series: [{ name: 'John', data: [1235] }, { name: 'Toto', data: [2] }, { name: 'Matt', data: [1] }, { name: 'Jane', data: [72] }, { name: 'Joe', data: [3] }] }); }); What I need to code is to give the value 1 one box where the label fits in as like any other example in highchart. Thanks in advance for your help!
has comment: http://stackoverflow.com/comment/45290404
has comment: http://stackoverflow.com/comment/45289783
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28484721
favorite count: 0
has comment: http://stackoverflow.com/comment/45289810
linked to: http://stackoverflow.com/q/20044479

http://stackoverflow.com/q/28525716
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45372223
has comment: http://stackoverflow.com/comment/45369668
type: Question
has comment: http://stackoverflow.com/comment/45369601
has comment: http://stackoverflow.com/comment/45372381
tagged with: javascript
tagged with: optimization
score: 0
has comment: http://stackoverflow.com/comment/45374872
has comment: http://stackoverflow.com/comment/45372212
has comment: http://stackoverflow.com/comment/45371805
has body: I updated this Question, beacuse my Fiddles were not saved well - I'm building an app that contain a serie of similar operations with a form. Instead of adding a lot of forms I chose to use a generic form and dynamically change the events on the buttons of the form. My challenge is to make the code more generic, so I easily can add much more operations without multiplying the code. The complete non-generic code is in the Fiddle link, a part of that is placed here, under the link. refined Fiddle // sample function init() { operationA.addEventListener('mousedown', prepareA); operationB.addEventListener('mousedown', prepareB); } // Operation flow: // Prepare &gt;&gt; Cancel or Process &gt;&gt; Execute function prepareA() { if (isEventsRemoved) { showForm(); ok.addEventListener('mousedown', processA); cancel.addEventListener('mousedown', cancelA); isEventsRemoved = false; } else { alert("Cancel other operation first"); } } function cancelA() { hideForm(); cleanUp(processA, cancelA); } function processA() { hideForm(); cleanUp(processA, cancelA); if (input.value == "a") { executeA(); } else { alert("No good, try operationA again."); cleanUp(processA, cancelA); prepareA(); } } function executeA() { alert("Executing A"); } Instead of repeating the same functions/methods for A, B, C etc.. I started with generic functions, passing parameters for A, B ,C etc. But when I follow this line, I don't know how to glue it together, some kind of recursiveness starts to appears, see the generic Fiddle. Again only part of the code under the Fiddle link. Problem Fiddle // Set it up function init() { operationA.addEventListener('mousedown', function(){ prepareAll(processA, cancelA)}); operationB.addEventListener('mousedown', function(){ prepareAll(processB, cancelB)}); } // Operation flow: // Prepare &gt;&gt; Cancel or Process &gt;&gt; Execute function prepareAll(processHandler, cancelHandler) { if (isEventsRemoved) { showForm(); ok.addEventListener('mousedown', processHandler); cancel.a…
has comment: http://stackoverflow.com/comment/45372176
has title: Use instances, or pass parameters: best way to optimize

http://stackoverflow.com/q/28565399
possible better answer: http://stackoverflow.com/a/31818469
tagged with: facebook
has answer: http://stackoverflow.com/a/31818469
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/1087031
downvote count: 1
tagged with: ionic-framework
type: Question
has answer: http://stackoverflow.com/a/28600115
upvote count: 9
has body: I'm using the Ionic framework to create an app and I now want to add facebook (oauth2) login. I already implemented a facebook login on my website using OAuth; I simply redirect the user to the relevant facebook URL, let them enter their credentials there and I then get the token in my (Flask) backend. This works like a charm. I now wonder how I can implement the same in my Ionic/Cordova/Angular app. As I see it now there are a couple options: Redirect the user to the mobile version of Facebook within the Ionic/Cordova webview in the app to authenticate my app (just like I do in my normal website), and then return the user to the Ionic app again. I've got the feeling that this is not the right way to do it though. Use Facebooks Javascript authentication which returns the token to the app. I can then POST the token to my server to save it for later usage. Let the user insert his username and password in the Ionic app and POST those to my server and then use those to authenticate the user on facebook and get a token for it. This obviously totally defies the purpose of OAuth, but I guess it would work. I read this article on the Ionic blog about how to implement Facebook login, but that uses the Auth0 plugin, which I don't want to use (it costs money and I don't want to be dependent on another company). Yet another option which I am not aware of.. So I now wonder; what is the best way to implement (OAuth based) Facebook login in my Ionic app and why? All tips are welcome!
tagged with: javascript
has title: How to add OAuth facebook login in Ionic/Angular?
answer count: 2
score: 8
favorite count: 0
accepted answer: http://stackoverflow.com/a/28600115
tagged with: cordova
tagged with: angularjs

http://stackoverflow.com/comment/69976877
type: Comment
has text: This worked for me! The error messages I was getting from the npm debug log (and somewhat more cryptically in the console) indicated what version of jQuery was needed. This was while provisioning vagrant for a Drupal 8 site. Much thanks!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/30578061

http://stackoverflow.com/q/28579814
type: Question
has comment: http://stackoverflow.com/comment/46287798
answer count: 1
upvote count: 6
has body: I'm having difficulties implementing multi-touch panning with hammer.js. Panning events are only fired with single pointers. If I try to drag with two fingers it does not fire until I release at least one finger. Do I have to do something special to the hammer configuration? EDIT: I already found that I can configure 2 pointers for the pan event, but now I see that Chrome has a built-in feature to open a context menu on two-finger tap, which most of the time prevents the panning from being recognized. If I simply catch the 'contextmenu' event and call preventDefault(), it will (obviously) completely disable the pan recognizer. Any other way? BR, Daniel
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
score: 6
has comment: http://stackoverflow.com/comment/48003147
has answer: http://stackoverflow.com/a/38569799
tagged with: hammer.js
tagged with: panning
favorite count: 0
has title: Multi-Touch Panning with Hammer.js

http://stackoverflow.com/comment/45324447
score: 0
type: Comment
has text: and name the class remove-stick ? left. removeAttribute('remove-stick');
comment on: http://stackoverflow.com/a/28502519
type: AnswerComment

mshtml
tags question: http://stackoverflow.com/q/28475956
tag name: mshtml
type: Tag

http://stackoverflow.com/a/28490781
answers question: http://stackoverflow.com/q/28490684
type: Answer
accepted answer of: http://stackoverflow.com/q/28490684
has comment: http://stackoverflow.com/comment/45302809
score: 4
upvote count: 4
has body: When you do var br = document.createElement('br'); you have a reference to a SINGLE element. So when you do this: div.appendChild(printName); div.appendChild(br); div.appendChild(printEmail); div.appendChild(br); You are saying "add the printName element, then add this &lt;br&gt; element after it. Now, create the printEmail element, then MOVE that same &lt;br&gt; element after it." So in the end, you still have just ONE &lt;br&gt; element, after everything else. The fix that probably involves the least code change is something like: function br() { return document.createElement('br'); } div.appendChild(printName); div.appendChild(br());
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45262289
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28468461
score: 0
has text: what do you mean by pass?what you really want?

http://stackoverflow.com/comment/45375508
score: 1
comment on: http://stackoverflow.com/a/28529953
type: AnswerComment
type: Comment
has text: Ok, but correct me if I'm wrong: you are dealing with _.str global, like in my example?

http://stackoverflow.com/tag/pdf
tags question: http://stackoverflow.com/q/28582520
tags question: http://stackoverflow.com/q/28475247
tags question: http://stackoverflow.com/q/28476604
tags question: http://stackoverflow.com/q/28547006
tags question: http://stackoverflow.com/q/28584146
type: Tag
tag name: pdf
tags question: http://stackoverflow.com/q/28557522
tags question: http://stackoverflow.com/q/28450943
tags question: http://stackoverflow.com/q/28466470
tags question: http://stackoverflow.com/q/28566196
tags question: http://stackoverflow.com/q/28591704
tags question: http://stackoverflow.com/q/28446691
tags question: http://stackoverflow.com/q/28567281
tags question: http://stackoverflow.com/q/28522749
tags question: http://stackoverflow.com/q/28461238

http://stackoverflow.com/a/28632909
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28580145
has body: It might be possible to keep some of your script hidden. The issue is; who's account does anything run under. You could share some script with someone that ran an HTTP Request with UrlFetchApp.fetch() to your Apps Script Content Service script. So, you would have a Stand Alone Apps Script in your Drive, in your account that received a request, and returned something. That could cause lots of requests to the script in your account, depending on how many people you are sharing this with. The code that the user had in their file, would access their files, and work on their files, and the user could see that code. Your Content Service would basically just be processing data and accessing files that aren't in the users account. Anything that had to do with the User Interface you couldn't hide from the user. You can't hide values being copied into cells, or formatting the color, or opening a dialog box. You could use your content service to do things like create the HTML, then return the HTML to the user. That way the user wouldn't be able to see the code that did something like create dynamic HTML.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28580145

http://stackoverflow.com/comment/45287720
comment on: http://stackoverflow.com/q/28478702
type: Comment
has text: I hate to have to repeat this... I am new to this style of coding could you possibly show me an example
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45463882
comment on: http://stackoverflow.com/q/28577558
score: 0
type: Comment
type: QuestionComment
has text: I developer so i don't know more designing like animation.

http://stackoverflow.com/q/28446210
has comment: http://stackoverflow.com/comment/45221818
upvote count: 3
type: Question
has comment: http://stackoverflow.com/comment/45221729
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/28446424
linked to: http://stackoverflow.com/q/12779776
has answer: http://stackoverflow.com/a/28446382
answer count: 3
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Fade bottom or top of text in a div
has body: I'd like to create a list with a particular size, but it's contents can be larger than the list. I thought it would be real nice looking if the list had items in it and they faded out at the bottom and the top, while having a background image for the container that also contains the list. This is proving harder than expected, and I'm having a difficult time finding an appropriate guide for such a thing. The images below shows the expected result Is this even possible? Thanks in advance. Edit: I've looked at this and this, but I can't use those techniques because there's a background image in the background, not a solid color
has answer: http://stackoverflow.com/a/28446425
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28446425
tagged with: css
possible better answer: http://stackoverflow.com/a/28446382

http://stackoverflow.com/a/28464556
has comment: http://stackoverflow.com/comment/45254831
answers question: http://stackoverflow.com/q/28464456
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45254897
has body: you can use reverse() directly instead of using a temporary variable to hold your array data. jsfiddle demo $.each($('textarea[name=source]').val().split('\n').reverse(), function(e){ alert(this); });
accepted answer of: http://stackoverflow.com/q/28464456
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28516263
has title: How to transfer an element in jQuery?
has answer: http://stackoverflow.com/a/28516326
accepted answer: http://stackoverflow.com/a/28516326
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has body: I've got this function that calls upon a modal $('#btn1').click(function () { // Get textfield var textfield = $('#txt1'); // Get value var input = textfield.val(); // Check if the value is already in the database var json = textfield.data('json'); if (itemExists(input, json)) { // Stuff } else { $('#modalAddText').append('X does not exist'); $('#myModal').modal(); } }); Then this to check if the user clicked "OK" $('#modalOk').click(function () { insertItem(itemone, itemtwo); $('#myModal').modal('hide'); }); So the problem is I don't have access to the textfield in the first function anymore, so how can I get/keep access to it? And I can't just do $('#txt1'); because I have multiple txtfields So can I somehow transfer the textfield variable?
tagged with: twitter-bootstrap
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45349788
type: Question

http://stackoverflow.com/comment/45474498
has text: If not in jQuery, you can add an event listener. Check this JSFiddle - http://jsfiddle.net/6jbcvd2c/1/ Add the javascript in the template itself, it must work.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28581058
type: AnswerComment

http://stackoverflow.com/q/28493111
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/3237076
tagged with: jquery
tagged with: ajax
has body: I am calling a webservice using ajax call(javascript) to return json.It is working fine.But when i changed my site to HTTPS it is not working.What will be the reason? function GetReportguid1, callback) { $.ajax({ type: "POST", url: "/demo/Datapage.aspx/GetData", contentType: "application/json; charset=utf-8", dataType: "json", data: JSON.stringify({ guiddemo: guid1 }), success: function (results) { callback(results); }, error: AjaxFailed }); };
type: UnansweredQuestion
score: 0
has answer: http://stackoverflow.com/a/28493142
has title: HTTPS issue with ajax call in javascript
has comment: http://stackoverflow.com/comment/45306607
type: Question

http://stackoverflow.com/a/28478489
downvote count: 0
has comment: http://stackoverflow.com/comment/45279605
type: Answer
score: 6
has body: The first anchor is not in the head element. Anchors are not allowed within the head element The end tag for the head element is optional The start tag for the body element is optional By trying to start an anchor in the head, you implicitly end the head element and start the body element. The end tag for the head and start tag for the body are then invalid markup and are ignored.
answers question: http://stackoverflow.com/q/28478429
upvote count: 6
accepted answer of: http://stackoverflow.com/q/28478429
type: AcceptedAnswer

facebook-graph-api
tags question: http://stackoverflow.com/q/28472095
tag name: facebook-graph-api
tags question: http://stackoverflow.com/q/28445991
tags question: http://stackoverflow.com/q/28462925
tags question: http://stackoverflow.com/q/28575761
tags question: http://stackoverflow.com/q/28554422
tags question: http://stackoverflow.com/q/28592426
tags question: http://stackoverflow.com/q/28558995
type: Tag

http://stackoverflow.com/comment/45456429
type: Comment
type: QuestionComment
score: 1
has text: http://facebook.github.io/react/docs/jsx-gotchas.html#custom-html-attributes
comment on: http://stackoverflow.com/q/28573329

http://stackoverflow.com/q/28582017
has answer: http://stackoverflow.com/a/47831737
tagged with: media
favorite count: 0
has title: Recording audio from multiple microphones simultaneously with getUserMedia()
has body: it is possible to access different microphones at the same time using getUserMedia()? This whould be useful to filter out background noise; create some sort of stereoscopic effect; make available multiple audio tracks for an international streaming conference. Apparently, it is quite tricky for video source: Capture video from several webcams with getUserMedia I was wondering if, for the audio source, the problem was different.
tagged with: web-audio-api
has comment: http://stackoverflow.com/comment/91006421
type: UnansweredQuestion
score: 11
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/53631901
linked to: http://stackoverflow.com/q/21182518
upvote count: 12
answer count: 1
tagged with: javascript
tagged with: getusermedia

http://stackoverflow.com/a/28588901
upvote count: 2
answers question: http://stackoverflow.com/q/28588597
accepted answer of: http://stackoverflow.com/q/28588597
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: You can combine both keypress and keyup events to achieve this. Use keypress to prevent unwanted characters, and keyup for the actual calculation. You'll also have to use e.stopImmediatePropagation() to make sure keyup won't proceed with the calculation even when an invalid character entered: $discount.on('keypress', function(e) { if (e.which != 8 &amp;&amp; e.which != 0 &amp;&amp; (e.which &lt; 48 || e.which &gt; 57)){ e.stopImmediatePropagation(); return false; } } .on('keyup change', function(e) { $newPrice.val(Math.round(($price.val() - (this.value / 100) * $price.val()))* 100) / 100); }); I took the liberty to hook for a change event as well, so the total will get updated when you delete characters (using backspace or delete key) as well. See updated Codepen
score: 2

http://stackoverflow.com/comment/45417957
type: QuestionComment
has text: What does MakeApiCall() return? Is it a json string? If so, it's being double serialized
comment on: http://stackoverflow.com/q/28552397
score: 0
type: Comment

task
type: Tag
tag name: task
tags question: http://stackoverflow.com/q/28548985
tags question: http://stackoverflow.com/q/28502050

http://stackoverflow.com/comment/45321769
type: QuestionComment
type: Comment
has text: Problem fixed. I had a comment after the ?> which was sent back to ajax together with the array apparently. Don't know why this wasn't sent back when not in function though. But now it works.
score: 0
comment on: http://stackoverflow.com/q/28488545

http://stackoverflow.com/a/28506966
has comment: http://stackoverflow.com/comment/45333772
has comment: http://stackoverflow.com/comment/45333430
has comment: http://stackoverflow.com/comment/45333230
type: Answer
has comment: http://stackoverflow.com/comment/45333613
has comment: http://stackoverflow.com/comment/45333490
has body: Use data-attr to store data. Send Use console.log($("#link").data("value")); to fetch it. So your code becomes Send and dont use $('form#myform').submit(); and to fetch data in PHP, use $name = $_POST["name"];
has comment: http://stackoverflow.com/comment/45333468
has comment: http://stackoverflow.com/comment/45333570
has comment: http://stackoverflow.com/comment/45333707
answers question: http://stackoverflow.com/q/28506879
has comment: http://stackoverflow.com/comment/45333282
has comment: http://stackoverflow.com/comment/45333920
score: 0

http://stackoverflow.com/q/28560886
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28561110
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/7286532
accepted answer: http://stackoverflow.com/a/28563362
has title: Javascript: addEventListener not taking updated DOM into account?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45433193
has comment: http://stackoverflow.com/comment/45436783
has comment: http://stackoverflow.com/comment/45433897
type: AnsweredQuestion
has body: I'm very new to javascript and I'm trying to give some dynamic features to a site I'm working on. In particular, I want to have an unfolding menu item that unfolds and folds back whenever the mouse is on and off of it, respectively. I got the unfolding part down but the event listener that triggers the folding back does it whenever the mouse if off of the area where the menu item used to be, event though it's just been extended. The HTML markup looks like this: Places The event listeners are declared like this: and the extend and retract functions are the following: function extend() { if(!extended) { var drop = document.getElementById("drop"); var form = document.createElement("form"); form.setAttribute("action", "place.php"); form.setAttribute("method", "get"); drop.appendChild(form); for(var i = 0; i < listPlace.length; i++) { var li = document.createElement("li"); var input = document.createElement("input"); li.setAttribute("class", "dropOption"); input.setAttribute("type", "submit"); input.setAttribute("name", "location"); input.setAttribute("value", listPlace[i]); li.appendChild(input); form.appendChild(li); } extended = true; } } function retract() { var dropOption = document.getElementsByClassName("dropOption"); while(dropOption[0]) { dropOption[0].parentNode.removeChild(dropOption[0]); } extended = false; } I realize it all must look amateurish but like I said, I'm new to this. I'd really appreciate it if someone could help me.
has answer: http://stackoverflow.com/a/28561110
has answer: http://stackoverflow.com/a/28563362
type: Question

http://stackoverflow.com/comment/45358641
type: Comment
has text: Okay , I see clearer now , I think just use NodeJS server side and fully exploit the framework. This will be a big challenge but I think it is totally worth it! Maybe later I'll use Ratchet + PHP. $http of AngularJS uses Ajax , OK with that. I will make sure to combine it with Socket.io . Thank you very much for your help!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28520282

http://stackoverflow.com/a/28572208
answers question: http://stackoverflow.com/q/28571510
has comment: http://stackoverflow.com/comment/45459057
has body: Thanks to @tadman I came up with this so far, seems to work as I expect it to. The problem was that I did not update the promise before calling then on it, and it was branching instead of calling it in sequence. And this is what I wanted - to turn an object that has both sync/async into async to allow chaining. Petka (@Esailija) also shows great example of building DSLs above (semvar version bumping &amp; git pushing) by extending bluebird library, but for my purposes this is enough. var Sample = function () { this.promise = Promise.resolve(); }; Sample.prototype.a = function () { this.then(function () { console.log("1"); }); return this; }; Sample.prototype.b = function () { this.then(function () { return new Promise(function (res, rej) { setTimeout(function() { console.log("2"); res(); }, 500); }); }); return this; }; Sample.prototype.c = function () { this.then(function () { console.log("3"); }) return this; }; Sample.prototype.chainPromise = function (func) { this.promise = this.promise.then(func); }; var s = new Sample(); s.a().b().c(); or even then instead of chainPromise? Sample.prototype.then = function (func) { this.promise = this.promise.then(func); return this.promise; };
type: Answer
has comment: http://stackoverflow.com/comment/45457027
score: 0

http://stackoverflow.com/q/28524244
has comment: http://stackoverflow.com/comment/45364678
tagged with: angularjs-ng-transclude
answer count: 1
tagged with: angularjs-ng-repeat
tagged with: angularjs
has answer: http://stackoverflow.com/a/28524391
accepted answer: http://stackoverflow.com/a/28524391
type: AnsweredQuestion
has title: angularjs transclude and ng-repeat: doing it right
type: Question
tagged with: javascript
has body: I have the following code that produces not the expected result: 1 content 2 content 3 content 4 content Instead the result is: 1 2 3 4 content It seems that the ng-repeat gets done first and for the last item it handles the transclude. I know that ng-repeat create the nodes during the compile phase, but I thought in the link phase the link function is called for each node and adds the embedded content. Can somebody explain what is happening here and how to do it correct? Transclude content
score: 0

http://stackoverflow.com/q/28437788
downvote count: 2
upvote count: 1
has title: Javascript: Change image depending on multiple variables
has answer: http://stackoverflow.com/a/28437874
type: Question
has comment: http://stackoverflow.com/comment/45207189
answer count: 1
tagged with: javascript
tagged with: jquery
score: -1
tagged with: ajax
favorite count: 0
has body: this is a question if it is even possible to create...and that with not that much knowlege of Javascript: I have some cars with several "options", e.g.: type: sedan, cabriolet color: black, blue, red rims: rimA, rimB, rimC tyres: tyre1, tyre2, tyre3 In total that are 54 different cars, and for each I have a set of 3 images each. They would all have a unique name based on the above values, something like this: sedan-black-rimA-tyre1.jpg sedan_blue-rimA-tyre2.jpg cabriolet-red-rimC-tyre1.jpg ... [type]-[color]-[rims]-[tyres].jpg Now I would like to create a page where the "standard car" is already shown (Sedan, black, rimA, tyre1). There are buttons in the corners labeled with the options type, color, rims, tyres - which open like an accordion and show the "values" as images. In each the standard values are already preselected. Selecting different options, the shown image should change accordingly - ideally per ajax, so not to reload the whole page. In the footer are some social buttons th share the custom car, therefore the link has to contain the values just selected. Again, is such a page possible to create with medium javascript knowledge, and if so, could you hint me in the right direction where to find tutorials / more information on how to do it exactly (especially the part with the multiple "options/values")? Thanks a bunch in advance, Emil
type: UnansweredQuestion

http://stackoverflow.com/a/28463859
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28463807
type: Answer
accepted answer of: http://stackoverflow.com/q/28463807
upvote count: 15
has body: Change your getInitialState(). Currently your data is an object literal and object literals doesn't support map(). Change it to an array.
score: 15
has comment: http://stackoverflow.com/comment/45254331

http://stackoverflow.com/comment/45274926
has text: @JoëlMulaj'i Ok, can you give me a example of your table?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28475690

http://stackoverflow.com/comment/45447390
has text: @DaveNewton I am loading saves from a webserver, so that the community can create levels. It could be my host provider, since this HTML page is quite obscure.
comment on: http://stackoverflow.com/q/28548487
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28477446
score: -1
answer count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28477974
tagged with: return
has title: Javascript & jquery return value
has comment: http://stackoverflow.com/comment/45277745
downvote count: 2
upvote count: 1
type: Question
has body: I've been staring at the following problem for 3 hours now. I would like to start the whole code from the beginning after finishing the 'newLevel'-function at the bottom of the code. I've been trying to wrap the code inside of if() and while() statements but just can't get it to work. Shortly the problem is that newLevel()-function can't send the new value of variable level to the beginning of the code. How could I do this? Thank you for the downvotes! $(document).ready(function(){ var level = 1; if(level == 1) {random variables} if(level == 2) {random variables} if(level == 3) {random variables} $('#check').click(function(){ // if we click 'Check correct answer button if(givenAnswer == correctAnswer) { $('#raisingCrystals').animate({ 'marginTop' : "-=51%", 'opacity' : '0.0' },2000, function(){ $('#crystalsH3 &gt; h3').html('+3'); $('#crystalsH3 &gt; h3').css('color','#0D5C94'); $('#crystalsH3').animate({ 'font-size' : "10vw" },2000, function(){ $('#totalPoint &gt; h3').html(totalPoints); $('#speak4 &gt; p').css('font-size','1.7vw'); $('#speak4 &gt; p').html('Blaa blaa...'); $('#check &gt; h2').html('---Next assesment---'); // let's do a function that check, if the '---Next assesment---'-button is clicked $('#check &gt; h2').click(function newLevel(){ level++; }); }); }); }); } else { } }); });
tagged with: if-statement
tagged with: javascript

http://stackoverflow.com/q/28591090
has answer: http://stackoverflow.com/a/28616499
has comment: http://stackoverflow.com/comment/45489752
has body: I want to select all radio buttons with a specific name. Currently, i do this: var points = 0, size = 4; function checkAnswer(answer, q) { if (answer) //If answer's right. { points += 10; } else //If answer's wrong. { points -= 10; } document.getElementById("score").innerHTML = "You have " + points + " points."; //Display score while (size--) document.getElementsByClassName("test" + q)[size].disabled = "true"; size = 4; } Question 1 Answer Answer Right Answer Answer Question 2 Answer Right Answer Answer Answer No score yet! I want to have a better way to do that, for example some way of getElementsByName, but not using that function (since it's mostly not supported). I suppose i could do that using attributes, but i dont know how to do that. Please help me, thanks. Also, i prefer not to use jQuery.
tagged with: javascript
answer count: 2
downvote count: 0
favorite count: 0
type: UnansweredQuestion
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45526221
has answer: http://stackoverflow.com/a/28591439
type: Question
has title: Setting all radio buttons with name

http://stackoverflow.com/a/28492240
type: Answer
has comment: http://stackoverflow.com/comment/45305398
accepted answer of: http://stackoverflow.com/q/28491838
answers question: http://stackoverflow.com/q/28491838
has comment: http://stackoverflow.com/comment/45610801
score: 3
has body: You've found yourself a rather interesting issue, and it may be related to what we found with another similar problem. See this answer. To test the theory, here is your code copy and pasted into Stack Overflow snippets. The first one is using d3 3.2.8, and seems to work properly. /*modified from Mike Bostock at http://bl.ocks.org/3943967 */ var data = [ {"key":"FL", "pop1":3000, "pop2":4000, "pop3":5000}, {"key":"CA", "pop1":3000, "pop2":3000, "pop3":3000}, {"key":"NY", "pop1":12000, "pop2":5000, "pop3":13000}, {"key":"NC", "pop1":8000, "pop2":21000, "pop3":11000}, {"key":"SC", "pop1":30000, "pop2":12000, "pop3":8000}, {"key":"AZ", "pop1":26614, "pop2":6944, "pop3":30778}, {"key":"TX", "pop1":8000, "pop2":12088, "pop3":20000} ]; var n = 3, // number of layers m = data.length, // number of samples per layer stack = d3.layout.stack(), labels = data.map(function(d) {return d.key;}), //go through each layer (pop1, pop2 etc, that's the range(n) part) //then go through each object in data and pull out that objects's population data //and put it into an array where x is the index and y is the number layers = stack(d3.range(n).map(function(d) { var a = []; for (var i = 0; i < m; ++i) { a[i] = {x: i, y: data[i]['pop' + (d+1)]}; } return a; })), //the largest single layer yGroupMax = d3.max(layers, function(layer) { return d3.max(layer, function(d) { return d.y; }); }), //the largest stack yStackMax = d3.max(layers, function(layer) { return d3.max(layer, function(d) { return d.y0 + d.y; }); }); var margin = {top: 40, right: 10, bottom: 20, left: 50}, width = 677 - margin.left - margin.right, height = 533 - margin.top - margin.bottom; var y = d3.scale.ordinal() .domain(d3.range(m)) .rangeRoundBands([2, height], .08); var x = d3.scale.linear() .domain([0, yStackMax]) .range([0, width]); var color = d3.scale.linear() .domain([0, n - 1]) .range(["#aad", "#556"]); var xx = margin.top; var svg = d3.select("svg") .attr("width", width + margin.left + margin.right) .attr("height", hei…
upvote count: 3
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28591400
type: AnsweredQuestion
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28591950
answer count: 1
accepted answer: http://stackoverflow.com/a/28591950
tagged with: mapbox
has title: Animating polylines between markers - Mapbox
tagged with: maps
type: Question
has body: I have the following code to plot markers and polylines between points. It runs this script when a user changes a selection on the page. $.post('_posts/get-pins.php', {traveller: $(this).val()}, function(data){ // Create empty featureLayer var featureLayer = L.mapbox.featureLayer().addTo(map); // Create empty featureCollection var featureCollection = { "type": "FeatureCollection", "features": [] }; var lineArray = []; $.each(data, function (k, item) { // Create new feature object and push to featureCollection featureCollection.features.push({ "type": "Feature", "properties": { "id": item.id, "title": item.title, "description": item.description, "image": item.image, "marker-symbol": "star", "marker-color": "#ff8888", "marker-size": "large" }, "geometry": { "type": "Point", "coordinates": [ item.long, item.lat ] } }); lineArray[item.id] = [item.lat, item.long]; }); featureLayer.setGeoJSON(featureCollection); lineArray = lineArray.filter(function(){return true}); var polyline = L.polyline(lineArray).addTo(map); },'json'); I have found the following example on the mapbox examples. https://www.mapbox.com/mapbox.js/example/v1.0.0/dynamically-drawing-a-line/ I was wondering if this kind of animation is possible on drawing simple lines, and if so how to do it.

http://stackoverflow.com/comment/45548678
type: AnswerComment
score: 0
has text: Thanks for your answer, but when I look at the jsfiddle I see a red and green column, not red and blue as would be expected from the code. Also the "could be filled" tooltip doesn't show. The style and tooltip seem to only be effecting the bottom of the column.
type: Comment
comment on: http://stackoverflow.com/a/28619469

http://stackoverflow.com/comment/45437449
has text: @Cataclysm, you can try the answer I gave by filling the the textarea with spaces. Though I'm looking forward to another way to do this.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28560255

http://stackoverflow.com/comment/45795777
comment on: http://stackoverflow.com/q/28575628
type: Comment
score: 0
has text: Did your question get answered? Can you mark one of the answers as the "best answer" by checking the green checkmark to the left of it?
type: QuestionComment

http://stackoverflow.com/q/28447473
has body: $('.item').click(function(){ myFunc(); }); function myFunc(){ $.ajax({ success: function (data) { //call API }, beforeSend: function() { $('.loading').css({'display':'block!important'}); }, complete: function () { $('.loading').css({'display':'none !important'});}, }) } my code within beforeSend doesn't work, the success came first. This is strange, it should be beforeSend execute first. I try to put an alert() before showing my loading, the loading did appear. What's wrong here?
answer count: 4
linked to: http://stackoverflow.com/q/15821141
has comment: http://stackoverflow.com/comment/45224416
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45223766
has answer: http://stackoverflow.com/a/28447642
has answer: http://stackoverflow.com/a/28448616
tagged with: javascript
has comment: http://stackoverflow.com/comment/45223734
has title: ajax beforeSend doesn't execute according to flow
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/28447494
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/45224177
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28448335
has comment: http://stackoverflow.com/comment/45224183

http://stackoverflow.com/q/28544542
upvote count: 1
type: AnsweredQuestion
score: 1
has title: Retrieving value of inner promise
accepted answer: http://stackoverflow.com/a/28544607
type: Question
tagged with: location
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28544607
has body: I am trying to access the value of a nested promise from a controller. Here is my controller. I am calling my service, expected a city name to be returned: LocationService.getCurrentCity(function(response) { // This is never executed console.log('City name retrieved'); console.log(response); }); And here is the service. I am updating the position of the client, and then I request the city from Google. The console.log(city) do log the correct city as expected. this.getCurrentCity = function() { return this.updateMyPosition().then(function() { return $http.get('http://maps.googleapis.com/maps/api/geocode/json?latlng=' + myPosition.lat + ','+ myPosition.lng +'&amp;sensor=false').then(function(response) { var city = response.data['results'][0]['address_components'][3]['long_name']; console.log(city); return city; }); }); } How can I access the city in my controller?
answer count: 1
favorite count: 0
tagged with: promise
tagged with: angularjs
tagged with: angular-promise

http://stackoverflow.com/comment/45206788
comment on: http://stackoverflow.com/q/28437181
has text: I tried to use the js at - github.com/sagens42/md5asm. It gives me empty string for md5 value. Here's the code: var calcS = new md5(reader.result); $scope.md5Value = calcS.getMd5();
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45215048
has text: I am going to be using JQuery and SPServices to accomplish the upload. The only thing I am really using the FilePicker for is to get the path and filename. The string representing the path-n-file that you see in the table, below the picker, is how I am going to get the file.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28441899

http://stackoverflow.com/comment/45475671
has text: try using arrayname.indexOf("arrayitemtobecmpared");
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28584143
type: Comment

http://stackoverflow.com/q/28570599
tagged with: node.js
downvote count: 0
type: UnansweredQuestion
has body: I've been reading through http://nodejs.org/api/repl.html , but unless I'm missing something, I'm not sure if you can start a script and when you hit a breakpoint drip into the repl. eg: app.get('/', function(req, res) { try { var bucket = []; var targets = require('url').parse(req.url); console.log('this is the outside ',url); //// break here and drop into repl /// emitter.getTarget = function(url) { var self = this; console.log('this is the ',url);
type: Question
score: 3
has answer: http://stackoverflow.com/a/28571094
has title: How to drop into REPL from a node script upon hitting a breakpoint
answer count: 1
tagged with: javascript
favorite count: 0
upvote count: 3

http://stackoverflow.com/comment/45330032
type: Comment
comment on: http://stackoverflow.com/q/28499803
type: QuestionComment
score: 0
has text: just to make sure, you want the "beetle" in the top to be centered?

http://stackoverflow.com/comment/45226655
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28449114
has text: If i passed "2/11/2012" as a startDateString, The function works. Else block fired. Maybe value of startDate element is in wrong format?
score: 0

http://stackoverflow.com/q/28505802
tagged with: node.js
score: 1
has answer: http://stackoverflow.com/a/28506470
upvote count: 1
type: Question
tagged with: mongodb
has body: I am using mongoose and I am facing a problem of creating a document if it does not exist, and if it exists, I want to update an array in the document. For example, if I have var courseSchema = new mongoose.Schema({ code : { type: String }, name : { type: String }, dept : { type: String }, instructors : [{ type : mongoose.Schema.ObjectId, ref: 'User' }], }); var Course = mongoose.model('Course', courseSchema); ... ... // This code should check if a course exists with a specified 'code' and // 'name' and , if it exist, I want to add req.body.instructor_id to // instructor array in that document, else I want to create a document with // the specified course, name(and dept) and with req.body.instructor_id as the only element in // the instructors array // So far I have this, but it is clearly wrong. Course.findOneAndUpdate( {code: req.body.code, name: req.body.name}, {$push: {instructors: req.user._id}}, {upsert: true}, function (err, course) { if (err) console.log("error " + err); else { console.log(JSON.stringify(course, null, '\t')); } } );
tagged with: mongoose
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
has title: Mongoose create a document if not found with specified fields, if found update an array in the document
type: UnansweredQuestion

http://stackoverflow.com/q/28544902
has body: I am trying to export a table to excel, I can do it but the sheet is left to right, I want it to be right to left. of course I can do it manually (Page Layout -> Sheet right-to-left), but I want it to be automatically. I'm using for the exporting jquery.table2excel.js: //table2excel.js (function($, window, document, undefined) { var pluginName = "table2excel", defaults = { exclude: ".noExl", name: "Table2Excel" }; // The actual plugin constructor function Plugin(element, options) { this.element = element; // jQuery has an extend method which merges the contents of two or // more objects, storing the result in the first object. The first object // is generally empty as we don't want to alter the default options for // future instances of the plugin this.settings = $.extend({}, defaults, options); this._defaults = defaults; this._name = pluginName; this.init(); } Plugin.prototype = { init: function() { var e = this; e.template = " <!--[if gte mso 9]> "; e.template += "<x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions>"; e.template += "<x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook> <![endif]--> {table} "; e.tableRows = ""; // get contents of table except for exclude $(e.element).find("tr").not(this.settings.exclude).each(function(i, o) { e.tableRows += " " + $(o).html() + " "; }); this.tableToExcel(this.tableRows, this.settings.name); }, tableToExcel: function(table, name) { var e = this; e.uri = "data:application/vnd.ms-excel;base64,"; e.base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))); }; e.format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }); }; e.ctx = { worksheet: name || "Worksheet", table: table }; window.location.href = e.uri + e.base64(e.format(e.template, e.ctx)); } }; $.fn[pluginName] = function(options) { this.each(function() { if (!$.data(this, "plugin_" + pluginName)) { $.data(this, "plugin_"…
upvote count: 6
score: 6
tagged with: excel
tagged with: export-to-excel
type: Question
tagged with: javascript
has title: html export table to excel right to left
has answer: http://stackoverflow.com/a/57036844
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/29090653
score: 0
type: Answer
has body: Not sure if I could help but I'm also trying to get this work. I have contacted Google and they send me this snippet specifically for Magento: <?php // Obtain order variables with Magento functions $orderId = $this->getOrderId(); $order = Mage::getModel('sales/order')->loadByIncrementId($orderId); $customer = Mage::getModel('customer/customer')->load($order->getCustomerId()); $address = $order->getShippingAddress(); ?> <?php echo $orderId; ?> MERCHANT_ORDER_DOMAIN <?php echo htmlentities($customer->getEmail()); ?> <?php echo htmlentities($address->getCountryId()); ?> CURRENCY <?php echo $order->getGrandTotal(); ?> -<?php echo $order->getDiscountAmount(); ?> <?php echo $order->getShippingAmount(); ?> <?php echo $order->getTaxAmount(); ?> ORDER_EST_SHIP_DATE ORDER_EST_DELIVERY_DATE HAS_BACKORDER_PREORDER HAS_DIGITAL_GOODS <?php foreach ($order->getAllItems() as $item): ?> <?php echo htmlentities($item->getName()); ?> <?php echo $item->getBasePrice(); ?> <?php echo (int)$item->getQtyOrdered(); ?> <?php endforeach; ?> Also he said: All of the below variables are required in order for the OCM code to trigger. Please refer to the Order level variables here. ORDER_EST_SHIP_DATE ORDER_EST_DELIVERY_DATE HAS_BACKORDER_PREORDER HAS_DIGITAL_GOODS I changed the variables as required but for me, I don't even get the error messages just like you got for OCM, so I wouldn't know if these are the right code but may be for someone else. I'm sure you've already come across all these informations but I also need an answer, too.
answers question: http://stackoverflow.com/q/28590260

http://stackoverflow.com/a/46829227
type: Answer
answers question: http://stackoverflow.com/q/28574685
downvote count: 0
score: 2
upvote count: 2
has body: Notes the space after ; in split. function ReadCookie() { var allcookies = document.cookie; alert("All Cookies : " + allcookies ); // Get all the cookies pairs in an array cookiearray = allcookies.split('; '); //notes the space after ; // Now take key value pair out of this array for(var i=0; i&lt;cookiearray.length; i++){ name = cookiearray[i].split('=')[0]; value = cookiearray[i].split('=')[1]; alert("Key is : " + name + " and Value is : " + value); } }

http://stackoverflow.com/comment/45330795
type: Comment
comment on: http://stackoverflow.com/a/28505781
score: 0
type: AnswerComment
has text: Have you checked the encoding inside the browser?

http://stackoverflow.com/q/28542764
has comment: http://stackoverflow.com/comment/45399002
has comment: http://stackoverflow.com/comment/45399045
has answer: http://stackoverflow.com/a/28542971
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28542961
has answer: http://stackoverflow.com/a/28542961
has body: I have an array of objects. Each object has a title and a link. [Object { title="Do it", reslink="http://img-9gag-ftw.9cac.../photo/a5PrnLE_460s.jpg"}, Object { title="\n \n ...le \n ", reslink="http://img-9gag-ftw.9cac.../photo/aE17NWG_460s.jpg"}, Object { title="\n \n ...es \n ", reslink="http://img-9gag-ftw.9cac...oto/a2Y5RqD_460s_v1.jpg"}] I need to: create an element on the page for each title and create an element for each reslink What is the easiest way to accomplish that?
type: Question
has comment: http://stackoverflow.com/comment/45398949
has answer: http://stackoverflow.com/a/28542898
has comment: http://stackoverflow.com/comment/45398988
tagged with: javascript
has answer: http://stackoverflow.com/a/28542860
accepted answer: http://stackoverflow.com/a/28542860
has answer: http://stackoverflow.com/a/28543075
score: 0
answer count: 5
has title: Iterate over object's property

http://stackoverflow.com/comment/45272160
type: AnswerComment
score: 0
type: Comment
has text: Never use `body` for delegated event handlers. Use `document` as the default as body can stop receiving mouse events if the styling results in a computed body height of 0. See my answer for details.
comment on: http://stackoverflow.com/a/28474270

http://stackoverflow.com/comment/45277593
has text: Tried it in about.js too before asking the question, same issue.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28477232
type: AnswerComment

http://stackoverflow.com/comment/53925661
comment on: http://stackoverflow.com/a/28589590
score: 0
type: AnswerComment
type: Comment
has text: With my structure making it configurable is a matter of string concatenation though, right?

http://stackoverflow.com/comment/45405809
type: Comment
has text: Yes. You can substitute `/content/data.html` by `{{variable}}`.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28539436

http://stackoverflow.com/a/28468063
upvote count: 2
has body: Passing vm.newItem means you have it in 2 places in the View. While it may be clear, it's also repeating yourself and leaves you open to possibly having one get out of sync. And at what additional value? I think it is clear already without that like this. Add Otherwise you have this duplication. Add You say it is easier to test, but why? You are testing a function on the controller, so it's perfectly fine to expect that function is use a property on the same controller. You mock dependencies to the controller, but not members of it.
answers question: http://stackoverflow.com/q/28457605
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/a/28457340
has body: So AJAX wasn't that hard to learn it seems. for anyone else having this problem here is the solution I came up with MyRIO Robot Controller Start Control Stop Control
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28456851

http://stackoverflow.com/q/28478148
has body: I'd like to have a drop down menu and have two buttons on a page, where one button will send out something like: url/?tile=x&amp;status=on if the "On" button is pressed or url/?tile=x&amp;status=off if the off button is pressed x = is the value in the drop down menu I can do something like this: &lt;form&gt; Select Tile For On/Off &lt;select id="tileSelect2" data-range="63" name="tile"&gt;&lt;/select&gt; &lt;script&gt; var select = document.getElementById("tileSelect2"); var range = select.dataset.range; for (var i=0; i&lt;+range; i++) { var node = document.createElement("option"); node.value = i; node.text = i; select.appendChild(node); } &lt;/script&gt; &lt;input type="submit" value="Switch Tile On"&gt; &lt;input type="submit" value="Switch Tile Off"&gt; &lt;/form&gt; But that will just send the same thing out for both buttons. Is there a way of making different buttons do different things? I'd be happy if it sent: url/?tileon=x and url/?tileoff=x Or the other option suggested above. I've found various methods where you can run a script from a button press, but I can't work out from that how to make it send out the value selected to the server. I need to keep it simple as it's being hardcoded into an embedded sever. Many thanks.
score: 0
has answer: http://stackoverflow.com/a/28478308
answer count: 2
has title: Send out value of drop down box with two different buttons with HTML or Javascript
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28478302
type: Question
tagged with: javascript

http://stackoverflow.com/comment/66667790
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28523394
has text: Answer - http://stackoverflow.com/a/38299304/1374554

http://stackoverflow.com/comment/45383341
type: Comment
has text: Removing datatype did not help. I'm accessing the opencart API, which returns json which I'm sure about and checked.
comment on: http://stackoverflow.com/a/28524428
type: AnswerComment
score: 0

http://stackoverflow.com/q/28523313
has answer: http://stackoverflow.com/a/28523721
has body: I just can't seem to get a hang of JavaScript promises. In Parse, I have an attribute on a user that stores an array of Facebook friends IDs. When a new user logs in through Facebook for the first time I want to iterate through their Facebook friends that are using the app, then update those user's Facebook friends array to include this new user. So... in user before_save I have this: var friendsArray = user.get("facebookFriends"); // Iterate through all Facebook friends _.each(friendsArray, function(facebookId){ // Retrieve the Facebook friend user var query = new Parse.Query(Parse.User); query.equalTo("facebookId", facebookId); console.log("this executes"); query.find().then( function(){ var user = results[0]; // This does not execute console.log("Need to update " + user.get("displayName") + "'s facebook friends"); return Parse.Promise.as(); }); } My problem is not that different than another previous problem I encountered (Parse JavaScript SDK and Promise Chaining), except that this time I need the results of the async call before I can begin updating the user's Facebook friends array.
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/28523721
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45363354
has comment: http://stackoverflow.com/comment/45363308
score: 0
has title: Parse JavaScript Promises within Loop not Completing
has comment: http://stackoverflow.com/comment/45363206
tagged with: promise
tagged with: parse-platform
linked to: http://stackoverflow.com/q/27723121

http://stackoverflow.com/a/28469258
score: 1
has comment: http://stackoverflow.com/comment/45263661
has comment: http://stackoverflow.com/comment/45263647
has comment: http://stackoverflow.com/comment/45263763
type: AcceptedAnswer
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28469146
has body: Your constructor doesn't actually create anything. All it does it store an argument in a variable. So, when you call it N times, that's all it does is store a different value into the same variable N times in a row. Your code is essentially doing this: var param; var Socket = function(iParam) { param = iParam; } for(var i....){ Socket(param[i]); } It is not clear to me what you want it to do, but perhaps the constructor needs to create an object (probably using new), initialize it and then return it. If you want a new Socket object back from each call to the constructor, then you can do it like this: var util = require('util'); function Socket(iParam) { this.param = iParam; } util.inherits(Socket,EventEmitter); Socket.prototype.test = function(){ return this.param; }; module.exports = function(x) { return new Socket(x); };
accepted answer of: http://stackoverflow.com/q/28469146
has comment: http://stackoverflow.com/comment/45263756
downvote count: 0

http://stackoverflow.com/a/28445233
has body: I think you are looking for something like the following. Note that I have wrapped all the calls to deferred.resolve() into callbacks from asynchronous functions (in this case process.nextTick), since that would be a more realistic use case then resolving the promise before returning it, and is, I assume what you would be doing with your asynchronous tasks. Also you declare a variable 'myClass' and also use the same identifier as a function parameter for 'myMethod'.I don't think that is really what you meant to do, so I have changed that in my example below. var ClassTwo = function() {}; var ClassOne = function() {}; var Q = require('q'); ClassOne.prototype.myMethod = function(myClass) { myClass.test().then(function(result) { // now test returns a promise console.log('returns '+ result); // that we call .then() on }); }; ClassTwo.prototype.test = function() { var one = function() { var deferred = Q.defer(); console.log('ONE'); process.nextTick(function() { deferred.resolve()}); return deferred.promise; }; var two = function() { var deferred = Q.defer(); console.log('TWO'); process.nextTick(function() { deferred.resolve()}); return deferred.promise; }; var three = function() { var deferred = Q.defer(); console.log('THREE'); process.nextTick(function() { deferred.resolve('FOUR')}); return deferred.promise; }; return one() .then(two) .then(three) }; (new ClassOne()).myMethod(new ClassTwo());
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28444230
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28444230
score: 1
has comment: http://stackoverflow.com/comment/45226517

http://stackoverflow.com/q/28450809
type: Question
has comment: http://stackoverflow.com/comment/45231934
has comment: http://stackoverflow.com/comment/45229591
has answer: http://stackoverflow.com/a/28450840
has title: Javascript Date parsing NaN in IE8
score: 0
answer count: 1
tagged with: internet-explorer-8
accepted answer: http://stackoverflow.com/a/28450840
tagged with: javascript
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45229764
has body: I get NaN error when I try to parse date from JSON in my Javascript Format of date: "2015-02-10T23:01:00.000Z" This is my code that works in Chrome but not in IE8: var sdate = new Date(entry.startDate); var sdateMonth = sdate.getMonth() + 1; var sdateDay = sdate.getDate(); var edate = new Date(entry.endDate); var edateMonth = edate.getMonth() + 1; var edateDay = edate.getDate();
linked to: http://stackoverflow.com/q/11020658

http://stackoverflow.com/comment/45498435
score: 1
comment on: http://stackoverflow.com/a/28553837
type: AnswerComment
type: Comment
has text: It doesn't really make sense as the `save` occurs *after* the timeout has waited its 1000ms (since it is inside it). You probably have something else running in parallel, which is the one taking 3s. So `$timeout` wants to wait 1000ms, but the processor is busy doing the other thing (it is javascript so only one thing is done at a time), hence the $timeout "wait" more. However it is unsafe to rely on that as some users computer could be faster or slower, so you need to be deterministic and find what is causing this 3s delay.

http://stackoverflow.com/a/48484025
score: 0
type: Answer
has body: function formatDate(userDate) { var first = userDate.indexOf("/"); var last = userDate.lastIndexOf("/"); var months = userDate.substring(0, first); var years = userDate.substring(last + 1); var days = userDate.substring(last, 3); return (years + months + days); } console.log(formatDate("12/31/2014"));
answers question: http://stackoverflow.com/q/28477304

http://stackoverflow.com/comment/45411643
comment on: http://stackoverflow.com/a/28538882
score: 0
type: AnswerComment
has text: @Esailija how though? His code is explicitly creating a rejection and not handling it as a fixated return value to return from a method in a stud.
type: Comment

http://stackoverflow.com/comment/45213403
type: AnswerComment
score: 0
type: Comment
has text: Why would we add jQuery for such a simple problem? The OP didn't ask for a jQuery solution, and technically if you add 9,000+ lines of code to your project by adding the jQuery library, then it isn't a shorter solution. I love jQuery, and it definitely has its purpose, but I think that far too often people rely on it for very simple tasks instead of taking the time to learn JavaScript.
comment on: http://stackoverflow.com/a/28441668

http://stackoverflow.com/comment/45953548
has text: here's a tutorial on how to use the FS object https://www.adobe.com/devnet/archive/html5/articles/real-world-example-html5-filesystem-api.html
score: 0
comment on: http://stackoverflow.com/q/28437913
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45335148
comment on: http://stackoverflow.com/q/28507793
score: 0
has text: I added the code please take a look!
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45485476
score: 0
type: AnswerComment
has text: separating in two different apps is a good alternative for large applications i think, in my case is not necessary unfortunate =(..
type: Comment
comment on: http://stackoverflow.com/a/28589179

http://stackoverflow.com/q/28470902
has title: Google Map Marker as Reactjs Component
score: 1
type: Question
has answer: http://stackoverflow.com/a/37822986
tagged with: reactjs
answer count: 2
tagged with: google-maps
has answer: http://stackoverflow.com/a/28474384
linked to: http://stackoverflow.com/q/23367489
downvote count: 0
tagged with: javascript
tagged with: google-maps-api-3
favorite count: 0
has body: This stackoverflow question is answered by @Omar Torres showing how to place a marker on a Google Map using Reactjs. Working jsfiddle I'd like to use an array to pull in multiple map markers, and I want the "marker" variable: var marker = new google.maps.Marker({position: this.mapCenterLatLng(), title: 'Hi', map: map}); To be a React Component so I can set a key and take advantage of the full performance of React's diff algo. Here's my attempt, which isn't working: /** @jsx React.DOM */ var ExampleMarker = React.createClass({ render: function () { marker = new google.maps.Marker({position: new google.maps.LatLng(this.props.lat, this.props.lon), title: this.props.mls, map: this.props.map}); return ( &lt;div&gt;{marker}&lt;/div&gt; ); } }); var ExampleGoogleMap = React.createClass({ getDefaultProps: function () { return { initialZoom: 8, mapCenterLat: 20.7114, mapCenterLng: -157.7964, }; }, componentDidMount: function () { var mapOptions = { center: this.mapCenterLatLng(), zoom: this.props.initialZoom }, map = new google.maps.Map(this.getDOMNode(), mapOptions); this.setMarkers(map); this.setState({map: map}); }, mapCenterLatLng: function () { var props = this.props; return new google.maps.LatLng(props.mapCenterLat, props.mapCenterLng); }, setMarkers: function (map) { this.props.markers.forEach(function(marker) { &lt;ExampleMarker mls={marker.mls_no} lat={marker.latitude} lon={listing.longitude} key={marker.mls_no} map={map} /&gt;; }.bind(this)); }, componentDidUpdate: function () { var map = this.state.map; map.panTo(this.mapCenterLatLng()); }, render: function () { var style = { width: '100%', height: '100%' }; return ( &lt;div className='map' style={style}&gt;&lt;/div&gt; ); } }); var data = [ { 'title' : "marker1", 'latitude' : "21.883851754", 'longitude' : "-159.465845879" }, { 'title' : "marker2", 'latitude' : "22.1640990399", 'longitude' : "-159.310355405" }, { 'title' : "marker3", 'latitude' : "22.0855947129", 'longitude' : "-159.344410728" } ]; React.renderCom…
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/q/28488149
linked to: http://stackoverflow.com/q/3434278
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/28491552
favorite count: 0
has comment: http://stackoverflow.com/comment/45298061
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/45298170
score: 2
has comment: http://stackoverflow.com/comment/45298593
downvote count: 0
has comment: http://stackoverflow.com/comment/45298129
has body: I think this is absolutely ludicrous. Given HTML Javascript var statCounter = 5; Executing console.log(statCounter); // logs How can this be? How absurd is this?!!? http://jsfiddle.net/rkkj58nw/
has title: Why does passing a javascript variable with the same name as a div Id pass the div
has comment: http://stackoverflow.com/comment/45298557
type: Question
has comment: http://stackoverflow.com/comment/45298127
tagged with: javascript

http://stackoverflow.com/comment/45395907
score: 0
has text: Use jQuery's `on` instead of 1990s style `onclick` attributes and it won't be an issue.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28541185

http://stackoverflow.com/q/28505101
has comment: http://stackoverflow.com/comment/45329368
tagged with: jsfiddle
type: AnsweredQuestion
has body: http://jsfiddle.net/KeithDickens/t2t9pvz4/19/ As it's written it works fine on my Intranet test server but JSFiddle it does nothing. Am I missing a nuance of JSFiddle? HTML &lt;input type="button" value="Add More" onclick="nextLine();"&gt; &lt;div id="test1"&gt; Test1:&lt;input type="text"&gt; Test2:&lt;input type="text"&gt; Test3:&lt;input type="text"&gt; &lt;/div&gt; &lt;br /&gt; &lt;br /&gt; &lt;div style="display:none" id="test2" name="test2"&gt; Test1:&lt;input type="text"&gt; Test2:&lt;input type="text"&gt; Test3:&lt;input type="text"&gt; &lt;input type="button" value="Remove"&gt; &lt;/div&gt; &lt;br /&gt; &lt;br /&gt; &lt;div style="display:none;" id="test3" name="test3"&gt; Test1:&lt;input type="text"&gt; Test2:&lt;input type="text"&gt; Test3:&lt;input type="text"&gt; &lt;input type="button" value="Remove"&gt; &lt;/div&gt; JavaScript var xy = 2; var divid = ""; function nextLine() { divid = "test" + xy; document.getElementById(divid).style.display = 'block'; xy++; }
has title: Why does this code work on my test server but not on jsfiddle?
type: Question
tagged with: testing
answer count: 1
has answer: http://stackoverflow.com/a/28505160
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45329367
has comment: http://stackoverflow.com/comment/45331660
accepted answer: http://stackoverflow.com/a/28505160

http://stackoverflow.com/comment/52110014
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28536392
has text: Do you require that visitors to your site register or is it just anyone can come in and use your site which includes hitting PubNub?
type: Comment

http://stackoverflow.com/q/28500851
tagged with: arrays
linked to: http://stackoverflow.com/q/19970301
tagged with: javascript
has comment: http://stackoverflow.com/comment/45321045
has comment: http://stackoverflow.com/comment/45321064
has title: Array of Array, JSON.stringify() giving empty array instead of entire object
favorite count: 0
linked to: http://stackoverflow.com/q/8943737
has answer: http://stackoverflow.com/a/63547099
has answer: http://stackoverflow.com/a/28501061
has comment: http://stackoverflow.com/comment/45320985
has answer: http://stackoverflow.com/a/28501169
linked to: http://stackoverflow.com/q/2295496
answer count: 4
has body: Here's my array (from Chrome console): Here's the pertinent part of code: console.log(hours); var data = JSON.stringify(hours); console.log(data); In Chrome's console I get [] from the last line. I should get {'Mon':{...}...} Here is the minimal amount of JavaScript to reproduce the issue: var test = []; test["11h30"] = "15h00" test["18h30"] = "21h30" console.log(test); console.log(JSON.stringify(test)); // outputs [] I tried some other stuff like Convert array to JSON or Convert javascript object or array to json for ajax data but the problem remains.
has answer: http://stackoverflow.com/a/28501093
accepted answer: http://stackoverflow.com/a/28501061
tagged with: object
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45321692
has comment: http://stackoverflow.com/comment/45321352
possible better answer: http://stackoverflow.com/a/28501093
tagged with: http://stackoverflow.com/tag/json
downvote count: 3
has comment: http://stackoverflow.com/comment/45321224
score: 9
type: Question
has comment: http://stackoverflow.com/comment/45320980
upvote count: 12

http://stackoverflow.com/comment/45278240
score: 0
type: AnswerComment
type: Comment
has text: What do yo mean? Edit your question and provide an example of expected result
comment on: http://stackoverflow.com/a/28477181

http://stackoverflow.com/comment/45281295
comment on: http://stackoverflow.com/a/28479149
type: AnswerComment
has text: The problem was that you were passing the tagname (` `) and its properties object (`{rel: ...}`) as 2 separate arguments to `append()` - where as `append()` expects one fully constructed jQuery object or HTML string.
score: 0
type: Comment

http://stackoverflow.com/a/28492183
upvote count: 6
type: AcceptedAnswer
has body: Add a title attribute to the element. That's what's done in the image above. up vote If you want a custom tooltip, see this answer. You would basically use a combination of pseudo elements and custom data-* attributes. You would give the pseudo elements a content value of attr(data-tooltip) in order to access the data-tooltip attribute, for instance.
accepted answer of: http://stackoverflow.com/q/28492167
type: Answer
answers question: http://stackoverflow.com/q/28492167
downvote count: 0
score: 6

http://stackoverflow.com/q/28533150
linked to: http://stackoverflow.com/q/7958292
has comment: http://stackoverflow.com/comment/45383053
has comment: http://stackoverflow.com/comment/45384323
score: 0
has body: function neighbor(color_indices) { var neighbor_face = []; var neighbor_index_temp = []; //initialize to the given length var color_indices_length = color_indices.length; for (var i = 0; i &lt; color_indices_length; i++) { if (color_indices[i] % 2 == 0 ) { if (color_indices[i] % 10 == 8) { neighbor_index_temp[0] = (color_indices[i]) + 1; neighbor_index_temp[1] = (color_indices[i]) - 17; neighbor_index_temp[2] = (color_indices[i]) - 19; //check if it is in the array for (var k = 0; k &lt; 3; k++){ if ($.inArray(neighbor_index_temp[k],color_indices) != -1){ color_indices.push(neighbor_index_temp[k]); } } The input : color_indices would be an array of the global variable. I am trying to push neighbor_index_temp of only new to the color_indices. I tried to implement $.inArray but it doesn't seem to work. Any suggestions? Thanks!
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28535339
accepted answer: http://stackoverflow.com/a/28535339
has comment: http://stackoverflow.com/comment/45381186
has comment: http://stackoverflow.com/comment/45383847
has title: try to not add the elements already in the array
has comment: http://stackoverflow.com/comment/45384124
tagged with: three.js
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/45302791
comment on: http://stackoverflow.com/q/28490087
score: 0
type: QuestionComment
type: Comment
has text: all nested routes: home.create,home.requestId.details, home.requestId.save, home.requestId.reorder. admin.userid.detail .. etc so basically i don't get the error on home, admin, etc

http://stackoverflow.com/comment/45407331
type: QuestionComment
comment on: http://stackoverflow.com/q/28546871
score: 0
has text: @BobTheAwesome like this ? https://regex101.com/r/xJ5oI4/2
type: Comment

http://stackoverflow.com/comment/45491841
type: Comment
comment on: http://stackoverflow.com/a/28592595
has text: Okay but how would I use stringFormat then? See edit.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45420072
type: AnswerComment
score: 0
has text: $ symbols aren't required? I see them in javascript or maybe that is jquery. Never mind $ is for jquery
type: Comment
comment on: http://stackoverflow.com/a/28553626

http://stackoverflow.com/q/28592170
upvote count: 25
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45494888
has body: Currently, the HTML5 web speech api works great on google chrome for all devices except mobile iOS. Text-to-speech works, but speech-to-text is not supported. webkitSpeechRecognition is not supported. See: Chrome iOS webkit speech-recognition I am unable to find a workaround. I would like to add speech recognition support for iOS to my current web app that uses speech recognition and speech synthesis. Any suggestions? Thank you.
score: 25
has title: Add iOS speech recognition support for web app?
has comment: http://stackoverflow.com/comment/78038249
tagged with: google-chrome
type: Question
has answer: http://stackoverflow.com/a/76552947
tagged with: ios
tagged with: javascript
has answer: http://stackoverflow.com/a/47424509
answer count: 2
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
tagged with: speech-recognition
favorite count: 0
linked to: http://stackoverflow.com/q/20640081

http://stackoverflow.com/a/28508123
accepted answer of: http://stackoverflow.com/q/28507546
score: 5
answers question: http://stackoverflow.com/q/28507546
upvote count: 5
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: You should change the url on the box, usually you just run the box running the meteor command cd workspace cd myAPP meteor and it works, but now you should run this commands. cd workspace cd myApp ROOT_URL=http://machinename.abc1-2.nitrousbox.com meteor Now run again node-inspector you should get something like Visit http://machinename.abc1-2.nitrousbox.com:8080/debug?port=5858 to start debugging.

http://stackoverflow.com/comment/45478913
comment on: http://stackoverflow.com/a/28584125
type: AnswerComment
has text: Sorry that did not even displayed anything. Wrapping did nothing. My issue was that the result wont loop to the other items.
score: 0
type: Comment

http://stackoverflow.com/q/28503933
tagged with: css
downvote count: 1
has title: How can I create WebService Client side on HTML5 that sends a integer number?
linked to: http://stackoverflow.com/q/124269
type: Question
has answer: http://stackoverflow.com/a/28504096
upvote count: 0
tagged with: webservice-client
tagged with: javascript
score: -1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
type: UnansweredQuestion
has body: I just want a simple example of a WebService Client in HTML5 that sends a integer number to a link on my network. I've tried but it didn't work, the client side that I used is below if necessary. Thanks in advance. Numero:
tagged with: web-services

http://stackoverflow.com/comment/45367151
type: Comment
comment on: http://stackoverflow.com/a/28525592
has text: I didn't even notice in your answer, if I would have, I would have commented :) Happy to be of help :D
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45456335
type: Comment
comment on: http://stackoverflow.com/a/28572718
has text: Well, but you said yourself that you cannot so I wondered about that :-)
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45600401
comment on: http://stackoverflow.com/a/28615500
type: Comment
has text: I think the third sql statement `<sql:query var="categoryProducts"` is the issue...
score: 0
type: AnswerComment

http://stackoverflow.com/q/28549186
has comment: http://stackoverflow.com/comment/45411432
answer count: 1
tagged with: javascript
has title: Have JavaScript send returned values to two inputs elements
has body: I am trying to add a section of code (shown below) to have my audio book picker supply an audio file name, as well as displaying the chapter and chapter number. How can I make my added code send the second set of returned values to the input field with the id='audio', just as it sends return values to the input with the id='chapter-picker'? var chapterPicker = myApp.picker({ input: '#chapter-picker', rotateEffect: true, formatValue: function (picker, values) { return values[0] + ' ' + values[1]; }, //Start of what I am trying to add input: '#audio', rotateEffect: true, formatValue: function (picker, values) { return values[0] + values[1] + '.mp3'; } //End of what I am trying to add cols: [ { textAlign: 'left', values: ['Genesis', 'Exodus', 'Leviticus'], onChange: function (picker, book) { if(picker.cols[1].replaceValues){ picker.cols[1].replaceValues(chapters[book]); } } }, { values: chapters.Genesis, width: 160, }, ] });
has answer: http://stackoverflow.com/a/28550506
score: 0
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45412183
has comment: http://stackoverflow.com/comment/45412732
has comment: http://stackoverflow.com/comment/45411700

http://stackoverflow.com/comment/45405512
comment on: http://stackoverflow.com/a/28545883
has text: Nope :'(. Thanks for trying though.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/28452984
type: AcceptedAnswer
score: 4
type: Answer
upvote count: 4
has body: The best practice for setting data attributes is to keep them lowercase and separate words with hyphens as needed. This is due to the way jQuery serialises them in its internal cache, and having capitalised letters can cause mis-matches when retrieving data from the generated cache object. Also note that the delegated form of on() takes a string as its second parameter, not a jQuery object. With that in mind, try this: $(document).on('change', "select.tbl-sel-input", function () { var attribute_value = $(this).data("product-id"); var input_value = $(this).val(); alert(attribute_value + ' - ' + input_value); }); Option 1 Option 2 Option 3 Option 4 Option 5 Option 6
downvote count: 0
answers question: http://stackoverflow.com/q/28452907
accepted answer of: http://stackoverflow.com/q/28452907
has comment: http://stackoverflow.com/comment/45233268
has comment: http://stackoverflow.com/comment/45233296

remote-debugging
tag name: remote-debugging
tags question: http://stackoverflow.com/q/28574350
type: Tag

http://stackoverflow.com/comment/66083184
has text: @Dodekeract: sure, but that's not where the error stems from.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28551582

http://stackoverflow.com/comment/45246571
type: Comment
has text: Thank you for reply. but http://bootsnipp.com/snippets/featured/multiple-fields-contact-form . See this link you will get an idea what I am asking. when clicking the green button it will create new textboxes with the same name. After submitted the values into database it save all the values in one cell. I want to save the values row by row.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28460211

http://stackoverflow.com/q/28465072
tagged with: javascript
tagged with: ajax
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: iis
downvote count: 2
tagged with: http-redirect
tagged with: php
has title: Page redirect from external php file (in ajax call)
has comment: http://stackoverflow.com/comment/45255867
has answer: http://stackoverflow.com/a/28465932
has body: I have this Salesforce "Web-to-Lead" form that I'm working with (on an IIS server), and I got it validating properly in an Ajax call (using the roscripts.com ajax validation as a starting point... this uses the Mootools library to carry out its Ajax functions), as well as sending all of the validated data using cURL, however I want the form to redirect to a new page after validation succeeds. The Ajax call runs every time the Submit button is clicked and either displays errors on the page or runs whatever is included in the "else" section of the validation code. The Ajax function: window.addEvent('domready', function() { $('registerForm').addEvent('submit', function(e) { new Event(e).stop(); var log = $('log_res').empty().addClass('ajax-loading'); this.send({ update: log, onComplete: function() { log.removeClass('ajax-loading'); //adding a header redirect here works, but redirects every time ajax call runs, regardless if validation succeeds or not } }); }); }); The "action" php file function: &lt;?php if (rule){ //validation errors } else { //where all of the logic happens after validation succeeds //cURL function //redirect attempts: header( 'Location: http://www.place.com'); // doesn 't work echo '&lt;meta http-equiv="refresh" content="2" ; url="http://www.place.com"&gt;'; //resets the form, but doesn't redirect to www.place.com }; ?&gt; I'm totally stumped here, I can't get this darn thing to redirect, no matter how hard I try. Any help would be greatly appreciated!
type: Question
upvote count: 0
score: -2
has comment: http://stackoverflow.com/comment/45255888

http://stackoverflow.com/a/28463613
score: 0
has comment: http://stackoverflow.com/comment/45253708
has body: jQuery is injected into the page context, not the phantom context. It you use page.injectJs(), jQuery can only be accessed through page.evaluate().
type: Answer
answers question: http://stackoverflow.com/q/28463413

scroll
tags question: http://stackoverflow.com/q/28510263
tags question: http://stackoverflow.com/q/28586004
tags question: http://stackoverflow.com/q/28591494
tags question: http://stackoverflow.com/q/28453207
tags question: http://stackoverflow.com/q/28525527
tags question: http://stackoverflow.com/q/28583709
tags question: http://stackoverflow.com/q/28463471
tags question: http://stackoverflow.com/q/28586530
tags question: http://stackoverflow.com/q/28554725
tags question: http://stackoverflow.com/q/28443334
type: Tag
tags question: http://stackoverflow.com/q/28490029
tag name: scroll
tags question: http://stackoverflow.com/q/28552387
tags question: http://stackoverflow.com/q/28444271
tags question: http://stackoverflow.com/q/28516206
tags question: http://stackoverflow.com/q/28488357

http://stackoverflow.com/a/28840592
downvote count: 0
has body: The itemTemplate is only applicable to the items in the igCombo list. The input field of the igCombo is populated with the text key data property of the selected item.
answers question: http://stackoverflow.com/q/28543433
upvote count: 1
type: Answer
score: 1

http://stackoverflow.com/comment/45495717
comment on: http://stackoverflow.com/a/28578873
type: Comment
has text: If you really want to have variables which are used in a client-side script but not exported, you can do this: `(function() { var x; /* x will not be exported */ /* Do some stuff */ })();`. Here you're defining a function, which contains a local variable `x`, and then running it. The local variable will not be accessible anywhere outside the function definition. `x` can even be a function itself, if you want.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28496618
has body: Below is my string.When I console b it is showing as below output: var a='602,315,805,887,810,863,657,665,865,102,624,659,636'; var b = a.replace(',',"$"); console.log(b); output: 602$315,805,887,810,863,657,665,865,102,624,659,636 What should I do to replace complete commas in string to $.
tagged with: regex
answer count: 4
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28496827
linked to: http://stackoverflow.com/q/10610402
has answer: http://stackoverflow.com/a/28496657
downvote count: 1
type: Question
duplicate of: http://stackoverflow.com/q/10610402
possible better answer: http://stackoverflow.com/a/28496731
tagged with: javascript
has answer: http://stackoverflow.com/a/28496855
has answer: http://stackoverflow.com/a/28496731
accepted answer: http://stackoverflow.com/a/28496657
favorite count: 0
has title: Replace string having , with $
upvote count: 2

http://stackoverflow.com/a/28510498
has body: var foo = 9; does not declare a global variable, it declares a local variable. In Node.js, a local variable declared in the outermost scope of a module will be local to that module. If you want to test the value of a local variable declared in another file, your best bet is probably to read the contents of that file into a string (using fs.readFileSync, perhaps) and then eval() the string, which should define the variable in the current scope. That will only work if the local variable is declared in the file's outermost scope. If it's a local variable inside a function, for example, you're out of luck (unless you want to do some gnarly string parsing, which would stretch the bounds of sanity).
accepted answer of: http://stackoverflow.com/q/28510355
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28510355
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/45219164
comment on: http://stackoverflow.com/q/28444378
type: Comment
type: QuestionComment
score: 2
has text: Right after you do `delete_cookie()`, read the cookie again and see if it's there before you redirect. If it is still there, then you aren't deleting it appropriately. If it is not there, but it is there after redirect, then you must not be doing the path correctly. Troubleshoot to find out where your error is.

http://stackoverflow.com/comment/45552223
type: Comment
has text: Hi! Thank you for help! I added 'show-hint' addon, and added new helper like you suggest. Can you please help me to understand how this should work? :) I think I'm on right way, just want to get this working))
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28588570

http://stackoverflow.com/comment/45456996
has text: Your question is clear as mud. There are undeclared variables, variables that aren't defined, and expressions separated by a comma that should be separate statements. It will help greatly if you post a minimal, "working" example that displays the issue.
comment on: http://stackoverflow.com/q/28573663
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/q/28534491
linked to: http://stackoverflow.com/q/26775808
answer count: 0
tagged with: angular-timer
has body: I've implemented the Angular Timer directive (http://siddii.github.io/angular-timer/) in my application which is intended to track time spent across projects. The timer works as it should except for when I stop and restart the timer. Visibly, the timer appears to stop but when I restart it, after waiting 10 seconds for instance, that 10 seconds gets ADDED onto the displayed time and it continues counting from there. So it seems to be constantly running in the background. I have the following code contained within my controller: allProjects = [...array of objects here...]; $scope.timerRunning = true; $scope.startTimer = function (){ $scope.$broadcast('timer-start'); $scope.timerRunning = true; }; $scope.stopTimer = function (){ $scope.$broadcast('timer-stop'); $scope.timerRunning = false; }; $scope.$on('timer-stopped', function (event, data){ console.log('Timer Stopped - data = ', data); }); In my view I have the following HTML: {{project.title}} {{project.description}} {{hhours}}:{{mminutes}}:{{sseconds}} start stop Angular Timer example I borrowed from: http://siddii.github.io/angular-timer/examples.html#/angularjs-single-timer.
score: 0
has comment: http://stackoverflow.com/comment/58406132
has title: Angular Timer - timer not stopping
has comment: http://stackoverflow.com/comment/45383599
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45418383
has comment: http://stackoverflow.com/comment/45423641
linked to: http://stackoverflow.com/q/23383233
has comment: http://stackoverflow.com/comment/45383593
tagged with: timer
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/q/28505486
has answer: http://stackoverflow.com/a/28507766
score: 0
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
has body: I have found a few good examples of doing this but am having trouble. I have a click function that I want to send some info to my controller from my directive. The function looks like so - function selected(info){ scope.changeSelect = info; console.log(info); } Pretty straight forward - so far this works fine, the console.log shows what i need it to show. After this point I think I have something incorrect. It looks like so. In the top of my directive I have my scope set like so scope: { changeSelect: "&amp;" } Then next to the html directive call inline I have this change-select="onChange(changedVal)" &gt; and then in my controller I have $scope.onChange = function(changedVal) { $scope.myPick = changedVal; console.log("hit"); }; This part is not getting a hit - i am not sure what I am doing wrong here and could use a second pair of eyes. Thanks! Don't know if this helps, but gutted out the non relevant parts and dropped it into an (non working) fiddle to make this a bit more clear - http://jsfiddle.net/aubxhak3/1/
linked to: http://stackoverflow.com/q/21478194
type: Question
has title: Angular, Sending information from directive to controller
tagged with: javascript

http://stackoverflow.com/comment/45412390
has text: The change event only fires when the input field loses focus …
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28549573
type: QuestionComment

http://stackoverflow.com/comment/45215799
type: QuestionComment
comment on: http://stackoverflow.com/q/28443088
score: 0
has text: just build first the html code and append it in just one call
type: Comment

http://stackoverflow.com/a/28493102
answers question: http://stackoverflow.com/q/28487315
score: 0
has comment: http://stackoverflow.com/comment/45309397
type: Answer
has body: You can use DriveApp instead. var files = DriveApp.getFilesByName(data[i].toString()); while (files.hasNext()) { var file = file.getNext(); if (file.getMimeType().indexOf("other") !== -1) { Logger.log(file.getUrl()); } }
has comment: http://stackoverflow.com/comment/45353413
has comment: http://stackoverflow.com/comment/45362794

http://stackoverflow.com/q/28520874
accepted answer: http://stackoverflow.com/a/28553386
score: 0
tagged with: atom-editor
has title: AngularJS Mean.js Atom Beautifier Javascript Issue
tagged with: mean
answer count: 1
has body: I've just spent the last many hours debugging a problem that occurs after atom beautification. My question regards why would the following be an issue. This is a snippet of code in the MEAN.js scaffolding in the file layout.server.view.html: (I dont know what this code does... but that's a different story) &lt;!--Embedding The User Object--&gt; &lt;script type="text/javascript"&gt; var user =; &lt;/script&gt; After I use the atom beautifier it looks like this: &lt;!--Embedding The User Object--&gt; &lt;script type="text/javascript"&gt; var user = { { user | json | safe } }; &lt;/script&gt; The latter causes a javascript error in chrome and firefox. And my question is... why. I did not think white space mattered in javascript. I'd also like to know what this code is doing, if you have a few more cycles. Thanks!
tagged with: angularjs
has answer: http://stackoverflow.com/a/28553386
type: AnsweredQuestion
type: Question
tagged with: javascript

http://stackoverflow.com/a/28489287
answers question: http://stackoverflow.com/q/28487120
upvote count: 1
has body: http://jsfiddle.net/f4v1vy7x/5/ I made a Can object to store the configuration for each can (so you can have different frameHeights, frames and frameRates. I used window.requestAnimationFrame because it's far more efficient than setInterval. On each available frame I check whether it's time to animate based on each Can's set frame rate: var Can = function( selector, frameHeight, frames, frameRate ) { this.domCan = document.getElementById( selector ); this.frameHeight = frameHeight; this.frames = frames; this.frameRate = frameRate; this.frame = 0; }; onload = function startAnimation() { var can1 = new Can( 'animate', 400, 27, 20 ); var can2 = new Can( 'animate2', 400, 27, 100 ); var cans = [ can1, can2 ]; window.requestAnimationFrame( function() { can1.start = can2.start = new Date(); animate( cans ); } ); }; var animate = function( cans ) { for( var i = 0; i &lt; cans.length; i++ ) { var now = new Date(); var can = cans[i]; if( now - can.start &gt;= 1000 / can.frameRate ) { can.start = now; var frameOffset = (++can.frame % can.frames) * -can.frameHeight; can.domCan.style.backgroundPosition = "0px " + frameOffset + "px"; } } window.requestAnimationFrame( function() { animate( cans ); } ); }
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/45300358
score: 1

http://stackoverflow.com/a/28448138
type: Answer
has comment: http://stackoverflow.com/comment/45225309
score: 2
downvote count: 0
has body: You can make use of CSS classes and switch between classes when required. .class_one { background: url (image.png); } .class_two { background: url (image2.png), url (image.png); }
upvote count: 2
has comment: http://stackoverflow.com/comment/45225077
has comment: http://stackoverflow.com/comment/45225016
answers question: http://stackoverflow.com/q/28448022

http://stackoverflow.com/comment/45357899
score: 0
has text: Why do your forms have the same `name`?
comment on: http://stackoverflow.com/q/28520316
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45431401
has text: @jQuery.PHP.Magento.com - Sorry, 0 is always being sent to the DB when it should instead be the value that is in the label where the id is total.
type: Comment
comment on: http://stackoverflow.com/q/28559912
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45409653
has text: jQuery UI and jQuery on page. No duplicates either.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28548260

http://stackoverflow.com/q/28552421
score: 0
has answer: http://stackoverflow.com/a/28552625
answer count: 1
accepted answer: http://stackoverflow.com/a/28552625
has title: Change in scope does not appear in child scope
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45417892
has comment: http://stackoverflow.com/comment/45417997
type: AnsweredQuestion
type: Question
tagged with: angularjs-directive
has body: I have a directive pr-items rendering instances of child-directives pr-item using a template and ng-repeat: app.directive('prItems', function(){ console.log('prItems'); return { restrict: 'E', scope: { items:'=', }, template:' ', ... }); The child directive pr-item renders content using another template: app.directive('prItem', function($compile){ console.log('prItem'); return { restrict: 'E', template: ' * {{item.name}} {{item.selected}} ', ... }); This works fine so far. On a click on the item, the parent directive gets notified using an event via $emit. When the parent element changes state of one of the items, this change does not show up in the respective item as demonstrated in this Plunk. Now I am curious what I'm missing.
tagged with: javascript
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/45417938

http://stackoverflow.com/q/28591861
answer count: 2
accepted answer: http://stackoverflow.com/a/28591907
downvote count: 0
has answer: http://stackoverflow.com/a/28591920
tagged with: jquery
favorite count: 0
has title: Javascript get id of parent div
possible better answer: http://stackoverflow.com/a/28591920
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28591907
upvote count: 1
type: Question
has body: I have the following structure: Save When clicking on Save button i would like to get the parent div that is like accord%_1. I'll explain myself better: I have like 30 structures like the one i've shown created. All of them are exactly the same except from the id="accordX_1" key which is id="accord1_1" in the first collapsable panel, id="accord2_1" in the second and so on. What i need to do is get that id's value. How can this be done? Regards,
tagged with: javascript
has comment: http://stackoverflow.com/comment/45490254

http://stackoverflow.com/q/28463542
tagged with: cookies
tagged with: session-cookies
type: Question
has body: I'm running into a problem where Javascript I've written is getting an outdated cookie value. Each request made to the server should be updating the cookie with a the date the session will expire. But occasionally the date is in the past (which doesn't make sense because the page just loaded which renews the session). So I'm wondering if the outdated value could be coming from the browser (Chrome) cache. Do cookie values get stored in the cache and then placed in document.cookie when the cached resource is utilized? I'm reading the cookie via this code: readCookie : function(name) { var match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)")); return (match ? decodeURIComponent(match[3]) : null); },
has comment: http://stackoverflow.com/comment/45252966
tagged with: javascript
tagged with: caching
score: 0
has title: Are cookies stored in browser cache?
has comment: http://stackoverflow.com/comment/45253190
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45252941
answer count: 0

http://stackoverflow.com/comment/45411143
type: QuestionComment
has text: Could you post the full code for what you're trying to do here or on jsfiddle.net?
comment on: http://stackoverflow.com/q/28549071
score: 3
type: Comment

http://stackoverflow.com/comment/45335995
type: QuestionComment
comment on: http://stackoverflow.com/q/28503603
has text: For now they should all contain the same number of rows. Although I can think of future changes where that may not be the case (if I split context examples onto multiple lines).
score: 0
type: Comment

http://stackoverflow.com/comment/45267720
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28471661
has text: @dfsq i have posted real data..

http://stackoverflow.com/a/28533243
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45381265
accepted answer of: http://stackoverflow.com/q/28533210
type: Answer
answers question: http://stackoverflow.com/q/28533210
has comment: http://stackoverflow.com/comment/45381404
has comment: http://stackoverflow.com/comment/45381295
has body: Because when j = (factor_Array.length-1) it tries to access the j+1 element, which doesn't exist. The following would work as you expect for (var j = 0; j &lt; (factor_Array.length-1); j++){ total = factor_Array[j] * factor_Array[j+1]; }

http://stackoverflow.com/comment/45332894
comment on: http://stackoverflow.com/a/28500385
score: 0
type: Comment
has text: Thanks yeah, combination of this and the above proved to be my solution. Hadn't really had much of a delve into custom html helpers before now so it's been a good experience!
type: AnswerComment

http://stackoverflow.com/comment/45369147
has text: @Bergi when I say that, I speak about the callback in the array myDeferred, not the callback on the setTimeout
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28526470
score: 0

http://stackoverflow.com/comment/45275784
type: Comment
type: QuestionComment
has text: The second idea doesn't require to call the GPU, as walls are static and can be stored in an array that has nothing to do with the GPU. It's interesting however that you are saying that this is nowadays an anti-pattern. But how people do when they want to do pixel-wise collision? My game will have a lot of complex forms, and I don't want to manually create a polygon that looks like the form for each of them, because it would take me a lot of time.
score: 0
comment on: http://stackoverflow.com/q/28468202

http://stackoverflow.com/q/28517417
score: 13
linked to: http://stackoverflow.com/q/14338817
tagged with: shadow-dom
tagged with: http://stackoverflow.com/tag/html
answer count: 4
upvote count: 13
type: UnansweredQuestion
tagged with: iframe
has body: I'm trying to find a way to encapsulate Javascript without using iframes. Ideally, I'd like a way to load external HTML components (widgets) on a parent page, without the two-step loading process, which comes with using iframes (first the host page loads, and only then does the iframe content is loaded). Is it possible to accomplish that with some of the new web components technologies - shadow DOM / templates / imports? I was able to come close with adding HTML to shadow DOM and encapsulating CSS, but couldn't confirm whether it's possible to get a separate document for the component's javascript execution.
has answer: http://stackoverflow.com/a/78299127
tagged with: javascript
has answer: http://stackoverflow.com/a/28518932
type: Question
has title: Shadow DOM: is it possible to encapsulate JS?
tagged with: web-component
linked to: http://stackoverflow.com/q/39331408
downvote count: 0
has answer: http://stackoverflow.com/a/36949380
has answer: http://stackoverflow.com/a/39366126
favorite count: 0

http://stackoverflow.com/q/28486000
has title: Accessing an external library callback in an Angular controller
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45293949
answer count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45296238
type: UnansweredQuestion
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/45293845
has body: I have an external library (http://support.video.limelight.com/support/docs/player_api/) that calls the function limelightPlayerCallback() every time something with the player changes. I want to be able to trigger actions in my Angular controller every time the library calls that function. When I declare the function in my HTML, everything works as expected. function limelightPlayerCallback (playerId, eventName, data){ console.log(playerId); console.log(eventName); console.log(data); } Gets me player1 onPlayerLoad null And also allows me to access the LimelightPlayer object and run queries and commands on it like. LimelightPlayer.doGetPlayheadPositionInMilliseconds() LimelightPlayer.doLoadMedia() But once I start trying to declare the limelightPlayerCallback() function in my controller, or access the LimelightPlayer object, the function is never called so I am not able to interact with the player at all. What is the best way to go about interfacing with a library that works like this in Angular?
has comment: http://stackoverflow.com/comment/45294202
tagged with: angularjs-scope

http://stackoverflow.com/comment/45360107
score: 0
type: Comment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/70936/discussion-between-crowcoder-and-jfriend00).
type: AnswerComment
comment on: http://stackoverflow.com/a/28520936

http://stackoverflow.com/comment/45408941
comment on: http://stackoverflow.com/a/28525133
type: Comment
score: 0
type: AnswerComment
has text: One last question...I have the form's id in the variable formID but now having trouble with the syntax to reference it. Could you please steer me to the correct syntax. Using `var formData = document.forms[formID].serialize();` results in "Uncaught TypeError: undefined is not a function". I'm learning javascript and arrived at this syntax from the documentation, but I must be missing something. Thank you.

http://stackoverflow.com/comment/45296045
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28485949
has text: window.XMLHttpRequest is the only reference to that particular constructor, and if that is removed, the function can in no way be referenced again.

http://stackoverflow.com/q/28528053
tagged with: javascript
score: -1
has body: I made a simple digital clock in JavaScript: window.onload = function runMiniClock() { var time = new Date(); var hours = time.getHours(); var minutes = time.getMinutes(); minutes=((minutes &lt; 10) ? "0" : "") + minutes; ampm = (hours &gt;= 12) ? "PM" : "AM"; hours=(hours &gt; 12) ? hours-12 : hours; hours=(hours == 0) ? 12 : hours; var clock = hours + 1 + ":" + minutes + " " + ampm; if(clock != document.getElementById('clock').innerHTML) document.getElementById('clock').innerHTML = clock; timer = setTimeout("runMiniClock()",1000); setInterval(function(){ document.getElementById("clock").innerHTML = (new Date()).toLocaleTimeString(); }, 1000); } This code works perfectly, but when I open the console I see an error message: Uncaught ReferenceError: runMiniClock is not defined Why does it show that error message? Here is the demo
has answer: http://stackoverflow.com/a/28528083
accepted answer: http://stackoverflow.com/a/28528083
answer count: 2
has comment: http://stackoverflow.com/comment/45371580
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28528195
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45371467
has comment: http://stackoverflow.com/comment/45371586
type: AnsweredQuestion
upvote count: 0
has title: Uncaught ReferenceError: XXX is not defined
has comment: http://stackoverflow.com/comment/45371501
type: Question
possible better answer: http://stackoverflow.com/a/28528195

http://stackoverflow.com/comment/45387312
type: Comment
comment on: http://stackoverflow.com/q/28536526
score: 0
type: QuestionComment
has text: do you want something like these ? . [Click here JSFIDDLE](http://jsfiddle.net/higunjan/RAEtg/26/)

http://stackoverflow.com/q/28570622
has answer: http://stackoverflow.com/a/28573162
upvote count: 1
accepted answer: http://stackoverflow.com/a/28573307
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28573307
has title: Node-Webkit Get video duration from avi file path
answer count: 2
downvote count: 0
possible better answer: http://stackoverflow.com/a/28573162
favorite count: 0
linked to: http://stackoverflow.com/q/3057157
tagged with: ffmpeg
tagged with: avi
tagged with: node-webkit
tagged with: node.js
type: AnsweredQuestion
has body: I'm looking for a way to get the video duration from avi file path in Node-Webkit, one that does not involve using ffmpeg. ffprobe.exe is a large file (30mb) and it seems a bit to much to keep it all when this is the only thing I would need it for.
score: 1

http://stackoverflow.com/comment/45213698
comment on: http://stackoverflow.com/a/28441035
has text: look: http://jsfiddle.net/3r8wrumL/10/ .Try to leave toolbar to body and then mouseenter element. you will see that toolbar append to element without `setTimeout(function()` animation.
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/q/28438696
linked to: http://stackoverflow.com/q/28415037
tagged with: ember.js
type: AnsweredQuestion
has body: I just want to try using Ember.js for a website I am doing (Disclaimer: I am a Java web developer, GWT). So far what I have tried is to slap the whole body tag code into like this Now, I just want to take advantage of Ember.js stuff like components, models and validation for my website. Here's a run down of the dependencies involved: app.js App = Ember.Application.create(); App.Router.map(function() { }); The thing is, when I put the body into a x-handlebars script the jQuery plugins (like bxslider, carousel, etc.) that used to work would not work with the stuff that was inside the script tag. What could be wrong with my approach?
has answer: http://stackoverflow.com/a/28438839
accepted answer: http://stackoverflow.com/a/28438839
has comment: http://stackoverflow.com/comment/45207462
type: Question
has title: Using Ember.js for Single Page Website (not really a web app)
score: 0
has comment: http://stackoverflow.com/comment/45207395
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/45478939
type: QuestionComment
comment on: http://stackoverflow.com/q/28585428
has text: I'm getting Array( `["Foo", "Bar", "John", "Doe"]` ) where as I'm expecting I should get something back like Array( Array(`["Foo", "Bar"]`) , Array( `["John", "Doe"]` ) )
score: 0
type: Comment

http://stackoverflow.com/q/28517597
tagged with: javascript
tagged with: mocha.js
has answer: http://stackoverflow.com/a/28518674
answer count: 2
downvote count: 0
score: 1
favorite count: 0
has title: Mocha test MongoDB: Uncaught TypeError in multiple test
has comment: http://stackoverflow.com/comment/45352513
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/45352567
has answer: http://stackoverflow.com/a/32489317
has body: I have written a test but it constantly yields Uncaught TypeError. I can run the two tests separately. But when I run two tests together, there is problem. To reuse connection, I write a file to connect to Mongodb database.js var MongoClient = require('mongodb').MongoClient; var appDb = null; var url = 'mongodb://localhost:27017/theDB' exports.connectToServer = function(callback) { MongoClient.connect(url, function(err, db) { if(err) console.log(err); appDb = db; callback(); }); }; exports.getDb = function() { if(typeof appDb !== 'undefined') { return appDb; } }; I then have two tests in the same directory, /test But when I test with Mocha by tying mocha, test1 runs well but test2 won't run. It says: 1) Project test suite 'before all' hook: Uncaught TypeError: undefined is not a function test1.js var appDb = require('./database'); var Q = require('q'); var EnquiryForm = require('../EnquiryForm'); var EnquiryFormReset = require('../EnquiryFormReset'); var should = require('should'); describe('EnquiryForm', function() { before(function(done) { appDb.connectToServer(done); }); describe('.getValue(key)', function() { it('should get Key', function() { // test using promise; }) }); after(function() { var reset = new EnquiryFormReset(); reset.reset(); }); }); test2.js var appDb = require('../database'); var Q = require('q'); var Project = require('../routes/models/Project'); var Clear = require('./MongoScripts/Clear'); var should = require('should'); describe('Project test suite', function() { before('project before', function(done) { appDb.connectToServer(done); }); describe('.createProject(project), .getProjectById(id)', function() { it('can use the createProject to create and getProjectById to find by id.', function() { // another test }) }); after('project after', function() { var clear = new Clear(); clear.clear(); }); });
upvote count: 1
type: Question
tagged with: mongodb

http://stackoverflow.com/a/28469739
downvote count: 0
has comment: http://stackoverflow.com/comment/45264817
has comment: http://stackoverflow.com/comment/45264726
has comment: http://stackoverflow.com/comment/45264744
score: 5
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28469600
answers question: http://stackoverflow.com/q/28469600
type: Answer
has body: There are two implicit parameters on every function: this and arguments. The apply method on the Function object lets you invoke it with those parameters explicitly set. So what will happen here is that you a get a function wrapping another, and when you call it it will pass down the arguments to the original. It will also keep track if it was called and its result.
upvote count: 5

http://stackoverflow.com/comment/45461837
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28576174
type: Comment
has text: You have no idea where this data is coming from, and if by some chance it **is** coming from SQL, you have no idea how it's coming and may not (probably do not) have access to the SQL code that is generating it. Then again, assuming the input is already sorted could be a good idea if your idea of fun is fixing bugs six months later in code that you had forgotten you had written. I'm not sure why you would say "JS is a poor choice" for sorting. This is 2015, not 2002. JS could sort that array in a few microseconds. On my machine, it sorted it one million times in just over a millisecond.

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

http://stackoverflow.com/comment/45292957
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28484979
has text: @diosney - See my answer for how you can accomplish this.

http://stackoverflow.com/comment/45459689
type: AnswerComment
has text: A good reason NOT to add properties this way to `Object.prototype` is that this will pick up the `isString` property in all iterations of any object as in `x = {}; for (prop in x) {}`, http://jsfiddle.net/jfriend00/5qLwa9L4/. This can easily break existing code.
score: 1
type: Comment
comment on: http://stackoverflow.com/a/28574852

http://stackoverflow.com/comment/45381458
has text: http://www.datatables.net/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28533339
score: 0

http://stackoverflow.com/a/28566863
accepted answer of: http://stackoverflow.com/q/28546897
answers question: http://stackoverflow.com/q/28546897
type: Answer
upvote count: 1
score: 1
has body: I got this working following this link - in a nutshell I had to update the yepnode to the 1.5.4 version that is displayed within the Site_MAP_edgePreload.js. Once saved &amp; after doing a force refresh this now works in IE 11 as well as 10 &amp; 9. https://forums.adobe.com/thread/1242630?start=0&amp;tstart=0
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28586295
answers question: http://stackoverflow.com/q/28582943
score: 5
has body: Ran into the same problem today with a c# app which has the windows forms webbrowser control Got the maps working by changing the api call from "https://maps.googleapis.com/maps/api/js?v=3.exp" to "https://maps.googleapis.com/maps/api/js?v=3.19">
upvote count: 5
type: Answer
downvote count: 0

http://stackoverflow.com/comment/45328153
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28504330
has text: Had to make a minor change to my change function, but this was the answer I used successfully. Thanks

http://stackoverflow.com/a/29897181
has body: I had exactly the same problem and it made no sense why the dropdown events wouldn't fire for me properly; turns out that class="dropdown-toggle" in my &lt;a&gt; element interfered with its data-toggle="dropdown" attribute. Why this is the case, no idea (probably a package issue I'm not willing to spend more time delving into), but removal of this class did it for me; no need for all those crazy manual animation class hacks in the events.
score: 0
answers question: http://stackoverflow.com/q/28541887
type: Answer

http://stackoverflow.com/q/28539934
answer count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/45598866
type: Question
has comment: http://stackoverflow.com/comment/45602597
tagged with: xbl
has body: I've made a restartless add-on that is a CustomizableUI widget based on custom XBL elements. For an upcoming version I have altered the main XBL element &lt;slyzoom&gt;. However, when I test the upgrade and inspect the markup with the DOM Inspector, the main XBL element is not refreshed in currently opened windows — only in newly opened windows the XBL element is expressed as intended. I'm not entirely sure whether the problem lies with CustomizableUI not refreshing properly, or with the XBL bindings not refreshing properly. And, although I don't have to restart Firefox, opening a new window for upgrade changes to take effect still kind of defeats the purpose of having a restartless add-on, for me. Another question, by Noitidart, seems to hint at a similar problem, although Noitidart seems to use a slightly different approach of loading bindings rules, so I'm not entirely sure my problem is exactly the same. Can you shed a light on where the problem most likely lies? My bootstrap.js1 file is fairly involved, so I'll only put a simplified, slimmed down version here, with only startup() and shutdown() and with what I think are the most important aspects of getting it to work (see inline comments for additional commentary): const Cc = Components.classes; const Ci = Components.interfaces; const Cu = Components.utils; const NSXUL = 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'; const URI_CSS_BINDINGS = 'chrome://slyzoom/content/bindings.css'; let ioService = Cc[ '@mozilla.org/network/io-service;1' ].getService( Ci.nsIIOService ); let windowMediator = Cc[ '@mozilla.org/appshell/window-mediator;1' ].getService( Ci.nsIWindowMediator ); let styleSheetUri = ioService.newURI( URI_CSS_BINDINGS, null, null ); function startup( data, reason ) { let CustomizableUI = Cu.import( 'resource:///modules/CustomizableUI.jsm', {} ).CustomizableUI; // create the widget, this all works fine CustomizableUI.createWidget( { id: 'slyzoom', type: 'custom', defaultArea: null, onB…
has comment: http://stackoverflow.com/comment/45592840
tagged with: firefox-addon
tagged with: firefox
downvote count: 0
has title: Restartless add-on upgrade: reload XBL element in CustomizableUI widget
tagged with: javascript
has comment: http://stackoverflow.com/comment/45610125
favorite count: 0
linked to: http://stackoverflow.com/q/24403667
type: UnansweredQuestion
tagged with: xul
score: 2

http://stackoverflow.com/q/28550718
has comment: http://stackoverflow.com/comment/45414690
has answer: http://stackoverflow.com/a/28550901
has answer: http://stackoverflow.com/a/28551033
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28550757
tagged with: javascript
has body: I'm trying to get the URL of a certain image out of the given HTML code &lt;div class="image_div_name"&gt; &lt;img src="http://www.thisistheimage.com" alt=""&gt; &lt;/div&gt; So this is my current code that should solve it: var picture = document.getElementsByClassName("image_div_name"); var src = picture[0]; If I now print picture via console.log, I get the correct div: &lt;div class="image_div_name"&gt; &lt;img src="http://www.thisistheimage.com" alt=""&gt; &lt;/div&gt; However, if I want to access the src, it doesnt seem to work: var src = picture[0].src; console.log(src); Gives back: undedfined If I try: console.log(picture[0].innerHTML) it gets better and I receive: &lt;img src="http://www.thisistheimage.com" alt=""&gt; However I'm looking for way to merely get the URL itself, as in: http://www.thisistheimage.com Can you help? What am I doing wrong?
has title: Get src and set as variable via class (id not available)
has answer: http://stackoverflow.com/a/28550754
accepted answer: http://stackoverflow.com/a/28550754
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/28550757
answer count: 4
type: AnsweredQuestion

http://stackoverflow.com/q/28466214
linked to: http://stackoverflow.com/q/29176763
has answer: http://stackoverflow.com/a/29176874
tagged with: doublebuffered
type: Question
answer count: 1
tagged with: javascript
score: 0
has title: three.js: texture feedback loop (fbo pingpong?)
tagged with: opengl-es
type: UnansweredQuestion
tagged with: three.js
tagged with: fbo
has body: i'm trying to realize a web version of a hlsl shader i've made (with vvvv)- i'm rather new to web programming but found three.js/webGL would be the way to go. so far everything is working out ok, but now I'm stuck at the most complex part, which involves texture feedback: the output texture of a renderpass is it*s input texture in the next frame (very easy to do in vvvv using a "frameDelay" function") to make this as easy as possible let's say i want to add 0.1 to the red component of a pixel in each frame (modulo 1.0 of course)- so red values keep looping from 0 to 1.....how would i do that in three.js? i couldn't find any example realizing something similar; from searching the web/this site i've learned it should generally be possible (in GLSL) using "fbo pingpong" or "double-buffering", but i got no luck in implementing that.... so before posting all code i'd like to confirm the necessary steps, any help much appreciated: -setup scene1 + gemoetry -setup material1: "red counter" shader (-setup scene2 and material2) -setup 2 WebGLRenderTargets Texture1 + Texture2 -render scene1 to Texture1, with Texture2 as uniform input for material1 (-render Texture1 to Screen (using scene2/material2)) -swap Texture1 with Texture2 and (re-)set uniforms for material1

http://stackoverflow.com/comment/45365215
has text: Yes, whatever the characters are present
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28524324

http://stackoverflow.com/comment/58485388
type: QuestionComment
has text: It looks like server side problem, if you using java servlet you can look at this example to serve *.pdf files http://www.avajava.com/tutorials/lessons/how-do-i-serve-up-a-pdf-from-a-servlet.html regarding another framework it should be same, `Media-Type` http://www.iana.org/assignments/media-types/media-types.xhtml and `Content-Disposition` type http://www.iana.org/assignments/cont-disp/cont-disp.xhtml
score: 0
comment on: http://stackoverflow.com/q/28438800
type: Comment

http://stackoverflow.com/comment/45399314
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28480253
score: 0
has text: Updated question with a comprehensive example for clarity.

http://stackoverflow.com/a/34893529
has comment: http://stackoverflow.com/comment/58628556
answers question: http://stackoverflow.com/q/28568773
has body: You can give tooltipTemplate a function, and format the tooltip as you wish: tooltipTemplate: function(v) {return someFunction(v.value);} multiTooltipTemplate: function(v) {return someOtherFunction(v.value);} Those given 'v' arguments contain lots of information besides the 'value' property. You can put a 'debugger' inside that function and inspect those yourself.
type: Answer
score: 11
upvote count: 11
has comment: http://stackoverflow.com/comment/58627975
downvote count: 0

http://stackoverflow.com/q/28438913
accepted answer: http://stackoverflow.com/a/28457183
downvote count: 0
answer count: 1
favorite count: 0
has body: I am using the Vimeo (V3) API to search for public videos from a client side app. All I need to be returned is the title and url of videos matching my query, but instead I am receiving reams of superfluous data (to my app) amounting to 300K + responses. I noticed previous (deprecated) APIs have params such as summary_response for the search videos end point. Is there anything like that for V3? Nothing appears to be available according to the V3 end point docs. Is there any other way of limiting the response data if there are no params?
has title: Limit returned data with Vimeo API 3
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/28457183
type: Question
tagged with: vimeo
tagged with: javascript
tagged with: api

http://stackoverflow.com/comment/45338648
comment on: http://stackoverflow.com/q/28508369
type: Comment
type: QuestionComment
score: 0
has text: Thanks tadman. My C++ code is simply supposed to declare a V8 Int32Array and assign the values as per the JavaScript code, unless I'm doing this incorrectly. The addon is compiled as release (not debug mode) x64. If my C++ code is not equivalent to my JavaScript code an explanation on how I'm doing it wrong would be appreciated. :)

http://stackoverflow.com/q/28549482
type: UnansweredQuestion
has body: I have a script that allows me to click on a div to start an audio track at a given offset (thus acting as a cue). I have several of these divs in a page. In certain circumstances, they will only play if played in order. In other circumstances, the offset is misinterpreted. For example, when I have this div: Artists\The Black Keys\El Camino\01.Lonely Boy. Stop In a file by itself, the offset works correctly. If I have it together with a bunch of similar divs, it doesn't play at all. In other combinations, (seems like it has to do with certain files, but I haven't been able to narrow down a cause among them), some play properly whenever clicked, some only play if the file before it was played first.
has comment: http://stackoverflow.com/comment/45416874
type: Question
has comment: http://stackoverflow.com/comment/45421680
tagged with: javascript
has comment: http://stackoverflow.com/comment/45412080
score: 0
has title: Javascript misbehaves intermittently with audio files
tagged with: html5-audio
answer count: 0

http://stackoverflow.com/a/28613477
answers question: http://stackoverflow.com/q/28566095
has comment: http://stackoverflow.com/comment/89134526
has comment: http://stackoverflow.com/comment/89132642
upvote count: 2
has comment: http://stackoverflow.com/comment/89129290
has body: You can add the image to the paper project as a paperjs Raster item, as such var raster = new Raster({ source: "http://paperjs.org/tutorials/images/working-with-rasters/mona.jpg", position: view.center }); It will be inserted into the project in the current layer. You can then use paperjs functions like sendToBack and bringToFront to manipulate what appears where. I would probably put the raster image on the first Layer then add a new Layer for the drawing to make it easy to keep track of.
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/89167321

http://stackoverflow.com/q/28548882
upvote count: 1
has comment: http://stackoverflow.com/comment/45412351
possible better answer: http://stackoverflow.com/a/28551134
has answer: http://stackoverflow.com/a/28551134
has title: How to change a javascript array to a JSON object for angular-schema-form?
tagged with: http://stackoverflow.com/tag/json
answer count: 3
tagged with: ionic-framework
has comment: http://stackoverflow.com/comment/45413353
accepted answer: http://stackoverflow.com/a/28550185
downvote count: 0
tagged with: javascript
tagged with: angular-schema-form
has comment: http://stackoverflow.com/comment/45415460
type: AnsweredQuestion
score: 1
favorite count: 0
has body: I need some help please converting a javascript generated array that I am preparing to be used by the angular-schema-form (requires a JSON Object). I create an array using a for loop with some field items that I have retrieved from a $http request. I am able to create the array without issue however, when I now try to prepare it for the angular-schema-form object this is where I am having issues converting it to the required JSON object format. I create the array in javascript like this, var objectSchema = []; for(index = 0; index &lt; instanceFields.length; index++) { var fieldObject = []; fieldObject.id = instanceFields[index].id; fieldObject.title = instanceFields[index].description; fieldObject.type = pass_type; fieldObject.value = instanceFields[index].value.raw; objectSchema.push(fieldObject); } This is a console.log of the array. console.log(objectSchema); // result 0: Array[0] id: "103859" length: 0 title: "Summary" type: "string" value: "" 1: Array[0] id: "101842" length: 0 title: "Job Type" type: "string" value: "696" I have tried to convert the above to JSON using JSON.stringify but this is returning an empty result. I have also tried to pass the array to angula.toJson but I am getting an empty results as well. var myJsonString = angular.toJson(objectSchema, true); console.log(myJsonString); // result [ [], [] ] If you have any direction for me please to follow it would be greatly appreciated. Thanks B
tagged with: angularjs
has answer: http://stackoverflow.com/a/28550088
type: Question
has answer: http://stackoverflow.com/a/28550185

http://stackoverflow.com/q/28587854
answer count: 3
has answer: http://stackoverflow.com/a/28587974
has answer: http://stackoverflow.com/a/28588032
accepted answer: http://stackoverflow.com/a/28588032
has answer: http://stackoverflow.com/a/28587998
tagged with: javascript
tagged with: jquery
has body: I have this code: it's a SPAN or a DIV: with a ID I got the image url from a DB. http://server.com/images/file.png But I want to display that url in an Image. Like this: How can i get it? it's possible with JavaScript/jQuery, etc. Many Thanks.
type: AnsweredQuestion
has title: Changin span content (image url) to a image (display)
type: Question
possible better answer: http://stackoverflow.com/a/28587974
has comment: http://stackoverflow.com/comment/45483199
score: 0

http://stackoverflow.com/comment/45479389
has text: Polling will work, but maybe listening for a [mutation event](https://developer.mozilla.org/en/docs/Web/API/MutationObserver) will be better.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28586095
type: AnswerComment

http://stackoverflow.com/comment/45303824
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28491468
has text: ^^ make sure you see the actual event being sent to GA in the request. Also, real time only shows basic stuff at first like page views. You need to wait a bit to see things like events or custom vars. Even though GA collects it all at the same time, different things take different amounts to show up in the reports (even real time reports) based on a number of factors
score: 0

http://stackoverflow.com/comment/45462857
type: AnswerComment
comment on: http://stackoverflow.com/a/28557537
score: 0
type: Comment
has text: As u suggest (Thanks) i changed folder structures. Now i'm getting only these error message.(Refer in question)

http://stackoverflow.com/a/28561733
has body: There is no way you can prevent users from changing stuff in their console. All the front-end code (HTML, JS, CSS) is sent to the browser, then anybody can view it and change it to their will. If you really want to limit the allowed colors, make a server-side check.
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28561676
downvote count: 0

rsvp.js
type: Tag
tag name: rsvp.js
tags question: http://stackoverflow.com/q/28587085

http://stackoverflow.com/comment/45327634
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28504157
has text: Pick a random number in the range `[$min, min($total, $max)]`, assign it to the first element. Subtract this from `$total`. Repeat this for the next element, and so on.
score: 1

http://stackoverflow.com/comment/45352248
type: Comment
type: QuestionComment
has text: @JamesGaunt thanks for the response. a bit of both, it is critical for me that a request is sent and therefore need to know if angular for what ever reason doesn't send the request or it is interrupted whilst making it so I can handle it. does that make sense?
comment on: http://stackoverflow.com/q/28517500
score: 0

http://stackoverflow.com/comment/45718745
has text: You could do so in Lua using [mod_magnet](http://redmine.lighttpd.net/projects/1/wiki/Docs_ModMagnet).
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28577640

http://stackoverflow.com/a/28465416
answers question: http://stackoverflow.com/q/28464651
has body: If I've undertood your question correctly (accurated in commnets), you want to remove the whole tr containing tds with duplicate ids. This is what you can do: function removeTr(id) { var ids = document.querySelectorAll(id), // Get a collection of cells with same ids len = ids.length, n; if (len &lt; 2) {return;} // Quit, no duplicated ids for (n = 0; n &lt; len; n++) { // Iterate through the collection if (ids[n]) { // Check, if the element exists ids[n].parentElement.removeChild(ids[n]); // If the wanted id is found, remove the parent } } } A live demo at jsFiddle. Then just call removeTr('#table_line_0'); using the wanted id as an argument.
has comment: http://stackoverflow.com/comment/45256868
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45257351
has comment: http://stackoverflow.com/comment/45257493
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28464651
type: Answer

http://stackoverflow.com/a/28561792
has comment: http://stackoverflow.com/comment/45436175
has comment: http://stackoverflow.com/comment/45434828
upvote count: 3
has comment: http://stackoverflow.com/comment/45434567
has comment: http://stackoverflow.com/comment/45448358
has comment: http://stackoverflow.com/comment/45435461
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45453949
has comment: http://stackoverflow.com/comment/45435373
type: Answer
has comment: http://stackoverflow.com/comment/45435604
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28561676
has body: The bottom line: Never trust anything from the client. The client can change whatever they desire, and can even edit the data that's going to the server. If you wish to ensure they can't do something, then you will have to put checks on the only thing they can't change (The server). Here is a good guide explaining the benefits of what I mentioned. To answer your comment below: Javascript: $.ajax({ type: "POST", url: 'change_theme.php', data: {change-text-color:$('input[name="change-text-color"]:checked').val(),change-background-color:$('input[name="change-background-color"]:checked').val()}, beforeSend: function(){$("#posting").html('&lt;img src="icons/ajaxloader.gif"/&gt;'); }, success: function(html) { if ( html == "1" ) { $('.tduzalani, .temayi-degistir-alani').animate({'opacity':'0'}, 300, 'linear', function(){ $('.tduzalani, .temayi-degistir-alani').css('display', 'none');}); swal({ title: "Theme was changing succuesfully!", text: ":)", timer: 5000 }); } else { alert('There was an error saving this!') } } }); PHP: &lt;?php include_once 'includes.php'; $textcolors = array('#fa743e','#323949','#000000','#d8dbdf'); $bgcolors = array('#fa743e','#ffcc4d','#94d487','#4a913c','#89c9fa','#3b94d9','#abb8c2','#dd2e44','#f5abb5','#bfcfee','#be72ea','#ea729f','#000000','#0e1d40','#0e4034','#40310e','#451468','#ffffff','#006cff','#bb0707','#660202','#44404b','#422929','#323949'); // if( isSet($_POST['change-text-color']) &amp;&amp; in_array($_POST['change-text-color'], $textcolors) &amp;&amp; isSet($_POST['change-change-background-color']) &amp;&amp; in_array($_POST['change-background-color'], $bgcolors) ) { $text-color=mysql_real_escape_string($_POST['change-text-color']); $background-color=mysql_real_escape_string($_POST['change-background-color']); $data=$Suavi-&gt;change_theme($uid,$text-color,$background-color); echo 1; } else { echo 0; } exit; ?&gt;
answers question: http://stackoverflow.com/q/28561676

http://stackoverflow.com/comment/45376161
score: 0
type: Comment
has text: @AgustínBarrientos Your question should have been how to render something at regular interval then.
type: AnswerComment
comment on: http://stackoverflow.com/a/28530063

http://stackoverflow.com/a/28580783
answers question: http://stackoverflow.com/q/28580741
has comment: http://stackoverflow.com/comment/45469655
has comment: http://stackoverflow.com/comment/45470065
upvote count: 2
type: AcceptedAnswer
has body: function verification() { var1 = document.getElementById("person1").value; var2 = document.getElementById("person2").value; if((var1 != "") || (var2 != "")) { // do what ever you want here. return true; } else { alert("Fill at least one field"); return false; } } &lt;form id="form" action="start.php" method="post" enctype="multipart/form-data" onsubmit="return verification();"&gt; Person 1: &lt;input type="text" id="person1" name="person1" /&gt; &lt;br/&gt; Person 2: &lt;input type="text" id="person2" name="person2" /&gt; &lt;br /&gt; &lt;input type="submit" value="Submit" name="Submit" /&gt; &lt;/form&gt; And you should put your inline javascript to js file, so put that function verification to some js file.
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45469756
downvote count: 0
has comment: http://stackoverflow.com/comment/45469769
accepted answer of: http://stackoverflow.com/q/28580741
has comment: http://stackoverflow.com/comment/45469845

http://stackoverflow.com/a/28529001
answers question: http://stackoverflow.com/q/28528679
score: 4
has body: Because the ECMAScript spec says so: 4.3.24 function member of the Object type that is an instance of the standard built-in Function constructor and that may be invoked as a subroutine Note that Some objects are not callable: var obj = {}; typeof obj; // "object" --&gt; It's not callable obj(); // TypeError: obj is not a function Some objects are callable but are not functions: var obj = document.createElement('object'); typeof obj; // "function" --&gt; It's callable obj instanceof Function; // false --&gt; It's not a function Some objects are callable and are functions: function obj(){} typeof obj; // "function" --&gt; It's callable obj instanceof Function; // true --&gt; It's a Function instance Not all Function instances are callable: var obj = Object.create(Function.prototype); obj instanceof Function; // true --&gt; It's a Function instance typeof obj; // "object" --&gt; It's not callable obj(); // TypeError: obj is not a function
type: Answer
upvote count: 4
downvote count: 0

http://stackoverflow.com/q/28540324
has body: I am trying to invoke a back-end POST webservice from an http adapter created for IBM Mobilefirst. Here is the code: var input = { method : 'post', returnedContentType : 'json', path : '/JLRDurbanPilot/locator', body:{ contentType:"application/json; charset=UTF-8", content: JSON.stringify([{"model":"L"}]) } } return WL.Server.invokeHttp(input); When i run this, i get an HTTP status 400 error with the description - The request sent by the client was syntactically incorrect (). Any help ?
type: UnansweredQuestion
tagged with: ibm-mobilefirst
upvote count: 1
tagged with: mobilefirst-adapters
has title: Error invoking back-end POST web service from IBM Mobilefirst http adapter
type: Question
has answer: http://stackoverflow.com/a/28540976
tagged with: javascript
downvote count: 0
answer count: 1
score: 1
favorite count: 0

http://stackoverflow.com/comment/45323294
has text: Ah! I didn't know that. It seems that it isn't a bug, it's a feature in that case. Thank you!
comment on: http://stackoverflow.com/a/28502015
type: AnswerComment
type: Comment
score: 2

http://stackoverflow.com/a/28530267
has body: If I understand your question right, there are at least 2 different ways: load an initial page which purpose is to redirect (via JavaScript or Refresh header) to the main page; load the entire main page in the first request, containing a placeholder block. Then set the cookie. Then fill the placeholder using AJAX technique (send another request using JS and replace HTML content of placeholer with a newly generated one). For the 2nd approach you don't even need cookie, as JS can pass the value with a query string (GET request parameter).
accepted answer of: http://stackoverflow.com/q/28528809
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28528809
type: AcceptedAnswer

http://stackoverflow.com/comment/45358780
type: Comment
comment on: http://stackoverflow.com/a/28517393
has text: Interesting, `(.toString 6. 2)` worked, but `(.toString 6 2)` gave an illegal syntax error. What would cause this?
score: 0
type: AnswerComment

http://stackoverflow.com/q/28527420
tagged with: docker
has body: I am using node 0.12.0 with express and created a Docker image. This is my directory structure: -server/ -config/ -config.js -app.js -package.json -node-modules/ -deep-extend/ -... -... -... My package.json looks like: { "name": "test", "version": "2.0.0", "private": true, "dependencies": { ... ... "deep-extend": "^0.3.2", ... ... } } and config/config.js looks like: var deepExtend = require('deep-extend'); ... ... ... module.exports = deepExtend({}, .....); I have an issue running this app. When running it with node server/app I got and error: Error: Cannot find module 'deep-extend' When running the following, the problem solved and node server/app runs fine: cd config npm install deep-extend When is the problem? Why node doesn't look on parent folder for node_modules?
has comment: http://stackoverflow.com/comment/45374982
score: 0
tagged with: require
has answer: http://stackoverflow.com/a/28804294
answer count: 1
accepted answer: http://stackoverflow.com/a/28804294
has comment: http://stackoverflow.com/comment/45371253
has comment: http://stackoverflow.com/comment/45371098
tagged with: npm
has title: node can't find modules that exists in parent node_modules folder
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45374047
has comment: http://stackoverflow.com/comment/45370370
type: Question
tagged with: javascript

http://stackoverflow.com/comment/45249375
score: 0
type: QuestionComment
type: Comment
has text: DNS aliasing and that type of thing is done with server config or at the domain registration level. You can't do much in the browser.
comment on: http://stackoverflow.com/q/28461691

http://stackoverflow.com/q/28574337
has body: I have a strange problem. I have to take screenshots from vk.com in album with comments. In this case everything is ok: But when i click to load more comments, the screenshot has a black lower part: The code is pretty simple: // click on image casper.waitForSelector(".photo_row_img", function() { this.click('.photo_row_img'); }); // get more comments casper.waitForSelector("#pv_comments_header", function() { casper.click('#pv_comments_header'); }); // take screenshot casper.wait(10000, function() { casper.captureSelector('capture.jpg', '#pv_photo_wrap'); }); I spent two days and still do not understand what's going on.
has comment: http://stackoverflow.com/comment/45458454
answer count: 1
tagged with: casperjs
tagged with: screenshot
has answer: http://stackoverflow.com/a/28574850
has title: Black part of page during capture with CasperJS
type: AnsweredQuestion
tagged with: phantomjs
tagged with: capture
has comment: http://stackoverflow.com/comment/45458704
score: 0
type: Question
accepted answer: http://stackoverflow.com/a/28574850
tagged with: javascript

http://stackoverflow.com/comment/45328215
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28504409
has text: Why are you adding a random number to your loop counter?

http://stackoverflow.com/comment/45347674
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28513108
has text: Which dropdown plugin is this? I'm guessing it emits some kind of event which you can attach functions to

http://stackoverflow.com/comment/45417030
type: QuestionComment
comment on: http://stackoverflow.com/q/28551889
score: 0
has text: Not really sure what you're doing, but if you're going to open a new window you should do it as the immediate cause of a user action. Websites that just "randomly" (from the user's point of view) open windows are generally not websites that the user will return to later.
type: Comment

http://stackoverflow.com/comment/45331025
has text: @JamesMontagne It's pretty common in node.js to provice `error` as the first argument to a callback -regardless of whether or not there's an error. Not that this question is about node.js, but it's a pattern which conflicts with your suggestion.
comment on: http://stackoverflow.com/q/28505859
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28580947
has answer: http://stackoverflow.com/a/28581155
has answer: http://stackoverflow.com/a/28581193
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28583906
tagged with: animation
score: 11
tagged with: css
has answer: http://stackoverflow.com/a/28581448
upvote count: 11
has answer: http://stackoverflow.com/a/37578784
type: AnsweredQuestion
has body: I'm trying to reproduce a specific animation each time a button is pressed. Specifically, I'm using jQuery and the animate.css library for this effect: on button click, a class is added (two classes to be precise: fadeInDown animated) to the element I want to animate. The animation does work correctly, but only once. Why is this? Fiddle: http://jsfiddle.net/jqm4vjLj/2/ I want the animation to reset every time I click the button, even if it is halfway through completion from a previous click. It should also work whenever I click the button, not only once. JS: $("#button").click(function () { $("#button").removeClass(); $("#button").addClass("fadeInDown animated"); }); Classes from animate.css: @-webkit-keyframes fadeInDown { 0% { opacity: 0; -webkit-transform: translateY(-20px); transform: translateY(-20px); } 100% { opacity: 1; -webkit-transform: translateY(0); transform: translateY(0); } } @keyframes fadeInDown { 0% { opacity: 0; -webkit-transform: translateY(-20px); -ms-transform: translateY(-20px); transform: translateY(-20px); } 100% { opacity: 1; -webkit-transform: translateY(0); -ms-transform: translateY(0); transform: translateY(0); } } .fadeInDown { -webkit-animation-name: fadeInDown; animation-name: fadeInDown; } .animated { -webkit-animation-duration: 1s; animation-duration: 1s; -webkit-animation-fill-mode: both; animation-fill-mode: both; }
type: Question
answer count: 8
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28581448
has answer: http://stackoverflow.com/a/33184607
has answer: http://stackoverflow.com/a/67343821
has title: jQuery + Animate.css animation only working once, animation not resetting
possible better answer: http://stackoverflow.com/a/28581278
has answer: http://stackoverflow.com/a/28581278

http://stackoverflow.com/comment/45293301
comment on: http://stackoverflow.com/q/28485547
score: 0
has text: It shouldn't really matter if the unchecked boxes are submitted or not, because PHP should always check if the box is checked or not anyway.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45398728
has text: Right. Sorry, I didn't know. Done! Thanks again :)
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28494894
type: Comment

http://stackoverflow.com/comment/45616164
has text: but some time it comes: Use of getPreventDefault() is deprecated. Use defaultPrevented instead.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28549554

http://stackoverflow.com/a/28890431
type: Answer
answers question: http://stackoverflow.com/q/28573362
has body: I disabled the sorting on datatables using ordering: false setting which creating the table. I used a custom jQuery-based library TableSorter which gives the functionality of sorting the rows without firing an ajax request to update the page. Hope it helps.
score: 0

http://stackoverflow.com/q/28584766
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/19593145
has comment: http://stackoverflow.com/comment/45527908
upvote count: 3
has comment: http://stackoverflow.com/comment/45476934
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45506083
tagged with: coldfusion
score: 3
has comment: http://stackoverflow.com/comment/45505895
tagged with: cookies
has comment: http://stackoverflow.com/comment/45476942
has body: I am creating a cookie using javascript by using the code document.cookie="USERNAME=xyz"; After that I am trying to delete same cookie using coldfusion by the code &lt;cfcookie name="USERNAME" value="0" expires="now"/&gt; But I am unable to delete the cookie, it still shows in browsers console(firebug). On dump the cookies, it shows the cookie that is created by javascript even after refreshing the page multiple times. Same thing happens if a cookie is created by coldfusion and trying to delete it through javascript. Using coldfusion i am able to get the cookie value or change the cookie value of the cookie that is created by javascript but unable to delete that cookie. Using this code to change/set the value of cookie using coldfusion &lt;cfset coookie.USERNAME = 0&gt; Is there any reason for this or any way to delete?
has answer: http://stackoverflow.com/a/36664790
has title: How to delete a cookie using coldfusion which is created through javascript or the viceversa?
type: Question

http://stackoverflow.com/a/28573617
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28562113
accepted answer of: http://stackoverflow.com/q/28562113
score: 0
has body: AWS Elastic Beanstalk is about a close as you're going to get to this. You will still need to configure a few basic things, but it's pretty easy to get going either with a deployable piece of code (war file) or by checking it out of source control (depending on the language/platform).

http://stackoverflow.com/a/28506175
score: 0
has comment: http://stackoverflow.com/comment/45333126
type: Answer
has comment: http://stackoverflow.com/comment/45333617
has comment: http://stackoverflow.com/comment/45333208
has comment: http://stackoverflow.com/comment/45333721
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45333813
answers question: http://stackoverflow.com/q/28505843
has body: You return before actually calling preventDefault. The following will work: $(function(){ $('a').click(function(e) { e.preventDefault(); return false; }); });

http://stackoverflow.com/comment/48001276
has text: It should be a list of routes. I'll add a note about that and some links to example projects.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28558545
score: 2

eclipse
tag name: eclipse
tags question: http://stackoverflow.com/q/28443966
tags question: http://stackoverflow.com/q/28574350
type: Tag
tags question: http://stackoverflow.com/q/28484846

http://stackoverflow.com/comment/45541506
type: AnswerComment
score: 0
type: Comment
has text: Ultimately, it is up to you to determine what validation rules fit your application, the ones I entered were just for demonstration purposes.
comment on: http://stackoverflow.com/a/28602572

http://stackoverflow.com/q/28522118
favorite count: 0
has comment: http://stackoverflow.com/comment/45362748
upvote count: 8
has title: Return array without element at index n in lodash
type: UnansweredQuestion
tagged with: lodash
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45361710
has body: Right now I have this function: function without(array, index) { array.splice(index, 1); return array; } I thought this would be something lodash would have a utility for, but looks like not. Having this function allows me to do a one-liner that I can chain: var guestList = without(guests, bannedGuest).concat(moreNames); No way to achieve this without introducing a predicate function, using lodash?
has comment: http://stackoverflow.com/comment/45361383
has answer: http://stackoverflow.com/a/30137799
tagged with: arrays
tagged with: javascript
answer count: 1
score: 7

http://stackoverflow.com/comment/45392475
has text: Fires once for me. FF35 on Win7 - Edit : and also once in IE11.
comment on: http://stackoverflow.com/q/28539147
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28564606
has comment: http://stackoverflow.com/comment/45439712
answers question: http://stackoverflow.com/q/28564089
accepted answer of: http://stackoverflow.com/q/28564089
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
upvote count: 1
has body: Let's have this object : $scope.user = { firstName: '', lastName: '', ... } With an info for your form which would be like that : $scope.signupForm = [ { description: 'Firstname', type: 'text', model: 'firstname' }, { description: 'Lastname', type: 'text', model: 'lastname' }, You should be able to access it that way : ng-model="user[row.model]" EDIT (opinion based) : Depending on the case, this solution might be a good option. That way, you just have to send the object "user" to save it. I would have done it with a little difference. I would have received this object from back-end : [{ description : "Firstname", type: "text", value: "" }, { description: ... and I would have had my ng-model that way : ng-model="row.value" And because I'm a bit lazy, I would have sent back the description, type,... to the back end. The second option may be easier if that kind of model is supposed to change sometimes.

http://stackoverflow.com/comment/45372996
comment on: http://stackoverflow.com/q/28528809
type: Comment
type: QuestionComment
score: 0
has text: When you say "JS" are you talking about the browser or node.js?

http://stackoverflow.com/q/28522600
tagged with: cors
answer count: 1
accepted answer: http://stackoverflow.com/a/28523565
has comment: http://stackoverflow.com/comment/45362720
has body: I am relatively new to MongoDB so I am still getting used to it. Currently I am trying to post a json object to mongo from the client side using the code below in javascript. var addUserButton = document.getElementById('add-user'); var userNameInput = document.getElementById('name'); addUserButton.onclick = function() { var newUser = new Object(); newUser.name = userNameInput.value; var newUserJson = { 'name': newUser.name}; $.post('127.0.0.1:27017/test', newUserJson); }; When ever I run this code though I get error stating: XMLHttpRequest cannot load %3127.0.0.1:27017/test. Cross origin requests are only supported for protocol schemes... etc I read up on this and was wondering if adding the following CORS handler to mongoDB would fix this. If it is correct, how would I go about adding this to MongoDB? I could not find documentation on how to add this CORS handler to mongo function handleCors(req, res, callback) { res.setHeader('Access-Control-Allow-Origin', '*') res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE,OPTIONS'); res.setHeader('Access-Control-Allow-Headers', 'Authorization'); // CORS OPTIONS request, simply return 200 if (req.method == 'OPTIONS') { res.statusCode = 200; res.end(); callback.onOptions(); return; } callback.onContinue(); };
tagged with: node.js
has comment: http://stackoverflow.com/comment/45368850
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28523565
has title: Modifying MongoDB to allow cross origin requests
type: Question
tagged with: mongodb
tagged with: javascript
tagged with: http-headers
score: 0

http://stackoverflow.com/comment/45427326
type: Comment
comment on: http://stackoverflow.com/q/28557676
type: QuestionComment
score: 2
has text: Nope json.parse will not work as I have "job.desk.number" as a string and i want to turn it into a value. Please understand the question before answering thanks!

http://stackoverflow.com/a/28461615
downvote count: 0
answers question: http://stackoverflow.com/q/28461256
score: 1
accepted answer of: http://stackoverflow.com/q/28461256
type: Answer
upvote count: 1
has body: This should do it: $('div.article-preview.js-articles-new').wrap('&lt;div class="col-sm-12" /&gt;'); var divs = $("div.col-sm-12"); for (var i = 0; i &lt; divs.length; i += 3) { divs.slice(i, i + 3).wrapAll('&lt;div class="row" /&gt;'); } jsFiddle example
type: AcceptedAnswer

http://stackoverflow.com/a/28471686
has body: replace function showhide(id){ if (document.getElementById) { var divid = document.getElementById(id); var divs = document.getElementsByClassName("hide"); for(var i=0;i&lt;divs.length;i++) { divs[i].style.display = "none"; } divid.style.display = "block"; } return false; } with function showhide(id){ $('.hide').hide(); $('#'+id).show(); return false; }
answers question: http://stackoverflow.com/q/28471582
upvote count: 1
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/28509885
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45338924
tagged with: css
tagged with: google-chrome
has title: Mobile Chrome not Repositioning CSS Background Containers Onload/Resize
type: Question
has body: Okay, a little background -- I wanted to make a single page layout with multiple stacked background images for a home page in drupal and have it easily edited using some div tags in the CMS system. It seems to be working all well and good in all sorts of different browsers -- even safari gasp. Except when I test it on a mobile device. Chrome on mobile seems to not move my background image positions. Now it was moving them but I had to cache the window size because when I was scrolling in chrome on mobile it was firing off window resize events every time I scroll (why? I have no idea). So basically, I can't seem to duplicate this behavior on a desktop. Any ideas as to why my background containers might not be repositioning themselves correctly to adjust for an increased height of the text container (due to the narrow width). var imageHeight, imageWidth, totalHeight, windowWidth, i; var imageArray = []; var textContainerArray = []; Adjusts window size on load jQuery(document).ready(function() { /*Image Containers*/ imageWidth = window.innerWidth; imageHeight = window.innerHeight; Sets initial image locations textContainerArray[1] = imageHeight*0; textContainerArray[2] = imageHeight*1; textContainerArray[3] = imageHeight*2; textContainerArray[4] = imageHeight*3; i = 1; while (i&lt;5){ imageArray[i] = imageHeight*(i-1); console.log(imageArray[i]); console.log(i); i++ } i = 1; Determine if there is a container while (jQuery(".ct-pos-"+i).hasClass("hp-page") == true){ console.log(jQuery(".ct-pos-"+i).hasClass("hp-page")); if (jQuery(".ct-pos-"+i).height() + jQuery(".ct-pos-"+i).offset().top &gt; imageHeight*i){ if (jQuery(".ct-pos-"+ (parseInt(i) +1)).hasClass("hp-page") == true){ imageArray[i+1] = jQuery(".ct-pos-"+i).height() + jQuery(".ct-pos-"+i).offset().top; textContainerArray[i+1] = (jQuery(".ct-pos-"+i).height() + jQuery(".ct-pos-"+i).offset().top); } } /*console.log(i);*/ i++; } Sets Position to scale up or scale down until aspect ratio breaks if (imageWidth*.625…
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/45338988
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45891595
type: Comment
type: QuestionComment
has text: Using the method you suggested, the matrix I used is [[-20,20,0,-9],[20,0,-5,9],[0,-20,5,0],[-1,-1,-1,0],[1,1,1,0]], and still i can a result vector of all null
comment on: http://stackoverflow.com/q/28541569
score: 0

http://stackoverflow.com/comment/45350153
has text: I don't know dropzonejs but I think you can try the following. Return the just uploaded file from the server side, and in your success function do something like this `.success(function(response){ $scope.list = response['file'] })`
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28516361

http://stackoverflow.com/a/28479652
answers question: http://stackoverflow.com/q/28479584
type: Answer
score: 13
upvote count: 13
has comment: http://stackoverflow.com/comment/45281734
has comment: http://stackoverflow.com/comment/45282740
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28479584
has comment: http://stackoverflow.com/comment/45281692
downvote count: 0
has body: When you test anything but a String, it is turned into a String. null is turned into a string 'null'. Try it: console.log(new String(null)); Likewise for undefined.
has comment: http://stackoverflow.com/comment/45281680
has comment: http://stackoverflow.com/comment/45281685

http://stackoverflow.com/comment/45469282
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28580298
has text: Your code adds that class and working fine.
score: 0

http://stackoverflow.com/a/28483079
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28482383
has body: Ok I think I understand, i'll recap. So your headerdata array is in some order that you want to display this information that is correct. The data array is not in the correct order. So you are attempting to use the 'headerdata' order to display the 'data' data. It sounds like you can make use of angular filters, specifically orderBy : https://docs.angularjs.org/api/ng/filter/orderBy If you can't find a filter that works for you, then you should reorder the data array in a custom filter or in your controller to how you need it rather than trying to do this weird thing you are trying to do.
has comment: http://stackoverflow.com/comment/45288328
has comment: http://stackoverflow.com/comment/45288255

http://stackoverflow.com/q/28450557
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28455505
has comment: http://stackoverflow.com/comment/45229793
has comment: http://stackoverflow.com/comment/45229436
has comment: http://stackoverflow.com/comment/45234110
type: Question
has answer: http://stackoverflow.com/a/28451244
linked to: http://stackoverflow.com/q/9628450
has comment: http://stackoverflow.com/comment/45233339
has comment: http://stackoverflow.com/comment/45233533
has title: Change paragraph content when height of a div reaches a certain percentage
has comment: http://stackoverflow.com/comment/45234203
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28451244
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28455505
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45234739
has body: I'm making a loader for a website. The HTML is as follows: 50% 50% When element blueContainer has a height of 2%, I want the text in both paragraphs to be 2%. I want the paragraph text to always show the height in percentage of blueContainer. Height values are applied through an external CSS file, I am not very well versed in the language of Javascript, and I've tried some ways but I cannot figure out how I should do this. EDIT: Some of the things I've tried (and probably miserably failed at): function percentages(){ document.getElementByClassName("greyPercent, bluePercent"){ if (document.getElementByClassName("greyContainer, blueContainer"){ } } } This is where I'm stuck at too, because I have no idea how I could tell the javascript to run the function when the element has a certain height. EDIT: Here is a jsfiddle to illustrate what I'm doing. I gave the containers a background colour because of a lack of images. https://jsfiddle.net/1s5tw6es/
has comment: http://stackoverflow.com/comment/45229374
tagged with: css
has comment: http://stackoverflow.com/comment/45233224

http://stackoverflow.com/q/28443951
has comment: http://stackoverflow.com/comment/45220426
has answer: http://stackoverflow.com/a/28445810
tagged with: javascript
has comment: http://stackoverflow.com/comment/45217657
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/45217999
has comment: http://stackoverflow.com/comment/45217722
tagged with: sql
has title: Why is my C# method not being called from AJAX?
answer count: 1
has body: I am trying to call the following C# method: [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public static string getJSONdata() { string jsonString = ""; using (SqlConnection con = new SqlConnection(connectionString)) { con.Open(); using (SqlCommand cmd = new SqlCommand("SELECT TOP 10 * FROM DRAW ORDER BY DrawID DESC;", con)) { using (SqlDataReader reader = cmd.ExecuteReader()) { List&lt;Dot&gt; _Dot = new List&lt;Dot&gt;(); while (reader.Read()) { Dot dot = new Dot(); dot.x = (int.Parse(reader["xCoord"].ToString())); dot.y = (int.Parse(reader["yCoord"].ToString())); if (reader["DrawID"] != DBNull.Value) dot.i = (int.Parse(reader["DrawID"].ToString())); _Dot.Add(dot); } JavaScriptSerializer jss = new JavaScriptSerializer(); jsonString = jss.Serialize(_Dot); } } } System.Diagnostics.Debug.WriteLine(" JSON: " + jsonString); return jsonString; } Here is my JavaScript code: $.ajax({ url: 'Default.aspx/getJSONdata', data: '{ }', contentType: 'application/json; charset=utf-8', dataType: 'json', success: function (response) { alert(response.d); }, error: function (xhr, ajaxOptions, thrownError) { alert(xhr.status); alert(thrownError); } }); First, I am getting the ajax error. No idea why it's not called. Second, I am still not sure I am returning the correct JSON data I want, whether in the correct format or not. Thanks for your help. Edit. It is returning a JSON string correctly. Note: the connectionString works in another function, so that's not it.
has comment: http://stackoverflow.com/comment/45219963
has comment: http://stackoverflow.com/comment/45220226
has comment: http://stackoverflow.com/comment/45217701
has comment: http://stackoverflow.com/comment/45218105
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45217849
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/45220158

http://stackoverflow.com/comment/45339572
has text: `Ext.getCmp('callClassAvailableGrid').getEl().isMasked()` returns `false`
type: AnswerComment
comment on: http://stackoverflow.com/a/28498813
type: Comment
score: 0

tcp
type: Tag
tags question: http://stackoverflow.com/q/28441539
tag name: tcp

http://stackoverflow.com/q/28446168
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28447802
upvote count: 3
type: Question
score: 3
tagged with: javascript
has title: nodejs 'exec' command doesn't execute 'sed' command properly
accepted answer: http://stackoverflow.com/a/28447802
tagged with: sed
answer count: 1
downvote count: 0
tagged with: exec
favorite count: 0
has body: I have a file where I want to scan it, find the character '{' and create a new line, then add an IP on the new line and add a semi-cologne to the end of the line, then write to a config file. I can accomplish this with the following sed command when running from shell: sed -i 's/{/&amp;\n1.1.1.1;/g' /tmp/test.conf inside test.conf: acl testACL{ }; the output from the command in shell shows: acl testACL{ 1.1.1.1; }; works perfect! Now the problem is when I get nodejs to execute it: var sys = require('sys'); var exec = require('child_process').exec; function puts(error, stdout, stderr) { sys.puts(stdout) }; exec("sed -i 's/{/&amp;\n1.1.1.1;/g' /tmp/test.conf",puts); return 0; when I run the command in console: 'nodejs test.js' I get blank output and when I check the file, the file 'test.conf' has not been altered! why?! Also if you're thinking 'its a permissions issue!' I've had nodejs exec command write basic echos to the test config file and it worked fine. I have also tried the 'shelljs' module with no luck there. I have tried countless combinations for hours now with no prevail! I'm puzzled.

http://stackoverflow.com/comment/45304723
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28491917
type: Comment
has text: Completely false - scripts *can* be dynamically loaded in pages.

http://stackoverflow.com/comment/45432230
comment on: http://stackoverflow.com/a/28560031
type: AnswerComment
type: Comment
has text: @user2244961 , use ` ` Give name="total" So you already have code for that in PHP.
score: 1

http://stackoverflow.com/a/28497301
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28497057
has comment: http://stackoverflow.com/comment/45314330
score: 2
accepted answer of: http://stackoverflow.com/q/28497057
upvote count: 2
has body: You should do below &lt;input name="filter" type="radio" data-bind="checked:$root.sortType, event: { change: $root.onInputChange}"&gt;
has comment: http://stackoverflow.com/comment/45314352

papaparse
type: Tag
tag name: papaparse
tags question: http://stackoverflow.com/q/28561396

http://stackoverflow.com/comment/45329517
comment on: http://stackoverflow.com/a/28504611
type: AnswerComment
score: 0
has text: Take out the 's' from beneath the ` ` tag, and try **just** using min-width
type: Comment

http://stackoverflow.com/a/28591997
answers question: http://stackoverflow.com/q/28575972
has body: You could just parse the result of $("datetime selector").val() to get the day and convert that to a word name if you need it.
score: 0
type: Answer

http://stackoverflow.com/comment/45481172
has text: Use local storage or cookie.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28587001
score: 1

http://stackoverflow.com/comment/99065200
comment on: http://stackoverflow.com/a/50286389
type: AnswerComment
type: Comment
score: 0
has text: Experimentally.

http://stackoverflow.com/comment/45303112
type: Comment
comment on: http://stackoverflow.com/q/28490717
has text: You can parse a date to a string using: `moment(theDateStr, theFormatStr);`. Once you've got that, you can just compare dates using `<` or `>`. There's nothing built in to compare string dates, you need to parse them.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45354071
type: Comment
type: QuestionComment
has text: That's a circular structure and you can't convert it to JSON.
score: 0
comment on: http://stackoverflow.com/q/28518506

http://stackoverflow.com/q/28580741
possible better answer: http://stackoverflow.com/a/28580829
has body: I have a form with 2 textboxes. I want to check that at least one textbox is filled, and if there is only one filled do some stuff and if there are both filled do something else. I found a javascript function that I think might help me but I don't know from where to call it. here is the function function verification() { var1= document.getElementById("form").value; var2= document.getElementById("form").value; if((var1 != "") &amp;&amp; (var2 != "")) { // do what ever you want here. } else { alert("Fill at least one field"); } } and the form: &lt;form id="form" action="start.php" method="post" enctype="multipart/form-data"&gt; Person 1: &lt;input type="text" name="person1" /&gt; &lt;br/&gt; Person 2: &lt;input type="text" name="person2" /&gt; &lt;br /&gt; &lt;input type="submit" value="Submit" name="Submit" /&gt; &lt;/form&gt;
tagged with: javascript
has answer: http://stackoverflow.com/a/28581249
has comment: http://stackoverflow.com/comment/45469613
score: 0
has title: Call a javascript function
has answer: http://stackoverflow.com/a/28580829
has comment: http://stackoverflow.com/comment/45469565
accepted answer: http://stackoverflow.com/a/28580783
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28581070
has answer: http://stackoverflow.com/a/28580783
type: Question

http://stackoverflow.com/comment/45279698
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28478374
has text: ah I see.. instead of innerText, can I use text?

http://stackoverflow.com/q/28515292
score: 1
upvote count: 1
type: Question
linked to: http://stackoverflow.com/q/16332312
tagged with: javascript
has comment: http://stackoverflow.com/comment/45349513
has answer: http://stackoverflow.com/a/28515450
downvote count: 0
answer count: 1
favorite count: 0
tagged with: html-select
tagged with: casperjs
accepted answer: http://stackoverflow.com/a/28515450
has body: My html code is: Default Bypass cache Basic caching Ignore query string Aggressive caching Cache everything Usually with casperjs I would use this.fillSelectors('form[name="formName"]', { 'select[id="custom-cache-pref"]': 'byc' }, false); to select option "byc" but this time the "select" element is not embedded in a form! How can I choose its value in this case?
has title: How to fill a select element which is not embedded in a form with CasperJS?
linked to: http://stackoverflow.com/q/26792260
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45348001

http://stackoverflow.com/a/28567477
has body: As ɴ-ᴀ-ᴛ-ʜ said in his comment, you need to be using .on to listen for the appear event. jQuery('.home-section-1').on('appear', function(){ jQuery('.page-scroll-indicator .fa.fa-circle').removeClass('active-ind'); jQuery('.page-scroll-indicator .section-1').addClass('active-ind'); }); Here's a code snippit showing it working, you'll notice that your method (Method 1) doesn't fire, while the method above (Method 2) does: /* * jQuery appear plugin * * Copyright (c) 2012 Andrey Sidorov * licensed under MIT license. * * https://github.com/morr/jquery.appear/ * * Version: 0.3.4 */ (function($) { var selectors = []; var check_binded = false; var check_lock = false; var defaults = { interval: 250, force_process: false } var $window = $(window); var $prior_appeared; function process() { check_lock = false; for (var index = 0, selectorsLength = selectors.length; index < selectorsLength; index++) { var $appeared = $(selectors[index]).filter(function() { return $(this).is(':appeared'); }); $appeared.trigger('appear', [$appeared]); if ($prior_appeared) { var $disappeared = $prior_appeared.not($appeared); $disappeared.trigger('disappear', [$disappeared]); } $prior_appeared = $appeared; } } // "appeared" custom filter $.expr[':']['appeared'] = function(element) { var $element = $(element); if (!$element.is(':visible')) { return false; } var window_left = $window.scrollLeft(); var window_top = $window.scrollTop(); var offset = $element.offset(); var left = offset.left; var top = offset.top; if (top + $element.height() >= window_top && top - ($element.data('appear-top-offset') || 0) <= window_top + $window.height() && left + $element.width() >= window_left && left - ($element.data('appear-left-offset') || 0) <= window_left + $window.width()) { return true; } else { return false; } } $.fn.extend({ // watching for element's appearance in browser viewport appear: function(options) { var opts = $.extend({}, defaults, options || {}); var selector = this.selector || this; if (!check_bind…
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45448661
answers question: http://stackoverflow.com/q/28566927

http://stackoverflow.com/q/28445475
has comment: http://stackoverflow.com/comment/45220522
has comment: http://stackoverflow.com/comment/45220909
upvote count: 0
has comment: http://stackoverflow.com/comment/45220872
accepted answer: http://stackoverflow.com/a/28445805
has comment: http://stackoverflow.com/comment/45220485
has comment: http://stackoverflow.com/comment/45220609
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45220374
has answer: http://stackoverflow.com/a/28445805
has comment: http://stackoverflow.com/comment/45220654
score: -1
possible better answer: http://stackoverflow.com/a/28445523
has comment: http://stackoverflow.com/comment/45220410
has title: How to reverse return value?
has answer: http://stackoverflow.com/a/28445523
has comment: http://stackoverflow.com/comment/45220354
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45220693
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45220346
has comment: http://stackoverflow.com/comment/45220986
has body: var arr = []; var a1; arr.push( ( (a1 = [1, 2, 'random']).num = 5 ) &amp;&amp; a1 ) Is there a way to not have to define the variable a1 and push the array a1 after setting the num property on it. If I were to take out &amp;&amp; a1 the number 5 would be pushed to arr. So anyways to push the array without having to define a1?
downvote count: 1

http://stackoverflow.com/a/28442795
downvote count: 0
answers question: http://stackoverflow.com/q/28441927
has comment: http://stackoverflow.com/comment/45215806
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45220457
score: 1
has comment: http://stackoverflow.com/comment/45216741
has body: Since you're pulling data from two ajax requests, perhaps it will be better to store both results in one global array that you can sort and loop through to build your table in price order. var resultsArray = new Array(); for (var i = 0; i &lt; json.results.length; i++) { resultsArray.push(json.results[i]); } resultsArray.sort(function(a,b) { return a.price - b.price; }); for (var i = 0; i &lt; json.results.length; i++) { //print your table here var price = resultsArray[i].price; //etc... } I fully demonstrated this in a fiddle
accepted answer of: http://stackoverflow.com/q/28441927
type: AcceptedAnswer

http://stackoverflow.com/comment/45432352
type: QuestionComment
comment on: http://stackoverflow.com/q/28560449
score: 3
has text: Have a look at: http://stackoverflow.com/questions/109086/stop-setinterval-call-in-javascript Probably what you are looking for. (When the row is hidden, clearInterval, when row is shown, setInterval again.)
type: Comment

http://stackoverflow.com/comment/45347389
comment on: http://stackoverflow.com/q/28514922
score: 0
type: Comment
type: QuestionComment
has text: What error are you getting?

http://stackoverflow.com/comment/45496928
has text: Thank you, this was really helpful in clearing things up for me as well!
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28571564

http://stackoverflow.com/comment/45408436
comment on: http://stackoverflow.com/a/28547004
has text: I think the approach could work under any scenario, it would just require more logic and checking. I was just working with your example, and so didn't know what needed to be handled in a more complex XML version.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45414065
has text: Strange, the application gave error. I'll try again. Thank U.
comment on: http://stackoverflow.com/q/28550431
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28557029
has comment: http://stackoverflow.com/comment/45426389
has comment: http://stackoverflow.com/comment/45426717
has comment: http://stackoverflow.com/comment/45426454
has comment: http://stackoverflow.com/comment/45426538
score: 0
has comment: http://stackoverflow.com/comment/45426357
has body: Do it like function factor(number, divisor, s) { if(number==divisor) arr = []; if(divisor &gt;= 1) { if(number % divisor == 0) { arr.push(divisor) return factor(number, divisor - 1) } else { return factor(number, divisor - 1); } } return arr; } Working Fiddle
type: Answer
answers question: http://stackoverflow.com/q/28556904

http://stackoverflow.com/comment/45464814
type: Comment
has text: thank you although the images are not in order :/ can you work out how to get them displaying in order: 1, 2, 3, 4, 5 and next row 6, 7, 8, 9, 10...
type: AnswerComment
comment on: http://stackoverflow.com/a/28578156
score: 0

http://stackoverflow.com/q/28514318
tagged with: angularjs
has answer: http://stackoverflow.com/a/28514508
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28514508
score: 1
has title: Handling $http AngularJS return data
upvote count: 1
possible better answer: http://stackoverflow.com/a/28514544
tagged with: ionic-framework
type: Question
has body: Here is client side in AngularJS (works fine): $scope.ajaxLogin = function(){ var fn = document.getElementById("username").value; var pw = document.getElementById("password").value; $http({ url: "myurl", method: "POST", headers: {'Content-Type': 'application/x-www-form-urlencoded'}, data: { username: fn, password: pw } }).success(function(data, status, headers, config) { // this callback will be called asynchronously // when the response is available $scope.showAlertError(); }).error(function(data, status, headers, config) { // called asynchronously if an error occurs // or server returns response with an error status. $scope.showAlertError(); }); }; I expect to have success only if user and password are matched. Server side: if ($result=mysqli_query($con,$sql)) { $rowcount=mysqli_num_rows($result); printf($rowcount); mysqli_free_result($result); } Before AngularJS I used normal AJAX handling. this is how i did earlier: function ajax_post(){ // Create our XMLHttpRequest object var hr = new XMLHttpRequest(); // Create some variables we need to send to our PHP file var url = "myurl"; var fn = document.getElementById("username").value; var ln = document.getElementById("password").value; var vars = "username="+fn+"&amp;password="+ln; hr.open("POST", url, true); // Set content type header information for sending url encoded variables in the request hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); // Access the onreadystatechange event for the XMLHttpRequest object hr.onreadystatechange = function() { if(hr.readyState == 4 &amp;&amp; hr.status == 200) { var return_data = hr.responseText; if(return_data=="1"){ console.log("this is return data"+return_data); }else{ ons.notification.alert({message: 'Login Failed!'}); } } } // Send the data to PHP now... and wait for response to update the status div hr.send(vars); // Actually execute the request } How can I use this with AngularJS? I tried putting similar code in success handler, but it always goes t…
answer count: 2
has answer: http://stackoverflow.com/a/28514544
downvote count: 0
tagged with: javascript
tagged with: ajax
favorite count: 0

http://stackoverflow.com/comment/45375689
has text: Hey Joppe - this was perfect! Really helped me understand a bit more about how to work around in the shadow DOM too - I really struggle sometimes getting down to the right granularity and though that `this.$.headerValue.selectedItem` would get me there (also thanks for picking up the missing `/` in my template call
type: AnswerComment
comment on: http://stackoverflow.com/a/28519751
score: 0
type: Comment

http://stackoverflow.com/comment/45284125
comment on: http://stackoverflow.com/a/28480851
score: 0
type: Comment
has text: Thanks, ill have a play with it. I have multiple hidden fields and i want the user to drag and drop onto an area what elements they want to use.
type: AnswerComment

http://stackoverflow.com/comment/45340858
has text: @KlausByskovPedersen I'm not sure, if the system is democratic, but please don't let other people (like me) to affect your decisions, you're free to vote down/up or close/reopen, answer or what ever as you wish.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28510665
type: Comment

http://stackoverflow.com/q/28540981
tagged with: qml
downvote count: 0
has comment: http://stackoverflow.com/comment/45399799
has title: Access QML Profiler via qml / js / c++ code
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45418950
type: UnansweredQuestion
has body: I would like to access the caller/callee list from QML Profiler programmatically, does anyone know whether there is a way to do this? I have read documentation and scanned other stackoverflow questions, but they deal with how to use QML Profiler. E.g. http://qt-project.org/doc/qtcreator-2.6/creator-qml-performance-monitor.html. However they do not list a way to programmatically access it. I'm looking for something like this: console.profile() ... // call some functions (which call other functions etc.) ... console.profileEnd() // &gt;&gt; be able to navigate the calls made &lt;&lt; I am aware it probably will not be this simple, however I would appreciate any help from more experienced users who could point me in the right direction.
tagged with: c++
answer count: 0
upvote count: 3
tagged with: qt-creator
type: Question
tagged with: qt
score: 3

http://stackoverflow.com/q/28546677
type: AnsweredQuestion
tagged with: chart.js
has answer: http://stackoverflow.com/a/28547387
type: Question
has answer: http://stackoverflow.com/a/39724546
tagged with: javascript
has answer: http://stackoverflow.com/a/68168189
has body: So im using chart.js http://www.chartjs.org/docs/ and i cant change the color of the text in the bottom ex: "January","February","March","April","May","June","July" and the numbers in the left side i tried all these options: scaleFontColor: "#FFFFFF" pointLabelFontColor : "#FFFFFF" my full code: &lt;script&gt; var randomScalingFactor = function(){ return Math.round(Math.random()*100)}; var lineChartData = { labels : ["January","February","March","April","May","June","July"], datasets : [ { label: "My Second dataset", fillColor : "rgba(255, 89, 114, 0.6)", strokeColor : "rgba(51, 51, 51, 1)", pointColor : "rgba(255, 89, 114, 1)", pointStrokeColor : "#fff", pointHighlightFill : "#fff", pointHighlightStroke : "rgba(151,187,205,1)", maintainAspectRatio: false, scaleFontColor: "#FFFFFF", pointLabelFontColor : "#FFFFFF", pointLabelFontSize : 30, data : [1,2,10,7,3,1] } ] } window.onload = function(){ var ctx = document.getElementById("canvas").getContext("2d"); window.myLine = new Chart(ctx).Line(lineChartData, { responsive: true }); } &lt;/script&gt;
favorite count: 0
possible better answer: http://stackoverflow.com/a/39724546
accepted answer: http://stackoverflow.com/a/28546827
downvote count: 1
has answer: http://stackoverflow.com/a/67428413
upvote count: 20
has answer: http://stackoverflow.com/a/28546827
has title: Chart.js Text color
answer count: 5
score: 19

http://stackoverflow.com/q/28555530
tagged with: javascript
score: -1
answer count: 2
upvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28555662
tagged with: plugins
has body: I've posted here before but can't find my account so this is my new first post. I'm attempting to use a js plugin called "blueberry slider" with a responsive js menu called "Menumaker" and something is conflicting, can't get the slider to show. I really don't know what I'm doing with JS yet, hoping someone can help. In Chrome, element inspection, it's saying "undefined is not a function". I haven't modified anything of the plugins.
has title: How To Get Two JS/Jquery Plugins to Work Together?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28555613
accepted answer: http://stackoverflow.com/a/28555662
downvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/28555613

http://stackoverflow.com/comment/45229462
type: Comment
type: QuestionComment
score: 2
has text: Make sure your if else logic is outside the document ready, since it will be executed only in document ready state but not is resize.
comment on: http://stackoverflow.com/q/28450736

http://stackoverflow.com/comment/45360361
type: AnswerComment
comment on: http://stackoverflow.com/a/28518837
score: 0
type: Comment
has text: But you have to replicate the undefined thing in every file; of which organized code should have several to differentiate functionality. Generally, I want to find null as well as undefined; it's not very frequent that the difference between the two will help any programmers at all.

http://stackoverflow.com/q/28530083
has title: Alternative to throwing/catching errors with async code?
has body: I'm used to throwing an instance of some error class and having them be caught somewhere down the line in the app, to account for user error. An example might be validating the username: function validateUsername (username) { if (!/^[a-z0-9_-]{3,15}$/.test(username)) { throw new ValidationError('Please enter 3-15 letters, digits, -, and/or _.'); } } $('#username').blur(function () { try { validateUsername($(this).val()); } catch (x) { $('&lt;p&gt;&lt;/p&gt;').addClass('error').text(x).insertAfter(this); } }); But now I'm realizing that I can't use these same practices for asynchronous calls. For example: function checkUsernameAvailability (username) { $.get('/users/' + username).done(function () { // Done = user returned; therefore, username is unavailable // But I can't catch this error without resorting to something gross // like window.onerror throw new ValidationError('The username you entered is already in use.'); }); } I could make checkUsernameAvailability accept a callback and/or return a promise and have it execute said callback with the availability of the username. $('#username').blur(function () { checkUsernameAvailability(username, function (available) { !available &amp;&amp; alert('The username you entered is already in use.'); }); }); But part of what makes exceptions so powerful is that they can bubble up the stack until they get caught, whereas if I had another function that called another function that called checkUsernameAvailability, I'd need to pass the result of this callback manually all the way until I get to the place where I want to handle it. What are some of the alternative methods for passing errors up the stack? I can think of some of these, but none of them are as clean as native exceptions: Passing a flag, or the ValidationError instance, to a callback (Node.js approach could work too, passing an error or null as the first argument, and the data as the second); but then, if I don't want to handle it at that point in the stack, I need …
tagged with: node.js
has comment: http://stackoverflow.com/comment/45375434
has comment: http://stackoverflow.com/comment/45375211
type: Question
answer count: 2
tagged with: javascript
tagged with: callback
score: 0
tagged with: exception
tagged with: asynchronous
has answer: http://stackoverflow.com/a/28530280
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28530145

http://stackoverflow.com/a/28490778
has comment: http://stackoverflow.com/comment/45302965
has comment: http://stackoverflow.com/comment/45302914
type: Answer
has body: The reason is that your code to repeat the setTimeout is outside the else clause of begintimer. So even though the countdown has reached the end, you do another setTimeout, and when it fires you're still at the end, so it starts the audio again, and this continues. Move the code to repeat the timer into the else clause: function begintimer(){ if (parselimit==1) { //ding ding ding ///////////////////////////////////ISSUE STATEMENT////// var audio = new Audio('alarmbuzzer.mp3'); audio.play(); /////////////////////////Audio Playing/////////////////// } else{ parselimit-=1; curhour=Math.floor(parselimit/3600); //alert(parselimit) /* greater than an hour divide by 60 but subtract the hours. */ if(parselimit > 3600) { //first convert hours back into seconds curmin = curhour * 3600; //subtract that from total to get minutes left. curmin = parselimit - curmin; curmin = Math.floor(curmin/60); //alert(curmin); } else { curmin = Math.floor(parselimit/60); } cursec=parselimit%60; curmin += ""; if(curmin.length == 1 || curmin==9) { curmin = "0" + curmin; } cursec += ""; //alert(cursec); if(cursec.length == 1 || cursec==9) { cursec = "0" + cursec; } curtime = curhour + ":" + curmin + ":" + cursec; //alert(document.getElementById("show_timer").innerHTML); document.getElementById("show_timer").innerHTML = curtime; st=setTimeout("begintimer()",1000); } } Here's the full code: //Javascript Countdown Timer. //set the amount of time click //start timer and the clock will //count down until it reaches zero var message = "Complete."; var parselimit = 0; var st = 0; var limit, curhour, curmin, cursec; function set_limit(strtstop) { //prevent multiple settimeouts if (st) { clearTimeout(st); } if (document.getElementById("pause").value == 1) { limit = document.getElementById("show_timer").innerHTML; } else { limit = document.getElementById("hours").value + ":" + document.getElementById("min").value + ":" + document.getElementById("sec").value; } parselimit = limit.split(":"); // take the mi…
accepted answer of: http://stackoverflow.com/q/28490532
answers question: http://stackoverflow.com/q/28490532
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/28493603
tagged with: datagrid
possible better answer: http://stackoverflow.com/a/28563379
tagged with: javascript
score: 0
answer count: 2
has body: I have a EasyUI datagrid , where I am loading data remotely. When the datagrid loads the data initially, It is has a sort order. For eg. A | B | C x | 123 | Some other text y | 657 | text text text z | 842 | text text This initial data is sorted on column A, but the datagrid is not aware of this sort order. I am creating the datagrid entirely in javascript : $('#'+elementId).datagrid({ loadMsg: 'Processing, please wait ...', singleSelect:true, pageSize:20, height:'550px', width:'100%', striped:true, fitColumns:true, rownumbers:true, onLoadSuccess:function(){ .... }, columns:getLayout() loadFilter:loadFilter, onBeforeLoad:function(param){ //Add some additional params and load data from server }, onBeforeSortColumn:function(sort,order){ ... }, onSortColumn:function(sort,order){ .... } }); How do I set the sort order on a particular column through javascript?
has title: Setting a column to show as sorted on a EasyUI Datagrid
has answer: http://stackoverflow.com/a/28686342
accepted answer: http://stackoverflow.com/a/28686342
tagged with: jquery-easyui
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28563379
type: Question

http://stackoverflow.com/q/28573938
answer count: 1
accepted answer: http://stackoverflow.com/a/28589917
tagged with: javascript
has body: I'm having a hard time understanding how different views are handled in Ionic and Angular. I have the following code: .config(function($stateProvider, $urlRouterProvider) { $stateProvider .state('index', { url: "/", templateURL: "templates/menu.html" }); }); With my understanding this should inject the code from menu.html into the ion-nav-view tags in index.html at run-time. However, when the page is loaded, it simply displays index.html with no injected code. I have been unable to find specific instructions on each property of state, making a possible error in my code hard to decipher. I also have found that state may be deprecated by the latest version of Angular, but Ionic docs explain to use state so that is what I have been trying to do. Any clarification or resources would be greatly appreciated.
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45457548
score: 0
has comment: http://stackoverflow.com/comment/45457392
type: Question
type: AnsweredQuestion
tagged with: angular-ui-router
has title: Issues traversing views in Ionic and AngularJS
has answer: http://stackoverflow.com/a/28589917
tagged with: ionic-framework

http://stackoverflow.com/comment/45392772
score: 0
type: AnswerComment
has text: Ok, thanks. Looks like a thorough manual testing is needed for this first step and hopefully can get it more automated moving forwards. I'm reading up on tools available in Webstorm now, too. Thanks again.
type: Comment
comment on: http://stackoverflow.com/a/28481961

http://stackoverflow.com/comment/45355301
score: 0
type: AnswerComment
type: Comment
has text: @Paulpro - I tried to clean up the terminology I used in my answer to address your comment.
comment on: http://stackoverflow.com/a/28518999

http://stackoverflow.com/comment/45279616
type: Comment
has text: i solved..it was this : Add i missed "contatti" before addContacts(). Thanks :)
comment on: http://stackoverflow.com/a/28478403
score: 1
type: AnswerComment

http://stackoverflow.com/q/28482148
possible better answer: http://stackoverflow.com/a/28482255
upvote count: 0
tagged with: javascript
type: AnsweredQuestion
has body: I wanted to create a javascript code library that will be eventually merged into one single minified code file. I was trying to search on how to be able to have these code files separated for development, but I could only find how to have a javascript file add a different javascript file to an existing html page. How do you separate javascript files for development only?
has comment: http://stackoverflow.com/comment/45287269
favorite count: 0
accepted answer: http://stackoverflow.com/a/28482475
type: Question
has comment: http://stackoverflow.com/comment/45287208
answer count: 2
downvote count: 2
has comment: http://stackoverflow.com/comment/45287075
has title: How do you separate javascript files for development?
score: -2
has comment: http://stackoverflow.com/comment/45286522
has comment: http://stackoverflow.com/comment/45287836
has comment: http://stackoverflow.com/comment/45286799
has comment: http://stackoverflow.com/comment/45286430
has answer: http://stackoverflow.com/a/28482255
has comment: http://stackoverflow.com/comment/45286778
has comment: http://stackoverflow.com/comment/45286417
has answer: http://stackoverflow.com/a/28482475

http://stackoverflow.com/q/28465787
has title: Getting An Error Message from Javascript to Appear Next to An HTML/JSP Input Using CSS
answer count: 1
tagged with: jsp
has comment: http://stackoverflow.com/comment/45257756
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28466639
type: Question
has comment: http://stackoverflow.com/comment/45257349
has answer: http://stackoverflow.com/a/28466639
tagged with: javascript
score: 0
has body: OK, so I have an input form very basic CRUD sort of thing. I have my validation occurring through Javascript, and when an error occurs the error message appears underneath the input field. I have the CSS up and running, and the text that was previously black is now red. I have tried floats, adjusting the margin, displaying inline, etc. but cannot find any sort of methodology. The code is on another computer, but what basically occurs is... The JS checks for a span value in the HTML if it's not there it creates it, if it creates it the error message is thrown, and it's properties are set by the CSS. Here is some of the HTML First Name: <form:input type="text" name="fName" id="fName" path="fName"/> <form:errors cssClass= "error" path="fName" /> A piece of the js if(document.getElementById('fName.errors') == null){ newSpan.id = "fname.errors"; newSpan.className = "error"; document.getElementById('fname.errorField').appendChild(newSpan); newSpan = document.createElement("span"); } function validateFName() { var alphaChar = /^[a-zA-Z]+$/; var nameFChek = document.input.fName.value; if (nameFChek == ""){ document.getElementById("fName.errors").innerHTML = "This field is blank (fname)"; return false; } and the CSS I currently have form { width: 800px;} label { float: left; width: 150px;} input[type=text] { float: left; width: 250px;} .clear { clear:both; height: 0; line-height: 0;} .floatright { float: right;}

http://stackoverflow.com/a/28589695
score: 1
upvote count: 1
downvote count: 0
has body: You probably can't do exactly what you want using Javascript, you need server-side things, PHP for instance. However, here are some helpful places to look for more info: You can run code after an iframe loads with this JQuery function: $('#myIframe').load(function(){ //your code (will be called once iframe is done loading) }); Look at this Stack Overflow question and answers about iframe loading. To target the specific element inside the function, do: $('iframe').aFunction(function() { this.doSomething(); } ); Look at this Stack Overflow question and answers about "this".
has comment: http://stackoverflow.com/comment/45486278
answers question: http://stackoverflow.com/q/28589387
has comment: http://stackoverflow.com/comment/45496068
type: Answer

http://stackoverflow.com/a/28564989
score: 3
has comment: http://stackoverflow.com/comment/47268320
has comment: http://stackoverflow.com/comment/45443627
has comment: http://stackoverflow.com/comment/45457599
accepted answer of: http://stackoverflow.com/q/28564518
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28564518
type: Answer
has body: expect() needs a function to call, not the result of the function. Change your code to: expect(function(){ fn("error"); }).to.throw(Error);
upvote count: 3
has comment: http://stackoverflow.com/comment/45440467
has comment: http://stackoverflow.com/comment/45458997

http://stackoverflow.com/q/28496891
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45313331
score: 3
answer count: 0
upvote count: 3
type: Question
has title: Drag and drop issues on IE9 and IE10
has comment: http://stackoverflow.com/comment/45314953
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/74826769
has comment: http://stackoverflow.com/comment/45315991
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I am currently trying to implement a drag and drop feature on my project. It seems to work fine on Chrome, Firefox and even IE11, but not IE9 and IE10 (which need to be supported). It seems that these two browsers doesn't update e.clientX and e.clientY when moving the mouse while dragging an object: it keeps the original click coordinates. Here is the code I am using: $("html").on("dragover", function(event) { event.preventDefault(); event.stopPropagation(); }); $("html").on("dragenter", function(event) { event.preventDefault(); event.stopPropagation(); }); $("html").on("dragleave", function(event) { event.preventDefault(); event.stopPropagation(); }); $("html").on("drop", function(event) { event.preventDefault(); event.stopPropagation(); updateXY(event); }); function updateXY(e) { e.preventDefault(); var originalEvent = e.originalEvent; var x = originalEvent.clientX; var y = originalEvent.clientY; $("#draggable").css({ top: y, left: x }); $("#x").text(x); $("#y").text(y); } * { margin: 0; padding: 0; } #draggable { border: 1px dotted gray; background: #fff; width: 200px; padding: 5px; text-align: center; position: absolute; top: 10px; left: 10px; cursor: move; } #droppable { position: relative; border: 1px solid silver; height: 300px; width: 500px; overflow: hidden; margin-bottom: 10px; } Hello world! Coordinates: 10 ; 10 And a JSFiddle is also available: http://jsfiddle.net/tq2zvg41/4/ How can I do?
has comment: http://stackoverflow.com/comment/45314802
favorite count: 0
tagged with: drag-and-drop

http://stackoverflow.com/comment/45335168
type: QuestionComment
score: 0
has text: I'm getting nothing at the moment. I'm hoping to get a single number (the sum of the 'spend' column) appear in my html.
comment on: http://stackoverflow.com/q/28504953
type: Comment

http://stackoverflow.com/comment/45445482
type: Comment
comment on: http://stackoverflow.com/q/28567563
has text: its a example to it not doing enything
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45333492
has text: Am I right to understand that exists a field `holding.id` that you want passed to `openLadders` ?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28506817

http://stackoverflow.com/a/28568542
accepted answer of: http://stackoverflow.com/q/28568346
has body: Try: drive.files.insert({ resource: { title: title, mimeType: 'text/csv', parents: [ { id: parentId } ] }, media: { mimeType: 'text/csv', body: body }, }, function(err, resp) {}); Looks like the documentation may have changed: https://github.com/google/google-api-nodejs-client/issues/96
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28568346
score: 1

http://stackoverflow.com/a/28550068
upvote count: 3
has comment: http://stackoverflow.com/comment/59208250
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28547142
has comment: http://stackoverflow.com/comment/45437211
answers question: http://stackoverflow.com/q/28547142
has body: Rony, AAD doesn't support cross origin calls on the token endpoint - so you won't be able to implement the auth code grant OAuth flow in JS (the token request using the code will fail). AAD supports the implicit grant OAuth flow for the scenario you describe (single page app calling a web api). ADAL.js implements the implicit grant flow. Please let us know if you have any issues using it. Hope that helps.
score: 3
has comment: http://stackoverflow.com/comment/45443035
type: AcceptedAnswer

http://stackoverflow.com/q/28477022
type: UnansweredQuestion
tagged with: mvvm
tagged with: css
has answer: http://stackoverflow.com/a/28477379
type: Question
tagged with: javascript
tagged with: css-animations
score: 0
has title: How to set css3 animation inline or by javascript?
answer count: 1
tagged with: keyframe
has body: I'd like to set css3 animation effect to multi element, but the animated position was related to the count of elements which is not certain. I had to set css style by js (maybe a mvvm framework). sample code: @-webkit-keyframes position { 0% {left:0} 100% {left: 5*elementCounts px;} } I found there's no way to set css property by data-*, neither to add inline css3 animation defining inline. Anybody have idea to resolve this in css or mvvm way?

http://stackoverflow.com/a/28504954
has comment: http://stackoverflow.com/comment/45331226
upvote count: 0
answers question: http://stackoverflow.com/q/28502868
type: Answer
has comment: http://stackoverflow.com/comment/45354712
has body: Thanks for the response, I have thought about this way, so actually I wouldn't need the web worker for it. So the downside of this approach is: 1) That I would have to implement the loops as recursive function calls ... And the bigger problem 2) The segment size has to be limited to one command, that this approach actually works, so I would have to wrap each command into a function that calls the next one, which would be a huge overhead... Thats why I am looking for a way around, if there is any?
downvote count: 1
score: -1

http://stackoverflow.com/a/28519236
has body: Try using window.location = "http://www.stackoverflow.com" for redirection, don't forget about using preventDefault()
type: Answer
answers question: http://stackoverflow.com/q/28519078
has comment: http://stackoverflow.com/comment/45355572
score: 0

http://stackoverflow.com/comment/45365075
score: 1
comment on: http://stackoverflow.com/q/28524494
type: Comment
type: QuestionComment
has text: Did you test this with other browsers...??

http://stackoverflow.com/q/28546712
has title: Problems using ng-class to switch a class on ng-click function
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28546776
score: 0
has answer: http://stackoverflow.com/a/28546775
accepted answer: http://stackoverflow.com/a/28546775
answer count: 3
possible better answer: http://stackoverflow.com/a/28546776
has body: Could somebody please tell me where this is going wrong? I basically have a simple check of a value - if the value is true, it should set the class to headerOn. If false, it should be headerOff. Easy. Here's the code: &lt;div ng-class="headerCheck ? 'headerOn' : 'headerOff'"&gt; And the function that I hit: $scope.headerControl = function() { $scope.headerCheck = true; console.log($scope.headerCheck); } I can confirm that the log is true. Any ideas why this isn't working for me?
tagged with: angularjs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28547742

http://stackoverflow.com/q/28537051
answer count: 3
has answer: http://stackoverflow.com/a/28713382
has body: I have my app written in node on a Debian 7 server launched with forever and working with apache proxy via a url (without port like http.//subdomain.domain.com) with this config: &lt;VirtualHost *:80&gt; ServerName subdomain.domain.com ProxyRequests off &lt;Proxy *&gt; Order deny,allow Allow from all &lt;/Proxy&gt; &lt;Location /&gt; ProxyPass http://localhost:8081/ ProxyPassReverse http://localhost:8081/ &lt;/Location&gt; &lt;/VirtualHost&gt; The app is running ok but the problem comes with socket.io, I´m getting this error: GET http://192.168.1.1:8081/socket.io/?EIO=2&amp;transport=polling&amp;t=1424074094677-75 net::ERR_CONNECTION_TIMED_OUT This is my server.js: var server = express.createServer(); server.configure(function(){ server.set('views', __dirname + '/views'); server.set('view options', { layout: false }); server.use(connect.bodyParser()); server.use(express.cookieParser()); server.use(express.session({ secret: "ezdoknahi!!"})); server.use(connect.static(__dirname + '/static')); }); server.configure('development', function(){ server.use(express.errorHandler()); }); //setup the errors server.error(function(err, req, res, next){ if (err instanceof NotFound) { res.render('404.jade', { locals: { title : '404 - Not Found' ,description: '' ,author: '' ,analyticssiteid: 'XXXXXXX' },status: 404 }); } else { res.render('500.jade', { locals: { title : 'The Server Encountered an Error' ,description: '' ,author: '' ,analyticssiteid: 'XXXXXXX' ,error: err },status: 500 }); } }); server.listen( port); //Setup Socket.IO var io = io.listen(server); io.sockets.on('connection', function(socket){ console.log('Client Connected'); socket.on('message', function(data){ // socket.broadcast.emit('server_message',data); // socket.emit('server_message',data); console.log(data); }); socket.on('disconnect', function(){ console.log('Client Disconnected.'); }); }); /////////////////////////////////////////// // Routes // And this is my client app (Angular.js): produccionApp.factory('s…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45632269
tagged with: node.js
has answer: http://stackoverflow.com/a/28708576
has answer: http://stackoverflow.com/a/28620951
tagged with: nginx
score: 1
tagged with: socket.io
type: Question
upvote count: 2
linked to: http://stackoverflow.com/q/27526281
has comment: http://stackoverflow.com/comment/45638566
tagged with: apache
downvote count: 1
has comment: http://stackoverflow.com/comment/45526013
tagged with: javascript
has title: Socket.io + Node.js + Apache
favorite count: 0
has comment: http://stackoverflow.com/comment/45489706

drupal
type: Tag
tag name: drupal
tags question: http://stackoverflow.com/q/28508955
tags question: http://stackoverflow.com/q/28482040

http://stackoverflow.com/a/28486739
upvote count: 1
downvote count: 0
score: 1
has body: Although this is probably really unhelpful, to add contrast to the jQuery answers, I made a pure JavaScript answer.... document.getElementById("test").onmouseover = function(){ this.style.opacity = "1"; if (typeof exTimeout !== "undefined") clearTimeout(exTimeout); } document.getElementById("test").onmouseleave = function(){ exTimeout = setInterval(function(){ document.getElementById("test").style.opacity = "0" }, 2000); } Live example (Side note, this only changes opacity so it still takes up physical space on the page, and it also requires CSS3 transitions to be made smooth)
has comment: http://stackoverflow.com/comment/45295426
answers question: http://stackoverflow.com/q/28486499
has comment: http://stackoverflow.com/comment/45295222
type: Answer
has comment: http://stackoverflow.com/comment/45295282

http://stackoverflow.com/comment/45491547
comment on: http://stackoverflow.com/a/28592392
type: AnswerComment
has text: `'hotels/hotelSortBy.php'` and `'/hotels/hotelSortBy.php'` are not the same thing.
score: 0
type: Comment

http://stackoverflow.com/a/28454120
has comment: http://stackoverflow.com/comment/45235390
score: 0
has body: You need to poll server multiple times or use a socket connection like socket.io. I reccomend reading this article.
has comment: http://stackoverflow.com/comment/45236067
has comment: http://stackoverflow.com/comment/45235495
has comment: http://stackoverflow.com/comment/45235554
type: Answer
has comment: http://stackoverflow.com/comment/45235773
answers question: http://stackoverflow.com/q/28454023

http://stackoverflow.com/comment/45353757
type: QuestionComment
score: 0
has text: @EvergreenTree I have seen syntastic /jshint check for missing semicolons but not the error above.
comment on: http://stackoverflow.com/q/28518042
type: Comment

http://stackoverflow.com/comment/45335990
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28508476
has text: Please add a link to your fiddle, or copy it here.

http://stackoverflow.com/a/28523109
has comment: http://stackoverflow.com/comment/45362868
accepted answer of: http://stackoverflow.com/q/28523073
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: $('.breadCrumb').on('click',function(){ $(this).off('click'); var bc = $(this).prop('id'); var id = bc.split('_'); $('#'+bc).removeClass("breadCrumb"); //$('.'+bc).show();//show spinner on specific id $.ajax({ url:'/ajax/breadcrumb/', data:{bc:id[1]} }).success(function(breadcrumb){ $('#'+bc).html(breadcrumb); //$('.spinner').hide(); }); });
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28523073

http://stackoverflow.com/a/28549886
accepted answer of: http://stackoverflow.com/q/28549819
has body: You need to remove the default class from the element within the .slideToggle() callback. Updated Example $('#accordion').find('.accordion-toggle').click(function () { $(this).next().slideToggle('fast', function () { var status = $(this).is(':hidden') ? 'open' : 'close'; $(this).removeClass('default').prev('h4').find('.accordion-status').html(status); }); }); In your CSS, you had the following: .accordion-content.default { display: block !important; } Which was preventing the content from being toggled. You could also just remove !important, and it will work as expected too. You should avoid using it as much as possible.
score: 2
answers question: http://stackoverflow.com/q/28549819
upvote count: 3
downvote count: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/28528780
tagged with: scala
has body: Is there any idiomatic javascript solution for this one: var addTuple = function(map,tuple) { map[tuple[0]] = tuple[1]; return map} I need it to rewrite this example (see finance3.js) in more functional style: angular.module('finance3', []) .factory('currencyConverter', ['$http', function($http) { var rates = {}; //should be future (or some other monad) mapped from $http.sucess, but it's hard to do with Js var processRate = function(rate) { return [rate.id.substring(3,6), window.parseFloat(rate.Rate)]; }; var addTuple = function(map,tuple) { map[tuple[0]] = tuple[1]; return map}; $http.jsonp(url).success(function(data) { rates = data.query.results.rate.map(processRate).reduce(addTuple, {}); }); return rates }]); So, .reduce(addTuple, {}) is like toMap here. P.S. By the way KnockoutJs provides at least more reactive (but still non-pure functional) way to update the model.
type: Question
has answer: http://stackoverflow.com/a/28529634
has comment: http://stackoverflow.com/comment/45372972
tagged with: javascript
score: 0
has title: Scala's `toMap` in Javascript
answer count: 1
accepted answer: http://stackoverflow.com/a/28529634
tagged with: angularjs
type: AnsweredQuestion

http://stackoverflow.com/comment/47469124
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29664018
has text: Otherwise, you could try using Promises (like jQuery's) to download the Analytics library (`$.getScript()`) and cancelling it from the `print` function if it has not already been resolved.

http://stackoverflow.com/comment/45412426
comment on: http://stackoverflow.com/q/28549622
type: Comment
type: QuestionComment
has text: On the plugin page, example barcodes actually have sources : http://lindell.me/JsBarcode/ It's a base64 image, directly hardcoded into the image source. You can very well save/print base64 images.
score: 0

http://stackoverflow.com/comment/45359747
type: Comment
comment on: http://stackoverflow.com/q/28521397
has text: There is no element in your html code with class `.btnShowInvoiceItems` that triggers the click event.
score: 0
type: QuestionComment

http://stackoverflow.com/a/28600554
has comment: http://stackoverflow.com/comment/45528576
has comment: http://stackoverflow.com/comment/45545097
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/109107903
has comment: http://stackoverflow.com/comment/45521656
has body: Use stroke CSS property on element &lt;path&gt; to get a thicker border, this is a SVG HTML5 feature. In your .css file add this: path { stroke: #555; } To display india only, you need to set the scale property to what best fit your HTML5 canavas. Checkout the framework API you use and figure out how to manage scale.
type: Answer
has comment: http://stackoverflow.com/comment/45558985
has comment: http://stackoverflow.com/comment/45523076
upvote count: 6
has comment: http://stackoverflow.com/comment/45525367
accepted answer of: http://stackoverflow.com/q/28506718
has comment: http://stackoverflow.com/comment/45545046
score: 6
answers question: http://stackoverflow.com/q/28506718

http://stackoverflow.com/comment/45434775
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28538934
has text: I didn't know that. And the icon, the oldest strikes (time is seen in the json file) a different color than newer strikes.
type: Comment

http://stackoverflow.com/comment/45321608
comment on: http://stackoverflow.com/a/28501192
score: 0
type: Comment
has text: can you explain to OP why you have to convert the string to an integer, and why you append the "px"? Might help him.
type: AnswerComment

listener
tags question: http://stackoverflow.com/q/28474774
tags question: http://stackoverflow.com/q/28469484
type: Tag
tag name: listener

http://stackoverflow.com/a/28477392
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28477154
type: Answer
downvote count: 0
has body: In the handler, this will be the clicked element, so you could just use this: $( "#home" ).click(function() { $("#wrapper #content .plates").children(":not('#"+this.id+" div, .nav')" ).fadeOut(700); });

http://stackoverflow.com/comment/45341962
has text: This seems like a very strange thing to do. You should generally try to do as much as possible with static HTML, and only use Javascript for the parts that need to be generated dynamically, like tables based on runtime data.
comment on: http://stackoverflow.com/q/28511627
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/28538231
score: 0
has comment: http://stackoverflow.com/comment/45390550
has comment: http://stackoverflow.com/comment/45394535
has body: Yeah, that looks more for a lack of feature in AngularJS filter than a problem in Videogular. We're using the AngularJS date filter that as you can see in the AngularJS docs only supports the browser timezone or UTC. https://docs.angularjs.org/api/ng/filter/date If you want to show hours I recommend you to create your own filter to show hours and use that instead of date:'mm:ss'. As it looks like a good feature for Videogular I will try to take a look to the AngularJS code and add complete timezone support.
type: Answer
has comment: http://stackoverflow.com/comment/45443189
has comment: http://stackoverflow.com/comment/45407206
answers question: http://stackoverflow.com/q/28501672
has comment: http://stackoverflow.com/comment/45444489
has comment: http://stackoverflow.com/comment/45398208

http://stackoverflow.com/a/28488576
has comment: http://stackoverflow.com/comment/79085597
downvote count: 0
answers question: http://stackoverflow.com/q/28487044
has body: There is no rule about your ajax routes having to return JSON, you can return HTML exactly like you do for your regular routes. @app.route('/getColors') def add_colors(): user = request.args.get("handle", 0, type = str) return render_template('colors.html', avatar_url=process_data(data)) Your colors.html file does not need to be a complete HTML page, it can be the snippet of HTML that you want the client to append. So then all the client needs to do is append the body of the ajax response to the appropriate element in the DOM.
score: 10
accepted answer of: http://stackoverflow.com/q/28487044
has comment: http://stackoverflow.com/comment/57125268
type: AcceptedAnswer
upvote count: 10
type: Answer

http://stackoverflow.com/comment/45352368
type: Comment
comment on: http://stackoverflow.com/a/28516245
type: AnswerComment
score: 0
has text: That's what I did in the first place, and it also reflects in AdfTranslations js file, but the popup still displays the orginal text. :|

http://stackoverflow.com/comment/45716032
score: 0
type: AnswerComment
type: Comment
has text: Is it possible to get an element by substring? Like if an element has text 'I am here'. I want to match only 'here' substring. Something like: by.xpath('span[@id="ID" and .*="here"]')@alecxe: Is it possible to get an element by substring?
comment on: http://stackoverflow.com/a/28545758

http://stackoverflow.com/comment/45481524
comment on: http://stackoverflow.com/q/28587167
score: 0
has text: `stock` is built from `seOutput`, and the `for` loop works, it just doesn't populates with bogus data because I'm not referencing `seOutput` correctly.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28506588
has comment: http://stackoverflow.com/comment/45332590
has answer: http://stackoverflow.com/a/28507101
type: Question
downvote count: 4
upvote count: 0
answer count: 1
tagged with: javascript
has title: How to select random song to play (from the list) on a HTML5 site using JavaScript?
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28507101
has comment: http://stackoverflow.com/comment/45332924
has comment: http://stackoverflow.com/comment/45332405
favorite count: 0
has comment: http://stackoverflow.com/comment/45332318
has body: My question is really easy, i am just a newbie in JavaScript and i need your help. I want to create a site that will select random song, title of it and also its album from a list of sources. I want it to look something like this: Title: (song 1 title here) Album: (album of song 1 here) (mp3 player here that uses the source of song 1) I have HTML code for my player here: Your outdated browser does not support HTML5. Get Mozilla Firefox >HERE< No idea what to do next... Could you guys help? I would really appreciate explaining to me everything you do :) (Sorry for my bad english)
score: -4
has comment: http://stackoverflow.com/comment/45332757
type: AnsweredQuestion

http://stackoverflow.com/comment/45309319
comment on: http://stackoverflow.com/a/28493556
type: Comment
has text: @TamilVendhanKanagaraju `+2` will be automatically become `2`. You will not write `+1 + 2` while calculating. you will just write `1 + 2`.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45346270
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28514113
has text: @void in the label needs to set the first phrase separated with "," but this program is setting the second label with undefined... and that is not the second phrase... label 1 hola, como, estas.... label 2, undefined... even when the prase [1] being something else

http://stackoverflow.com/q/28450297
answer count: 1
has title: I can't find an elegant way to add a Database Source to a dgrid
has comment: http://stackoverflow.com/comment/45230633
tagged with: dojo
type: AnsweredQuestion
tagged with: dgrid
has comment: http://stackoverflow.com/comment/45231394
has comment: http://stackoverflow.com/comment/45236797
has answer: http://stackoverflow.com/a/28456100
has comment: http://stackoverflow.com/comment/45228798
tagged with: grid
type: Question
has comment: http://stackoverflow.com/comment/45228894
tagged with: javascript
has comment: http://stackoverflow.com/comment/45229196
score: 0
accepted answer: http://stackoverflow.com/a/28456100
has comment: http://stackoverflow.com/comment/45228675
has body: For now I have require([ "dojo/on", "dgrid/OnDemandGrid","dgrid/Tree","dgrid/Editor", "dgrid/Keyboard", "dojo/_base/declare", "dgrid/data/createHierarchicalStore", "data/projects_data", "dojo/domReady!" ], function( on, Grid, Tree, Editor, Keyboard, declare, createHierarchicalStore, hierarchicalCountryData ){ var count = 0; // for incrementing edits from button under 1st grid function nbspFormatter(value){ // returns "&amp;nbsp;" for blank content, to prevent cell collapsing return value === undefined || value === "" ? "&amp;nbsp;" : value; } var StandardGrid = declare([Grid, Keyboard, Editor, Tree]); window.grid = new StandardGrid({ collection: createHierarchicalStore({ data: hierarchicalCountryData }, true), columns: [ {renderExpando: true, label: "Name", field:"variant_name", sortable: false, editor: "text", editOn: "dblclick"}, {label: "Visited", field: "bool", sortable: false, editor: "checkbox"}, {label:"Project", field:"project", sortable: false, editor: "text", editOn: "dblclick"}, {label:"locked", field:"locked", editor: "text", editOn: "dblclick"}, {label:"modified", field:"modified", editor: "text", editOn: "dblclick"}, {label:"summary", field:"summary", editor: "text", editOn: "dblclick"} ] }, "treeGrid2"); grid.on("dgrid-datachange", function(evt){ console.log("data changed: ", evt.oldValue, " -&gt; ", evt.value); console.log("cell: ", evt.cell.row.id, evt.cell.column.field); }); grid.on("dgrid-editor-show", function(evt){ console.log("show editOn editor: ", evt); }); grid.on("dgrid-editor-hide", function(evt){ console.log("hide editOn editor: ", evt); }); }); data/projects is a js file containing the data. but how to connect this dGrid now to a MySQL database? Can't find any good information in the docs. I think might be something with JSON rest but not sure about this. Addition: I can show the db in an HTML Table. is there a suitable possibilty to populate dGrid from a HTML Table? I am still missing something. Have connections from Database -> PHP but…

http://stackoverflow.com/a/28583599
downvote count: 0
score: 1
has body: Lets start off with what the problem actually is; you are using this code in both surfacefunc and materialfunc document.getElementsByTagName("option").... That method will get all the option elements in the entire page, of which there are 7 in total (2 surfaces, and 5 materials). When you change the selected index of each of your dropdowns, you retrieve the selectedIndex of that dropdown, but then use that index in the entire list of all options to find a value - this is never going to work. What you need to do is be more specific about which options you want, you can do that by issuing the call to getElementsByTagName against the actual select element, rather than the whole document, or just use .options[index] to access a select elements options. function materialfunc() { var material_price=0; var elem = document.getElementById("CurrentSurfaceMaterial"); material_price = elem.options[elem.selectedIndex].value; return material_price; } And for that matter, you may as well just shorten it altogether function materialfunc() { return document.getElementById("CurrentSurfaceMaterial").value; } As it does exactly the same thing. Another problem, is that for the text fields you're only recalculating the total onclick, which means only when first entering the field (assuming that is done by clicking on it and not, for example, tabbing to it). You may consider using onchange or onblur in addition.
answers question: http://stackoverflow.com/q/28582958
upvote count: 1
type: Answer

http://stackoverflow.com/q/28566884
type: Question
has title: Not able to read from JSON object after a certain level
tagged with: http://stackoverflow.com/tag/json
has body: Here is my problem - $comment = stdClass Object ( [kind] =&gt; Listing [data] =&gt; stdClass Object ( [modhash] =&gt; [children] =&gt; Array ( [0] =&gt; stdClass Object ( [kind] =&gt; t1 [data] =&gt; stdClass Object ( [subreddit_id] =&gt; t5_2qh16 [banned_by] =&gt; [link_id] =&gt; t3_2qgate [likes] =&gt; [replies] =&gt; stdClass Object ( [kind] =&gt; Listing [data] =&gt; stdClass Object ( [modhash] =&gt; [children] =&gt; Array ( [0] =&gt; stdClass Object ( . . . ) [1] =&gt; stdClass Object ( [kind] =&gt; t1 [data] =&gt; stdClass Object . . . I'm reading the $comment->data->children array and I'm able to read till $comment->data->children[0]->data->replies perfectly . But while I'm trying this $comment->data->children[0]->data->replies->data->children , getting error as trying to get non-object property 'data' . Any help ? What I'm doing wrong ? BTW , I've tried by converting the JSON to array also , got the error exact in same place .
has comment: http://stackoverflow.com/comment/45445175
has comment: http://stackoverflow.com/comment/45444718
has comment: http://stackoverflow.com/comment/45444333
tagged with: javascript
tagged with: ajax
has comment: http://stackoverflow.com/comment/45444177
answer count: 0
score: 0
type: UnansweredQuestion
tagged with: php

http://stackoverflow.com/comment/45450697
comment on: http://stackoverflow.com/a/28567887
type: Comment
has text: That did it, thank you so much for your attention to my question and being so responsive and helpful! :D
score: 1
type: AnswerComment

http://stackoverflow.com/a/28739947
score: 0
type: AcceptedAnswer
has body: What was happening was that the model on the backend had it's properties starting with an uppercase letter and since Ember is used by conventions it wasn't connecting properly between the backend model and the frontend model. Changing the backend properties to camelCase solved the problem. Moral of the story, always use camelCase when working with Ember.
type: Answer
answers question: http://stackoverflow.com/q/28474387
accepted answer of: http://stackoverflow.com/q/28474387

http://stackoverflow.com/q/28485160
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28485240
has body: I have a table that displays info on certain components and at the right side of the table, I have a delete button. As of now, I have it so when clicking on a component's row it brings you to a new page. Since my delete button is also on that row, it brings me to that page when clicked instead of deleting the component. Is there a way to make only the button event fire when clicked instead of the table's row event? Here's what my HTML looks like: {{#components}} {{general_name}} {{type}} {{/components}} And here's the javascript events I have that should route the clicks to the right spot: 'click #remove' : 'deleteComponent', 'click .component': 'openComponent', I have tried using jQuery's removeClass("component") on my button but that doesn't seem to work. Any ideas?
tagged with: javascript
type: Question
score: 0
has answer: http://stackoverflow.com/a/28485260
answer count: 2
accepted answer: http://stackoverflow.com/a/28485260
tagged with: jquery
has comment: http://stackoverflow.com/comment/45292267
possible better answer: http://stackoverflow.com/a/28485240
tagged with: http://stackoverflow.com/tag/html
tagged with: mustache
has comment: http://stackoverflow.com/comment/45292294
has title: Button in table fires both button and table event when clicked

http://stackoverflow.com/comment/45485700
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28587664
has text: @azangru, yes, this is "by design". `ng-change` was meant to update the controller of the change. The controller doesn't need an additional trigger if it itself changes the model values.

http://stackoverflow.com/comment/45483054
score: 0
type: AnswerComment
type: Comment
has text: how silly of me... yeah, doing json for both solved it. Thanks @farincz
comment on: http://stackoverflow.com/a/28587301

http://stackoverflow.com/a/28471504
type: Answer
answers question: http://stackoverflow.com/q/28471269
score: 0
has body: HTML Replicated Code &lt;form action="update.php" ng-controller="EditController" method="post" id="UpdateForm"&gt; &lt;input type="text" value="{{title}}"&gt; &lt;textarea&gt;{{notes}}&lt;/textarea&gt; &lt;input type="submit" value="Submit"&gt; &lt;/form&gt; Javascript Code var notesId = $routeParams.notesId; $scope.editNotes = function() { $http.post('www/edit.php', notesId) .success(function(data) { $scope.allNotes = data; //here i updated value $scope.notes = $scope.allNotes[0].text_notes; $scope.title = $scope.allNotes[0].notes_title; }); }; $scope.editNotes(); The values of $scope.notes &amp; $scope.title is what I want to display in the Form field values, because I'm updating some stuff &amp; I don't want my users to start from scratch.

http://stackoverflow.com/comment/45328997
comment on: http://stackoverflow.com/a/28503450
score: 0
type: Comment
has text: that is my last question.. hehe :) i've been trying to add the values of all drop box but it has no return value
type: AnswerComment

http://stackoverflow.com/a/28468398
score: 0
answers question: http://stackoverflow.com/q/28468323
type: Answer
has body: ng-checked does not update the value bound in ng-model. It only affects the presence of the checked attribute on the element itself. Your best bet is to use ng-change to execute some function and update all your models accordingly. &lt;input type="checkbox" ng-model="everyoneCheck" ng-change="toggleCheckAll()"/&gt; And in your controller, you can have toggleCheckAll() loop over your models and set them based on the value of everyoneCheck

http://stackoverflow.com/comment/45234695
type: Comment
comment on: http://stackoverflow.com/a/28453744
type: AnswerComment
score: 0
has text: error again, SyntaxError: unterminated string literal $('body').append(' function PreviewImage2() {

http://stackoverflow.com/comment/45234771
type: Comment
type: QuestionComment
has text: You forget to wrap your `div` in quotes: `createElement('div')`
comment on: http://stackoverflow.com/q/28453903
score: 0

http://stackoverflow.com/a/31705715
type: Answer
score: 2
downvote count: 0
has body: You probably want to look into something like Redux as your "flux" framework. It's absolutely excellent — we use it at Docker. Here's why it's good and how it can help you. Why use redux? It uses a single store model. All stores save state within Redux itself in their own key. An example of the state Redux saves is: { vendors: [{...}, ...], // The "vendor" store updates this part of the state inventory: [...] // the "inventory" store updates this part of the state } And Redux, or a redux provider, is the parent of all components. Therefore all components receive the state as props. How does a single store model improve things? Each individual "store" which responds to actions within Redux updates only one part of the state object. For example, the "vendor" store only updates the "vendor" key of the state. The individual store is given the current state each time an action happens. This makes stores entirely pure. This is great for testing, immutable data, hot-reloading, rewinds etc. Because your single top-level Redux store saves all state, each component can receive this state as props and automatically re-render whenever this state changes — even from unrelated components out of hierarchy. Here's an example of a single store in action, so you can get the idea: import assign from 'object-assign'; import consts, { metrics, loading, URLS } from 'consts'; const actions = { // As you can see, each action within a store accepts the current "state" // and can modify that state by returning new data. [metrics.FETCH_METRICS_PENDING]: (state, data) =&gt; { return assign({}, state, {status: loading.PENDING}); }, [metrics.FETCH_METRICS_SUCCESS]: (state, data) =&gt; { return assign({}, state, {status: loading.SUCCESS, metrics: data.payload}); }, [metrics.FETCH_METRICS_FAILURE]: (state, data) =&gt; { return assign({}, state, {status: loading.FAILURE}); }, [metrics.OBSERVE_METRICS_DATA]: (state, data) =&gt; { let metrics = state.metrics.slice().concat(data.payload); return assig…
answers question: http://stackoverflow.com/q/28554004
upvote count: 2

http://stackoverflow.com/q/28566786
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45443819
tagged with: javascript
tagged with: jquery
score: 4
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28568680
favorite count: 0
has comment: http://stackoverflow.com/comment/45444093
has title: How to remove preventDefault behaviour of Bootstrap dropdown
has comment: http://stackoverflow.com/comment/45443791
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
has comment: http://stackoverflow.com/comment/45443931
type: Question
upvote count: 4
has body: I'm using Bootstrap 3 dropdown menu in my markup. But other than the default behaviour, it should pop out if I'm hovering the elements. So I created a small script: jQ('.dropdown').hover(function() { jQ(this).find('.dropdown-menu').stop(true, true).delay(50).fadeIn(); }, function() { jQ(this).find('.dropdown-menu').stop(true, true).delay(50).fadeOut(); }); which is working fine. But for some reason the Bootstrap dropdown prevents redirecting to another page when I want to have the first item (which triggers the hover) as a link. I'm clicking on the link and nothing happens, it only appends a class .open. I only can open the link if I do a right click and select open destination in new tab. How can I fix this? Thanks
has answer: http://stackoverflow.com/a/28568680
has comment: http://stackoverflow.com/comment/45443988

http://stackoverflow.com/comment/45457027
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28572208
has text: Your `chainPromise` method should work, I wonder why you don't use it for your `a`,`b`,`c` methods in your example?

http://stackoverflow.com/comment/45390631
score: 0
type: QuestionComment
type: Comment
has text: Access-Control-Allow-Headers: origin,accept,content-type,content-length,uid,pwd,deviceid,devicetype,push,token,hash,id
comment on: http://stackoverflow.com/q/28538199

http://stackoverflow.com/comment/45326956
type: AnswerComment
has text: You can ask another question, providing it isn't going to expand your original question too much.
comment on: http://stackoverflow.com/a/28503450
score: 0
type: Comment

http://stackoverflow.com/a/28510672
has body: This line Home Can be changed to this: Home You don't need to use a function on your controller to set the url, although you can navigate this way - sometimes you want to redirect the user programatically and this works for those cases. Also, leaving href="#" in that line is causing you a problem. In a non-angular page # is used as a href placeholder but on an Angular href="#" is actually going to be picked up by $routeProvider which will try to change the contents of the ng-view container. What loads will depend upon how you set up your .config section, but is generally not desirable behavior. As you create more pages, add paths to your .config section and you can link to them from your html the same way as I did above with the /instructions path. Here's an example: angular.module('DataEntry', ['ngRoute']) .config(function ( $routeProvider ) { $routeProvider .when('instructions', { templateUrl: 'views/instructions.html', controller: 'MainCtrl' }) .when('faq', { templateUrl: 'views/faq.html', controller: 'FaqCtrl' }) .when('example', { templateUrl: 'views/example.html', controller: 'ExampleCtrl' }) }); and in your markup: Home FAQ Example
has comment: http://stackoverflow.com/comment/45340571
accepted answer of: http://stackoverflow.com/q/28510567
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28510567
type: Answer
has comment: http://stackoverflow.com/comment/45340456
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/45340422

http://stackoverflow.com/a/28567644
answers question: http://stackoverflow.com/q/28567549
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28567549
has body: You put return statement inside if clause like so: row = this.props.cells.map(function(cell, i) { if(cell.URL != null && cell.URL.length > 0){ return {cell.Text} ; } else { return {cell.Text} ; } }.bind(this));
has comment: http://stackoverflow.com/comment/78300547
upvote count: 51
type: AcceptedAnswer
score: 51
has comment: http://stackoverflow.com/comment/64257066
type: Answer
has comment: http://stackoverflow.com/comment/64242359
has comment: http://stackoverflow.com/comment/75786957

http://stackoverflow.com/a/28585991
answers question: http://stackoverflow.com/q/28582943
type: Answer
score: 1
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45488719
has body: after more research: According to this link : https://code.google.com/p/gmaps-api-issues/wiki/JavascriptMapsAPIv3Changelog, all calls to 3.17 will serve 3.18. excerpt below: 3.20 17 February 2015 The current JavaScript Maps API v3 experimental version (3.19) will become the release version. Version 3.17 will be removed. Requests for 3.17 or any prior version will now be served version 3.18. Versioning documentation is available at: https://developers.google.com/maps/documentation/javascript/basics#Versioning Available versions after rollover: Experimental: 3.20 Release: 3.19 Frozen: 3.18

http://stackoverflow.com/a/28473753
score: 8
has comment: http://stackoverflow.com/comment/54086445
has body: For positive integer less or equal to 1024: "type": "integer", "minimum": 0, "maximum": 1024 For string to be not empty and not longer than 64 symbols: "type": "string", "pattern": "^.{1,64}$" There are good explanations of all the guards at official site.
answers question: http://stackoverflow.com/q/28472980
downvote count: 0
upvote count: 8
type: Answer

http://stackoverflow.com/q/28520114
tagged with: php
has comment: http://stackoverflow.com/comment/45357099
downvote count: 2
tagged with: wordpress
upvote count: 1
has answer: http://stackoverflow.com/a/28520491
type: AnsweredQuestion
score: -1
type: Question
answer count: 1
accepted answer: http://stackoverflow.com/a/28520491
tagged with: javascript
tagged with: jquery
has title: implode breaks Ajax call
favorite count: 0
tagged with: ajax
has body: So I'm making an Ajax call which will first check to see if that post ID has already been voted on. Currently I'm just working on the PHP to first get the post id's, if it is empty set it or if it is not empty to append the ID. Question here: Except when I use the implode or explode method it does not seem to make a call back to the javascript. Although if I was to refresh the page it does register the vote. This is the PHP file. For user Id I've just set it to my admin id to start with. function my_user_vote() { $user_id = 1; $pageVoted = $_REQUEST["post_id"]; $currentPosts = get_user_meta($user_id, 'pages_voted_on'); if (empty($currentPosts)) { // Empty create single array $postsVotedOn[] = $pageVoted; } else { $postsVotedOn = explode('|', $currentPosts); $postsVotedOn[] = $pageVoted; } $boo = implode("|", $pageVoted); update_user_meta( $user_id, 'pages_voted_on', $boo); if ( !wp_verify_nonce( $_REQUEST['nonce'], "my_user_vote_nonce")) { exit("No naughty business please"); } $vote_count = get_post_meta($_REQUEST["post_id"], "votes", true); $vote_count = ($vote_count == '') ? 0 : $vote_count; $new_vote_count = $vote_count + 1; $vote = update_post_meta($_REQUEST["post_id"], "votes", $new_vote_count); if($vote === false) { $result['type'] = "error"; $result['vote_count'] = $vote_count; } else { $result['type'] = "success"; $result['vote_count'] = $new_vote_count; } if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { $result = json_encode($result); echo $result; } else { header("Location: ".$_SERVER["HTTP_REFERER"]); } die(); } This is the javascript. jQuery(document).ready( function() { jQuery(".user_vote").click( function() { post_id = jQuery(this).attr("data-post_id") nonce = jQuery(this).attr("data-nonce") jQuery.ajax({ type : "post", dataType : "json", url : myAjax.ajaxurl, data : {action: "my_user_vote", post_id : post_id, nonce: nonce}, success: function(response) { if(response.type == "success") …

http://stackoverflow.com/comment/45352728
type: QuestionComment
has text: Where's the `validar()` function?
score: 1
comment on: http://stackoverflow.com/q/28517771
type: Comment

http://stackoverflow.com/comment/45210318
comment on: http://stackoverflow.com/a/28440276
score: 0
type: AnswerComment
type: Comment
has text: Yes. I did tried above approach. But I am using panel instead of a div. And it's visibility is not working.

http://stackoverflow.com/a/28501784
upvote count: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28500999
type: Answer
has comment: http://stackoverflow.com/comment/45325132
has comment: http://stackoverflow.com/comment/45323373
accepted answer of: http://stackoverflow.com/q/28500999
downvote count: 1
has body: Hi Hope it will solve your problem, there was some error while attaching and removing the click event jsfiddle.net/u1dv83a1/3/ In this i have used the same code what you have used, but just changed the backButton pressed function in that
has comment: http://stackoverflow.com/comment/45322760
has comment: http://stackoverflow.com/comment/45322902
score: -1

http://stackoverflow.com/comment/45426738
type: Comment
has text: did you replace the getElementById("myBtn") with getElementById("<%= yourTextbox.ClientID %>")? I forgot to replace it in the example.
comment on: http://stackoverflow.com/a/28557309
score: 0
type: AnswerComment

http://stackoverflow.com/q/28501725
has comment: http://stackoverflow.com/comment/45329419
answer count: 1
tagged with: jquery
tagged with: asp.net
type: Question
has answer: http://stackoverflow.com/a/28505245
has body: I have an asp.net application. Previously the application was using jquery-1.7.2.min.js version. But I had to upgrade it to jquery-2.1.3.min.js in order to make kendo charts work. But now, a textbox with fieldType 'date' stopped popping up calendar with the new version. Here is my textbox, &lt;asp:TextBox ID="txtDateFrom" fieldtype='date' CssClass="selectstyle" Width="150px" runat="server" MaxLength="10"&gt;&lt;/asp:TextBox&gt; $(function () { $('input[fieldtype="date"]').datepicker({ firstDay: 1 , changeMonth: true , changeYear: true }); }); Now the problem is, if I keep the old version of jQuery, kendo charts do not work and if I keep the new version of jQuery, above JavaScript fails. Is there any way, I can update jquery-2.1.3.min.js to consider the above script for fieldtype?
has comment: http://stackoverflow.com/comment/45328196
score: 0
has comment: http://stackoverflow.com/comment/45322684
has title: jquery.min.js version conflict not working in asp.net website
tagged with: c#
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/45255904
comment on: http://stackoverflow.com/a/28464921
type: AnswerComment
score: 1
has text: LcSalazar is correct as to what the problem is. Also, the error message is a bit confusing. You have to interpret it as "this exception happened somewhere in the call stack below this call." That is, the illegal invocation happened at some point while executing `getRequest()`.
type: Comment

http://stackoverflow.com/comment/45321719
has text: Please disregard the jsbin link above as it is not working. Consider the jsfiddle: http://jsfiddle.net/yr1zyfL1/
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28489134

http://stackoverflow.com/a/28548649
has body: Within the map's callback function you need to return the transformed value (mapped): obj = [{ text: 'a'},{ text: 'b'}]; obj.map(function(item){ return Ext.merge({xtype: 'button'}, item); }); Following is what I tried at my end with node and it works: function merge_options(obj1,obj2){ var obj3 = {}; for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; } for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; } return obj3; } button = { xtype: 'button'}; obj = [{ text: 'a'},{ text: 'b'}]; btnsDest = obj.map(function(item){ return merge_options(button, item); }); console.log(JSON.stringify(btnsDest)); Output is: [{"xtype":"button","text":"a"},{"xtype":"button","text":"b"}]
has comment: http://stackoverflow.com/comment/45410977
answers question: http://stackoverflow.com/q/28548579
has comment: http://stackoverflow.com/comment/45422676
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28548579

http://stackoverflow.com/comment/46015602
score: 0
type: AnswerComment
has text: I know that, put an example with clone (true) and one with clone (). As I said above, when use clone () https://jsfiddle.net/3o38nbzs/4/ the drag works when using clone (true) https://jsfiddle.net/L5mg87jm/ the drag does not work. thx
type: Comment
comment on: http://stackoverflow.com/a/28871826

http://stackoverflow.com/comment/45387394
comment on: http://stackoverflow.com/a/28536415
type: AnswerComment
score: 0
type: Comment
has text: can you show me your html code of this element? seems this is caused by mixing usage of `'` and `"`

http://stackoverflow.com/comment/45476729
comment on: http://stackoverflow.com/a/28581984
score: 0
type: AnswerComment
type: Comment
has text: Thanks, I had not considered this type of approach. It'll certainly work, and as you point out it offers full control to customize the output e.g. to include a minimum number of decimals. However, as I posted in my own answer below, AngularJS already supports what I want by simply omitting the "number" ng-filter altogether.

http://stackoverflow.com/comment/45222149
type: Comment
has text: Oh, you also need the [] in angular.module('loanstreetIpadAppApp',[])
comment on: http://stackoverflow.com/a/28446500
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45337360
type: Comment
comment on: http://stackoverflow.com/a/28467324
has text: nevermind I figured it out! Used onclick javascript :)
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45421641
score: 0
comment on: http://stackoverflow.com/q/28554349
has text: I tried that @zazu but it only moved the contents to the left.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28580785
tagged with: getimagedata
type: UnansweredQuestion
score: 1
upvote count: 1
tagged with: putimagedata
type: Question
has body: I've been trying for days to reproduce an image just using the Canvas API with getImageData and putImageData, following some tutorials I've found around on the web. It's simple to do with squares or whatever other forms drawn from the Canvas, but it seems to be harder with an external picture. You can see how I tried, if you got a solution, I'd be happy to read it. I tried to read the image placed on the left side of the canvas and then reproduce it on the right side of the same canvas. var c = document.getElementById("canvas"), ctx = c.getContext('2d'); img = new Image(), img.src = "http://nagisalloum.com/wp-content/uploads/2012/01/white-duck-water2.jpeg"; img.onload = function(){ ctx.drawImage(img, 0, 0, 400, 300); } //read the width and height of the canvas var width = c.width, height = c.height, w2 = width / 2, imgData = ctx.getImageData(0, 0, 400, 300); function drawing(){ var index= (height * w2) * 4; for(index= 0; index&lt;=imgData.data.length; index+=4){ red = imgData.data[index]; green = imgData.data[index+1]; blue = imgData.data[index+2]; alpha = imgData.data[index+3]; } ctx.putImageData(imgData, w2, 300); } drawing(); Here is a fiddle : http://jsfiddle.net/6g82o9Lk/ Thank you for your help!
tagged with: javascript
tagged with: image
has title: HTML5 Canvas : Reproduce a picture with getImageData and putImageData
linked to: http://stackoverflow.com/q/22097747
tagged with: canvas
has answer: http://stackoverflow.com/a/28581131
downvote count: 0
answer count: 1
favorite count: 0

http://stackoverflow.com/a/28440020
has comment: http://stackoverflow.com/comment/45209839
has comment: http://stackoverflow.com/comment/45210280
has comment: http://stackoverflow.com/comment/45212002
upvote count: 2
has body: You can do the following: var now = new Date().getHours(); if (now &gt; 7 &amp;&amp; now &lt; 19) { document.getElementById('dayShift').checked = true; } else { document.getElementById('eveningShift').checked = true; } PS: You really should change the invalid duplicate IDs. And the required attribute should not be duplicated either.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28439926
type: Answer
accepted answer of: http://stackoverflow.com/q/28439926
has comment: http://stackoverflow.com/comment/45209881
has comment: http://stackoverflow.com/comment/45210059
score: 2
has comment: http://stackoverflow.com/comment/45210631
downvote count: 0

http://stackoverflow.com/comment/45447715
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28539975
has text: @Lucas_T did the server's image hint help you to make it work?

http://stackoverflow.com/comment/45375881
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28530415
has text: What do you mean by `This is removing any previous loaded video but the URL variable is what it will be found in the current clicked item while I want to restore the original.`?
type: QuestionComment

buttonclick
type: Tag
tags question: http://stackoverflow.com/q/28579200
tag name: buttonclick
tags question: http://stackoverflow.com/q/28588332
tags question: http://stackoverflow.com/q/28559585

http://stackoverflow.com/comment/45369879
comment on: http://stackoverflow.com/q/28527149
score: 0
type: QuestionComment
has text: It start very late and I see the website data, then it redirect
type: Comment

http://stackoverflow.com/comment/45344330
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28512968
has text: Thanks. I throught this was built-in in the jquery.

http://stackoverflow.com/comment/45442650
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28566186
has text: What does `setStep()` do ?
score: 0

http://stackoverflow.com/a/28454012
has body: $('body').append('&lt;script&gt;'+function PreviewImage2() { var oFReader = new FileReader(); oFReader.readAsDataURL(document.getElementById("uploadImage2").files[0]); oFReader.onload = function (oFREvent) { document.getElementById("uploadPreview2").src = oFREvent.target.result; }; }+'&lt;/script&gt;'); In your case try remove the ";" before the close script tag. But, more correct variant is: var script = document.createElement('script'); script.textContent = 'function PreviewImage2() {' + 'var oFReader = new FileReader();' + 'oFReader.readAsDataURL(document.getElementById("uploadImage2").files[0]);' + 'oFReader.onload = function (oFREvent) {' + 'document.getElementById("uploadPreview2").src = oFREvent.target.result;' + '}' + '}'; document.body.appendChild(script);
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28453706
answers question: http://stackoverflow.com/q/28453706
score: 1
upvote count: 1

http://stackoverflow.com/q/28479428
downvote count: 1
accepted answer: http://stackoverflow.com/a/28479575
tagged with: javascript
tagged with: prototype
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/28479565
favorite count: 0
has title: Javascript method chaining definition
type: Question
has answer: http://stackoverflow.com/a/28479575
has body: What is the difference between when using method chaining in Javascript I know that this can have some strange quirks so I am unsure: var Kitten = function() { this.name = 'Garfield'; this.color = 'brown'; this.gender = 'male'; }; Kitten.prototype.setName = function(name) { this.name = name; return this; }; Kitten.prototype.setColor = function(color) { this.color = color; return this; }; var obj = new Kitten().setName("tom").setColor("red"); And var Kitten = function() { this.name = 'Garfield'; this.color = 'brown'; this.gender = 'male'; this.setColor = function(color) { this.color = color; return this; }; this.setName = function(name) { this.name = name; return this; }; }; var obj = new Kitten().setName("tom").setColor("red");
possible better answer: http://stackoverflow.com/a/28479565
score: -1
answer count: 2
has comment: http://stackoverflow.com/comment/45281472

http://stackoverflow.com/comment/45273191
has text: As a matter of fact, I find functional approach more preferable; it became "common ground" for different languages of very high level. As a example, answer code, rewritten with `for`, is limited to JavaScript, programmer should know specific JavaScript language constructions (should we use `for` like C or we can use `for in` or something like that, should we use parentheses). Functional way is more simple, programmer should know functions and some APIs (which are becoming more and more unified between different languages).
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28474201
type: AnswerComment

http://stackoverflow.com/comment/45284545
comment on: http://stackoverflow.com/a/28481021
type: Comment
type: AnswerComment
has text: works like a charm, thanks! It's funny because in my original code I didn't have a class for the list elems and tried something like //items : ':not(.new-element)', which didn't work properly :P I'll accept as soon as SO lets me!
score: 0

http://stackoverflow.com/comment/45309879
comment on: http://stackoverflow.com/a/28481264
score: 0
type: Comment
has text: If my answer is correct to you, please validate it :) But sorry, I don't have a clue about Coldfusion. Never used it...
type: AnswerComment

http://stackoverflow.com/comment/45370069
has text: I've updated my fiddle, removed `display: block` for childs list element.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28527081
type: Comment

http://stackoverflow.com/q/28588918
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has title: Screen-witdh depended menu toggle and auto open in javascript
has answer: http://stackoverflow.com/a/28601710
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28601710
tagged with: javascript
has body: I'm trying to make a side-panel menu for a school project website. After browsing around a bit, I found This codepen. The Javascript code that originally comes with the codepen is as follows: $('.menu a, .nav a').on('click', function () { $('.wrapper').toggleClass('active'); }); Now, what i'm trying to do, is to make the menu on this page, which uses JQuery for toggling, Automatically open if the browser window width goes below 720 pixels. I've found another part of JQuery-Javascript, that tought me how to use the browser width. After merging that with the existing code above, I ended on this: function checkWindowSize() { if ( $(window).width() &lt; 720 ) { var smallscreen = true; } else { var smallscreen = false; $('.wrapper').toggleClass('active'); } } if (smallscreen = true) { $('.menu a, .nav a').on('click', function () { $('.wrapper').toggleClass('active'); }); } Again, what i need it to do is this: On page load or resize, check the browser window's width If it's under 720px, enable the toggle code for the menu so it auto-hides If it's over 720px, disable the toggle for the menu, un-hide the menu, and keep it open. Optitionally, hide the menu button (class .menu) when the browser is over 720px wide and make it re-appear when the window size comes under 720px As this is my 1st Stackoverflow question and my first actually practical use of Javascript, please bear with me...

http://stackoverflow.com/q/28530201
accepted answer: http://stackoverflow.com/a/28530243
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/28530249
has body: I have a query that runs just fine like this. It returns the right object and everything. var all = new Keen.Query("extraction", { eventCollection: "android-sample-button-clicks", timeframe: 'previous_300_minutes' }); But what I want to do is to do something like this. See how I use the time variable and insert it into the query for 'timeframe'? But then it always returns undefined. if (this.value == "1"){ var time = 'previous_300_minutes' } else { var time = 'previous_30_minutes' } var all = new Keen.Query("extraction", { eventCollection: "android-sample-button-clicks", timeframe: time }); This always returns undefined. I figure its because I cannot insert the time string variable into the query JSON like that. How can I insert this so that it is formatted correctly?
has answer: http://stackoverflow.com/a/28530249
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28530243
upvote count: 1
type: Question
tagged with: keen-io
has title: How to insert a variable string into a JSON query?
tagged with: javascript
answer count: 2

http://stackoverflow.com/comment/45318542
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28499371
has text: I'm editing my question and adding the Python code that is used for sending the file contents.

http://stackoverflow.com/comment/45208728
type: QuestionComment
has text: Matt: in every case that I tested (whether it be just trying to access the array element directly, or loop over the json array), get and getJSON have the same problem.
comment on: http://stackoverflow.com/q/28439479
score: 0
type: Comment

http://stackoverflow.com/comment/45483320
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28588042
type: Comment
has text: i tried that it brings text little bit in the center but the curtain effect which slides down and slides up is still not showing

http://stackoverflow.com/comment/45259168
type: Comment
type: QuestionComment
has text: @texas that code should update the myData formation name for the first item in the offsetFormations array. I've tested it in your fiddle and it does work.
score: 0
comment on: http://stackoverflow.com/q/28466510

http://stackoverflow.com/a/28567997
has comment: http://stackoverflow.com/comment/45446167
answers question: http://stackoverflow.com/q/28567906
type: Answer
has body: You could create a function that would represent the random item in your dictionary: function Model(route, template) { this.route = route; this.template = template; } Then you could create an object like below: var dictionary = { "key1": new Model("route1", "template1"), "key2": new Model("route2", "template2") }; In JavaScript objects are containers for key/value pairs. How we get the value for a specific key? var model = dictionary["key1"]; or var model = dictionary.key1; If key1 isn't a key of dictionary, then you will get as model the undefined. How we set the value for a specific key? dictionary.key5 = new Model("route5", "template5"); What happens if there is already the key5 ? You just assign a new value for this key. As it would happen, if we were in c#. Above we used the constructor pattern, in order we create the values of our dictionary. This is a commonly used pattern for the creation of objects with the same properties.
has comment: http://stackoverflow.com/comment/45446198
upvote count: 4
type: AcceptedAnswer
downvote count: 0
score: 4
accepted answer of: http://stackoverflow.com/q/28567906

http://stackoverflow.com/comment/45400293
has text: i got it working. But the data presented by blitzortung is live, can the PHP script make it live too with a http_refresh request?
comment on: http://stackoverflow.com/a/28538934
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28458249
has body: I'm trying to get an array I've called input and loop over it. If any values are odd numbers then they get multiplied by 2. If any are even they get divided by 2 and are then pushed to an output array which I can then return. So far I have this, (using cmd node): function modify(input) { var output = []; for (i=0; i=input.length; i++) { if (input % 2 == 1) { input*2; output.push[input]; } if (input % 2 == 0) { input/2; output.push[input]; } } return output; } module.exports.modify = modify;
type: Question
tagged with: arrays
possible better answer: http://stackoverflow.com/a/28458339
tagged with: javascript
score: 0
answer count: 4
has answer: http://stackoverflow.com/a/28458378
has answer: http://stackoverflow.com/a/28458346
has answer: http://stackoverflow.com/a/28458339
tagged with: input
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28458387
accepted answer: http://stackoverflow.com/a/28458387
has title: Modifying arrays from an input then returning an output

http://stackoverflow.com/comment/45276895
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28472359
score: 0
has text: Show other code pls, Sequelize init and model

http://stackoverflow.com/q/28512574
has title: Ember-data: loading one-to-one related model
has answer: http://stackoverflow.com/a/28512910
accepted answer: http://stackoverflow.com/a/28512910
has comment: http://stackoverflow.com/comment/45344036
has body: I feel like I'm missing something really simple. I've created two models related to one another in a one-to-one relationship, each with belongsTo('theOtherOne'). I have a route that loads a specific entry: Entry Model export default DS.Model.extend({ word: DS.attr('string'), entry: DS.attr('number'), definition: DS.belongsTo('definition', {async: true}), }); Definition Model export default DS.Model.extend({ body: DS.attr(), entry: DS.belongsTo('entry') }); Route model: function(params){ return this.store.find('Entry', params.entry_id); } So, how do I make the related record available to my template? I'm pretty sure the relationship is configured correctly, since, in the Ember inspector, I can see that the "belongsTo" property is set, and when I click on it, the appropriate API call is made and loaded into the store. However, it is still not (apparently) available to the template. Thanks in advance.
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/45343854
tagged with: ember-data
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
upvote count: 3
tagged with: ember.js

http://stackoverflow.com/a/28595535
answers question: http://stackoverflow.com/q/28568439
type: Answer
has body: I don't think you need the line to enqueue jQuery in your header, WordPress will handle that automagically as it is listed as a dependency of bootstrapjs. Additionally, you should probably list bootstrapjs as a dependency of bootstraplightbox like so: wp_enqueue_script( 'bootstraplightbox', get_stylesheet_directory_uri() . '/js/bootstrap-lightbox.js', array('jquery', 'bootstrapjs'), '', true ); This will make sure that the bootstrapjs file is loaded before bootstraplightbox, as I am assuming that must happen.
score: 0

http://stackoverflow.com/comment/45391478
score: 0
type: QuestionComment
type: Comment
has text: The above link shows how I can catch error(404) but if it occurs how can I resend with new url?
comment on: http://stackoverflow.com/q/28538455

http://stackoverflow.com/comment/45445430
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28557874
has text: @Skatox `$id` is recieved by the controller and the query runs. `$countryVenue` is the dataProvider for the fetched records and it does recieve data when the query is fired. Date Format is pretty much irrelevant just for display purpose. I do not know how to `CJSON Decode` and convert it to php array from the js code.
score: 0

http://stackoverflow.com/comment/45444245
has text: It would work in the aggregation framework if your timestamps were date type instead of numbers. I would always advise using a date type for time values. Could you switch?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28442880
type: QuestionComment

http://stackoverflow.com/a/28449776
has body: HTML &lt;script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=true"&gt;&lt;/script&gt; &lt;div id="map_canvas" style="width:100%;height:100%; position:absolute;"&gt;&lt;/div&gt; JAVASCRIPT var all=[{"Longitude":"17.3616","Lattitude":"78.4747","UserID":3},{"Longitude":"17.4954","Lattitude":"78.2960","UserID":3}]; var map; var infowindow = new google.maps.InfoWindow(); $(all).each(function (key, value) { if(key == 0){ map = new google.maps.Map(document.getElementById('map_canvas'), { zoom: 6, center: new google.maps.LatLng(this.Lattitude, this.Longitude), mapTypeId: google.maps.MapTypeId.ROADMAP }); } var marker = new google.maps.Marker({ position: new google.maps.LatLng(this.Lattitude, this.Longitude), map: map }); var content = this.Lattitude+", "+this.Longitude; google.maps.event.addListener(marker, 'click', (function(marker, key) { return function() { infowindow.setContent(content); infowindow.open(map, marker); } })(marker, key)); });
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28448246
answers question: http://stackoverflow.com/q/28448246

http://stackoverflow.com/comment/45411821
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28547682
has text: I see. For example purposes, if I had complex function and I ended with a value in a variable 'newValue', do I always have to 'return' that value just like my test function? Or is there another way for this exact same use case?
score: 0

http://stackoverflow.com/comment/46000967
comment on: http://stackoverflow.com/a/28589191
type: Comment
score: 0
type: AnswerComment
has text: Sorry for late reply, I have tried the same approach but couldnot able to read it. In this http://asurkov.blogspot.com/2012/02/aria-hidden-and-rolepresentation.html link it says role="presentaion" means element will get removed from accessible tree. So which means I cannot access it? is there any alternative for this??

http://stackoverflow.com/comment/45347211
type: AnswerComment
comment on: http://stackoverflow.com/a/28514691
score: 0
type: Comment
has text: A also think that `Timer` is nice solution

http://stackoverflow.com/comment/45438612
type: Comment
type: QuestionComment
has text: @DaImTo I have tried this already
score: 0
comment on: http://stackoverflow.com/q/28563940

http://stackoverflow.com/comment/52914664
type: Comment
type: QuestionComment
has text: Where is it written exactly? The page on JS plugins doesn't mention `Runtime.dynCall` at all. By the way, this was the part that my code was lacking. Thank you.
comment on: http://stackoverflow.com/q/28501455
score: 0

http://stackoverflow.com/q/28560130
tagged with: three.js
has comment: http://stackoverflow.com/comment/45438929
score: 2
tagged with: perspectivecamera
upvote count: 2
type: UnansweredQuestion
type: Question
tagged with: rotation
has body: I've been using threejs for a while for the 3D of an image-based modeling application ( vmtklab.orobix.com ). For camera rotation/translation/zooming I am using TrackballControls.js. controls = new THREE.TrackballControls( camera, renderer.domElement ); controls.dynamicDampingFactor = 0.5; controls.target.set( pos.x, pos.y, pos.z ); I'm used to camera movement as in vtk ( paraview, etc ) and I can not find how to replicate this behavior in threejs. See: http://jsfiddle.net/ugxbktLt/5/ Basically, if I click on the canvas in the center and I move the mouse along the y axis the camera rotates as expected. If I click on the canvas in a point which is distant from the center ( example on the right side of the cube ), the camera rotates in two directions and not only following my mouse movement. I was expecting that the camera rotates following only the vector between the start point ( mousedown ) and end point generated by mouse movement and NOT considering the position of the start point. It seems rotating around a sphere. Any suggestions? Best regards Simone
tagged with: camera
tagged with: javascript
has comment: http://stackoverflow.com/comment/45444042
has answer: http://stackoverflow.com/a/28587408
has comment: http://stackoverflow.com/comment/45478732
has comment: http://stackoverflow.com/comment/45441123
has title: threeJS Trackball Controls camera rotation
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45475556

http://stackoverflow.com/q/28438534
tagged with: mongodb
answer count: 1
tagged with: javascript
score: 0
tagged with: node.js
type: UnansweredQuestion
type: Question
has body: I've got a 3x deep object i'm trying to set with This is the object starting out { "_id": "53d905a709193fb6a0076fec", "active": 1, "article": null, "category_id": null, "clarification": null, "id": 5279, "language_id": 2, "master_id": 1667, "part_of_speech": "verb", "rank": 279, "word": "recordar", "hasSound": false, "extras": 0, "conjugations": { "present": [{ "prefixes": { "1": "Yo" }, "verb": "recuerdo", "grammar": "1PS" }], "preterite": [{ "prefixes": { "1": "Yo" }, "verb": "recordÃ©", "grammar": "1PS" }, { "prefixes": { "2": "Tu" }, "verb": "recordaste", "grammar": "2PS" }, { "prefixes": { "3": "El", "4": "Ella", "6": "Usted" }, "verb": "recordÃ³", "grammar": "3PS" }, { "prefixes": { "7": "Nosotros" }, "verb": "recordamos", "grammar": "1PP" }, { "prefixes": { "9": "Ellos", "10": "Ellas", "11": "Ustedes" }, "verb": "recordaron", "grammar": "3PP" }], "imperfect": [{ "prefixes": { "1": "Yo" }, "verb": "recordaba", "grammar": "1PS" }, { "prefixes": { "2": "Tu" }, "verb": "recordabas", "grammar": "2PS" }, { "prefixes": { "3": "El", "4": "Ella", "6": "Usted" }, "verb": "recordaba", "grammar": "3PS" }, { "prefixes": { "7": "Nosotros" }, "verb": "recordÃ¡bamos", "grammar": "1PP" }, { "prefixes": { "9": "Ellos", "10": "Ellas", "11": "Ustedes" }, "verb": "recordaban", "grammar": "3PP" }], "future": [{ "prefixes": { "1": "Yo" }, "verb": "recordarÃ©", "grammar": "1PS" }, { "prefixes": { "2": "Tu" }, "verb": "recordarÃ¡s", "grammar": "2PS" }, { "prefixes": { "3": "El", "4": "Ella", "6": "Usted" }, "verb": "recordarÃ¡", "grammar": "3PS" }, { "prefixes": { "7": "Nosotros" }, "verb": "recordaremos", "grammar": "1PP" }, { "prefixes": { "9": "Ellos", "10": "Ellas", "11": "Ustedes" }, "verb": "recordarÃ¡n", "grammar": "3PP" }] } } This is the $set object. collection.update({id: id}, {$set: obj}); var obj = { "conjugations.present.0.prefixes.1": "Yo", "conjugations.present.0.verb": "recuerdo", "conjugations.present.0.grammar": "1PS" } 1 And then this is the object after the update…
has title: MongoDB setting using dot operator
has answer: http://stackoverflow.com/a/28439167

http://stackoverflow.com/q/28487315
has comment: http://stackoverflow.com/comment/45352796
upvote count: 1
tagged with: google-sheets
has body: This script searches a spreadsheet and copies the link to the third column according to the value in the first column function onOpen() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var searchMenuEntries = [ {name: "Search in all files", functionName: "search"}]; ss.addMenu("Search Document List", searchMenuEntries); } function lastValue(column) { var lastRow = SpreadsheetApp.getActiveSheet().getMaxRows(); var values = SpreadsheetApp.getActiveSheet().getRange(column + "1:" + column + lastRow).getValues(); for (; values[lastRow - 1] == "" &amp;&amp; lastRow &gt; 0; lastRow--) {} return values[lastRow - 1]; } function search() { // Get the active spreadsheet and the active sheet var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getActiveSheet(); // Search the files in the user's Docs List for the search term var startRow = 2; // First row of data to process var numRows = lastValue("A"); // Number of rows to process // Fetch the range of cells A2:B3 var dataRange = sheet.getRange(startRow, 1, numRows) // Fetch values for each row in the Range. var data = dataRange.getValues(); for (i in data) { var files = DocsList.find(data[i].toString()); for (var j = 0; j &lt; files.length; j++) { if (files[j].getType() == "other"){ urlBase = "https://docs.google.com/fileview?id="; sheet.getRange(i, 3, 1, 1).setValue(urlBase + files[j].getId()); } } } } However when I run it, I get the following error: Cannot convert d59f868312238f16bd8534f61c01dd0695512d38 in (class) The string above is the last row value in the column A which I use to retrieve the link (using DocsList.find) Does anyone knows what is the problem with my code? Thanks
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28493102
has comment: http://stackoverflow.com/comment/45344280
tagged with: google-apps-script
has title: script to create a link to a file in a spreadsheet creating error "Cannot Convert"
has answer: http://stackoverflow.com/a/28512990
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28518141
favorite count: 0
type: Question
answer count: 3

http://stackoverflow.com/a/28462121
upvote count: 1
score: 1
has body: You should not be evaluating the expression against $index. If you desk check the repeat loop for every iteration, this is what you're evaluating: page $index 0 == 0 // true 1 == 1 // true 2 == 2 // true Instead, what you should do, is add a separate variable to the scope that tracks the current page, if you don't have one already. For illustrative purposes, let's call it currentPage. Then you can change your expression to: ng-class="(page === currentPage) ? 'active': ''" Additionally, in your selectedPage() function you would update currentPage to the page the user selected (i.e. $scope.currentPage = page).
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28461700
type: Answer
answers question: http://stackoverflow.com/q/28461700
has comment: http://stackoverflow.com/comment/45250248

http://stackoverflow.com/q/28585051
favorite count: 0
type: UnansweredQuestion
tagged with: node.js
score: 1
tagged with: react-router
upvote count: 1
type: Question
tagged with: reactjs
has answer: http://stackoverflow.com/a/28585850
tagged with: javascript
has title: React router & serverside rending
has body: I'm currently having a weird problem with server-side rendering using react / react-router which I simply can't figure out. I'm using ES6 with Babel (6to5) for transpiling Server.js snippet import routes2 from '../jsx/routes.js'; var routes = React.createElement(Router.Route, { handler: APP, path: "/" }); Router.run(routes, '/', (Handler) =&gt; { const CONTENT = React.renderToString(&lt;Handler/&gt;); console.log('\r\nroutes') console.log(CONTENT) }) Router.run(routes2, '/', (Handler) =&gt; { const CONTENT2 = React.renderToString(&lt;Handler/&gt;); console.log('\r\nroutes2') console.log(CONTENT2) }) Routes.js "use strict"; var _interopRequire = function (obj) { return obj &amp;&amp; obj.__esModule ? obj["default"] : obj; }; var APP = _interopRequire(require("./app.js")); var React = _interopRequire(require("react")); var Router = _interopRequire(require("react-router")); module.exports = React.createElement(Router.Route, { handler: APP, path: "/" }); Output CONTENT correctly outputs my rendered component CONTENT2 outputs &lt;noscript&gt;&lt;/noscript&gt; For some reason when I import my routes from an external file (so I can require them in both my client and server code) my serverside rendering fails to output the correct HTML
has comment: http://stackoverflow.com/comment/45478010
answer count: 1
downvote count: 0

http://stackoverflow.com/q/28489092
has title: Wrong number of child divs are inserted with jquery
has body: my pen: http://codepen.io/helloworld/pen/MYvZKL Its late here and I am lazy. I can not find the tiny error. I have 13 child divs, each 6 on a page. That should give me 2,16666 pages. So I round up to 3 pages. Therefore I would expect 3 green li-elements with page class. But there are only 2??? Why? 1 2 3 4 5 6 1 2 3 4 5 6 1 .command{ background:orange; border:1px solid blue; width:100px; } .page{ background:green; } $( document ).ready(function(){ commandPager(); }); function commandPager() { var maxCommandsPerPage = 6; var totalCommands = $('#current-commands > div').length; alert(totalCommands); var numOfPages = totalCommands / maxCommandsPerPage; var allPages = Math.round(numOfPages) for(var i = 1; i <= allPages ; i++) { $('#command-pager').append(' ' + i +' ') } }
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28489176
accepted answer: http://stackoverflow.com/a/28489176

http://stackoverflow.com/comment/45305236
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28469243
type: AnswerComment
has text: I am able to exactly as it is now, except I am not able to remove the tag buttons. No closing symbol on the tags added. I mean it closes if I click on the left but the symbol 'x' to close is not being displayed. Any idea on this ?

http://stackoverflow.com/q/28455482
accepted answer: http://stackoverflow.com/a/28456977
tagged with: sharepoint
has comment: http://stackoverflow.com/comment/45237609
favorite count: 0
has comment: http://stackoverflow.com/comment/45237951
has body: I'm working with json data returned from an Angularjs get request. This data is coming from a Sharepoint list. The date is a json date string and looks like this /Date(350697600000)/ So I am working with Angularjs and I need to display this date the "normal" way or as I want it to look. The json data is an array of objects so I'm displaying the data with ng-repeat in an unordered list. I'm trying to make a custom filter that will replace /Date( and )/ with an empty string, that is I just want the numbers. I need each json date in this array of objects to convert when it is being displayed on my page. This is what I have so far in my custom filter: app.filter('dateFilter', function() { return function(obj) { return obj.replace(/\/([^a-zA-Z])\/ /gi, ""); } }); My html code looks like this: &lt;li class="adv_li adv_li_birthday" ng-repeat="b in birthdays"&gt; &lt;div id="adv_birthday" ng-bind="b.Birthday | dateFilter | date:'d. MMMM yyyy'"&gt;&lt;/div&gt; &lt;div ng-bind="b.Employee.Name"&gt;&lt;/div&gt; &lt;/li&gt; As everybody could guess my filter is not working. I don't really know how to use .replace() or even if using a custom filter to solve this is the best idea. I could use some help with this. Hope my question is not to vague. Thx in advance everybody!
tagged with: angularjs
upvote count: 2
has title: Custom filter to replace certain string characters in a json date returned from Sharepoint
downvote count: 1
has comment: http://stackoverflow.com/comment/45238609
has answer: http://stackoverflow.com/a/28456977
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28456261
score: 1
has answer: http://stackoverflow.com/a/28456261
tagged with: http://stackoverflow.com/tag/json
tagged with: date
has comment: http://stackoverflow.com/comment/45237762
type: Question
has comment: http://stackoverflow.com/comment/45237823
answer count: 2
has comment: http://stackoverflow.com/comment/45237649
tagged with: javascript

http://stackoverflow.com/comment/45382739
comment on: http://stackoverflow.com/a/28534046
type: AnswerComment
has text: How is it not working, can you show your current html and css?
score: 0
type: Comment

http://stackoverflow.com/a/28550414
accepted answer of: http://stackoverflow.com/q/28549998
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28549998
has body: You try to draw the image before it was loaded. The script working flow is the following: image.src = 'http://lorempixel.com/400/200/'; then ctx.fillRect(0,0,100,100); ctx.restore(); and then, when image load complete var pattern = ctx.createPattern(image, 'repeat'); ctx.fillStyle = pattern; See your CodePen updated
type: AcceptedAnswer

http://stackoverflow.com/comment/46522448
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28552329
has text: @AmarSyla I gave up trying and instead of removing the tinymce control from the page and replacing it with a new one, just left it there and re-used it.

http://stackoverflow.com/a/28565137
accepted answer of: http://stackoverflow.com/q/28565069
type: AcceptedAnswer
downvote count: 0
has body: Is it possible to stay inside click event call stack when using promise.then? Not in this case. It would be possible if the promise completed synchronously, but usually promises are used for situations that will complete asynchronously, and that's the case here. Instead, you'd want to complete the storage.getUrl part before the click occurs (preload it), so that you can then play during the user event.
type: Answer
answers question: http://stackoverflow.com/q/28565069
score: 2
upvote count: 2

http://stackoverflow.com/q/28475695
score: -2
tagged with: http://stackoverflow.com/tag/json
has title: Reference error on javascript using json data from dbpedia server
downvote count: 2
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
tagged with: dbpedia
has body: Hi all and thanks in advance for the help: i got this error: Uncaught SyntaxError: Unexpected identifier for line 65 (the line with the "Var query"... here the third line) and when i click on the Execute button this is the other error: Uncaught ReferenceError: retrieveData is not defined (retrieveData is the function i call with the click) i have used an existing code modifyng it for my purpose. the very strange things are: 1: the original code run without errors (and it seems to me quite the same) 2: if i paste the url and the query and &output=json on the browser, it works fine... so i think it's not an error about mispelling... this is the code I wrote: and this is the original code: Thanks again --UPDATE-- Obviously i 'm made a mess with quotation mark. Thanks dodl. Now it works. A LITTLE NOTE if anyone tries to run this script: It will come "XMLHttpRequest same domain policy error"... Just add the '&callback=?' in the url, using the built-in support for JSONP in JQUERY.
has answer: http://stackoverflow.com/a/28475777
accepted answer: http://stackoverflow.com/a/28475777
has comment: http://stackoverflow.com/comment/45274691
upvote count: 0
type: Question
type: AnsweredQuestion

http://stackoverflow.com/q/28452548
type: Question
has comment: http://stackoverflow.com/comment/45237537
tagged with: cloud9-ide
tagged with: javascript
tagged with: express
has comment: http://stackoverflow.com/comment/45236551
tagged with: http-post
upvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45236537
type: UnansweredQuestion
tagged with: node.js
has body: I (try to) run a node.js app on cloud9 (c9.io). It requires express. It hosts a html file app.get('/index.html', function(req, res){ res.sendfile('./client/index.html'); }); which includes a form &lt;form action="/myaction" method="post"&gt; &lt;input type="text" id="name" name="name"... &lt;input type="submit" value="Send message" /&gt; I manage to hit the button, send a HTTP POST request with parameter name="somevalue" - which is prooven by Firebug Network Monitoring. BUT when I log the recieved req-object app.post('/myaction', function(req1, res) { //res.send('You sent the name "' + req.body.name + '".'); res.send("das der req " + req1 + "."); console.log(req1); }); it looks like a mess: http://pastebin.com/iq7mfueC - I can't find the name Parameter, because I can't find the form at all.
downvote count: 0
has title: Is HTTP POST Request blocked (critically altered) by Cloud9?
answer count: 0
linked to: http://stackoverflow.com/q/5710358
score: 1

http://stackoverflow.com/a/28486489
has comment: http://stackoverflow.com/comment/45302080
has comment: http://stackoverflow.com/comment/45294795
has body: It looks like your method should work as a GET to myfile.php. If you want to use the data parameter instead, then look at the official jQuery API docs for the .load() method (not to be confused with the .load() event handling method), where it says: data Type: PlainObject or String A plain object or string that is sent to the server with the request. So you can pass it as a string or as an object. As a string (which you more or less already have): $('#txtHint').load('myfile.php', "var1="+data1+"&amp;var2="+data2+"&amp;var3="+data3+"&amp;var4="+data4, function() { } ); As an object (note that this makes your request a POST): $('#txtHint').load('myfile.php', { var1: data1, var2: data2, var3: data3, var4: data4 }, function() { } ); Most of the examples in the jQuery docs don't use the data parameter, but the last two examples at the very bottom of the page (as of typing this answer) shows some basic examples of using it in the object format.
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28486299
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28486299

http://stackoverflow.com/q/28547205
has comment: http://stackoverflow.com/comment/45409562
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45407483
tagged with: javascript
has comment: http://stackoverflow.com/comment/45409496
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28548667
possible better answer: http://stackoverflow.com/a/28548178
has body: After seeing the following code, I started wondering if there was a way to access the full lowercase alphabet without using any letters(conditions to be applied below): [($=(!0)+'')[0]+$[1]+$[2]+((!1)+'')[3]+$[0],(([]+[])[1]+'')[1]+([]+{})[1],([]+{})[1]+(([]+[])[1]+'')[1]+$[3]].join(' '); // "trust no one" Using the various statements below the following letters can be accessed a b c d e f g i j l m n o p r s t u v x y: // "true" yeilds: e r t u !0+''; // "false" yeilds: a f l s !1+''; // "[object Object]" yeilds: b c j o t []+{}+''; // "undefined" yeilds: d i n [][1]+''; // "Infinity" yeilds: y 1/0+''; // Using the above statements "constructor" can be spelled // It has no value by itself but can be coupled with other statements to get more letters ($=[]+{}+'')[5]+$[1]+(([]+[])[1]+'')[1]+((!1)+'')[3]+($=!0+'')[0]+$[1]+$[2]+($=[]+{}+'')[5]+$[6]+$[1]+((!0)+'')[1]; // "function RegExp() { [native code] }" yeilds: g p v x (/./)[/*constructor" from above*/]+''; // "function Number() { [native code] }" yeilds: m (0)[/*"constructor" from above*/]+''; What are ways to access to remaining characters h q w z with the following limits applied: Only non-letter characters can be used in the code(symbols, numbers and punctuation) All characters used within the code must fall into ASCII's first 128 characters Code must not rely on environment variables such as global for node, window for browsers, etc Reencoding letters such as using escaped variants, octlet syntax, etc should be refrained from until all other avenues have been explored.
has comment: http://stackoverflow.com/comment/45413664
favorite count: 0
has answer: http://stackoverflow.com/a/28548178
has comment: http://stackoverflow.com/comment/45409601
has comment: http://stackoverflow.com/comment/45409457
has title: Get full alphabet without using letters
has answer: http://stackoverflow.com/a/72804596
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28548667
has comment: http://stackoverflow.com/comment/45409720
upvote count: 1

http://stackoverflow.com/comment/45270997
comment on: http://stackoverflow.com/a/28473436
type: AnswerComment
score: 0
type: Comment
has text: I ran the file getsession.php on the browser directly and it is returning `0`. However, modifying my code as you siggested has no effect on clicking the image. Any pointers?

http://stackoverflow.com/a/28490075
upvote count: 2
has body: One possibility is to turn it into a filter, especially if you're going to be reusing it: &lt;select ng-model="selectedItem" ng-options="opt as opt for opt in [] | minmax:1:10"&gt; &lt;/select&gt; angular.module("demoApp").filter("minmax", function() { return function(arr, min, max) { min = parseInt(min); max = parseInt(max); for(var i=min; i &lt;= max; i++){ arr.push(i); } return arr; }; }); Reference: https://docs.angularjs.org/api/ng/filter/filter for further reading on how filters work.
answers question: http://stackoverflow.com/q/28489619
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45301502
score: 2

http://stackoverflow.com/comment/45472278
comment on: http://stackoverflow.com/q/28581965
has text: if i remove track by $index then it is working
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28529126
has body: Ideally this burden would rest with the third-party library, but if that is not an option, you could attempt to utilize global transforms: If opts.global is true, the transform will operate on ALL files, despite whether they exist up a level in a node_modules/ directory. Use global transforms cautiously and sparingly, since most of the time an ordinary transform will suffice. You can also not configure global transforms in a package.json like you can with ordinary transforms. Global transforms always run after any ordinary transforms have run. So replacing .transform(to5) with .transform({ global: true }, to5). Also, 6to5 (now Babel) has built-in JSX support, so you shouldn't need Reactify.
score: 0
answers question: http://stackoverflow.com/q/28517749
type: Answer

http://stackoverflow.com/comment/45205100
score: 2
comment on: http://stackoverflow.com/q/28437587
type: QuestionComment
has text: You don't need to update the PHP variable, you can have Javascript calculate everything until the user is done and then you can pass the form data to the php for saving/processing whatever it is you wish to do. Using javascript to run this will cut back on the server-side calls. Run this client side then you can pass the complete data to the server.
type: Comment

sequelize.js
type: Tag
tags question: http://stackoverflow.com/q/28552883
tags question: http://stackoverflow.com/q/28573628
tags question: http://stackoverflow.com/q/28578745
tags question: http://stackoverflow.com/q/28503617
tags question: http://stackoverflow.com/q/28472359
tag name: sequelize.js
tags question: http://stackoverflow.com/q/28546885
tags question: http://stackoverflow.com/q/28482849

http://stackoverflow.com/a/28535591
answers question: http://stackoverflow.com/q/28535226
score: 0
type: Answer
has body: Here is the java script function code. For this to work, you need to make sure that the div display property to be set as or in the html code. Also you need to name the id of the button to be "next" so that it can be hidden on reaching the last button. function nextQ(){ var blockFound = 0; var lastQuestion = 0; var divs = document.getElementsByTagName("div"); for(var i = 0; i < divs.length; i++){ if ( blockFound == 1){ blockFound = 0; divs[i].style.display = 'block'; }else if ( divs[i].style.display == 'block' ){ if ( i + 2 == divs.length){ lastQuestion = 1; } blockFound = 1; divs[i].style.display = 'none'; } } if ( lastQuestion == 1){ document.getElementById('next').style.visibility = 'hidden'; } } Html code here. 1. The color of the sky is... Green Blue Red Purple 2. Paper comes from... Water Cement Trees The Sky 3. How many hours in a day? 24 22 16 48 Next Question

http://stackoverflow.com/q/28463121
has title: Create div transition like Spotify
score: 0
has comment: http://stackoverflow.com/comment/45252767
has comment: http://stackoverflow.com/comment/45252492
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
possible better answer: http://stackoverflow.com/a/28463856
has body: I would like to have some help about the transition of a div in CSS or JavaScript. I have a &lt;div&gt; with dispay:none;. With some JS, i change the display option on display:block. All is working correctly. But i would like to know how to make a transition when the &lt;div&gt; appear on the screen. Like the player Spotify when you want to search something. Thanks for you help. And really sorry for my BAD english !
has comment: http://stackoverflow.com/comment/45252568
accepted answer: http://stackoverflow.com/a/28463565
has comment: http://stackoverflow.com/comment/45252121
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28463565
tagged with: transition
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/28463856
answer count: 2
downvote count: 2
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45485490
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28589304
type: AnswerComment
has text: It works, but how can I, when I click on this item: http://prntscr.com/66qus1 a replacement to it? http://prntscr.com/66qv39

http://stackoverflow.com/q/28560445
possible better answer: http://stackoverflow.com/a/28560715
has answer: http://stackoverflow.com/a/28560715
tagged with: dom
answer count: 2
accepted answer: http://stackoverflow.com/a/28560672
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: input
tagged with: css
has body: Hi I have an hidden div with a range inside: This range works fine when it is displayed directly but I need to hidde this range and show it when user click on a specific button. The problem is that after the user click on the "showing range" button, the range is displayed but impossible to read his value. The demo and full code on jsbin: http://jsbin.com/voyilovuya/3/ HTML JS function showrangevalue(){ document.getElementById("value").innerHTML=document.getElementById("range1").value; } function showhiddencontainer(){ document.getElementById("container").innerHTML=document.getElementById("hiddencontainer").innerHTML; } Have you a solution? Thanks for your help!
score: 2
type: AnsweredQuestion
has title: Html/Js Input range object dynamically loaded inside a div don't works
upvote count: 2
has answer: http://stackoverflow.com/a/28560672
type: Question

http://stackoverflow.com/comment/45471776
score: 0
comment on: http://stackoverflow.com/a/28580562
type: Comment
type: AnswerComment
has text: can i call all id's by single reference ? why becoz i have 35 select options. can u help me?

http://stackoverflow.com/comment/45304184
comment on: http://stackoverflow.com/q/28491628
type: QuestionComment
has text: This can give you some tips: http://stackoverflow.com/questions/14446511/what-is-the-most-efficient-method-to-groupby-on-a-javascript-array-of-objects
score: 0
type: Comment

http://stackoverflow.com/q/28438078
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45206097
has comment: http://stackoverflow.com/comment/45206509
upvote count: 0
has body: I have a big excel file and I want to show the data on my website. I have made a matlab and a Java program(script) that can extract the information I want from the excel file. How do I get the data to the website? Should I have the matlab or java script running on a server and then make a javascript that in some way connects to the server? How would i do this? Or should a make a javascript that directly reads the excel file? I am a beginner in web development so I dont really know where to start...
accepted answer: http://stackoverflow.com/a/28438528
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45206820
type: AnsweredQuestion
tagged with: java
has title: Best way to present data from a big excel file on a website
has answer: http://stackoverflow.com/a/28438528
downvote count: 1
type: Question
tagged with: import-from-excel

http://stackoverflow.com/a/28546118
score: 0
type: Answer
has body: The element with id="second" needs to be styled to not show. There are many different css properties that could make it not show, and styling could be done statically on the id="second" element using the style attribute, or in a style sheet with #second as the selector, or dynamically using jQuery's style() method. I don't know enough about the fullpage plug-in to make a more precise recommendation.
answers question: http://stackoverflow.com/q/28541549

http://stackoverflow.com/comment/45272572
type: QuestionComment
has text: do i want to so something else when using ssl ?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28474309

http://stackoverflow.com/comment/45451448
type: Comment
type: QuestionComment
score: 0
has text: Thanks for your comment. I found the problem. For simplicity, I had not included above, all the html attributes that in my codes I have used in `input_html:{ id:'model_js'}`. One of them that I was using, was making a problem. I removed it and it is working now. So in summary, using `input_html` with more than one attributes might make troubles. It needs more care.
comment on: http://stackoverflow.com/q/28555875

http://stackoverflow.com/comment/45480831
type: AnswerComment
score: 0
type: Comment
has text: In that case, the answer provided by @phts should be sufficient.
comment on: http://stackoverflow.com/a/28586118

http://stackoverflow.com/q/28469188
has comment: http://stackoverflow.com/comment/45263638
possible better answer: http://stackoverflow.com/a/28469569
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28469569
has answer: http://stackoverflow.com/a/28469351
has title: How to echo a sum of a Javascript function?
tagged with: php
has body: So I've got this Example for you: http://jsfiddle.net/mwpmk9kk/1/ As you can see, i summarize the Values of all checkboxes into one readonly input field. Now i want to echo the Value of all selected Checkboxes into an .php-Site after submitting it (method="post"). I already tried it with echo $_POST['price']; but that did not work. Thank you in advance
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28469351
has comment: http://stackoverflow.com/comment/45263555
type: Question
has comment: http://stackoverflow.com/comment/45265166
tagged with: javascript

http://stackoverflow.com/comment/45500037
type: Comment
score: 0
type: AnswerComment
has text: p is assigned every event handler call - the other code bits demonstrate how that can be used.
comment on: http://stackoverflow.com/a/28578263

http://stackoverflow.com/comment/45360654
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28516511
has text: that has to be something javascript related, because I can print out the values in the DOM without problem. It's javascript that's interpreting them as null

http://stackoverflow.com/a/28566638
type: Answer
has comment: http://stackoverflow.com/comment/45447035
downvote count: 0
score: 5
answers question: http://stackoverflow.com/q/28566580
upvote count: 5
has body: here: mHelper.queryInventoryAsync(mGotInventoryListener); NPE because mHelper is null. Initialize mHelper object by calling IabHelper constructor with current Acitivty context and with public key: mHelper = new IabHelper(this, base64EncodedPublicKey); For more information What is base64EncodedPublicKey? see: Preparing Your In-app Billing Application

http://stackoverflow.com/comment/45509279
comment on: http://stackoverflow.com/a/28586299
has text: I agree. If the "new" data retrieved in an "ActiveProject" demands a lot of new logic and other API calls, it would be beneficial to create a new store.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28500323
has answer: http://stackoverflow.com/a/28500442
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28500529
possible better answer: http://stackoverflow.com/a/28500442
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28500630
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28500529
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has body: I seem to be able to hide the resource container using resource.parent().parent().hide(); but I don't understand why the input value is not clearing with resource.parent().siblings('.resource-value').children('input').val(''); when I use resource.parent().siblings('.resource-value') I get the parent of the input value but adding .children('input').val('') on top of that does nothing or if I add .children('input:text').val('') I have very similar code for something else which works just fine, looked at other questions and not sure what I'm missing. function removeResource(resource) { 'use strict'; //hide resource on screen resource.parent().parent().hide(); //set resource text value to '' resource.parent().siblings('.resource-value').children('input').val(''); } (function($) { 'use strict'; $(function() { $('#resources').on('click', '.remove-resource', function(evt) { // Stop the anchor's default behavior evt.preventDefault(); // Remove the image, toggle the anchors removeResource($(this)); }); }); })(jQuery); remove resource remove resource
has title: Clearing input text field value with Jquery
favorite count: 0

http://stackoverflow.com/a/28560310
has comment: http://stackoverflow.com/comment/45439184
answers question: http://stackoverflow.com/q/28560127
has body: I would do this: $(document).ready(function() { var shoulder = $(".TableContent .shouldbeunderTableMenu"); var clone = shoulder.clone(); shoulder.remove(); $(".TableContent").append(clone); });
has comment: http://stackoverflow.com/comment/45432520
has comment: http://stackoverflow.com/comment/45439359
has comment: http://stackoverflow.com/comment/45439102
has comment: http://stackoverflow.com/comment/45439320
has comment: http://stackoverflow.com/comment/45437875
has comment: http://stackoverflow.com/comment/45439291
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45439398
has comment: http://stackoverflow.com/comment/45439250
has comment: http://stackoverflow.com/comment/45432049

http://stackoverflow.com/comment/45357364
has text: You need to change the variable name. Data is used as the argument name of the success function.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28520278
type: Comment

selectors-api
tag name: selectors-api
type: Tag
tags question: http://stackoverflow.com/q/28452257
tags question: http://stackoverflow.com/q/28509627

http://stackoverflow.com/a/28442946
has body: Check the events list in the dropzone docs for more examples. var myDropzone = new Dropzone("#file"); //When a file is added to the list myDropzone.on("addedfile", function(file) { //Do whatever you want });
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28442441
answers question: http://stackoverflow.com/q/28442441
type: Answer
downvote count: 0

http://stackoverflow.com/q/28472230
has comment: http://stackoverflow.com/comment/45268880
upvote count: 3
has comment: http://stackoverflow.com/comment/45268845
tagged with: http://stackoverflow.com/tag/html
has body: I am having an issue while switching a design between devices. I know that css3 @media queries are use to handle on the bases of device width, orientation etc. As far as concern with the device size css media queries are working perfectly fine when am on large screen size or on mobile screen size. e.g This is the design for mobile screen size. and this is the design for large screen the media queries are working fine to switch the design. But i want to show the mobile screen design on desktop screen when the parent div size is small e.g equals to mobile screen size? In the below situation i need to shown the mobile screen design on desktop screen size. I googled it but didn't find any luck. I also try with different options of media queries. Is there any way to resolve this issue? Sorry I forget to mention that am using foundation framework for responsive design.
tagged with: css
answer count: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/45268609
has comment: http://stackoverflow.com/comment/45268698
has answer: http://stackoverflow.com/a/28472449
has comment: http://stackoverflow.com/comment/45268765
has answer: http://stackoverflow.com/a/28472703
accepted answer: http://stackoverflow.com/a/28472703
type: AnsweredQuestion
score: 3
downvote count: 0
has answer: http://stackoverflow.com/a/28472809
has answer: http://stackoverflow.com/a/28472488
tagged with: media-queries
has title: How to show mobile screen design on large screen size?
linked to: http://stackoverflow.com/q/326069
type: Question
has comment: http://stackoverflow.com/comment/45268717
possible better answer: http://stackoverflow.com/a/28472449
has comment: http://stackoverflow.com/comment/45268713
tagged with: javascript

http://stackoverflow.com/q/28569153
has comment: http://stackoverflow.com/comment/45448886
type: UnansweredQuestion
answer count: 0
tagged with: cookies
has comment: http://stackoverflow.com/comment/45448721
favorite count: 0
type: Question
tagged with: google-analytics
has title: How to reset google analytics fingerprints on a particular desktop?
tagged with: javascript
score: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/45449064
downvote count: 1
tagged with: macos
has body: I have a problem with a particular web application that is using google analytics "userid" features to identify me across different devices that I use. On one of my devices the web application has stopped working. It fails due to an excessively long (4+ second) call to the google analytics service, while trying to lookup my utm id. It doesn't matter which browser I am using and clearing cookies has been no help. I would like to force google analytics to treat my device as a completely new, never-before-seen device, so that the particular website will start working again on my device. I am hoping that will solve the problem, much the same as moving to a different computer allows me to continue to use the particular web site (but it's my main desktop that is having the problem and I won't be replacing it any time soon, so changing devices really is not feasible). So how do I reset google analytics fingerprints on a particular desktop? Specifics: The site I am using is cyclo-sphere.com, which works fine until I try to invoke the detailed analysis for a given ride. Tracing the calls, it always fails after a timeout of 4 seconds while getting my utm id. The desktop with the problem is Mac Pro running the latest Yosemite and I have been struggling with cyclo-sphere in Safari, the latest Chrome, and the latest Firefox -- all get tripped up in the same call to the google analytics service. Another Mac on the same OS works fine as does any PC I have tried. My iPad and iPhone also work just fine with the particular site. Here is an example of the call: https://www.google-analytics.com/plugins/ga/inpage_linkid.js var e=document;window._gaq||eval("var _gaq = [];");_gaq.push(["_provide","inpage_linkid",f]); function f(c,g){var l=/(?:^__utmli=|; ?__utmli=)([^;]*)/,d=this,m=function(a,b,d,c){var h="addEventListener",k="attachEvent";if(a[h])ah;else if(a[k])ak};this.e=function(){return"; path=/"};var n=c._trackPageview;c._trackPageview=function(a){d.a();d.f&amp;&amp;c.setXKey(12,1,d…
has comment: http://stackoverflow.com/comment/45448848

http://stackoverflow.com/a/28525353
has comment: http://stackoverflow.com/comment/45366607
has comment: http://stackoverflow.com/comment/45366631
has body: Don't put quotes around the value. json_encode() will put quotes around the string, so you end up with extra quotes. It should be: userDif = &lt;?php echo json_encode($difficulty); ?&gt;;
has comment: http://stackoverflow.com/comment/45366574
answers question: http://stackoverflow.com/q/28525319
type: Answer
has comment: http://stackoverflow.com/comment/45366599
has comment: http://stackoverflow.com/comment/45366591
has comment: http://stackoverflow.com/comment/45366691
score: 0

http://stackoverflow.com/q/28585088
has comment: http://stackoverflow.com/comment/45477646
type: Question
has title: Javascript variable value not refreshing in alert box
has answer: http://stackoverflow.com/a/28585371
has body: Please help me to fix this. The issue is when i select Bangalore and choose any name from 2nd level select and click on button than result is fine, now without refreshing page i choose Hyderabad and a value from 2nd level select and click on button it is still showing value from Bangalore's 2nd level value in alert. Code: -Select Your Area- Mettuguda Lingampally -Select Your Area- A F Hospital Abbur Script: function startAjax() { var a1 = $("#start_1").val(); var a2 = $("#start_2").val(); if(a1 != ''){ var b = a1; }else{ var b = a2; } alert(b); } $(document).ready(function() { $('#Rank').bind('change', function() { var elements = $('div.container').children().hide(); // hide all the elements var value = $(this).val(); if (value.length) { // if somethings' selected elements.filter('.' + value).show(); // show the ones we want } }).trigger('change'); }); for more detail: http://jsfiddle.net/72pbbsfy/2/ Thanks for help!
upvote count: 0
score: -2
has comment: http://stackoverflow.com/comment/45477574
tagged with: javascript
tagged with: jquery
answer count: 1
accepted answer: http://stackoverflow.com/a/28585371
favorite count: 0
downvote count: 2
type: AnsweredQuestion

http://stackoverflow.com/a/28531736
upvote count: 2
has body: Use the autocomplete's change event. You can bind it using the 'autocompletechange' event: $('input[name^="itemNo"]').on( "autocompletechange", function( event, ui ) {} ); or on initialization, as in the following example: $(function() { var availableTags = [ "ActionScript", "AppleScript", "Asp" ]; $('input[name^="itemNo"]').autocomplete({ source: availableTags }, { change: function(event, ui) { var currentquantity = $(this).val(); var maxquantity = $(this).data('maxquant'); alert(currentquantity); alert(maxquantity); return false; } }); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script src=https://code.jquery.com/ui/1.11.2/jquery-ui.js "&gt;&lt;/script&gt; &lt;link rel="stylesheet" href="//code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css"&gt; &lt;input type="text " data-type="product_serial " name="itemNo[] " data-maxquant=" " id="itemNo_1 " class="form-control autocomplete_txt serial_number_append " autocomplete="off "&gt; See documentation for further information: autocomplete API
downvote count: 0
has comment: http://stackoverflow.com/comment/45379014
answers question: http://stackoverflow.com/q/28531555
type: Answer
score: 2

http://stackoverflow.com/comment/45256131
score: 0
type: AnswerComment
type: Comment
has text: Thanks, I'll take a look. Also, I was just doing some searching and I found a solution here that sounds like what you mentioned. Is this along the lines of what you had in mind? http://stackoverflow.com/a/12535936/1536869
comment on: http://stackoverflow.com/a/28464724

http://stackoverflow.com/a/28480311
downvote count: 0
answers question: http://stackoverflow.com/q/28480274
type: Answer
has comment: http://stackoverflow.com/comment/45287842
score: 3
has comment: http://stackoverflow.com/comment/45285176
upvote count: 3
has body: Stop using inline event handlers, and the issue solves itself document.getElementById('IPR_FNM1').addEventListener('blur', punctuationReplace, false); function punctuationReplace(){ this.value = this.value.replace(/("|'|&lt;|&gt;)/g, '').replace(/&amp;/g, 'and') }
has comment: http://stackoverflow.com/comment/45283005

http://stackoverflow.com/comment/45523740
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28606840
has text: Btw, you should really mention the `priority`, and `terminal` DDO attributes in your angular nested directives article on your blog
type: AnswerComment

http://stackoverflow.com/a/28527526
has body: You are looking for a greeting element, not an element with an id $("greeting"). needs to be $("#greeting").
type: Answer
accepted answer of: http://stackoverflow.com/q/28527518
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28527518
type: AcceptedAnswer
upvote count: 1

http://stackoverflow.com/comment/45324874
type: AnswerComment
comment on: http://stackoverflow.com/a/28501974
type: Comment
has text: You haven't actually made your point clear. Which *one* do you want to click? Or do you want to click all of them? If yes, in what way?
score: 1

http://stackoverflow.com/q/28516033
type: AnsweredQuestion
has body: I am using the request module in node to make an http request. How do I read the response content of that request so that I can make a programmatic decision based on the response? gulp.task("run-server-tests", function(){ var responseJson = request("http://myurl/run-server-tests") plugins.util.log(responseJson); // not sure how to get at the response json });
accepted answer: http://stackoverflow.com/a/28516191
type: Question
tagged with: javascript
has title: how to read response of simple http request made in node
score: 0
answer count: 1
tagged with: gulp
has answer: http://stackoverflow.com/a/28516191
tagged with: node.js

http://stackoverflow.com/q/28573335
has answer: http://stackoverflow.com/a/28573769
linked to: http://stackoverflow.com/q/28445991
type: Question
tagged with: http://stackoverflow.com/tag/json
answer count: 2
has title: Find e-mails on string
accepted answer: http://stackoverflow.com/a/28573769
tagged with: javascript
tagged with: regex
possible better answer: http://stackoverflow.com/a/28574242
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28574242
score: 0
has body: I asked this question a few days ago: Unable to get a specific value on a JSON object The first answer was just perfect. Now I need to modify that regular expression in order to find e-mails. The problem is I don't know anything about regular expressions and I've been looking around but don't seem to be able to pull it off. This is the code: var m=null , result=JSON.stringify(response) , re=/"message":"([^"]+)"/g , messages=[]; while( m=re.exec(result) ) { messages.push(m[1]); Everything is explained on my other question, but basically what this code does is get message":"THIS TEXT" Now I want to find out whether that text contains an e-mail or not. I've been checking out many javascript regexp examples and find it rather confusing so if you could give me a little explanation (or something to read) about why it's done the way it's done I'd really appreciate it.

http://stackoverflow.com/q/28535364
tagged with: createelement
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28535411
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28535411
has answer: http://stackoverflow.com/a/28535406
type: Question
has title: How to create an element in JavaScript, under a specific HTML tag
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28535406
answer count: 2
has body: I want to create a paragraph element from JavaScript, but I want it to be placed under a certain tag in HTML. How would I do this?

http://stackoverflow.com/q/28534943
score: -4
has comment: http://stackoverflow.com/comment/45384306
type: Question
has body: On the game I'm making here, I have a bug I need to resolve and understand. Repro steps: Click on the above link. Click New Game Check JS console; see something like "Uncaught ReferenceError: highSoreArr is not defined" I don't understand why this error is happening, because the sequence I have in my head is &lt;script type="text/javascript"&gt; /* Temporary hard-coded array for now; will be generated by server-side code later */ var highScoreArr = [["Jon","130"], ["Michelle", "90"], ["Bob", "90"], ["Sally", "80"], ["Kurt", "10"]]; &lt;/script&gt; &lt;script src="/scripts/snakescripts.js" type="text/javascript"&gt;&lt;/script&gt; and the error is in the included file, which should be read after highScoreArr is in existence -- right?
has answer: http://stackoverflow.com/a/28534971
tagged with: javascript
has title: Need help understanding why my Javascript variable is said to not be defined
tagged with: dom
downvote count: 4
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45384331
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45384320
upvote count: 0
has comment: http://stackoverflow.com/comment/45384340

http://stackoverflow.com/q/28544873
type: UnansweredQuestion
tagged with: three.js
has answer: http://stackoverflow.com/a/28554988
has comment: http://stackoverflow.com/comment/45413864
type: Question
tagged with: javascript
score: 0
has title: Obj loaded in Three.js not receiving light
has body: I have an Obj loaded in the scene. With MeshBasicMaterial, everything works fine. However, when I change it into MeshLambertMaterial, it's absolutely dark. Note that I have already set an ambient and a point light up and a Box just near the Obj model (everything is right in the camera) with MeshPhongMaterial shows up as expected. Also, to avoid setting normals the wrong way, I also assigned the "side" property of the material to DoubleSide as follows: var material = new THREE.MeshLambertMaterial({color: 'yellow', side: THREE.DoubleSide}); What's wrong with it? Thanks in advance.
answer count: 1
has comment: http://stackoverflow.com/comment/45421247

http://stackoverflow.com/q/28484035
has comment: http://stackoverflow.com/comment/45290141
has comment: http://stackoverflow.com/comment/45290158
type: Question
accepted answer: http://stackoverflow.com/a/28484140
tagged with: arrays
answer count: 1
has comment: http://stackoverflow.com/comment/45290234
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45290624
has comment: http://stackoverflow.com/comment/45290137
has comment: http://stackoverflow.com/comment/45290212
has answer: http://stackoverflow.com/a/28484140
has body: I have two arrays where I need to compare values and get the duplicates. I wrote most of the code but seem to be stumped on the comparison. Here is my code: function compare(arr1, arr2) { for (var i = 0; i&lt; arr1.length; i++) { for (var j = 0; j &lt; arr2.length; j++) { if (arr1[i] == arr2[j]) { console.log[i]; } } } } compare([5, 3, 2, 5, 1, 6], [6, 4, 2, 7, 10]); I get the for loops to print all of the numbers, but for some reason the if statement comparison doesn't work. Is there something I am not getting about comparing values in arrays? I am not looking for a straight up answer but guidance if possible.
has comment: http://stackoverflow.com/comment/45290987
has comment: http://stackoverflow.com/comment/45290412
has title: Comparing values in multiple arrays
type: AnsweredQuestion

http://stackoverflow.com/a/28558545
has comment: http://stackoverflow.com/comment/48001276
has comment: http://stackoverflow.com/comment/58052058
has comment: http://stackoverflow.com/comment/45432482
type: Answer
answers question: http://stackoverflow.com/q/28553904
has comment: http://stackoverflow.com/comment/59932870
accepted answer of: http://stackoverflow.com/q/28553904
has comment: http://stackoverflow.com/comment/48642911
score: 139
has body: Note, this answer covers React Router version 0.13.x - the upcoming version 1.0 looks like it will have significantly different implementation details Server This is a minimal server.js with react-router: var express = require('express') var React = require('react') var Router = require('react-router') var routes = require('./routes') var app = express() // ...express config... app.use(function(req, res, next) { var router = Router.create({location: req.url, routes: routes}) router.run(function(Handler, state) { var html = React.renderToString(&lt;Handler/&gt;) return res.render('react_page', {html: html}) }) }) Where the routes module exports a list of Routes: var React = require('react') var {DefaultRoute, NotFoundRoute, Route} = require('react-router') module.exports = [ &lt;Route path="/" handler={require('./components/App')}&gt; {/* ... */} &lt;/Route&gt; ] Every time a request is made to the server, you create a single-use Router instance configured with the incoming URL as its static location, which is resolved against the tree of routes to set up the appropriate matched routes, calling back with the top-level route handler to be rendered and a record of which child routes matched at each level. This is what's consulted when you use the &lt;RouteHandler&gt; component within a route handling component to render a child route which was matched. If the user has JavaScript turned off, or it's being slow to load, any links they click on will hit the server again, which is resolved again as above. Client This is a minimal client.js with react-router (re-using the same routes module): var React = require('react') var Router = require('react-router') var routes = require('./routes') Router.run(routes, Router.HistoryLocation, function(Handler, state) { React.render(&lt;Handler/&gt;, document.body) }) When you call Router.run(), it creates a Router instance for you behind the scenes, which is re-used every time you navigate around the app, as the URL can be dynamic on …
has comment: http://stackoverflow.com/comment/63220851
has comment: http://stackoverflow.com/comment/47990657
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/57275769
downvote count: 0
upvote count: 139

http://stackoverflow.com/comment/45414041
comment on: http://stackoverflow.com/a/28550410
has text: The twttr object needs to be initialized in order to have a ready function.
type: AnswerComment
score: 3
type: Comment

http://stackoverflow.com/comment/45230706
type: Comment
type: QuestionComment
has text: Yeah, learning to use the browser's console would help a lot with debugging in the future.
comment on: http://stackoverflow.com/q/28449893
score: 0

http://stackoverflow.com/comment/45330343
type: AnswerComment
has text: You rule! I added if (!("ontouchstart" in document.documentElement)) { document.documentElement.className += " no-touch"; } To my scripts file, and .no-touch before my classes I didn't want activate :hover I.E .no-touch figure.effect-sarah:hover > figcaption h2, figure.effect-sarah.hovered > figcaption h2{} This way the hover toggle still works.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28505036

http://stackoverflow.com/comment/45217849
has text: @zerkms When I remove the data (I don't need it) and contentType I get a 200 error.
comment on: http://stackoverflow.com/q/28443951
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/45243570
comment on: http://stackoverflow.com/a/28458604
has text: Just curious, why do I need to pass both form values if the person is just going to change it in the form? Is it an AJAX thing or a form thing?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28543325
favorite count: 0
has body: I'm trying to AJAX my contact form using JQuery Validation and Malsup's AJAX form plugin, but the form is not submitting at all (works without AJAX). I'm new to JS, so bear with me. Here's my script: &lt;script src="http://malsup.github.com/jquery.form.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function() { // attach handler to form's submit event $(".new-form").submit(function() { // submit the form $(this).ajaxSubmit(); // return false to prevent normal browser submit and page navigation return false; }); // validate signup form on keyup and submit $(".new-form").validate({ submitHandler: function(form) { $(form).ajaxSubmit(); }, rules: { name: { required: true, minlength: 2 }, email: { required: true, email: true }, message: { required: true } }, messages: { name: { required: "Please enter your name", minlength: "Your name must consist of at least 2 characters" }, email: { required: "Please provide a valid email address" }, message: { required: "Please provide a message" } } }); }); &lt;/script&gt; Where have I gone wrong?
upvote count: 0
has answer: http://stackoverflow.com/a/28543492
accepted answer: http://stackoverflow.com/a/28543492
has comment: http://stackoverflow.com/comment/45400312
type: AnsweredQuestion
score: -1
tagged with: forms
type: Question
tagged with: javascript
tagged with: jquery
tagged with: ajax
has title: AJAX form not working (malsup form plugin)
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45400221

http://stackoverflow.com/comment/110544464
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28556796
has text: `d3.rebind()` is not available anymore in D3 library. This answer should be updated with relevant and updated code otherwise not marked as the proper answer

http://stackoverflow.com/comment/45324189
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28489740
has text: Damn, @Louis, my eyes just ran right past that part. Thanks a bunch!

http://stackoverflow.com/comment/45408715
score: 2
has text: You have access to the variable in your callback, why do you want to pass it as a parameter?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28547584

http://stackoverflow.com/comment/45461198
comment on: http://stackoverflow.com/a/28575471
type: AnswerComment
score: 0
has text: I've tried it. It now says "Empty" when I don't put something in and "Empty " when I do put something in. One thing that would help me a lot is if you could explain I could modify your code in order to execute Javascript code in one case and execute PHP code in the other case? One example could be when not empty execute some javascript code and when empty execute some PHP code.
type: Comment

functional-programming
tags question: http://stackoverflow.com/q/28592617
tag name: functional-programming
type: Tag
tags question: http://stackoverflow.com/q/28563042
tags question: http://stackoverflow.com/q/28585245
tags question: http://stackoverflow.com/q/28557076

http://stackoverflow.com/a/28520943
has body: Here's one solution which does a few iterations of the whole data to produce a tree. Some of these iterations can be combined to improve performance but here I've left them as they are so that it's clearer what's going on: Add a children property to each person _.each(data, function(person){ _.extend(person, {children: []}); }); Create a hash of the data with the index of the person as the key and the person as the value var people = _.reduce(data, function(memo, person){ memo[person.index] = person return memo; }, {} ); The people object will look like so: { 1: {theLevel:1,displayName: "John Doe1", index:1, parIndex:null }, 2: {theLevel:1,displayName: "John Doe2", index:2, parIndex:null }, 3: {theLevel:2,displayName: "John Doe3", index:3, parIndex:1 } etc. } Add each child to the children of it's parent: _.each(data, function(person){ if( !_.isNull(person.parIndex)) people[person.parIndex].children.push(person); }); This will leave you with a tree. You can then transform this tree into whatever you like. This snippet will produce the output in the question: function isParent (person) { return !_.isEmpty(person.children); } var parents = _.filter(people, isParent); var result = _.map(parents, function(person){ return { text: person.displayName, items: _.map(person.children, function(child){ return { text: child.displayName }; }) };
has comment: http://stackoverflow.com/comment/45371288
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45363352
type: Answer
has comment: http://stackoverflow.com/comment/45439495
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28511264
has comment: http://stackoverflow.com/comment/45372294
score: 1
answers question: http://stackoverflow.com/q/28511264
has comment: http://stackoverflow.com/comment/45366483

http://stackoverflow.com/a/28463386
upvote count: 1
has body: You don't have to stringify routes array when you pass it into runRote function. In it you are using forEach method on passed data which is an array method, not string. Correct code should be: var getRoutes = function(runRote) { API.$get().getStore().success(function(data, status) { runRote(data); }).error(function(data, status) { runRote(); }); }; Also configuration for otherwise route should be redirectTo: "templates/404.html"
has comment: http://stackoverflow.com/comment/45281385
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45277059
has comment: http://stackoverflow.com/comment/45288833
answers question: http://stackoverflow.com/q/28463184
score: 1

http://stackoverflow.com/a/28581058
accepted answer of: http://stackoverflow.com/q/28579641
answers question: http://stackoverflow.com/q/28579641
has comment: http://stackoverflow.com/comment/45488033
has comment: http://stackoverflow.com/comment/45472566
type: Answer
upvote count: 0
has body: You can use jQuery for achieving this. &lt;input type="text" value="" id="calender" readonly /&gt; And your JS, which can be added inside the template/your.html itself: $("#calender").click(function() { alert("clicked"); }); You can call your settoday() function instead of alerting. Here's a JSFiddle for you to test it. Non-jquery version: http://jsfiddle.net/6jbcvd2c/1/
has comment: http://stackoverflow.com/comment/45478572
score: -1
has comment: http://stackoverflow.com/comment/45474498
has comment: http://stackoverflow.com/comment/45505618
type: AcceptedAnswer
downvote count: 1

http://stackoverflow.com/a/28531850
answers question: http://stackoverflow.com/q/28531780
has body: You could try to grab the scroll position of the iframe before you reload the new url. var scrollPosition = $('iframe').contents().find('body').scrollTop(); Then after you load the new url: $('iframe').contents().find('body').scrollTop(scrollPosition);
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28531780

http://stackoverflow.com/comment/45374260
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28529529
has text: The Tag wiki says: "answers to questions questions tagged with this tag are expected to be in pure-java script unless another library is mentioned or tagged."
score: 0

http://stackoverflow.com/comment/45324660
type: AnswerComment
score: 0
type: Comment
has text: it wont really help because its a list within a foreach loop and basically it needs to pick up the unique id of each record and display the information for that record
comment on: http://stackoverflow.com/a/28501878

http://stackoverflow.com/a/28559188
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45430569
score: 1
has body: I added this css.. .zoom { -webkit-transform:scale(2); -moz-transform:scale(2); transform:scale(2); } And modified your script to add with these lines .. $(this).addClass("zoom") and $(this).removeClass("zoom") Plus I removed a lot of the transforms and such from both your script and css. In doing so I somehow remove the centering of your text below the images. I will leave that to you to trouble shoot here is an updated fiddle https://jsfiddle.net/pokd8jv9/2/
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28559020
downvote count: 0
answers question: http://stackoverflow.com/q/28559020
has comment: http://stackoverflow.com/comment/45433124
has comment: http://stackoverflow.com/comment/45430112

http://stackoverflow.com/comment/45238298
has text: "*Basically, I would use IDs instead going trough DOM Nodes*" not necessarily. Live NodeLists can be slow, but *querySelectorAll* returns static lists that should be as fast as an Array. Re "*…is faster to decrement than to increment*". Not any more, it's slower in some browsers. Do some tests on jsperf perhaps (there are probably quite a few already there testing that, e.g. [*Loops - increment vs decrement*](http://jsperf.com/loops-increment-vs-decrement/5)).
comment on: http://stackoverflow.com/a/28455332
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45472219
score: 0
has text: no .. Sorry no error
comment on: http://stackoverflow.com/q/28581965
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45279113
has text: Thank you for notification, I fixed it.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28477982

http://stackoverflow.com/comment/45227947
type: QuestionComment
comment on: http://stackoverflow.com/q/28449723
has text: Select2: The AJAX results did not return an array in the `results` key of the response. This is the error message, but I don't have a clue how to fix that...
score: 0
type: Comment

http://stackoverflow.com/comment/45260469
type: Comment
comment on: http://stackoverflow.com/a/28466498
type: AnswerComment
has text: Hi, Your sample has the same problem as mine, if you reduce/increase the size once or twice, then it looks asymmetric again. I dont mind rounding, but i would like it to round evenly on all sides. Atm it rounds ... quite randomly. Elements that are clones of each other, look different, even though they are exactly the same in every way.
score: 0

http://stackoverflow.com/q/28516951
tagged with: post
type: Question
tagged with: raspberry-pi
linked to: http://stackoverflow.com/q/14951251
downvote count: 0
tagged with: javascript
upvote count: 11
has answer: http://stackoverflow.com/a/28517120
tagged with: get
has title: Calling method in Node js from browser (Using Express)
answer count: 3
favorite count: 0
has answer: http://stackoverflow.com/a/28517065
accepted answer: http://stackoverflow.com/a/28517065
has answer: http://stackoverflow.com/a/62713468
score: 11
possible better answer: http://stackoverflow.com/a/28517120
tagged with: node.js
type: AnsweredQuestion
has body: I defined these three routes in app.js app.use('/', require('./routes/index')); app.use('/LEDon', require('./routes/LEDon')); app.use('/LEDoff', require('./routes/LEDoff')); In my route file I have the following: var express = require('express'); var router = express.Router(); var Gpio = require('onoff').Gpio, led = new Gpio(17, 'out'); router.get('/', function(req, res, next) { led.writeSync(1); }); module.exports = router; So when I go to the /LEDon page the method runs and everything works. Is it possible though to run a method without using a get request? My main goal is to just click a hyperlink which then runs the method..

http://stackoverflow.com/q/28507946
has comment: http://stackoverflow.com/comment/45334933
has comment: http://stackoverflow.com/comment/45334917
has answer: http://stackoverflow.com/a/43057563
has answer: http://stackoverflow.com/a/28508055
tagged with: javascript
has comment: http://stackoverflow.com/comment/45335013
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28508055
favorite count: 0
has comment: http://stackoverflow.com/comment/45334891
has answer: http://stackoverflow.com/a/28508080
has answer: http://stackoverflow.com/a/28508014
has title: How do detect input field changed when selecting from a datalist?
answer count: 5
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45335018
upvote count: 2
score: 1
accepted answer: http://stackoverflow.com/a/28508014
downvote count: 1
type: Question
has body: I have an input with attached datalist: &lt;input type="text" list="mylist"&gt; &lt;datalist id="mylist"&gt; &lt;option&gt;1 &lt;option&gt;2 &lt;/datalist&gt; When I choose an option from the list then the change event doesn't fire on the input element. So how can I detect input's change?
has answer: http://stackoverflow.com/a/28508127
has comment: http://stackoverflow.com/comment/45334918

http://stackoverflow.com/comment/45403673
type: Comment
has text: From the `globalAjaxInterceptor` service you *do have* access to the `$modal` service, just like the `$q` service. So use `$modal.open()` as normal.
score: 0
comment on: http://stackoverflow.com/q/28545046
type: QuestionComment

http://stackoverflow.com/comment/45228356
has text: btw when click `submit` I can see 'alert("check1");' is executing
comment on: http://stackoverflow.com/q/28449893
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/34314032
has comment: http://stackoverflow.com/comment/57000560
score: 4
answers question: http://stackoverflow.com/q/28446753
upvote count: 4
downvote count: 0
type: Answer
has body: My solution is it: Angular directive : app.directive("markdown", function() { return { restrict: 'EA', scope: { value: '='}, template: ' ', link: function($scope, element, attrs) { // Let's get a reference to the input element, as we'll want to reference it. var inputElement = angular.element(element.children()[1]); // This directive should have a set class so we can style it. element.addClass('edit-in-place'); // Initially, we're not editing. $scope.editing = false; // ng-click handler to activate edit-in-place $scope.edit = function() { $scope.editing = true; // We control display through a class on the directive itself. See the CSS. element.addClass('active'); // And we must focus the element. // `angular.element()` provides a chainable array, like jQuery so to access a native DOM function, // we have to reference the first element in the array. inputElement[0].focus(); }; // When we leave the input, we're done editing. $scope.blur = function() { $scope.editing = false; element.removeClass('active'); } } }; }); HTML: SKU SKU proveedor Descripción Cantidad Precio unitario Total

http://stackoverflow.com/comment/45363324
type: QuestionComment
has text: There is typo error at the closing curly bracket of the else block.. :)
comment on: http://stackoverflow.com/q/28523321
type: Comment
score: 1

http://stackoverflow.com/comment/45520630
has text: Thanks for that.. Between your answer and the various research I've done since asking this question, it seems the only way is to set each and every point's colour. I was hoping for a slightly more abstract way to do it.. I'll just make a little wrapper function myself to assign these colours to my data from an array. :)
type: Comment
comment on: http://stackoverflow.com/a/28586517
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45418961
has text: http://stackoverflow.com/questions/24688268/can-a-button-click-cause-an-event-in-iframe/24689865#24689865
comment on: http://stackoverflow.com/q/28552436
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/28600649
score: 6
has comment: http://stackoverflow.com/comment/45508668
downvote count: 0
has comment: http://stackoverflow.com/comment/45507463
type: AcceptedAnswer
upvote count: 6
has body: You have to use the correct type to set a uniform. If your uniform is vec4 then you have to use either gl.uniform4f or gl.uniform4fv. uniform valid type functions ---------------------------------------------- float gl.uniform1f gl.uniform1fv vec2 gl.uniform2f gl.uniform2fv vec3 gl.uniform3f gl.uniform3fv vec4 gl.uniform4f gl.uniform4fv int gl.uniform1i gl.uniform1iv ivec2 gl.uniform2i gl.uniform2iv ivec3 gl.uniform3i gl.uniform3iv ivec4 gl.uniform4i gl.uniform4iv sampler2D gl.uniform1i gl.uniform1iv samplerCube gl.uniform1i gl.uniform1iv mat2 gl.uniformMatrix2fv mat3 gl.uniformMatrix3fv mat4 gl.uniformMatrix4fv bool gl.uniform1i gl.uniform1f gl.uniform1iv gl.uniform1fv bvec2 gl.uniform2i gl.uniform2f gl.uniform2iv gl.uniform2fv bvec3 gl.uniform3i gl.uniform3f gl.uniform3iv gl.uniform3fv bvec4 gl.uniform4i gl.uniform4f gl.uniform4iv gl.uniform4fv From the OpenGL ES 2.0 spec section 2.10.4 The Uniform* command used must match the size of the uniform, as declared in the shader. For example, to load a uniform declared as a bvec2, either Uniform2i{v} or Uniform2f{v} can be used. An INVALID_OPERATION error will be generated if an attempt is made to use a non-matching Uniform* command. In this example using Uniform1iv would generate an error For all other uniform types the Uniform* command used must match the size and type of the uniform, as declared in the shader. No type conversions are done. For example, to load a uniform declared as a vec4, Uniform4f{v} must be used. To load a 3x3 matrix, UniformMatrix3fv must be used. An INVALID_OPERATION error will be generated if an attempt is made to use a non-matching Uniform* command. In this example, using Uniform4i{v} would generate an error
has comment: http://stackoverflow.com/comment/45509626
type: Answer
accepted answer of: http://stackoverflow.com/q/28584589
answers question: http://stackoverflow.com/q/28584589
has comment: http://stackoverflow.com/comment/45507132

http://stackoverflow.com/a/28664664
answers question: http://stackoverflow.com/q/28585752
score: 2
type: AcceptedAnswer
downvote count: 0
has body: SP.ClientContext.load method allows to specify which properties have to be requested. In the example you have provided, only Url property is requested: context.load(collTermListItem, 'Include(Url)'); but two properties are excepted as a result: console.log(oListItem.get_item('Title')); //&lt;--this property is not initialized console.log(oListItem.get_item('Url')); So, the solution would be to request both properties: context.load(collTermListItem, 'Include(Title,Url)'); Example The following example demonstrates how to retrieve Title and Url properties from Images library: var listTitle = 'Images'; var ctx = SP.ClientContext.get_current(); var list = ctx.get_web().get_lists().getByTitle(listTitle); var items = list.getItems(SP.CamlQuery.createAllItemsQuery()); ctx.load(items,'Include(Title,FileRef)'); ctx.executeQueryAsync( function () { for(var i = 0; i &lt; items.get_count();i++) { var item = items.getItemAtIndex(i); console.log(item.get_item('Title')); console.log(item.get_item('FileRef')); } }, function (sender, args) { //Error handling goes here.. });
type: Answer
accepted answer of: http://stackoverflow.com/q/28585752
upvote count: 2

http://stackoverflow.com/a/28570362
has comment: http://stackoverflow.com/comment/112968221
type: AcceptedAnswer
has body: Before you start drawing circles, fill the entire canvas with black using fillRect: var canvas = document.getElementById("myCanvas"); var ctx = canvas.getContext('2d'); // fill the entire canvas with black before drawing the circles ctx.fillStyle='black'; ctx.fillRect(0,0,canvas.width,canvas.height); for(var i = 0; i &lt; 10; i++) { ...
score: 8
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/28570138
has comment: http://stackoverflow.com/comment/45452699
accepted answer of: http://stackoverflow.com/q/28570138
upvote count: 9
has comment: http://stackoverflow.com/comment/45462519

http://stackoverflow.com/a/28515600
has comment: http://stackoverflow.com/comment/45348656
answers question: http://stackoverflow.com/q/28515417
has body: Hey you have the whole li-tag as an onclick-reciever. If you want only the text to be clickable you have to chose only the a-tags $(function(){ $('a').on('click', function(){ if($(this).closest('li').children('.drop').size() &gt; 0) { $("ul.drop").slideUp(); $("ul.drop").find('ul').hide(); } else { $(this).closest('li').siblings('li').find('ul').hide(); } $(this).closest('li').children('ul') .delay(20).slideToggle(600); }); }); $('ul').on('click', function(e){e.stopPropagation();}); Try this fiddle. It should work as you expect. http://jsfiddle.net/lacrioque/84rmsgxc/
score: 0
type: Answer

http://stackoverflow.com/comment/45245615
has text: @HienLe, I think David Hughes answer is suited nicely for this situation.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28459517

http://stackoverflow.com/a/28467599
score: 2
answers question: http://stackoverflow.com/q/28454017
downvote count: 0
upvote count: 2
type: Answer
has body: There are restrictions in using XDomainRequest. If your page happens to be in https and your target is http, then you will get this error. Take note that requests must be targeted to the same scheme as the hosting page. This restriction deliberately prevents HTTPS pages from making XDomainRequests for HTTP-based resources More details can be found here: http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx

http://stackoverflow.com/comment/45305035
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28448042
has text: @user3857726 - your given info. not enough to help you.

http://stackoverflow.com/q/28508225
type: UnansweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/45336006
has comment: http://stackoverflow.com/comment/45335905
type: Question
tagged with: javascript
has title: Hide four input boxes based on drop down selection
tagged with: jquery
has body: I want to hide four input boxes. When I use if and else it only hides two boxes. My code is in regular JavaScript but I would be open to a jQuery solution. window.onload = function() { var select = document.getElementById("billing_type"); select.onchange = function() { if (select.value == "2") { document.getElementById("secondpuppytable").style.display = "inline"; } else if (select.value == "3") { document.getElementById("thirdtable").style.display = "inline"; } else{ document.getElementById("firsttable").style.display = "none"; } } }
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/28508819

http://stackoverflow.com/q/28559894
tagged with: javascript
tagged with: jquery
answer count: 2
has answer: http://stackoverflow.com/a/28559940
has body: I need to display a drop down box on selection of a particular radio button and hide it for another button!could anyone help me with its code in jquery/javascript??
favorite count: 0
type: UnansweredQuestion
downvote count: 4
upvote count: 0
has answer: http://stackoverflow.com/a/28559998
score: -4
has comment: http://stackoverflow.com/comment/45431372
type: Question
has title: i need to display a drop down box on selection of a radio button
has comment: http://stackoverflow.com/comment/45431345

http://stackoverflow.com/q/28518307
has title: Get Isotope to not load specific images at all
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/45357107
tagged with: css
tagged with: onload
has comment: http://stackoverflow.com/comment/45354672
answer count: 0
score: 1
has body: I'm working with Isotope and I have a lot of images in it. The problem is that when visiting my one page website from a smartphone it takes quite a bit to load the page as isotope load all the images thumbnails as soon as isotope itself loads. So, basically I want to hide/not load all the images that mustn't be shown if it's category isn't clicked and what I did was use two workarounds: set the figure to display:none so that it doesn't show the void where it was supposed to be and the other images can actually occupy that space set the img src to about:blank so that it doesn't load until it's category is clicked then when the link "Click me!"(category) is clicked the figure gets set to display:block and the img src gets replaced by the real image path. style: #showfigure{ display:none; !important } body: Click me! script: Now, the only way I got it to work with multiple figures/images was giving each figure and image it's own id (showfigure1, showfigure2, showfigure3 etc... and showimg1, showimg2, showimg3, etc...) as using the same id only works for the first figure/img in the code. Am I missing something? I tried replacing the path of the img src like this: http://jsfiddle.net/F6Gds/28/ But I can't get it to do the same with the onclick function from the link "Click me!", and anyways there's the same problem with the ids. Thanks in advance for any help!
has comment: http://stackoverflow.com/comment/45355907
type: Question
has comment: http://stackoverflow.com/comment/45356699
tagged with: javascript
tagged with: jquery-isotope
tagged with: replace
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/45388947
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28535153
has text: seems to work just fine: http://dojo.telerik.com/@lhoeppner/ogIxU

http://stackoverflow.com/q/28553710
type: AnsweredQuestion
tagged with: javascript
type: Question
has body: I am using bigvideo js and would like to display a poster when the video is complete. Not sure what im doing wrong here any help would be great. vid.show('vid/video.mp4'); vid.getPlayer().on("ended", function(){ vid.getPlayer().posterImage.show('/posters/poster.jpg'); });
has answer: http://stackoverflow.com/a/30298797
score: 0
answer count: 1
tagged with: html5-video
accepted answer: http://stackoverflow.com/a/30298797
has title: BigVideo JS not showing poster

http://stackoverflow.com/comment/45449815
type: Comment
comment on: http://stackoverflow.com/q/28557102
score: 0
type: QuestionComment
has text: I do have the .htaccess setup for en.html or index.html so ztest.ca/en should open en.html automatically. this code works for the original maisonbertine website but it doesn't work on mine :(.

http://stackoverflow.com/q/28520004
downvote count: 0
has comment: http://stackoverflow.com/comment/45356903
has comment: http://stackoverflow.com/comment/45356835
has title: Why declare named function before DOM event fires?
type: Question
accepted answer: http://stackoverflow.com/a/28520076
score: 1
has body: I am reading Jon Duckett's book "Javascript and jQuery." In the section about event listeners he states: If you use a named function when the event fires on your chosen DOM node, write that function first. (You could also use an anonymous function) And follows it up with this code: function checkUsername() { var elMsg = document.getElementById('feedback'); if (this.value.length &lt; 5) { elMsg.textContent = 'Username must be 5 characters or more'; } else { elMsg.textContent = ''; } } var elUsername = document.getElementById('username'); elUsername.addEventListener('blur', checkUsername, false); Since the interpreter is going to go through and look for all named functions and variables before is processes the script, why does it matter that the function comes before it is passed into addEventListener?
has answer: http://stackoverflow.com/a/28520076
answer count: 2
upvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45356850
has answer: http://stackoverflow.com/a/28520045
favorite count: 0
possible better answer: http://stackoverflow.com/a/28520045
type: AnsweredQuestion

http://stackoverflow.com/q/28592271
tagged with: javascript
score: 0
answer count: 1
tagged with: backbone.js
has body: Default Backbone.Router implementation working incorrect, for example this URL is not handled by the router: http://localhost:8080/cmp/campaigns/20416/files/wondertag10(1).xls/info But this URL is working correct: http://localhost:8080/cmp/campaigns/20416/files/wondertag10.xls/info Router code: var fileInfo = function (id, filename) { App.screenBody.show(App.CMP.FileInfo.Main.get({ id: id, fileName: filename })); }; 'cmp/campaigns/:id/files/:filename/info': 'fileInfo' I think, this is due to a regular expression that uses the backbone library. How can I fix it?
has title: How to use Backbone.Router with URL's, containing spaces or round brackets?
has answer: http://stackoverflow.com/a/28595548
type: UnansweredQuestion
tagged with: marionette
tagged with: regex
type: Question

http://stackoverflow.com/comment/45327153
type: QuestionComment
comment on: http://stackoverflow.com/q/28504078
type: Comment
score: 3
has text: Is the source of the iframe local? e.g. on the same domain?

http://stackoverflow.com/a/28587253
has body: I finally made it work by overwriting the core-submenu element. Polymer('core-submenu', { activeChanged: function() { if (!this.opened){ var scope = this.id; if (scope!="") callDispatcher(scope); } if (this.hasItems()) { this.opened = this.active; } if (!this.active) { this.unselectAllItems(); } } });
type: Answer
answers question: http://stackoverflow.com/q/28581443
score: 0

http://stackoverflow.com/a/28518773
score: 1
has comment: http://stackoverflow.com/comment/45362773
answers question: http://stackoverflow.com/q/28518030
upvote count: 1
type: Answer
has body: I first had to delete .append("img").attr("src","http://www.metmuseum.org/~/media/Images/Metpublication/Cover/2004/Echoing_Images_Couples_in_African_Sculpture.jpg"); from my tooltip variable in var tooltip = d3.select("body") .append("div").attr("id", "tool_tip").style("position", "absolute") .style("z-index", "10") .style("visibility", "hidden") .style("background-color", "yellow")//.style("top","100px").style("left","20px") .text("a simple tooltip").append("img").attr("src","http://www.metmuseum.org/~/media/Images/Metpublication/Cover/2004/Echoing_Images_Couples_in_African_Sculpture.jpg"); That was causing embeded image tags when the page was being rendered. It was also causing the text to form within the embeded image and not after the #tool_tip div. As far as forming the tooltip on mouseover within the block of code svg.append("g").attr("class","points") .selectAll("text").data(places.features) .enter().append("path").attr("r", function(d){return 1234567}) .attr("class", "point") .on("mouseover", function(d) {... that I have posted in my question I did away with $('#tool_tip').text(d.properties[0].TeamName); and added this line of code return tooltip.html(d.properties[0].TeamName+"&lt;img src = 'http://www.metmuseum.org/~/media/Images/Metpublication/Cover/2004/Echoing_Images_Couples_in_African_Sculpture.jpg'&gt;")//text(d.properties[0].TeamName);//.append("img").attr("src","http://www.metmuseum.org/~/media/Images/Metpublication/Cover/2004/Echoing_Images_Couples_in_African_Sculpture.jpg"); the .html() function allowed me to properly format the html within the #tool_tip div on hover.
downvote count: 0

http://stackoverflow.com/comment/45433105
type: Comment
type: QuestionComment
has text: Possible duplicate:http://stackoverflow.com/questions/20866249/rotate-text-in-a-canvas-with-javascript
comment on: http://stackoverflow.com/q/28560842
score: 0

http://stackoverflow.com/q/28451750
has comment: http://stackoverflow.com/comment/45231020
tagged with: javascript
type: Question
answer count: 2
upvote count: 1
has title: Get element attributes within inline styles
tagged with: jquery
has body: I have the following html block: I need to get the position of each from the inline css, how can I do that? I know I can't use .attr() or js getAttribute as this would return the whole style block. I ideally I'd like something like: $(".container> .class").each(function(){ var context = $(this); var thisLeft = context.left; // which I know is incorrect } Is this possible? JQuery or vanilla fine
favorite count: 0
has answer: http://stackoverflow.com/a/28451798
accepted answer: http://stackoverflow.com/a/28451798
possible better answer: http://stackoverflow.com/a/28451924
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28451924
type: AnsweredQuestion

http://stackoverflow.com/a/28554988
type: Answer
answers question: http://stackoverflow.com/q/28544873
has body: Ah, the trick is that I have to invoke computeFaceNormals() and computeVertexNormals() manually.
score: 0

http://stackoverflow.com/q/28491838
has title: d3.js How to draw stacked horziontal bars from array?
type: Question
has answer: http://stackoverflow.com/a/28492240
score: 2
has body: I am trying to get this particular example of stacked horizontal bars to work in a browser standalone: http://tributary.io/inlet/4966973 . I know a question has been asked about this code before, but it was never taken to a working example. When I run the code below in a browser (ie outside the tributary site), I get this error: 'Error: Invalid value for attribute transform="translate(0,NaN)"'. Why won't the code run in a browser? Is there some element missing? /*modified from Mike Bostock at http://bl.ocks.org/3943967 */ var data = [ {"key":"FL", "pop1":3000, "pop2":4000, "pop3":5000}, {"key":"CA", "pop1":3000, "pop2":3000, "pop3":3000}, {"key":"NY", "pop1":12000, "pop2":5000, "pop3":13000}, {"key":"NC", "pop1":8000, "pop2":21000, "pop3":11000}, {"key":"SC", "pop1":30000, "pop2":12000, "pop3":8000}, {"key":"AZ", "pop1":26614, "pop2":6944, "pop3":30778}, {"key":"TX", "pop1":8000, "pop2":12088, "pop3":20000} ]; var n = 3, // number of layers m = data.length, // number of samples per layer stack = d3.layout.stack(), labels = data.map(function(d) {return d.key;}), //go through each layer (pop1, pop2 etc, that's the range(n) part) //then go through each object in data and pull out that objects's population data //and put it into an array where x is the index and y is the number layers = stack(d3.range(n).map(function(d) { var a = []; for (var i = 0; i < m; ++i) { a[i] = {x: i, y: data[i]['pop' + (d+1)]}; } return a; })), //the largest single layer yGroupMax = d3.max(layers, function(layer) { return d3.max(layer, function(d) { return d.y; }); }), //the largest stack yStackMax = d3.max(layers, function(layer) { return d3.max(layer, function(d) { return d.y0 + d.y; }); }); var margin = {top: 40, right: 10, bottom: 20, left: 50}, width = 677 - margin.left - margin.right, height = 533 - margin.top - margin.bottom; var y = d3.scale.ordinal() .domain(d3.range(m)) .rangeRoundBands([2, height], .08); var x = d3.scale.linear() .domain([0, yStackMax]) .range([0, width]); var color…
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/26029141
accepted answer: http://stackoverflow.com/a/28492240
upvote count: 2
tagged with: d3.js
type: AnsweredQuestion

http://stackoverflow.com/a/28529963
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28529797
downvote count: 0
has body: You can use setTimeout instead of setInterval and use 2 different functions to hide and show message, calling the other with the right timer. It is also good idea to store jQuery objects to variables instead of creating new all the time. var duration = 30; var interval = 5000; var blinkMessage = $('.blink_message'); function showMessage() { blinkMessage.removeClass('hidden'); setTimeout(hideMessage, duration) } function hideMessage() { blinkMessage.addClass('hidden'); setTimeout(showMessage, interval) } showMessage(); See this example on JSFiddle: http://jsfiddle.net/2bv4w62u/1/

http://stackoverflow.com/a/28483699
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28483576
type: Answer
score: 2
has body: The two main ways you can do it without if/else if/else being combined are a simple fall through function foo(opt) { if (opt === 'this') { return true; } if (opt === 'that') { return 'something else'; } /* Code here represents the case that opt is not this or that */ } Another more complex way of doing it would be to have some kind of array of options and then checking them all but it's a bad pattern and you really should consider using if/else if/else as a combined tree (not sure you've really explained why you can't do this. function foo(opt) { var checked = ['this', 'that']; if (opt === 'this') { return true; } if (opt === 'that') { return 'something else'; } if (checked.indexOf(opt) === -1) { return 'fall through case'; } } A switch is also possible but that's just a variation of a combined if/else if/else so if you can't use the latter I don't see how the former would help Again the above is a bad pattern but if for some reason that's what you have to then there's an implementation.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28483576

http://stackoverflow.com/a/28498842
upvote count: 1
has body: You can do the following: var duplicate = smValue.concat(smValue); Concat 'merges' array's together, or a better word is joining them together.
downvote count: 0
score: 1
type: Answer
answers question: http://stackoverflow.com/q/28498763

http://stackoverflow.com/a/28597776
has body: Ok, so the answer was so simple, I can't believe it took me so long to get to it. If you make a textbox readonly, it doesn't show the keyboard, but still fires key events. This allowed me to accept input from the external source without showing the keyboard. I also added a keyboard toggle button that simply hid the readonly textbox and showed the regular one. If my application would have been different, I could have just added and removed the readonly attribute and applied focus again to have the same effect. Thanks for all replies, including the ones that got deleted.
has comment: http://stackoverflow.com/comment/45503559
has comment: http://stackoverflow.com/comment/45877391
type: Answer
has comment: http://stackoverflow.com/comment/45582022
has comment: http://stackoverflow.com/comment/45582065
has comment: http://stackoverflow.com/comment/45546916
answers question: http://stackoverflow.com/q/28575259
score: 0
has comment: http://stackoverflow.com/comment/45503603

http://stackoverflow.com/q/28573303
has answer: http://stackoverflow.com/a/28573421
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28573386
accepted answer: http://stackoverflow.com/a/28573386
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45456236
has body: I have a node system, which stores a bunch of nodes that are connected to other nodes. The data is structured like this: [ {"id":0,"x":1,"y":2, "linksTo":[1]}, {"id":1,"x":3,"y":4, "linksTo":[0,2,3]}, {"id":2,"x":5,"y":6, "linksTo":[1,4]}, {"id":3,"x":3,"y":10,"linksTo":[1,4]}, {"id":4,"x":5,"y":12,"linksTo":[2,3]} ] What I'm trying to do is delete a certain node, and all references to that in the other nodes that might be "linked" to it based on its ID. I've gotten to the point where I can get the node i need using this function: function getNode(id, y){ var x; if(y){ x = id; } if(x &amp;&amp; y){ var nodeAtPos = false; Object.keys(paths.list).forEach(function(i){ if(paths.list[i].x == x &amp;&amp; paths.list[i].y == y){ nodeAtPos = paths.list[i]; return false; } return true; }); return nodeAtPos; } return paths.list[id]; } function deleteNode(x,y){ var obj = getNode(x,y); //need to delete obejct and delete key references in other objects that were connected to it } deleteNode(5,12); The end result would look like this in my data structure: [ {"id":0,"x":1,"y":2, "linksTo":[1]}, {"id":1,"x":3,"y":4, "linksTo":[0,2,3]}, {"id":2,"x":5,"y":6, "linksTo":[1]}, //changed {"id":3,"x":3,"y":10,"linksTo":[1]}, //changed ] But as you can see in my data strucutre, if I simply delete it, I still have a few nodes that linksTo to it that I need to clean up. Otherwise they will be linked to non existant nodes. What would be the simplest way to do this?
has comment: http://stackoverflow.com/comment/45456209
possible better answer: http://stackoverflow.com/a/28573421
has comment: http://stackoverflow.com/comment/45456205
type: AnsweredQuestion
has title: Delete object references to selected object by it's ID

http://stackoverflow.com/comment/45549188
comment on: http://stackoverflow.com/a/28601851
score: 0
type: AnswerComment
has text: Well, it's the same. The minus sign is a `.ui-icon-minus` with an `:after`, just apply the same code on it.
type: Comment

http://stackoverflow.com/comment/45270988
type: AnswerComment
comment on: http://stackoverflow.com/a/28473641
score: 0
type: Comment
has text: I should have mentioned that I won't always know the values "1", "2", or "3". They can really be anything, but I'm just trying to return the first one (which is "1" in this example).

http://stackoverflow.com/comment/45452381
has text: @Oluwafemi, sorry for that, I have edited my answer.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28567354
type: Comment

http://stackoverflow.com/q/28575591
has comment: http://stackoverflow.com/comment/45461226
has comment: http://stackoverflow.com/comment/45461556
type: Question
has answer: http://stackoverflow.com/a/28575794
has comment: http://stackoverflow.com/comment/45461725
tagged with: php
has comment: http://stackoverflow.com/comment/45461605
has comment: http://stackoverflow.com/comment/45461173
has comment: http://stackoverflow.com/comment/45461456
score: 0
has comment: http://stackoverflow.com/comment/45461736
has body: I have a html select dropdown list in my view &lt;?php $level = $this-&gt;escapeHtml($user-&gt;level); ?&gt; &lt;?php if ($level == 1): ?&gt; &lt;option value="1" selected ="selected"&gt;Administrator&lt;/option&gt; &lt;option value="2" &lt;?php IsSelected($level,2); ?&gt;&gt; Manager&lt;/option&gt; &lt;option value="3" &lt;?php IsSelected($level,3); ?&gt;&gt;HR Staff&lt;/option&gt; &lt;?php elseif ($level == 2): ?&gt; &lt;option value="1" &lt;?php IsSelected($level,1); ?&gt;&gt;Administrator&lt;/option&gt; &lt;option value="2" selected ="selected"&gt;Manager&lt;/option&gt; &lt;option value="3" &lt;?php IsSelected($level,3); ?&gt;&gt;HR Staff&lt;/option&gt; &lt;?php elseif ($level == 3): ?&gt; &lt;option value="1" &lt;?php IsSelected($level,1); ?&gt;&gt;Administrator&lt;/option&gt; &lt;option value="2" &lt;?php IsSelected($level,2); ?&gt;&gt;Manager&lt;/option&gt; &lt;option value="3" selected ="selected"&gt;HR Staff&lt;/option&gt; &lt;?php endif; ?&gt; &lt;/select&gt; What I want is that everytime I select on my dropdown, it must update the level column in my user table in database. I have tried using onchange event of javascript &lt;script type='text/javascript'&gt; function changeLevel(level){ var user_id = level.value; $.ajax({ type: 'GET', url: '/editLevel/'+user_id, cache: false, success: function(response) { $("#test").html(response); } }); alert(user_id); } &lt;/script&gt; but it fails on calling the parent url. this outputs http://localhost/ijm/public/%7B%7BURL()%7D%7D/editLevel/2 instead of http://localhost/ijm/public/user/editLevel/2 aside from that, how can I update my user table from that javascript function? this is my function in userController public function editLevelAction() { //return $this-&gt;$view; $id = (int) $this-&gt;params()-&gt;fromRoute('id', 0); $data = array( 'level' =&gt; $level ); $this-&gt;update('user', $data, 'id = ' .'39'); //return $this-&gt;redirect()-&gt;toRoute('user'); } what should i need to do for this to work? Thanks in ad…
has title: How to update in database after select change in html select in zend
answer count: 1
has comment: http://stackoverflow.com/comment/45461433
has comment: http://stackoverflow.com/comment/45461359
has comment: http://stackoverflow.com/comment/45468315
tagged with: zend-framework
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45461697
has comment: http://stackoverflow.com/comment/45466164
tagged with: onchange
has comment: http://stackoverflow.com/comment/45460782
has comment: http://stackoverflow.com/comment/45461200

http://stackoverflow.com/comment/45276445
comment on: http://stackoverflow.com/a/28476669
type: Comment
has text: @jogesh_pi it is just another approach suggested. yet there are other ways too.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28580466
has comment: http://stackoverflow.com/comment/45471997
tagged with: asp.net-mvc
has body: I'm trying to send two arrays of integer to my MVC controller via AJAX. here is my JavaScript code: var condDeviceIDs = []; var resDeviceIDs = []; $("#selectDvcForCond").on('click', function () { var deviceID = $('#dvc-cond').val(); condDeviceIDs.push(deviceID); }); $("#selectDvcForRes").on('click', function () { var deviceID = $('#dvc-res').val(); resDeviceIDs.push(deviceID); }); $("#AddScenarioButton").on('click', function () { $.ajax({ type: 'POST', url: "@Url.Action("AddScenario", "Device")", traditional: true, data: { 'conditionIDs': condDeviceIDs, 'resultIDs': resDeviceIDs }, } ); }); and here is my Action: public ActionResult AddScenario(int[] conditionIDs,int[] resultIDs) the problem is axaj passes only the last element of array to controller. I checked my JS code with firebug and it was correct. for example the 'condDeviceIDs' contains [17, 4, 6], but when ajax sends it to controller, "conditionIDs" only contains [6]. What am I doing wrong?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45470636
has comment: http://stackoverflow.com/comment/45469463
answer count: 1
has answer: http://stackoverflow.com/a/28597909
tagged with: jquery
has comment: http://stackoverflow.com/comment/45469830
tagged with: ajax
has comment: http://stackoverflow.com/comment/45469180
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45470412
has comment: http://stackoverflow.com/comment/45469993
has comment: http://stackoverflow.com/comment/45469446
has comment: http://stackoverflow.com/comment/45469884
has comment: http://stackoverflow.com/comment/45469495
has title: AJAX passes only the last element of array to MVC 5 controller
score: 0
has comment: http://stackoverflow.com/comment/45469127
has comment: http://stackoverflow.com/comment/45470076
has comment: http://stackoverflow.com/comment/45469639
has comment: http://stackoverflow.com/comment/45470818
type: Question
has comment: http://stackoverflow.com/comment/45469948
tagged with: asp.net-mvc-5
has comment: http://stackoverflow.com/comment/45471708

http://stackoverflow.com/a/60015099
has body: import React from 'react'; class MyComponent extends React.Component { getComponent(event) { event.target.style.backgroundColor = '#ccc'; // or you can write //arguments[0].target.style.backgroundColor = '#ccc'; } render() { return( Component 1 ); } } export { MyComponent }; // use this to be possible in future imports with {} like: import {MyComponent} from './MyComponent' export default MyComponent;
downvote count: 0
answers question: http://stackoverflow.com/q/28511207
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/106139561

http://stackoverflow.com/a/28570216
score: 1
upvote count: 1
type: AcceptedAnswer
has body: I found a Solution, just added this "res.header("Access-Control-Allow-Headers", "x-requested-with, x-requested-by");" to the headers, removed the other ones and removed cors server of the URL. Now its working fine. The working code: //Active Match router.get('/activematchbyid/:server/:sid', function(req, res, next) { var serverList = {br: 'BR1', na: 'NA1', eune: 'EUNE1', euw: 'EUW1', kr: 'KR1', lan: 'LAN1', las: 'LAS1', oce: 'OCE1', tr: 'TR1', ru: 'RU'}; var url = 'https://' + req.params.server + '.api.pvp.net/observer-mode/rest/consumer/getSpectatorGameInfo/' + serverList[req.params.server] + '/' + req.params.sid + '?api_key=' + apiKey; res.header("Access-Control-Allow-Headers", "x-requested-with, x-requested-by"); request(url, function(err, resp, body){ String.prototype.beginsWith = function (string) { return(this.indexOf(string) === 0); } if (body.beginsWith('&lt;html&gt;') || body.beginsWith('Missing')){ res.send(resp.statusCode); }else{ body = JSON.parse(body); res.send(body); }; }); });
type: Answer
answers question: http://stackoverflow.com/q/28568370
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28568370

http://stackoverflow.com/q/28578703
tagged with: javascript
has comment: http://stackoverflow.com/comment/45466619
has comment: http://stackoverflow.com/comment/45466508
tagged with: extjs
score: 0
has comment: http://stackoverflow.com/comment/45466560
answer count: 1
has title: EXTJS 4 - Grid Filter or store filter clearing existing filter on store
accepted answer: http://stackoverflow.com/a/28579271
tagged with: extjs4
has comment: http://stackoverflow.com/comment/45467468
type: AnsweredQuestion
tagged with: extjs4.2
tagged with: extjs4.1
has answer: http://stackoverflow.com/a/28579271
type: Question
has comment: http://stackoverflow.com/comment/45467461
has comment: http://stackoverflow.com/comment/45466554
has comment: http://stackoverflow.com/comment/45466223
has body: I have come across an issue where the grid filter is clearing the existing filter that is on the store. Basically, I have two grids on top of each other, when a user clicks on the top grid, data is filtered into the second grid, it is the second grid where the issue is occurring. I have created a simplified example of the issue via fiddle https://fiddle.sencha.com/#fiddle/if0 Notes The caveat is that I am "flattening" nested JSON custom fields via the record.beginEdit() command so that this data can be shown in the grid. I am using remoteFilter: false, if this is set to remoteFilter: true then the filter part works but remoteFilter: true destroys the nested data set via the record.beginEdit(); How to reproduce 1) If you apply the grid filter above in column Name and select Homer then the Grid filter is clearing down the filter applied on the store in line 113 and now showing the two Homer records. There are two Homer records but each has a different summaryId value. store.filter([{id: 'summaryId', property: 'summaryId', value:1, exactMatch: true}]); 2) If you deselect the filter, then the filter applied to the store in line 113 is not maintained and all records are now shown.
has comment: http://stackoverflow.com/comment/45466776
has comment: http://stackoverflow.com/comment/45466498

http://stackoverflow.com/comment/45484487
type: QuestionComment
has text: Ok, good to know that I wasn't just absolute rubbish at finding the answer, then! Thanks amigo
comment on: http://stackoverflow.com/q/28587356
score: 0
type: Comment

http://stackoverflow.com/q/28528697
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: node.js
has body: I'm building something like Amblilight and I need to capture the screen (1920x1080) as fast as possible and process it to get colors for LEDs. I'm using Node.js as programming language. I tried to capture screen using VNC protocol (using my own client impementation), but it gave me like 1 FPS and there was delay like 3 seconds. I need fastest way to capture the screen of the computer, which runs node.js. I'm using Ubuntu-based linux distro.
score: 3
has title: Fastest way to capture server screen in Node.js
upvote count: 3
type: Question
tagged with: vnc
has answer: http://stackoverflow.com/a/28529659

http://stackoverflow.com/q/28464261
has answer: http://stackoverflow.com/a/28464316
score: 0
has comment: http://stackoverflow.com/comment/45295406
answer count: 2
has title: Javascript - Troubles with looping through array index
has body: I'm making a quiz that displays how many questions you got right. I have managed to get it to work with the first question but i'm struggling to figure out how to loop through all the other questions within my array. here's my JS code: var questionArray = new Array (8); questionArray [0] = "q1" questionArray [1] = "q2" questionArray [2] = "q3" questionArray [3] = "q4" questionArray [4] = "q5" questionArray [5] = "q6" questionArray [6] = "q7" questionArray [7] = "q8" var correctAnswers = 0; function checkQuestions() { var questions = document.getElementsByName(questionArray[0]); var numberOfRadios = questions.length; for( var i = 0; i &lt; numberOfRadios; i++) { if(questions[i].checked) { if(questions[i].value == "correct") { correctAnswers++ } } } document.getElementById("correctAnswers").innerHTML = "You got:" + "&lt;br&gt;" + correctAnswers + "/8!!"; }
tagged with: loops
accepted answer: http://stackoverflow.com/a/28464316
type: AnsweredQuestion
tagged with: arrays
tagged with: javascript
type: Question
possible better answer: http://stackoverflow.com/a/28464373
has answer: http://stackoverflow.com/a/28464373

http://stackoverflow.com/q/28438834
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28439007
has body: I have a site that uses php to populates a series of divs with messages from a MySql server. I am trying to code in a toggle of each of the messages, so that they can be easily collapsed. The issue lies in how to code it in. Observe: [-] Its a piece of cake to bake a pretty cake. Its a piece of cake to bake a pretty cake. [-] Its a piece of cake to bake a pretty cake. Its a piece of cake to bake a pretty cake. I would greatly appreciate any advice that you could give me. I have tried using by class instead of Id, but nothing happens at all with that. I am fairly new to using javascript.
tagged with: http://stackoverflow.com/tag/html
tagged with: php
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45207554
downvote count: 1
type: Question
tagged with: javascript
score: -1
accepted answer: http://stackoverflow.com/a/28439007
upvote count: 0
has comment: http://stackoverflow.com/comment/45207465
answer count: 1
has title: Toggle Comment Boxes

mysql
tags question: http://stackoverflow.com/q/28566868
tags question: http://stackoverflow.com/q/28500318
tags question: http://stackoverflow.com/q/28458307
tags question: http://stackoverflow.com/q/28476038
tags question: http://stackoverflow.com/q/28516408
tags question: http://stackoverflow.com/q/28556538
tags question: http://stackoverflow.com/q/28592995
tag name: mysql
tags question: http://stackoverflow.com/q/28565405
tags question: http://stackoverflow.com/q/28511677
tags question: http://stackoverflow.com/q/28587951
tags question: http://stackoverflow.com/q/28521684
tags question: http://stackoverflow.com/q/28470474
tags question: http://stackoverflow.com/q/28559912
tags question: http://stackoverflow.com/q/28527237
tags question: http://stackoverflow.com/q/28453390
tags question: http://stackoverflow.com/q/28471139
tags question: http://stackoverflow.com/q/28514208
tags question: http://stackoverflow.com/q/28460715
tags question: http://stackoverflow.com/q/28477555
tags question: http://stackoverflow.com/q/28487086
tags question: http://stackoverflow.com/q/28466694
tags question: http://stackoverflow.com/q/28526417
tags question: http://stackoverflow.com/q/28551080
tags question: http://stackoverflow.com/q/28462451
type: Tag
tags question: http://stackoverflow.com/q/28445893
tags question: http://stackoverflow.com/q/28582725
tags question: http://stackoverflow.com/q/28494269
tags question: http://stackoverflow.com/q/28495544
tags question: http://stackoverflow.com/q/28515255
tags question: http://stackoverflow.com/q/28531370
tags question: http://stackoverflow.com/q/28528711
tags question: http://stackoverflow.com/q/28593146
tags question: http://stackoverflow.com/q/28470447
tags question: http://stackoverflow.com/q/28590972
tags question: http://stackoverflow.com/q/28561040
tags question: http://stackoverflow.com/q/28535693

http://stackoverflow.com/q/28503396
answer count: 1
has answer: http://stackoverflow.com/a/28503429
type: AnsweredQuestion
type: Question
has title: javascript setting a var with a new line break in string
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28503429
tagged with: jquery
score: 0
has body: I have a site with a commenting system. The system grabs the previous comment, and adds it to the next one. In reply to your comment:\n&lt;?php echo $_POST['firstComment'];?&gt;\n-------------\n When the user tries to add a new comment I would grab the above line and throw it here: $('#addCommentButton').click(function(){ var id = $(this).attr('name'); var firstComment = "&lt;?php echo $bodyComment;?&gt;"; $.ajax({....... The problem is the var firstComment gets defined as: "In reply to your comment: g ------------- asdfasfasfsfsdfsdf"; and i end up with a javascript error: Uncaught SyntaxError: Unexpected token ILLEGAL The problem is with the new line break which i need, so that the comment box looks presentable. How can i set the variable firstComment to what is here including new line breaks? I have tried: var firstComment = "&lt;?php echo $bodyComment;?&gt;".replace("\n|\r\n|&amp;#13;&amp;#10;",""); and still get the error.

http://stackoverflow.com/comment/45433527
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28558973
has text: Yes !!! Pawel thank you very much !!!1
score: 0

http://stackoverflow.com/comment/45508557
type: QuestionComment
comment on: http://stackoverflow.com/q/28584146
type: Comment
has text: @ArunprasanthKV, my ultimate goal is to capitalize every first letters in every textarea word. Sorry for a confusing question. I edited the question.
score: 0

http://stackoverflow.com/comment/45438929
type: QuestionComment
has text: Yes, the simulated trackball is in the center of the canvas. You appear to prefer to imagine the simulated trackball as being repositioned directly under the mouse on mousedown events.
score: 0
comment on: http://stackoverflow.com/q/28560130
type: Comment

http://stackoverflow.com/comment/45434431
score: 0
has text: And for some reason.. This tree itself doesnt work now! I dont remember changing anything! Going to tke another hour of brain storming I suppose. (UPDATE). My tree works now. But therefresh you suggested doesnt
comment on: http://stackoverflow.com/a/28543687
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45380462
has text: Thank you for your answer, but it doesn't totally work. In the code I posted, readWebpage was in a totally separate class called `DownloadWebPageTask` and therefore cannot be accessed the way you suggested above. Also, the `DownloadWebPageTask` class isn't being called at all. Any ideas how to fix these issues?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28532756
type: Comment

http://stackoverflow.com/q/28459382
downvote count: 2
has answer: http://stackoverflow.com/a/28465128
linked to: http://stackoverflow.com/q/28461564
tagged with: frameworks
has body: I have little experience with meteor, so for others who have some... What are some concrete downfalls, if any, of building what would normally be a multi-page app (e.g. blog) in meteor? I can't think of any reason not to go with meteor for my project other than fear of the unknown.
tagged with: javascript
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/28332032
has comment: http://stackoverflow.com/comment/45245185
has title: What are the downfalls of creating a traditional webapp in meteor?
tagged with: meteor
score: -1
favorite count: 0
type: Question
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/45259453
has comment: http://stackoverflow.com/comment/45245541
has answer: http://stackoverflow.com/a/28459991

cryptography
tag name: cryptography
type: Tag
tags question: http://stackoverflow.com/q/28583357
tags question: http://stackoverflow.com/q/28509456

http://stackoverflow.com/a/28572606
answers question: http://stackoverflow.com/q/28550228
type: Answer
upvote count: 2
has body: I've managed to get it working by intercepting ChromeWindow.openLinkIn() with a Proxy object: // window is a top level ChromeWindow window.openLinkIn = new Proxy( window.openLinkIn, { apply: function( target, thisArg, argumentsList ) { let url = argumentsList[ 0 ]; let where = argumentsList[ 1 ]; let params = argumentsList.length &gt; 2 ? argumentsList[ 2 ] : {}; // links opened through the context menu or Ctrl/⌘/Shift+click // don't have params.fromChrome = true if( !url || !where || params.fromChrome ) { return target.apply( thisArg, argumentsList ); } switch( where ) { case 'tab': // break intentionally omitted case 'tabshifted': let tabBrowser = window.gBrowser; tabBrowser.tabContainer.addEventListener( 'TabOpen', function onTabOpen( event ) { tabBrowser.tabContainer.removeEventListener( 'TabOpen', onTabOpen, true ); let tab = event.target; // do something with the new tab }, true ); break; case 'window': let windowTracker = { init: function() { observerService.addObserver( this, 'toplevel-window-ready', false ); }, destroy: function() { observerService.removeObserver( this, 'toplevel-window-ready' ); }, observe: function( subject, topic, data ) { let self = this; let chromeWindow = subject; if( 'toplevel-window-ready' == topic &amp;&amp; chromeWindow instanceof Ci.nsIDOMWindow ) { chromeWindow.addEventListener( 'DOMContentLoaded', function onChromeWindowDOMContentLoaded( event ) { this.removeEventListener( 'DOMContentLoaded', onChromeWindowDOMContentLoaded, true ); if( 'navigator:browser' == this.document.documentElement.getAttribute( 'windowtype' ) ) { // do something with the new chromeWindow // destroy the windowTracker self.destroy(); } }, true ); } } } windowTracker.init(); break; } return target.apply( thisArg, argumentsList ); } } ); PS.: Be sure to clean up and reinstall the original function, of course, when your extension is disabled. You can do this with something like this: let originalOpenLinkIn = window.openLinkIn; window.openLinkIn = new Proxy( w…
score: 2
downvote count: 0

http://stackoverflow.com/comment/45315427
type: QuestionComment
has text: i have this in html
score: 0
comment on: http://stackoverflow.com/q/28498014
type: Comment

http://stackoverflow.com/q/28535398
has body: I am using Polymer's paper dropdown menu in my application and it has a list of integers as paper-items. I am trying to extract the selected value from the dropdown, but I always get this error : Type Error : Undefined is not an object. The code I am using is this : &lt;paper-dropdown-menu id="dropmenu" label="Select Here&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"&gt; &lt;paper-dropdown class="dropdown"&gt; &lt;core-menu class="menu"&gt; &lt;paper-item&gt;0.405&lt;/paper-item&gt; &lt;paper-item&gt;0.540&lt;/paper-item&gt; and so on.. and for JS : &lt;script type="text/javascript"&gt; function getDropdownVal() { var f = function() { var dropd = document.querySelector('#dropmenu').detail.item; var x = dropd.value; var y = parseInt(x); alert("Selected item is" +y); }; f(); }; &lt;/script&gt; What am I doing wrong ? How do I fix this ? Thanks !
tagged with: javascript
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28548387
has title: Polymer How to get integer value of paper-dropdown menu
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28548387
possible better answer: http://stackoverflow.com/a/28537538
has answer: http://stackoverflow.com/a/28537538
type: Question
tagged with: polymer

http://stackoverflow.com/comment/45411362
score: 0
type: AnswerComment
has text: Okay, I undertand. So although I 'return' a value in my test function, I must 'return' the function that I call. I did this and it works. Thank you
type: Comment
comment on: http://stackoverflow.com/a/28547682

http://stackoverflow.com/q/28506406
has answer: http://stackoverflow.com/a/28506715
has comment: http://stackoverflow.com/comment/45332191
favorite count: 0
has body: I need help making a function that turns this list of variables: var a = {bacon: 12, chicken: 2}; var b = {bacon: 10, chicken: 5}; into this object: var obj = { a: {bacon: 12, chicken: 2}, b: {bacon: 10, chicken: 5} };
type: UnansweredQuestion
score: -4
tagged with: javascript-objects
has title: Turn a list of javascript variables into object key/value pairs
has comment: http://stackoverflow.com/comment/45332044
has comment: http://stackoverflow.com/comment/45332114
has answer: http://stackoverflow.com/a/28506512
has comment: http://stackoverflow.com/comment/45332234
type: Question
answer count: 2
downvote count: 4
upvote count: 0
has comment: http://stackoverflow.com/comment/45331991
tagged with: javascript

http://stackoverflow.com/comment/45318302
comment on: http://stackoverflow.com/q/28476576
score: 0
type: Comment
has text: Sorry should have said yes I would like it to show 2 ticks when count=2 and 3 when count=3 etc.
type: QuestionComment

http://stackoverflow.com/comment/45302051
type: QuestionComment
has text: @developerwjk does the `edit` make things any clear?
comment on: http://stackoverflow.com/q/28490199
score: 0
type: Comment

http://stackoverflow.com/a/28535077
has body: Since class is just syntactic sugar, this should work: class Component { constructor() { super() } } Component.prototype.render = style(function() { });
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28535006
type: Answer
upvote count: 6
score: 6
answers question: http://stackoverflow.com/q/28535006

http://stackoverflow.com/a/28530478
has body: xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { var xmlDoc = xmlhttp.responseXML; // get each property // Last known execution var x = xmlDoc.getElementsByTagName('province'); for (i = 0; i &lt; x.length; i++) { var e = document.getElementById('province_id'); var opt = document.createElement('option'); opt.value = x[i].getElementsByTagName('zoneid')[0].textContent; opt.innerHTML = x[i].getElementsByTagName('zone')[0].textContent; e.appendChild(opt); } } } i made a plunker and test it. replace the \" by ' and use .textContent http://plnkr.co/edit/fddv9rYpCcbz4zt1D9Sb?p=preview (sorry for mislead you before)
has comment: http://stackoverflow.com/comment/45378358
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45378663
has comment: http://stackoverflow.com/comment/45378274
type: Answer
answers question: http://stackoverflow.com/q/28529724
accepted answer of: http://stackoverflow.com/q/28529724
score: 0

http://stackoverflow.com/comment/45205414
has text: I guess you need to bone up on `this` and how it's used to hold instance-specific values.
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28437672

http://stackoverflow.com/q/28556413
score: 1
has answer: http://stackoverflow.com/a/28557809
upvote count: 1
type: Question
tagged with: javascript
tagged with: stackedbarseries
has body: I am trying to plot a stacked bar chart and i am dynamically passing the data to the chart When i pass the input [1, 0] [0, 1] [0, 0] [0, 1] ["2015-02-16", "2015-02-15"] in the variables s1,s2,s3,s4,dateArr (code snippet below) i get the proper stacked bar chart plotted But when the data passed to the stacked bar chart is as follows [2] [1] [0] [0] ["2015-02-16"] only the second array is plotted ,the first is being ignored Do notice however that the y axis starts from 2 ,i .e it recognizes the first array but the same is not being plotted here is the code i am using to plot the chart //plot stacked bar chart function function plotStack(s1,s2,s3,s4,dateArr) { if(dateArr.length==0){ s1=[0,0,0,0]; s2=[0,0,0,0]; s3=[0,0,0,0]; s4=[0,0,0,0]; dateArr.push(""); dateArr.push(""); dateArr.push(""); dateArr.push(""); } $('#graph_stacked').html(''); // redraw the stack var plotStack = $.jqplot('graph_stacked', [s1, s2, s3, s4], { // Tell the plot to stack the bars. stackSeries: true, captureRightClick: true, seriesDefaults: { renderer: $.jqplot.BarRenderer, rendererOptions: { barWidth: 40,shadow:true, // Set a 30 pixel width for the bars. shadowAngle: 90, highlightMouseDown: true // Highlight bars when mouse button pressed. Disables default highlighting on mouse over. }, pointLabels: { show: false } }, grid: { background: 'transparent' }, seriesColors: ["#47759e", "#444444", "#777777", "#9b9b9b"], series: [ {label: 'New'}, {label: 'In Progress'}, {label: 'Requesting Assistance'}, {label: 'Completed'} ], axes: { xaxis: { renderer: $.jqplot.CategoryAxisRenderer, ticks: dateArr }, yaxis: { // Don't pad out the bottom of the data range. By default, // axes scaled as if data extended 10% above and below the // actual range to prevent data points right on grid boundaries. // Don't want to do that here. padMin: 0 } }, legend: { renderer: $.jqplot.EnhancedLegendRenderer, show: true, placement: 'outside', rendererOptions: { numberRows: 2, numberColumns: 2 }, location: 's', marginTop: '4…
accepted answer: http://stackoverflow.com/a/28557809
answer count: 1
downvote count: 0
has title: JQPLOT Stacked Bar Chart array input issue
tagged with: jquery
favorite count: 0
type: AnsweredQuestion
tagged with: jqplot

http://stackoverflow.com/comment/45243138
score: 0
has text: tried, now its checking the wrong checkbox...
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28458215

http://stackoverflow.com/a/28521057
type: Answer
answers question: http://stackoverflow.com/q/28516374
has body: Ok, i solved with this code (if it can help others) &lt;script&gt; $(document).ready (function() { $("form").submit(function () { $.post("result.php",$(this).serialize(),function(texte){ $("div#resultDIV").append(texte); }); return false; }); }); &lt;/script&gt;
score: 0

http://stackoverflow.com/q/28484203
tagged with: angularjs
has title: Why do CSS transitions occur for unshift() and not for shift() in ng-repeat lists?
possible better answer: http://stackoverflow.com/a/28486046
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28485697
accepted answer: http://stackoverflow.com/a/28485697
downvote count: 0
tagged with: css-transitions
has answer: http://stackoverflow.com/a/28486072
upvote count: 8
type: Question
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/28486046
has body: I'm moving some elements in the page using ng-repeat and CSS transitions. If I change the data array using unshift the list transitions nicely. (In my application I'm transitioning position as well as opacity.) If, however, I use shift to update the array, the DOM is updated immediately with no transition. Here's a demo of one approach, where all works as expected aside from the transitions. Compare the behavior when using the two buttons. $scope.items.push( $scope.items.shift() ); Here's another demo of an alternative approach, where the transitions work, but the array loses an element each time the function runs. $scope.items.shift( $scope.items.push() ); The idea is that the user can cycle through the items in the array indefinitely and the CSS transitions occur in both directions. What seems to be the issue is that AngularJS updates the DOM in one case, but not in the other, though I wasn't able to demonstrate that in my testing. Also, based on some reading I did I tried using track by item.id with no success. Thanks much.
answer count: 3
tagged with: angularjs-ng-repeat
favorite count: 0
score: 8

http://stackoverflow.com/a/28549235
type: Answer
answers question: http://stackoverflow.com/q/28549028
has body: You can write an api for you DB module and require this module in your main file. var mysql = require('mysql'); ... connect = function (dbConfig) { mysql.createConnection({ host: dbConfig.hostname, port: dbConfig.port, user: dbConfig.user, password: dbConfig.password, database: dbConfig.db }); }; select = function (req, res) { var sql = "SELECT table_name as text from information_schema.tables where table_schema = ?"; connection.query(sql, [dbConfig.db], function (err, rows, fields) { if (!err) { var data = { "children": [] }; for (var i = 0; i &lt; rows.length; i++) { rows[i].leaf = true; data.children.push(rows[i]); } res.json(data); } else { console.log("db not connected"); } }); }; In your main file you can require this file. var myDBAPI = require('./myDBAPI'); app.get('/', function (req, res) { res.sendFile(__dirname+"\\client\\index.html"); }); app.get('/getTables', myDBAPI.select(req, res)); PS: Don't forget ; after instructions
has comment: http://stackoverflow.com/comment/45411443
score: 0

http://stackoverflow.com/q/28513846
tagged with: php
has answer: http://stackoverflow.com/a/28518851
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/28513937
has body: I have the following form setup: <form id="main" name='main' action='/IMC Tools/IMC_Directory_Tool/staff/index.php' method='post' <?php if ( isset($_form_params_) ) echo $_form_params_; ?>> <?php echo $hm->Zb('@page:state'); ?> <?php echo $hm->Zb('rs:def:username_login', ZB_ATTR, array( "value" => "admin" )); ?> <?php echo $hm->Zb('rs:def:password_login', ZB_ATTR, array( "value" => "password" )); ?> I tried using the following script but the pages just keeps going on a infinite loop on the same page. Tried other similar examples online but they are all giving me the same problem where the page keeps looping and never authenticates. Any help here would be great been scratching my head for several hours on this. UPDATE possible javascript conflict?: function CallSubmit( action, param, method ) { param = param || ""; method = method || "POST"; var f = document.forms["main"]; f["action"] = action; f["method"] = method; //--- [BEGIN] Brwoser Safari if ( navigator.userAgent.indexOf("Safari") != -1 ) { var obj = event.srcElement; if ( obj.name.length > 0 ) { f["action"] += "?" + obj.name; } } //--- [END] Brwoser Safari f.submit(); return false; }
tagged with: http://stackoverflow.com/tag/html
has title: Auto submit form - Looping issue
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45345799

http://stackoverflow.com/q/28494898
tagged with: javascript
has title: Allow keyboard shortcuts while limiting characters in iframe
tagged with: jquery
has comment: http://stackoverflow.com/comment/45310121
linked to: http://stackoverflow.com/q/4459610
has answer: http://stackoverflow.com/a/28495243
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28495243
type: AnsweredQuestion
tagged with: iframe
type: Question
score: 0
has body: I have an iframe which users can use to type and markup text with some html. I would however like to limit the amount of characters they can input. To solve this I am using the following code: iframeDocument.onkeypress=function(e){ if(iframeDocument.body.textContent.length &gt; 99 &amp;&amp; e.keyCode != 8 &amp;&amp; e.keyCode != 46 &amp;&amp; e.keyCode != 40 &amp;&amp; e.keyCode !=37 &amp;&amp; e.keyCode != 38 &amp;&amp; e.keyCode !=39 &amp;&amp; e.keyCode !=17){ e.stopPropagation(); e.preventDefault(); return false; }} This limits them to 100 characters while still allowing them to use markup without it affecting how many characters they can use. This method has two problems that I am having trouble solving. Keyboard shortcuts like ctrl+c and ctrl+v are disabled when the limit is reaching. Users are unable to highlight text and type another character to replace it when the limit is reached How can I go about fixing these issues?
answer count: 1

http://stackoverflow.com/comment/45410184
comment on: http://stackoverflow.com/a/28548089
type: AnswerComment
score: 0
type: Comment
has text: SyntaxError: missing ) after argument list---line 53-- this is the line 53 y = document.getElementByID("'" + TextBox1 "'").value;

http://stackoverflow.com/q/28586484
has comment: http://stackoverflow.com/comment/45480352
upvote count: 0
tagged with: arrays
has comment: http://stackoverflow.com/comment/45480247
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45480301
score: -3
has title: What is the size limit of an Array in JavaSCript?
linked to: http://stackoverflow.com/q/6154989
has body: I am trying to fill an array but when I fill it more than a certain size it stops working. Is there any size limit on arrays in JavaScript? Is it specified anywhere? I'm interested in a general answer, but I've spotted it not working using chrome on Windows.
has answer: http://stackoverflow.com/a/28586666
duplicate of: http://stackoverflow.com/q/6154989
favorite count: 0
type: Question
answer count: 1
downvote count: 3

http://stackoverflow.com/q/28437582
has title: Backbone Menu Not Sorting
type: Question
tagged with: backbone-views
tagged with: javascript
score: 0
tagged with: comparator
answer count: 2
has body: I'm having trouble getting a Backbone collection to sort properly. I inherited the project, so there may be some shenanigans someplace else, but I want to rule out any syntax error on my part. The project uses a JSON file to handle the data: "classifications": [ { "name": "1 Bedroom", "alias": "1BR", "id": "1BR", "menu_desc": "Residences" }, { "name": "2 Bedroom", "alias": "2BR", "id": "2BR", "menu_desc": "Residences" }, { "name": "3 Bedroom", "alias": "3BR", "id": "3BR", "menu_desc": "Residences" }, { "name": "4 Bedroom", "alias": "4BR", "id": "4BR", "menu_desc": "Residences" }, { "name": "Common Areas", "alias": "Common", "id": "Common", "menu_desc": "Resident Amenities" } ] Previously, there were no one-bedroom units, and the order in which it rendered was this: I added the one-bedroom classification, and suddenly the order was this: I did some digging and found documentation about the comparator property, but it only seems to apply to collections. This project doesn't use a collection for the classifications. It does for the submenu items (which floor the units are on, etc.), but not the main menu: var MenuClassificationListView = Backbone.View.extend({ id: "classification_accordion", template: _.template( "&lt;% var classifications = this.options.classifications; _.each(this.collection.attributes, function(v,k) { %&gt;"+ "&lt;h3 class='&lt;%= k %&gt;'&gt;&lt;%= classifications.get(k).get('name') %&gt;"+ "&lt;p&gt;&lt;%=classifications.get(k).get('menu_desc')%&gt;&lt;/p&gt;&lt;/h3&gt;"+ "&lt;% var model = new MenuClassificationList(v); var view = new MenuClassificationItemView({collection:model, classification:k}); %&gt;"+ "&lt;% print(view.render().el.outerHTML); %&gt;"+ "&lt;% }); "+ "%&gt;"), render: function(){ //console.log(this.options.classifications); //console.log(this.collection.attributes); //alert(1); this.$el.html(this.template()); return this; } }); How do I incorporate the comparator? Thanks, ty
tagged with: sorting
tagged with: backbone.js
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28437878
has answer: http://stackoverflow.com/a/28464526

http://stackoverflow.com/comment/45313835
has text: My question . Both are different way to represent apple class or both are same.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28497118
score: 0

http://stackoverflow.com/comment/45356419
has text: Just tried this, and manually adding a stroke in the browser works fine, but saving this and loading through QWebView doesn't change stroke-width (that is, no change is detected by QWebView)
score: 0
comment on: http://stackoverflow.com/q/28519677
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28535226
has comment: http://stackoverflow.com/comment/45384967
has comment: http://stackoverflow.com/comment/45386178
favorite count: 0
possible better answer: http://stackoverflow.com/a/28535781
has answer: http://stackoverflow.com/a/28535591
has comment: http://stackoverflow.com/comment/45385442
accepted answer: http://stackoverflow.com/a/28535387
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28535638
has body: I am creating a simple quiz and would like to know how to show one question at a time but only using JavaScript. I do not know jQuery. Essentially, I would like the first question to be shown automatically. Here is an example of what my HTML looks like: 1. The color of the sky is... Green Blue Red Purple 2. Paper comes from... Water Cement Trees The Sky 3. How many hours in a day? 24 22 16 48 I currently don't have script for showing next div and hiding the previous one because I don't know how to even start. I'm looking to have it put into this form... function nextQ(){ // code } ... and for it to be called by this button: Next Question I am really new to HTML and JavaScript and would appreciate any help. Thanks.
has comment: http://stackoverflow.com/comment/45385528
score: 4
has comment: http://stackoverflow.com/comment/45385009
answer count: 5
has answer: http://stackoverflow.com/a/28535846
has comment: http://stackoverflow.com/comment/45385480
has comment: http://stackoverflow.com/comment/45385337
type: Question
has comment: http://stackoverflow.com/comment/45384998
has comment: http://stackoverflow.com/comment/45385112
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45385594
has answer: http://stackoverflow.com/a/28535387
upvote count: 4
has answer: http://stackoverflow.com/a/28535781
has comment: http://stackoverflow.com/comment/45384902
downvote count: 0
has comment: http://stackoverflow.com/comment/45385422
tagged with: javascript
has comment: http://stackoverflow.com/comment/45384984
has title: JavaScript - How to show the next div and hide the previous one?

http://stackoverflow.com/comment/45388535
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28535465
has text: Double escapes can be valid. It just changes the meaning to: `i` followed by `f` followed by `\ ` followed by zero or more `s` then `\(`

session-timeout
type: Tag
tags question: http://stackoverflow.com/q/28490199
tag name: session-timeout

http://stackoverflow.com/comment/45314502
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28497473
has text: Does traceur support destructuring in arguments at all?
score: 0

reveal.js
tags question: http://stackoverflow.com/q/28563979
tag name: reveal.js
type: Tag

http://stackoverflow.com/comment/45487554
type: AnswerComment
comment on: http://stackoverflow.com/a/28587716
has text: No worries, I like his answer better as well.
type: Comment
score: 0

http://stackoverflow.com/comment/45678369
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28507520
has text: Thnx bro. is there a plugin that can config/create an intent filter like on activation call. like emergency call? i mean making our own activation call or number to open the application while locked?

http://stackoverflow.com/q/28491260
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45318697
has answer: http://stackoverflow.com/a/28522362
downvote count: 0
has body: I have one wordpress plugin which displays popup on scroll. So I have code like this: jQuery(window).scroll(function(){ //display popup }); I have problem with one site. The site has those css rules: html, body { overflow: hidden; } div#pageWrap { overflow: scroll; -webkit-overflow-scrolling: touch; } So scroll event is not triggering on window and my popup doesn't work. So in this case I should set scroll event on #pageWrap div instead on window because scroll event doesn't propagate: jQuery("#pageWrap").scroll(function(){ //display popup }); My question is can I handle this dinamicaly. I cannot change code of my plugin for each site where I have this problem. Is possible to do something like make scroll event to propagate or to set some failback. Any idea about this will be helpful.
tagged with: wordpress
has title: jQuery scroll() event doesn't propagate
has comment: http://stackoverflow.com/comment/45332426
type: Question
score: 3
tagged with: javascript
upvote count: 3
has answer: http://stackoverflow.com/a/28524741
answer count: 2
linked to: http://stackoverflow.com/q/8378243
has comment: http://stackoverflow.com/comment/45306244
tagged with: jquery
has comment: http://stackoverflow.com/comment/45303602
has comment: http://stackoverflow.com/comment/45303720
favorite count: 0

http://stackoverflow.com/comment/52594445
type: AnswerComment
comment on: http://stackoverflow.com/a/28725383
score: 0
type: Comment
has text: @maxivis As for your second question, if you don't include the `noscript` tags, I don't see how this would be possible, as the only other code is a script tag which wouldn't run is JS were disabled. Maybe if that script runs, but other scripts fail to load/run, you might see that. Or maybe Google does this for IP addresses that are used by bots. Tough to say without a way of reproducing it.

http://stackoverflow.com/a/28517655
has body: I found the answer here: Why are certain function calls termed "illegal invocations" in JavaScript? It seems some native functions depend on context, so to fix this I bind to window: module.exports.requestAnimationFrame = (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame).bind(window);
accepted answer of: http://stackoverflow.com/q/28516768
answers question: http://stackoverflow.com/q/28516768
type: Answer
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/45460793
has text: @jfriend00 libraries such as underscore, lodash, or even jquery, rely on a generic function (`_` or `$` for instance) that returns a wrapper from an object. For instance if your library is called `toto`you could provide `toto(anything).extendedMethod()`
comment on: http://stackoverflow.com/a/28574852
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/q/28460860
has answer: http://stackoverflow.com/a/28461356
has comment: http://stackoverflow.com/comment/45247949
tagged with: local-storage
type: AnsweredQuestion
score: 3
has title: localstorage update property in array
downvote count: 0
type: Question
tagged with: javascript
tagged with: jquery
favorite count: 0
upvote count: 3
answer count: 1
accepted answer: http://stackoverflow.com/a/28461356
has body: I am trying to update a property in localstorage. I don't want to loop through and reset the whole thing. Is this possible? var aR = [ { "id": 1, "width": 500 }, { "id": 2, "width": 400 } ] localStorage.setItem('test', JSON.stringify(aR)); // need to update property localStorage['test'][1]['width'] = '720';

http://stackoverflow.com/q/28573398
favorite count: 0
accepted answer: http://stackoverflow.com/a/28573452
upvote count: 1
type: AnsweredQuestion
tagged with: jquery-ui
score: 1
type: Question
has title: Do not show jQuery UI Autocomplete when typing
has body: I am using the jQuery UI Auto-complete functionality to show an auto-complete on a text input. I want more fidelity as to when the list appears. I have made triggers for Click and Double Click which show the auto-complete (based on if the user chooses to include each trigger) but I have found no way to affect whether or not the auto-complete shows up when typing. How do I make it that auto-complete does not show when typing (not triggered by key events)? Answer function InitialiseAutoCompleteEx(inputId, trigOnClick, trigOnDoubleClick, trigOnType, trigOnCtrlSpace, rawAutoCompleteItems) { var autoCompleteItems = rawAutoCompleteItems.split("|"); var input = $("#" + inputId); input.autocomplete( { source: autoCompleteItems, minLength: 0, disabled: true, close: function() { $(this).autocomplete("option", "disabled", true); } }); if (trigOnClick) { input.click(function() { $(this).autocomplete("option", "disabled", false); $(this).autocomplete("search"); }); } if (trigOnDoubleClick) { input.dblclick(function() { $(this).autocomplete("option", "disabled", false); $(this).autocomplete("search"); }); } if (trigOnType) { input.keydown(function(event) { var key = String.fromCharCode(event.which); if ( /[a-zA-Z0-9]/.test(key) ) { $(this).autocomplete("option", "disabled", false); $(this).autocomplete("search"); } }); } if (trigOnCtrlSpace) { input.keydown(function(event) { if (event.which == 32 &amp;&amp; event.ctrlKey) { $(this).autocomplete("option", "disabled", false); $(this).autocomplete("search"); event.preventDefault(); } }); } }
tagged with: jquery-ui-autocomplete
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28573452

http://stackoverflow.com/comment/45471603
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28581630
has text: I think it may be something to do with my javascript. I need some sort of way of telling it what to do when the screen is a certain size and automatically flipping

http://stackoverflow.com/comment/45348548
score: 0
comment on: http://stackoverflow.com/a/28515369
type: Comment
has text: @Roamer-1888 I guess its fine fine in that case as well.. http://jsfiddle.net/hs8tqxyb/
type: AnswerComment

http://stackoverflow.com/comment/45474891
type: QuestionComment
comment on: http://stackoverflow.com/q/28583718
has text: It might be nice if you tell us what your jQuery is meant to do.
score: 0
type: Comment

http://stackoverflow.com/a/36601118
type: Answer
upvote count: 20
downvote count: 0
has body: In Qt5.6, if you want to make C++ part and JavaScript to communicate, the only way to do it is using QWebChannel on a QWebEngineView, as you stated. You do it this way in the .cpp file: m_pView = new QWebEngineView(this); QWebChannel * channel = new QWebChannel(page); m_pView-&gt;page()-&gt;setWebChannel(channel); channel-&gt;registerObject(QString("TheNameOfTheObjectUsed"), this); Here, you just say that you register an object named TheNameOfTheObjectUsed that will be available on the JS side. Now, this is the part of code to use in the JS side : new QWebChannel(qt.webChannelTransport, function (channel) { // now you retrieve your object var JSobject = channel.objects.TheNameOfTheObjectUsed; }); Now, if you want to retrieve some properties of the class in the JS side, you need to have a method on the C++ side which returns a string, an integer, a long... This is what it looks like on the C++ side, in your .h: Q_INVOKABLE int getInt(); Q_PROPERTY(int myIntInCppSide READ getInt); And now, you get the int like this on the JS side : var myIntInJSside= JSobject.myIntInCppSide; This is a very simple explanation, and I recommend you to watch this video which was very useful to me. Also, you might want to read more about the JavaScript API provided by QWebChannel, as well as the documentation about QWebChannel. Hope that helps!
score: 20
answers question: http://stackoverflow.com/q/28565254
has comment: http://stackoverflow.com/comment/78295128
has comment: http://stackoverflow.com/comment/78258004

http://stackoverflow.com/comment/45277566
score: 1
type: Comment
type: QuestionComment
has text: The Cthulhu is real.
comment on: http://stackoverflow.com/q/28477348

http://stackoverflow.com/q/28553889
has comment: http://stackoverflow.com/comment/45421220
has comment: http://stackoverflow.com/comment/45421266
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45420607
linked to: http://stackoverflow.com/q/10808109
has comment: http://stackoverflow.com/comment/45421225
has title: HTML5 script tags, does defer wait on any previous async scripts
type: Question
score: 9
has comment: http://stackoverflow.com/comment/45421317
has body: The HTML5 script tag loading directives seem pretty cool https://stackoverflow.com/a/24070373/1070291 Is it possible to async load a bunch of scripts but have a single script wait to execute based on the async ones completing. Is my app script guaranteed to execute after my libraries or will it only execute in order with other defer scripts?
upvote count: 9
has comment: http://stackoverflow.com/comment/45420975
has answer: http://stackoverflow.com/a/28554014
tagged with: javascript
has comment: http://stackoverflow.com/comment/45421183
linked to: http://stackoverflow.com/q/436411
has comment: http://stackoverflow.com/comment/45421041
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28554014

http://stackoverflow.com/q/28552014
type: Question
has title: PHP return to jquery / ajax not working
tagged with: javascript
tagged with: jquery
tagged with: ajax
answer count: 2
favorite count: 0
has body: PHP return to jquery / ajax not working, In my edit function error message is displayed yet success function executed and in my delete function nothing is displayed yet success is executed.. Have tried everything :( (well obviously not everything...) Any ideas? currentPage.EditItem = function(id) { if (confirm('Are you sure you wish to edit?')) { console.log("DetailPage :: edit"); var itemm = $("#itemm").val(); var amount = $("#amount").val(); var statuss = $("#statuss").val(); var Uid = localStorage.getItem("Uid"); console.log(statuss); if (itemm == "") { alert("Please enter item"); } else if (amount == "") { alert("Please enter amount"); } else if (statuss == "") { alert("Please enter status"); } else { $.ajax({ type:'POST', url:'http://www.mywebsite.com/edit.php', data:{'Uid':Uid,'itemm':itemm,'amount':amount,'statuss':statuss}, success: function(data) { alert("Edit item success"); window.location.href = "new_up.html"; }, error: function() { alert("Edit user failure"); }, }); window.location.href = "new_up.html"; }; }; }; PHP &lt;?php // Check connection stuff $itemm_id = $_POST['Uid']; $itemm_itemm = $_POST['itemm']; $itemm_amount = $_POST['amount']; $itemm_statuss = $_POST['statuss']; print($itemm_statuss ); $qry = "xxxxxxxxxxx"; if (!mysqli_query($con,$qry)) { die('Error: ' . mysqli_error($con)); } echo "success"; mysqli_close($con); ?&gt; DELETE currentPage.deleteItem = function(id) { if (confirm('Are you sure you wish to delete?')) { var Uid = localStorage.getItem("Uid"); $.ajax({ type:'POST', url:'http://www.mywersite.com/delete.php', data:{'Uid':Uid}, success: function(data){ if(data == "YES"){ alert("Item deleted!"); window.location.href = "new_up.html"; } else{ alert("can't delete the row") } }, }); }; }; PHP // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $itemm_id = $_POST['Uid']; $qry = "DELETE FROM balance1 WHERE id ='$itemm_id'"; if (!mysqli_query($con,$qry)) { die('Error: ' . mysqli_…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45417136
has answer: http://stackoverflow.com/a/28552187
upvote count: 1
tagged with: php
score: 0
has answer: http://stackoverflow.com/a/28552235
downvote count: 1

http://stackoverflow.com/comment/45464929
type: Comment
type: QuestionComment
has text: Thsnks Anatoli, that's what I want to do. How?
comment on: http://stackoverflow.com/q/28573267
score: 0

http://stackoverflow.com/comment/45235812
type: Comment
type: QuestionComment
has text: what does this mean x$(), its not an error?
comment on: http://stackoverflow.com/q/28454304
score: 0

http://stackoverflow.com/a/47269794
type: Answer
has body: tooltips: { enabled: true, mode: 'single', callbacks: { label: function(tooltipItems, data) { return data.datasets[tooltipItems.datasetIndex].label+": "+tooltipItems.yLabel; } } }
answers question: http://stackoverflow.com/q/28568773
score: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/81491130
upvote count: 2

http://stackoverflow.com/comment/45364011
score: 0
has text: Now it slides but still not filtering ..
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28523659

http://stackoverflow.com/comment/45395678
comment on: http://stackoverflow.com/q/28540895
has text: Is it sth like `if (document.getElementById("submit1").value != "") {...}` ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45217322
score: 0
has text: Chromedriver 2.9 is old. How about using a newer version? Also, if I cut and paste your code into a file here and execute it, it works. I have Chormedriver 2.11. (I should upgrade...) You do **not** need `selenium-standalone` or to mess with environment variables or to use `xvfb` or to use Java.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28441155

http://stackoverflow.com/q/28498286
has body: Suppose I have the following HTML: 1 2 3 AlwaysAtTheEnd After list item 3, I will be inserting a list item 4 using javascript. After that happens, the HTML will look like this: 1 2 3 4 AlwaysAtTheEnd However, I want the "AlwaysAtTheEnd" item to smoothly slide down to make room for the new item rather than instantly pop down to make space. I tried simply adding the following CSS, but it doesn't seem to affect anything: li { -webkit-transition: all 1s ease-in-out; -moz-transition: all 1s ease-in-out; -o-transition: all 1s ease-in-out; transition: all 1s ease-in-out; } Fiddle here: http://fiddle.jshell.net/pcsj2mgb/ EDIT: Fixed fiddle: http://fiddle.jshell.net/pcsj2mgb/1/
has title: How to use CSS transition for existing list items to make room for new ones?
tagged with: javascript
score: 6
has comment: http://stackoverflow.com/comment/45317549
has comment: http://stackoverflow.com/comment/81991950
type: AnsweredQuestion
favorite count: 0
has answer: http://stackoverflow.com/a/28499407
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/28499407
has answer: http://stackoverflow.com/a/28498615
has answer: http://stackoverflow.com/a/28499625
answer count: 3
has comment: http://stackoverflow.com/comment/45316946
upvote count: 7
possible better answer: http://stackoverflow.com/a/28498615
downvote count: 1

http://stackoverflow.com/comment/84464810
comment on: http://stackoverflow.com/a/39724546
has text: Is it possible to set this "per chart"?
type: AnswerComment
score: 8
type: Comment

http://stackoverflow.com/q/28564089
has answer: http://stackoverflow.com/a/28564606
has comment: http://stackoverflow.com/comment/45439339
answer count: 1
has body: I'm trying to use ng-repeat to create a user form but I'm struggling a bit. When I bind the inputs to the scope with the names in the signupForm.modelBindings array the names are set as the input value, and obviously that's not what I want. How do I bind the inputs to the scope whilst leaving the inputs empty? P.S: It feels like I'm trying to do this in a very nooby way, is there an even better way of achieving what I want without having to create a lot of arrays containing the values? EDIT: I found a better solution but I still have the problem of the inputs not being empty. Take a look at updated code: * The info for the form: $scope.signupForm = [ { description: 'Firstname', type: 'text', model: 'user.firstname' }, { description: 'Lastname', type: 'text', model: 'user.lastname' }, { description: 'Date of birth', type: 'text', model: 'user.dateOfBirth' }, { description: 'Country', type: 'text', model: 'user.country' }, { description: 'Display name', type: 'text', model: 'user.displayName' }, { description: 'E-mail', type: 'email', model: 'user.email' }, { description: 'Password', type: 'password', model: 'user.firstname' }, { description: 'Confirm password', type: 'password', model: 'user.confirmPassword' } ] I tried clearing it by setting the scopes to empty strings but it didn't work: $scope.firstname, $scope.lastname, $scope.dateOfBirth, $scope.country, $scope.displayName, $scope.email, $scope.password, $scope.confirmedPassword = '';
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45439031
accepted answer: http://stackoverflow.com/a/28564606
type: AnsweredQuestion
has title: Angular inputs not being empty on page load when using ng-model inside an ng-repeat
type: Question
has comment: http://stackoverflow.com/comment/45439095
tagged with: javascript
tagged with: angularjs-ng-model
score: 0

http://stackoverflow.com/q/28480274
tagged with: this
answer count: 5
has answer: http://stackoverflow.com/a/28480343
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28480328
has answer: http://stackoverflow.com/a/28480311
type: Question
has answer: http://stackoverflow.com/a/28480604
possible better answer: http://stackoverflow.com/a/28480311
has title: Issue passing 'this' into Javascript function
tagged with: javascript
has answer: http://stackoverflow.com/a/28480320
score: 0
has body: Slightly confused by this problem. I have written this function to replace punctuation in input elements: function punctuationReplace(element){ var elementToChange = document.getElementById(element); elementToChange.value = elementToChange.value.replace(/\"/g, ''); elementToChange.value = elementToChange.value.replace(/\'/g, ''); elementToChange.value = elementToChange.value.replace(/&amp;/g, 'and'); elementToChange.value = elementToChange.value.replace(/&lt;/g, ''); elementToChange.value = elementToChange.value.replace(/&gt;/g, ''); } &lt;input type="text" id="IPR_FNM1" name="IPR_FNM1" value="" maxlength="30" size="31" placeholder="Forename 1" onblur="punctuationReplace(this)"/&gt; When I manually run the function in the browser console with the relevant ID as the argument, it works. And when inside the function I add the line alert(element.id);, I get an alert containing the correct element ID. So I am confused as to why the above punctuationReplace function won't work when I call it using onblur="punctuationReplace(this)". I'm sure there is a simple solution but no idea what it is.
accepted answer: http://stackoverflow.com/a/28480328

http://stackoverflow.com/comment/45372972
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28528780
has text: http://ramdajs.com/docs/#fromPairs might be what you are looking for.

http://stackoverflow.com/q/28577751
has answer: http://stackoverflow.com/a/28577937
has answer: http://stackoverflow.com/a/28577827
has body: How can I submit an AJAX form in rails by using a button? My Code: Controller: def list @events = ExternalEvent.all if !params[:city_id].nil? @events = @events.where(city_id: params[:city_id]) end respond_to do |format| format.js format.html end end list.js.erb: $('#events').html("&lt;%= j render 'events' %&gt;"); list.erb: &lt;%= javascript_include_tag "jquery" %&gt; &lt;%= javascript_include_tag "application" %&gt; &lt;div id='events'&gt; &lt;%= render 'events' %&gt; &lt;/div&gt; _events.erb: &lt;%= form_tag('/list', remote: true) do %&gt; &lt;input name='city_id' value='2'&gt; &lt;input type='Submit'&gt; &lt;% end %&gt; &lt;table&gt; &lt;% for event in @events %&gt; &lt;tr&gt; &lt;td&gt; &lt;%= event.name %&gt; &lt;/td&gt; &lt;/tr&gt; &lt;% end %&gt; &lt;/table&gt; On clicking submit the AJAX form is submitted successfully. But how do I submit the form from outside the form. Using &lt;input type='button' onclick="document.getElementById('get_event').onsubmit()" value="Change City"&gt; returns a JavaScript error Uncaught TypeError: object is not a function onclick How do I submit this form externally?
upvote count: 3
tagged with: ruby-on-rails
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/28577827
tagged with: forms
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: How do I submit a Rails AJAX form using onclick
possible better answer: http://stackoverflow.com/a/28577937
favorite count: 0
tagged with: ajax

http://stackoverflow.com/comment/45407850
comment on: http://stackoverflow.com/a/28516245
score: 0
type: AnswerComment
type: Comment
has text: Tried overriding RichBundle as well, again, can see it updated in the browser debugger but the popup still displays the same message! :|

http://stackoverflow.com/a/28498156
upvote count: 2
has comment: http://stackoverflow.com/comment/45315687
has body: one solution is to use an event for example, In your AnotherView trigger a event and pass to model to View onClickHandler: function(){ var aModel = app.aModel(); Backbone.trigger('model:assigned',aModel); } in your sidebarView's initialize you should listen for event Backbone.on("model:assigned",function(passedModel){ this.model = passedModel; }) Note1: You must be sure that sidebarView is initialized by the time you are triggering event. Note2: Try avoiding Global events , i used as i don't know your code structure.
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28497375
has comment: http://stackoverflow.com/comment/45316456
accepted answer of: http://stackoverflow.com/q/28497375
downvote count: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/45434086
has text: Have a look at my function : http://jsfiddle.net/bsw5s60j/ I tried doing as u said. It doesnt work when I add it to this
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28543687
score: 0

http://stackoverflow.com/q/28586684
tagged with: javascript
has title: ANGULARJS -validate on submit only
tagged with: validation
answer count: 1
has answer: http://stackoverflow.com/a/28588313
tagged with: angularjs
type: AnsweredQuestion
score: 0
accepted answer: http://stackoverflow.com/a/28588313
type: Question
has body: I would like to do a validation on submit only. Right now, I've created a directive for an input that checks if minimum value is 5000 but I dont want it to check each number I type via keypress. I only want it to check when I hit submit. Here it is : http://jsfiddle.net/58b7491d/ HTML Number (Min: 5000) Min Value should be 5000 Submit JAVASCRIPT angular.module('myAppApp', []) .directive('minValue', function () { return { require: "ngModel", restrict: 'A', link: function postLink(scope, element, attrs, ngModel) { ngModel.$validators.minValueErrMsg = function (value) { var status = true; console.log(value); if (value < attrs.minValue) { status = false; } return status; }; } }; }) .controller('MainCtrl', function ($scope, $controller) { //LETS DO THE FORM VALIDATION AFTER HITTING SUBMIT!! $scope.submitPlanInfo = function (isValid) { console.log($scope.myForm); if ($scope.myForm.$valid) { console.log($scope.myForm.initInvestment); // console.log(angular.isNumber(parseInt($scope.myForm.initInvestment.$modelValue))); var minVal = parseInt($scope.myForm.initInvestment.$modelValue); // console.log(angular.isNumber(minVal)); if (minVal < 5000){ console.log("should be min 5000"); return false; }else{ console.log("success"); return true; } alert("Valid"); } }; //END OF FORM VALIDATION });

http://stackoverflow.com/comment/45251089
comment on: http://stackoverflow.com/q/28462542
has text: @George Garchagudashvili, I tried it and alert box, gives me a weird result. It is like this "<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs.. "
score: 0
type: QuestionComment
type: Comment

recaptcha
tag name: recaptcha
tags question: http://stackoverflow.com/q/28513959
tags question: http://stackoverflow.com/q/28489025
tags question: http://stackoverflow.com/q/28537400
tags question: http://stackoverflow.com/q/28458418
tags question: http://stackoverflow.com/q/28505540
tags question: http://stackoverflow.com/q/28516693
tags question: http://stackoverflow.com/q/28576874
type: Tag

http://stackoverflow.com/comment/57125268
comment on: http://stackoverflow.com/a/28488576
has text: How to append the new template ('colors.html') to the div using jquery? I know how to do that with json but have problems with loading external html page. Your advice would be highly appreciated.
type: AnswerComment
score: 1
type: Comment

http://stackoverflow.com/q/28483539
answer count: 2
has answer: http://stackoverflow.com/a/28484991
tagged with: asp.net
tagged with: gridview
possible better answer: http://stackoverflow.com/a/28484991
accepted answer: http://stackoverflow.com/a/28497776
type: AnsweredQuestion
has body: I have a gridview with 3 templatefield columns. When the gridview is databound, an input text box is generated in the template fields where the placeholders are. The question is, is it possible to get the values from the input boxes in the code-behind file on post back? Or does it need to be done client side with js? This is a slimmed down version of the gridview: &lt;asp:GridView ID="GV" runat="server" AutoGenerateColumns="False" CellPadding="3" DataSourceID="DS" Font-Size="X-Small" Width="100%" BackColor="White" CellSpacing="1" BorderColor="#333333" BorderStyle="Inset" BorderWidth="1px" ShowFooter="True" ondatabound="GV_DataBound" &lt;AlternatingRowStyle BackColor="White" /&gt; &lt;Columns&gt; &lt;asp:TemplateField&gt; &lt;HeaderTemplate&gt; &lt;/HeaderTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:BoundField DataField="SKILL" HeaderText="Skill" HtmlEncode="False" SortExpression="SKILL"&gt; &lt;/asp:BoundField&gt; &lt;asp:BoundField DataField="COMP_GEN" HeaderText="Competencies (General)" HtmlEncode="False" SortExpression="COMP_GEN"&gt; &lt;/asp:BoundField&gt; &lt;asp:TemplateField HeaderText="Designer Score"&gt; &lt;ItemTemplate&gt; &lt;asp:PlaceHolder runat='server' ID="devGenDesScore"&gt;&lt;/asp:PlaceHolder&gt; &lt;/ItemTemplate&gt; &lt;FooterTemplate&gt; &lt;asp:TextBox ID="devGenDesScoreTotal_txt" name="inputs" runat="server" Width="50px"&gt;&lt;/asp:TextBox&gt; &lt;/FooterTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;FooterStyle BackColor="#C6C3C6" ForeColor="Black" /&gt; &lt;HeaderStyle BackColor="#005293" Font-Bold="True" ForeColor="white" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" /&gt; &lt;PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" /&gt; &lt;RowStyle BackColor="White" ForeColor="#253E51" /&gt; &lt;SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" /&gt; &lt;SortedAscendingCellStyle BackColor="#F1F1F1" /&gt; &lt;SortedAscendingHeaderStyle BackColor="#594B9C" /&gt; &lt;Sorted…
type: Question
tagged with: c#
has title: Get Input value from Inputbox inside ASP Gridview
has comment: http://stackoverflow.com/comment/45289339
has answer: http://stackoverflow.com/a/28497776
tagged with: javascript
has comment: http://stackoverflow.com/comment/45289745
has comment: http://stackoverflow.com/comment/45289529
score: 0
has comment: http://stackoverflow.com/comment/45289821

http://stackoverflow.com/q/28528076
score: 4
upvote count: 4
answer count: 1
downvote count: 0
favorite count: 0
has title: IndexedDB cursors
has answer: http://stackoverflow.com/a/28528157
type: UnansweredQuestion
has body: my question is pretty simple. I can't understand an example from the MDN article about iterating a result from an IndexedDB. Specifically, I can't see any loop used for iteration. There is no for/while/do cycle. Here is the example: function displayData() { var transaction = db.transaction(['rushAlbumList'], "readonly"); var objectStore = transaction.objectStore('rushAlbumList'); objectStore.openCursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listItem = document.createElement('li'); listItem.innerHTML = cursor.value.albumTitle + ', ' + cursor.value.year; list.appendChild(listItem); cursor.continue(); } else { console.log('Entries all displayed.'); } }; };
type: Question
tagged with: indexeddb
tagged with: javascript

http://stackoverflow.com/a/28443838
type: Answer
answers question: http://stackoverflow.com/q/28443721
score: 2
accepted answer of: http://stackoverflow.com/q/28443721
downvote count: 0
has body: You can do that in this way : $http.get("scripts/data/myData.json").success(function(response) { $scope.myData= response }).error(function(err) { alert(err); }) Please see here working demo http://plnkr.co/edit/dV1lHIZyoKYNDxbPwHNV?p=preview
type: AcceptedAnswer
upvote count: 2
has comment: http://stackoverflow.com/comment/45217760

http://stackoverflow.com/comment/45291367
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28470900
type: Comment
has text: @pankajpakar Thank you again. If I have a lot of ng-include I have to add ng-init every where right? No lazy solution for it?

required
tag name: required
tags question: http://stackoverflow.com/q/28518122
tags question: http://stackoverflow.com/q/28506901
type: Tag
tags question: http://stackoverflow.com/q/28567637

http://stackoverflow.com/comment/45321751
type: Comment
comment on: http://stackoverflow.com/a/28489218
has text: yeah i noticed that, I will try to fix that
type: AnswerComment
score: 0

http://stackoverflow.com/q/28532722
has answer: http://stackoverflow.com/a/28532852
has body: When applying the slide up/down effect in jquery , the image is resized as much the menu slides up/down, but i want the slide effect with the image going down/up, not resizing. How to slide the image purely? Thanks $(document).ready(function(){ $('.logo').hide(); }); $(document).ready(function () { $(window).scroll(function (event) { // what the y position of the scroll is var y = $(this).scrollTop(); // whether that's below the form if (y &gt;= 30) { // if so, ad the fixed class $('.menu').addClass('fixed'); $('.menu').slideDown(); $('.logo').slideDown(); } else { // otherwise remove it //$('.logo2').removeClass('fixed'); $('.menu').slideUp(); $('.logo').slideUp(); } }); }); .menu.fixed { position:fixed; background:#000; width:100%; height: 100px; z-index:100; padding: 0px; margin: 0px; } .logo { margin-left:50%; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="menu"&gt; &lt;img src="http://www.digifloor.com/wp-content/uploads/2013/10/google-logo.png" height="80px" class="logo" /&gt; &lt;/div&gt; dadadasdassdasdadasdasasdasd &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; dadadasdassdasdadasdasasdasd &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; dadadasdassdasdadasdasasdasd &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; dadadasdassdasdadasdasasdasd &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; dadadasdassdasdadasdasasdasd &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; dadadasdassdasdadasdasasdasd &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; dadadasdassdasdadasdasasdasd &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; dadadasdassdasdadasdasasdasd &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; dadadasdassdasdadasdasasdasd &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; …
has title: Slide up/down effect in jquery resizes image - how to avoid
favorite count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: css
score: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/45380359

http://stackoverflow.com/comment/45316250
comment on: http://stackoverflow.com/q/28497236
score: 0
has text: @Quentin I would like to tell you that, [this](http://stackoverflow.com/questions/13840429/what-is-the-difference-between-client-side-and-server-side-programming) is a process. But I need the way. Could you please give me a demo of ajax http request implementing my `php` code ?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45372465
type: QuestionComment
comment on: http://stackoverflow.com/q/28528497
has text: why did someone give my question a negative rating? i dont get it. im just trying to get help on my question. instead of doing that why dont u tell me what i did wrong here.
score: 0
type: Comment

http://stackoverflow.com/comment/45410154
comment on: http://stackoverflow.com/a/28548514
has text: Hey thanks a lot! But I need to keep the dimmer until the user clicks again to close the menu. Sorry if I couldn't make it clear. I'm trying to achieve it with your code now.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45381215
has text: Thanks @NickTomlin and @WiredPrairie for the insight,here is what i had for the `getInitialState` method, the item array is supposed to be filtered with the search text `getInitialState: function () { initialState = this.getCollection().map(function(model) { return { id: model.cid, name: model.get('name'), description: model.get('description'), } }); return { init: initialState, items : [] } }` But this doesn't really feel right, I feel i should be able to do the searching without passing through react's state concept, and rather use only collections
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28527078

http://stackoverflow.com/a/28497919
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45315367
has comment: http://stackoverflow.com/comment/45315199
answers question: http://stackoverflow.com/q/28497832
has comment: http://stackoverflow.com/comment/45315237
has body: The web inspector does not show you the source code. It shows you a representation of the DOM. The browser performs normalisation and error correction on your code when it constructs the DOM so the DOM does not accurately reflect your source code. Use View Source instead. The &lt;script&gt; tag is still in the wrong place when I look at the site.
type: Answer
has comment: http://stackoverflow.com/comment/45315597
score: 1
has comment: http://stackoverflow.com/comment/45315309

http://stackoverflow.com/comment/45448721
comment on: http://stackoverflow.com/q/28569153
type: QuestionComment
has text: Not completely sure I get what you are asking, but Google Analytics works by setting and tracking through cookies, so if you clear your session cookies, then all associations between your browser and GA will be wiped out.
score: 0
type: Comment

http://stackoverflow.com/a/28464724
has comment: http://stackoverflow.com/comment/45256131
type: Answer
has body: Your slideshow should preload only the first slide and the adjacent slides. When the slides change, check if the next (and previous) slide is preloaded and load it if not. If it was not loaded, make your transition wait for it to load, if it is loaded, cycle normally.
has comment: http://stackoverflow.com/comment/45255917
has comment: http://stackoverflow.com/comment/45304255
has comment: http://stackoverflow.com/comment/45255635
score: 0
answers question: http://stackoverflow.com/q/28447770

http://stackoverflow.com/comment/45260929
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28438799
score: 0
has text: I guess I'm wondering how a **context** is defined.

http://stackoverflow.com/a/28497336
has comment: http://stackoverflow.com/comment/45318738
accepted answer of: http://stackoverflow.com/q/28495689
score: 1
answers question: http://stackoverflow.com/q/28495689
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45316132
type: Answer
has body: var csv = [ {"entity_name":"BEDFORD UNITARY AUTHORITY","level1":"Local Government","level2":"EAST OF ENGLAND","Year":"2014","Month":"09","Spend":3535}, {"entity_name":"DEPARTMENT FOR WORK AND PENSIONS (DWP)","level1":"Central Government","level2":"DEPARTMENT FOR WORK AND PENSIONS (DWP)","Year":"2014","Month":"09","Spend":123032}, {"entity_name":"HALTON BOROUGH COUNCIL","level1":"Local Government","level2":"NORTH WEST","Year":"2014","Month":"09","Spend":1332945}, {"entity_name":"HARINGEY LONDON BOROUGH COUNCIL","level1":"Local Government","level2":"LONDON","Year":"2014","Month":"09","Spend":21371}, {"entity_name":"HOUNSLOW LONDON BOROUGH COUNCIL","level1":"Local Government","level2":"LONDON","Year":"2014","Month":"09","Spend":4680}, {"entity_name":"OLDHAM METROPOLITAN BOROUGH COUNCIL","level1":"Local Government","level2":"NORTH WEST","Year":"2014","Month":"09","Spend":46459}, {"entity_name":"BARNET LONDON BOROUGH COUNCIL","level1":"Local Government","level2":"LONDON","Year":"2014","Month":"08","Spend":5727}, {"entity_name":"BEDFORD UNITARY AUTHORITY","level1":"Local Government","level2":"EAST OF ENGLAND","Year":"2014","Month":"08","Spend":7071}, {"entity_name":"BRISTOL CITY COUNCIL","level1":"Local Government","level2":"SOUTH WEST","Year":"2014","Month":"08","Spend":2000}, {"entity_name":"BRISTOL CITY COUNCIL","level1":"Local Government","level2":"SOUTH WEST","Year":"2014","Month":"08","Spend":6657}, {"entity_name":"BRISTOL CITY COUNCIL","level1":"Local Government","level2":"SOUTH WEST","Year":"2014","Month":"08","Spend":121072}, {"entity_name":"BRISTOL CITY COUNCIL","level1":"Local Government","level2":"SOUTH WEST","Year":"2014","Month":"08","Spend":10000}, {"entity_name":"BRISTOL CITY COUNCIL","level1":"Local Government","level2":"SOUTH WEST","Year":"2014","Month":"08","Spend":538118} ]; var data = d3.nest() .key(function(d) { return d.level2}) .key(function(d) { return d.Year}) .rollup(function(d) { return d3.sum(d, function(g) {return g.Spend; }); }).entries(csv)…
downvote count: 0
has comment: http://stackoverflow.com/comment/45318750

http://stackoverflow.com/q/28495993
has body: Here is a typical example of what I need to do $testArr = array(2.05080E6,29400,420); $stockArrays = array( array(2.05080E6,29400,0), array(2.05080E6,9800,420), array(1.715E6,24500,280), array(2.05080E6,29400,140), array(2.05080E6,4900,7)); I need to identify the stockArray that is the least different. A few clarifications The numeric values of array elements at each position are guaranteed not to overlap. (i.e. arr[0] will always have the biggest values, arr1 will be at least an order of 10 magnitude smaller etc). The absolute values of the differences do not count when determining least different. Only, the number of differing array indices matter. Positional differences do have a weighting. Thus in my example stockArr1 is "more different" thought it too - like its stockArr[0] &amp; stockArr[3] counterparts - differs in only one index position because that index position is bigger. The number of stockArrays elements will typically be less than 10 but could potentially be much more (though never into 3 figures) The stock arrays will always have the same number of elements. The test array will have the same or fewer elements. However, when fewer testArr would be padded out so that potentially matching elements are always in the same place as the stockArray. e.g. $testArray(29400,140) would be transformed to $testArray(0,29400,140); prior to being subjected to difference testing. Finally, a tie is possible. For instance my example above the matches would be stockArrays[0] and stockArrays[3]. In my example the result would be $result = array(0=&gt;array(0,0,1),3=&gt;array(0,0,1)); indicating that the least different stock arrays are at indices 0 &amp; 3 with the differences being at position 2. In PHP I would handle all of this with array_diff as my starting point. For Node/JavaScript I would probably be tempted to the php.js array_diff port though I would be inclined to explore a bit given that in the worst cast scenario it is an O(n2) affair. I am a newbie when it c…
tagged with: go
has comment: http://stackoverflow.com/comment/45321715
type: Question
type: AnsweredQuestion
tagged with: node.js
favorite count: 0
score: -1
has answer: http://stackoverflow.com/a/28509612
tagged with: php
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45311794
accepted answer: http://stackoverflow.com/a/28509612
has title: Finding the difference between two arrays in PHP, Node and Golang
upvote count: 0
has comment: http://stackoverflow.com/comment/45383677
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/q/28511567
has comment: http://stackoverflow.com/comment/45341860
score: 1
has body: I've defined a Angular directive, which seems to be working fine --- provided I hard-code it's attribute value. For example: &lt;notes-history application-id="11"&gt;&lt;/notes-history&gt; {{applicationid}} &lt;notes-history application-id="{{applicationid}}"&gt;&lt;/notes-history&gt; The first &lt;notes-history&gt; directive works fine. The plain text binding works fine. However, when the directive's link() function is called the second time, the application-id (based on the 3rd parameter passed to link()) is an empty string. How do I get it to bind to the attribute? Update: Here's the (mostly) full code for the directive. (Javascript generated from TypeScript) var notesHistory = (function () { function notesHistory(notesService, alertsService) { this.notesService = notesService; this.alertsService = alertsService; var directive = {}; directive.priority = 0; directive.restrict = "EA"; directive.scope = { applicationId: "@applicationId" }; directive.replace = true; directive.transclude = false; directive.templateUrl = "app/views/notesHistory.html"; directive.link = function (scope, instanceElement, instanceAttributes, controller, transclude) { // elided. // instanceAttributes.applicationId is correct here // when hard-code, and '' when bound. }); }; return directive; } return notesHistory; })(); app.directive("notesHistory", ["notesService", "alertsService", notesHistory]); Update 2 I have actually figured out my problem, and it turns out to be unrelated to the directive. The problem was the controller's first (and essentially, only) action was to make an async web service call to get the data. So the order of events was: Run Controller (launch webservice call) Run directive (using data) Process response from webservice (receiving data needed for directive) Since this has become a completely different problem, I'll create a new question for it.
tagged with: angularjs-scope
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28511763
has title: How to bind an attribute in a AngularJS directive?
favorite count: 0
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/28511763
type: Question
tagged with: angularjs-directive

http://stackoverflow.com/a/29035385
accepted answer of: http://stackoverflow.com/q/28591416
has body: I ended up using audacity and just combined the 2 sounds into one and then just initialized at the lose screen with Ptero.audio.play('Ptero_Lose_Music');
answers question: http://stackoverflow.com/q/28591416
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/29079810
score: 8
downvote count: 0
has body: Before calling to addHTML, you can add images or text to your jsPDF object: var pdf = new jsPDF('p','pt','a4'); var imgData = '[binary]'; pdf.addImage(imgData, 'JPEG', 20, 20, 20, 26); pdf.text(50, 40, "Header"); pdf.addHTML(document.body,40,100,function() { pdf.save('web.pdf'); }); HTML content... Images must be encoded with base64. You can use this tool for that: http://dataurl.net/#dataurlmaker
upvote count: 8
type: Answer
has comment: http://stackoverflow.com/comment/60316032
answers question: http://stackoverflow.com/q/28454050

http://stackoverflow.com/comment/84771703
comment on: http://stackoverflow.com/a/31147677
has text: closing the browser and/or clearing the cookies does not work
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/45482310
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28587609
type: QuestionComment
has text: For starters, you have lots of spaces in your syntax where there shouldn't be spaces. E.g., `$ (this)` should be `$(this)`

http://stackoverflow.com/comment/45327068
type: Comment
comment on: http://stackoverflow.com/q/28504011
type: QuestionComment
has text: I suggest you **edit your post** instead of noting errors in comments.
score: 0

http://stackoverflow.com/comment/45403033
type: Comment
has text: you need to wait until promise is resolved `var promise = SaveSubmitService.addItem('http://*****/Services/Account.asmx/Login', $scope.login); promise.then(function(data){$scope.data = data})`
score: 0
comment on: http://stackoverflow.com/q/28544750
type: QuestionComment

http://stackoverflow.com/comment/45251330
has text: @rantanplan, in firebug status of post gitHint2 is 200 ok.
comment on: http://stackoverflow.com/q/28462542
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/137246991
score: 1
comment on: http://stackoverflow.com/a/77104729
has text: In the case both vertical & horizontal scrolled is needed, change `const drag = (ev) => isDrag && (elem.scrollLeft -= ev.movementX);` to `const drag = (ev) => isDrag && (elem.scrollLeft -= ev.movementX) && (elem.scrollTop -=ev.movementY);` and set a fixed (max-)height to the parent
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28460652
has body: something like this? http://jsfiddle.net/swm53ran/222/ use document.write on the new window Try it
answers question: http://stackoverflow.com/q/28460500
downvote count: 0
has comment: http://stackoverflow.com/comment/45247259
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/45395160
comment on: http://stackoverflow.com/q/28539491
type: Comment
type: QuestionComment
score: 0
has text: ok i will try this but i dont know CSRF. i copied this function that generates a token. `private function generateToken(){ // Time based PHP Unique ID $uid = uniqid(NULL, TRUE); // Random SHA1 hash $rawid = strtoupper(sha1(uniqid(rand(), true))); // Produce the results $result = substr($uid, 6, 8); $result .= substr($uid, 0, 4); $result .= substr(sha1(substr($uid, 3, 3)), 0, 4); $result .= substr(sha1(substr(time(), 3, 4)), 0, 4); $result .= strtolower(substr($rawid, 10, 12)); // Return the result return $result; }`

http://stackoverflow.com/a/28518777
type: Answer
has comment: http://stackoverflow.com/comment/45367420
has body: Consider the difference in the behaviors of these two event handlers: var tags = document.getElementsByTagName("a"); for (var i=0, t; t = tags[i]; i++) { t.addEventListener("click", (function (index) { return function () { console.log("iife - " + index); }; })(i) ); t.addEventListener("click", function () { var index = i; console.log("non iife - " + index); } ); } demo
score: 0
answers question: http://stackoverflow.com/q/28518119

http://stackoverflow.com/q/28453959
upvote count: 4
answer count: 2
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
tagged with: browser-tab
has comment: http://stackoverflow.com/comment/45235304
favorite count: 0
type: UnansweredQuestion
has title: How can I set the browser tab's anchor target name via javascript?
has answer: http://stackoverflow.com/a/28455084
tagged with: anchor
has answer: http://stackoverflow.com/a/61400543
has body: When my website is called from an external hyperlink it shall be re-opened within the same browser tab, if it is already open. This can be achieved by specifying an appropriate target attribute within the hyperlink's HTML: &lt;a href='http://my-website.org' target='my_target' /&gt; However, this does not work, if the first tab is opened without a target being specified, e. g. by directly typing in the website's url. After this the hyperlink using my_target will pull up a second browser tab. So, I want to set a default target name of the browser tab, if none exists, to ensure that this tab is used, if this default target is used in hyperlinks. How can this be done in JavaScript?
type: Question
tagged with: javascript
score: 4

http://stackoverflow.com/q/28466648
has answer: http://stackoverflow.com/a/28466794
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45259106
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45258870
upvote count: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/28466794
has title: jQuery get number after | from textbox
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I have a text box where I want value to be inserted in below format name|qty name2|qty2 In want to get value of qty+qty2+.... so on all quantity in textarea after |, next product are in new line &lt;textarea onchange=gettotal()&gt;&lt;/textarea&gt; How I parse textarea value to get all qty? pls help
type: Question

http://stackoverflow.com/comment/45330628
comment on: http://stackoverflow.com/q/28505265
type: QuestionComment
type: Comment
has text: I didn't mark this as a duplicate-- I marked it as not clear what OP was asking. You can't load stuff from the file system into javascript on the server if you don't have code on the server side.
score: 0

http://stackoverflow.com/comment/45257678
score: 0
type: Comment
type: QuestionComment
has text: sacrificing a perfectly straight line comparison, by utilising the original charts axis position translation both charts make a line which without care inspection appears to be directly straight, yet most importantly the axis values matchup. Guessing this is the best I can pull off at present http://jsfiddle.net/ah8p3581/6/ Thanks for the insight and the fresh pair of eyes Pawel
comment on: http://stackoverflow.com/q/28437413

http://stackoverflow.com/comment/45354579
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28517056
has text: Ah, I see. Thank you for trying to get me on the right track though!
score: 0

http://stackoverflow.com/q/28461685
has title: Get value in cell of HTML table with Razor
upvote count: 1
type: Question
tagged with: javascript
downvote count: 0
tagged with: jquery
has body: I have a table that looks like such: Action Location SelectionType @foreach (var item in Model.List) { Display Delete @Html.DisplayFor(modelItem => item.AdvertisementLocation) @Html.DisplayFor(modelItem => item.AdvertisementSelectionType) } The first column displays the word "Display" which is a link that when clicked fires a function to get the contents of a template and display it. It does this by sending the Id to the function that is associated with that row. On load I populate a list with all the ads, and then foreach ad in the list a row is added to the table. My question is how could I access the Id that is associated with the the Display column for that row with javascript. the work flow is a user can select an ad and edit it, upon update I refresh the page for the changes to be displayed in the table, and the table loads with row 1 in focus. I would would like to be able to focus the table on the row that had just been updated.
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: razor
answer count: 0
score: 1

http://stackoverflow.com/comment/45472040
type: Comment
comment on: http://stackoverflow.com/a/28572102
score: 1
has text: Check this out : https://github.com/parhelium/laboratory/commit/6cf54f03ac9d18087107920111c76097133b1d9e
type: AnswerComment

http://stackoverflow.com/a/28552983
has comment: http://stackoverflow.com/comment/45419300
type: Answer
has comment: http://stackoverflow.com/comment/45419071
has comment: http://stackoverflow.com/comment/45418969
score: 0
answers question: http://stackoverflow.com/q/28552534
has body: I hope this is what you are looking for var main = { onload: function() { alert("HI"); }, showSurprise: function() { alert("HI"); } }; window.onload = main.onload(); You should pass it as a function.

http://stackoverflow.com/comment/45494480
type: QuestionComment
score: 0
has text: Your div is not a child of the input, it's a sibling. Since it is after the input there is no way to select it with css. Your HTML code seems wrong. Why would you have a repeater that lists only English (USA) for each option? Also the test should look like: expect(element(by.css('selector')).getText()).toBe('blah blah'); getText is a method for the element, not the selector. And you need an expectation to compare it with a toBe method.
type: Comment
comment on: http://stackoverflow.com/q/28584118

http://stackoverflow.com/a/28577928
score: 1
accepted answer of: http://stackoverflow.com/q/28577678
answers question: http://stackoverflow.com/q/28577678
has body: Because your currentURL initially does not contain the #, the indexOf will return -1 and the result is that the last character (your slash) will be removed. You should explicitly check whether the hash is inside the currentURL before slicing it: var hashIndex = currentURL.indexOf('#'); var sliceURL = (hashIndex != -1) ? currentURL.slice(0, hashIndex) : currentURL;
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0

http://stackoverflow.com/q/28494111
has answer: http://stackoverflow.com/a/28494894
has title: How to hide certain elements using Greasemonkey?
has body: I'm looking to hide certain elements using Greasemonkey. Links like this: View Or images like this: Of course, it's a part of a larger Div, but that div can't be hidden because it would hide other things I don't want hidden. So, is there any way to hide these elements using Greasemonkey? (Editor's note: also applies to Tampermonkey)
type: Question
tagged with: greasemonkey
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/45368965
answer count: 1
linked to: http://stackoverflow.com/q/15048223
favorite count: 0
tagged with: tampermonkey
accepted answer: http://stackoverflow.com/a/28494894
has comment: http://stackoverflow.com/comment/45413556
upvote count: 4
type: AnsweredQuestion
downvote count: 0
linked to: http://stackoverflow.com/q/11195658

http://stackoverflow.com/q/28545871
favorite count: 0
tagged with: entity-framework-6
tagged with: wcf
has body: When trying to edit and save a record in an ajax call via javascript, I am getting the above subject error. I did some looking up, and the only thing I can find was something about a "compareByIdentity" property which I couldn't get how to implement in my situation, if that's the case. The below class is where there is a one to many relationship. There can be one "project" to many "timetrackings". This is the class for the "TimeTrackings" where the "ProjectID" is the foreign key. I am using a WCF application to retrieve and edit the data with EF 6. This is the first time I'm encountering it in my application. Obviously, because of the way the relationship is set up. Can someone please inform me how I can correct this error? namespace YeagerTechDB.Models { using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; [Serializable, DataContract(IsReference = true)] public partial class TimeTracking { [Key] [ScaffoldColumn(false)] [Editable(false)] [Display(Name = "Tracking ID")] [DataMember] public int TimeTrackingID { get; set; } [Required] [Display(Name = "Project ID")] [DataMember] public short ProjectID { get; set; } [Required] [DataType(DataType.Date)] [DataMember] public DateTime StartDate { get; set; } [Required] [DataType(DataType.Date)] [DataMember] public DateTime EndDate { get; set; } [DataType(DataType.MultilineText)] [DataMember] public string Notes { get; set; } [DataType(DataType.DateTime)] [DataMember] public DateTime CreatedDate { get; set; } [DataType(DataType.DateTime)] [DataMember] public DateTime? UpdatedDate { get; set; } [DataMember] public virtual Project Project { get; set; } } } The output of the debugging is below. Please copy the image and paste it to your favorite image viewer for better detail. Notice that the value of the TimeTrackingID is set correctly to 1.
has title: Getting the error: JavaScript runtime error: Circular reference in value argument not supported
has answer: http://stackoverflow.com/a/28545983
type: AnsweredQuestion
tagged with: asp.net-mvc
tagged with: javascript
score: 4
type: Question
upvote count: 4
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/28545983
tagged with: jquery

http://stackoverflow.com/a/28588114
type: Answer
has body: You can use the JQuery plugin to connect to CoachDB. You can look through the below links to get more details http://www.couchbase.org/community/articles/couchdb/recipes/3 http://java.dzone.com/news/couchdb-jquery-plugin
has comment: http://stackoverflow.com/comment/45502540
score: 0
has comment: http://stackoverflow.com/comment/45507040
answers question: http://stackoverflow.com/q/28587956

http://stackoverflow.com/q/28558495
tagged with: jquery-mobile
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I know this already asked here. I referred this Link 1 , Link 2 but working the same in jquery mobile not able to get the value. I want to get column A value how to get this one. Here is the Fiddle what i tried Code is like: onclick="deleteRow(this)" function deleteRow(r) { $(r).parent().parent().hide(); var Something = $(r).closest('tr').find('td:eq(1)').text(); alert(Something); // this one gave the input element as child alert($(r).parent().parent().children().children().html); alert($(r).parent().parent().children().children().text()); } check this also Fiddle 1
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28558667
accepted answer: http://stackoverflow.com/a/28558667
type: Question
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/2315600
linked to: http://stackoverflow.com/q/12987000
score: 0
has title: Get the clicked table row element value

http://stackoverflow.com/q/28492495
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28493370
type: Question
has comment: http://stackoverflow.com/comment/45305837
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28493472
has comment: http://stackoverflow.com/comment/45306262
has comment: http://stackoverflow.com/comment/45305644
score: -1
has answer: http://stackoverflow.com/a/28492670
has comment: http://stackoverflow.com/comment/45305684
tagged with: php
has body: I want to validate form and then send the values using $.ajax .but it shows Undefined index: is_ajax. why it does not get form_data? why it happens?What change should be done? here is my script function validateForm() { var oldPassword = document.forms["dsettings"]["oldPassword"].value; var newPassword = document.forms["dsettings"]["newPassword"].value; var retypePassword = document.forms["dsettings"]["retypePassword"].value; if (document.forms["dsettings"]["oldPassword"].value == null || oldPassword == "") { alert("Enter old password"); return false; } else if (document.forms["dsettings"]["newPassword"].value == null || newPassword == "") { alert("Enter new password"); return false; } else if (document.forms["dsettings"]["retypePassword"].value == null || retypePassword == "") { alert("Retype new password"); return false; } else if ( newPassword != retypePassword) { alert("Retype new password correctly"); return false; } else { var action = $("#dsettings").attr('action'); var form_data = { oldPassword: $('#oldPassword').val(), newPassword: $('#newPassword').val(), is_ajax: 1 }; $.ajax({ type: "POST", url: action, data: form_data, success: function(response) { if(response == "success") $("#message").html(' Successfully changed password! '); else if(response == "wrong_old_password") { $("#message").html(' Wrong old password!type again! '); } else { $("#message").html(' update error.Try again! ! '); } } }); } } my html code submit and php code <?php $is_ajax = $_REQUEST['is_ajax']; // some codes ?>
has title: why $.ajax is not getting data?
downvote count: 1
has answer: http://stackoverflow.com/a/28493310
has comment: http://stackoverflow.com/comment/45305721
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45306071
has comment: http://stackoverflow.com/comment/45305941
answer count: 4
upvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45313406
comment on: http://stackoverflow.com/q/28496629
type: Comment
type: QuestionComment
has text: @Ali.NET: You're saying that the second `ready` is in an `iframe`? That ***really*** changes the question.
score: 1

http://stackoverflow.com/comment/45247609
type: QuestionComment
comment on: http://stackoverflow.com/q/28460754
score: 1
has text: It will indeed work with `var contentElement = document.getElementById("main_table").getElementsByTagName('tbody')[0];`
type: Comment

http://stackoverflow.com/q/28522710
tagged with: javascript
answer count: 2
downvote count: 0
favorite count: 0
tagged with: angularjs
upvote count: 2
has answer: http://stackoverflow.com/a/28523114
has body: Here's a jsfiddle example of what I'm trying to accomplish. I'm trying to build a US phone number input where the view displays as (333) 555-1212, but the model binds to the numeric integer 3335551212. My intention is to add custom validators to NgModelController which is why I have require: ng-model; there are simpler solutions without the isolate scope and NgModelController, but I need both. You'll see an immediate error in the console: Error: Multiple directives [ngModel, ngModel] asking for 'ngModel' controller on: &lt;input ng-model="user.mobile numeric" name="telephone" type="tel"&gt; -- thought I was using an isolate scope here...
score: 2
type: AnsweredQuestion
has title: AngularJS Multiple directives asking for ngModel
type: Question
tagged with: angularjs-ng-model
tagged with: angularjs-directive
possible better answer: http://stackoverflow.com/a/28522765
accepted answer: http://stackoverflow.com/a/28523114
has answer: http://stackoverflow.com/a/28522765

http://stackoverflow.com/comment/45388034
has text: Then there must be an error showing in your console. Just test it with `return Json("This works");`
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28536472

http://stackoverflow.com/a/28588956
answers question: http://stackoverflow.com/q/28588597
upvote count: 2
type: Answer
has body: Use both keyup keypress like this. $discount.on('keyup keypress', function(e) { if (e.which != 8 &amp;&amp; e.which != 0 &amp;&amp; (e.which &lt; 48 || e.which &gt; 57)){ e.stopImmediatePropagation(); return false; } But i guess in your code you are also disabling delete, left, right, backspace which a user won't like i guess. Here is a function which is more user friendly and allows number, left, right, backspace, delete. function validateQty(event) { var key = window.event ? event.keyCode : event.which; if (event.keyCode == 8 || event.keyCode == 46 || event.keyCode == 37 || event.keyCode == 39) { return true; } else if ( key &lt; 48 || key &gt; 57 ) { return false; } else return true; }; And to use it, do, $discount.on('keyup keypress', function(e) { e.stopImmediatePropagation(); return validateQty(e); }
score: 2
downvote count: 0

http://stackoverflow.com/comment/45307684
type: Comment
type: QuestionComment
score: 1
has text: I'm not sure what you're looking for exists yet(a good book). However, if you look at what express is doing, it's wrapping the `http` module built into node and giving it an interface with app.get, app.post etc. and offering middleware to authenticate and format queries. It's completely doable, but express has done a lot of the hard work to make it efficient.
comment on: http://stackoverflow.com/q/28493574

http://stackoverflow.com/comment/45399329
type: QuestionComment
type: Comment
has text: possible duplicate of [how to push associative item into array in javascript?](http://stackoverflow.com/questions/10550158/how-to-push-associative-item-into-array-in-javascript)
comment on: http://stackoverflow.com/q/28542849
score: 0

http://stackoverflow.com/a/28482293
upvote count: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28481539
accepted answer of: http://stackoverflow.com/q/28481539
type: Answer
score: 2
downvote count: 0
has body: 1) Yes, there are two exports so that the helper can be used as a function from within other JavaScript after it is imported and as a handlebars helper. In other JavaScript: import { boundLoc } from 'app/helpers/boundLoc'; boundloc(input); and in a template: {{boundloc input}} 2) Yes, the behavior you described is accurate. That would only export a boundHelper and not the function for consumption elsewhere. You can always try a POC. Note, however, that you may have trouble with generated tests if you try to only export the boundHelper. See this answer for more details.

http://stackoverflow.com/a/30155851
answers question: http://stackoverflow.com/q/28564821
score: 0
type: Answer
has body: Could you use order and apply a value for each price object's (1 day, 2 day, ground), etc.. ? As far as the render, could you have the ng-repeat refresh on-click when you update the list, and possibly apply a fade in / out?

http://stackoverflow.com/comment/45536634
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28557698
has text: Won't that overwrite the render page though?
type: AnswerComment

http://stackoverflow.com/comment/45316946
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28498286
has text: The javascript you have in the fiddle is indeed wrong. You're appending a child node to the second last item. It should be as hitesh below did: appending to the `parentNode` of the second last item. Altough it could just be `lastItem.parentNode.insertBefore(newItem, lastItem)`, skipping the use of `nextSibling` if you'd get the last item instead of the second last.

http://stackoverflow.com/comment/45437541
comment on: http://stackoverflow.com/a/28563487
score: 0
type: AnswerComment
has text: I am already using JS to to this. I solved my problems using getElementById.value = "" to when the page loads the textarea show as null. Thank you anyway!
type: Comment

http://stackoverflow.com/q/28441279
has comment: http://stackoverflow.com/comment/45213230
has body: I have a requirement to display a popup after a certain interval, where a countdown timer runs for 5 mins, and if there is no interaction until the countdown becomes 0:00, it redirects to a certain url. I have written the following js function for this but it is buggy at times the timer runs in negative or stops executing! Here is the code - function displayOnTimeOut() { window.docTitle = document.title; var outputText = AdfPage.PAGE.findComponent('root:popupTxt'); outputText.setValue(' '); var timerInitDate = new Date(); var endTime = timerInitDate.getMinutes() * 60 + timerInitDate.getSeconds() + 300; function displayCountdown() { var d = new Date(); var timeNow = d.getMinutes() * 60 + d.getSeconds(); var timeleft = endTime - timeNow; var seconds = timeleft % 60; var minutes = Math.floor(timeleft / 60); var minutesText = " minutes"; if (minutes == 1) { minutesText = " minute"; } var secondsText = " seconds"; if (seconds == 1) { secondsText = " second"; } if (seconds &gt; 1 &amp;&amp; seconds % 2 == 0) { document.title = document.title == docTitle ? 'News Flash' : docTitle; } if (timeleft == 0) { clearInterval(timerIntervalId); window.onbeforeunload = null; outputText.setValue(' '); window.location.href = '/some/url.jspx'; return; } else { outputText.setValue(minutes + minutesText + " and " + seconds + secondsText); } } window.timerIntervalId = setInterval(displayCountdown, 1000); var popup = AdfPage.PAGE.findComponentByAbsoluteId('root:popup'); popup.show(); } var timeOutPeriod = 60 * 1000; if (typeof timerTimeoutId !== 'undefined') { clearTimeout(timerTimeoutId); } if (typeof timerIntervalId !== 'undefined') { clearTimeout(timerIntervalId); } window.timerTimeoutId = setTimeout(displayOnTimeOut, timeOutPeriod); Please ignore how / when this is called, I invoke it using ExtendedRenderKitService when required. I'm not too much of an expert in JS coding as it would be evident by the above code, please can someone have a look? Much appreciated. Thanks!
score: 0
has answer: http://stackoverflow.com/a/28441968
answer count: 1
tagged with: setinterval
has comment: http://stackoverflow.com/comment/45212751
tagged with: timer
has comment: http://stackoverflow.com/comment/45212803
has comment: http://stackoverflow.com/comment/45213028
type: AnsweredQuestion
has title: JavaScript timer | Random behavior
accepted answer: http://stackoverflow.com/a/28441968
has comment: http://stackoverflow.com/comment/45212683
tagged with: oracle-adf
type: Question
tagged with: settimeout
tagged with: javascript
has comment: http://stackoverflow.com/comment/45212549

http://stackoverflow.com/comment/45241078
score: 0
type: Comment
has text: Can you give further details please? I have used this tool for Odata, which I did start using to complete this problem of mine, however the OData query would only return two arrays and therefore I started going down this path which seems like it should work.
type: AnswerComment
comment on: http://stackoverflow.com/a/28456711

http://stackoverflow.com/q/28575014
tagged with: javascript
tagged with: jquery-ui-datepicker
has body: I am trying to call the datepicker on dynamically created elements but doesn't work. I know that my format is not correct. Anyone knows how? $("body").on('click', '.startNew', function() { $(".startNew").datepicker({ dateFormat : "yy-mm-dd 00:00:00", numberOfMonths: 2, onSelect: function(selected) { $(".endNew").datepicker("option","minDate", selected) } }); }); $("body").on('click', '.endNew', function() { $(".endNew").datepicker({ dateFormat : "yy-mm-dd 00:00:00", numberOfMonths: 2, onSelect: function(selected) { $(".startNew").datepicker("option","maxDate", selected) } }); });
has comment: http://stackoverflow.com/comment/45459364
answer count: 2
has title: jquery calling datepicker on dynamic elements
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28575061
favorite count: 0
tagged with: datepicker
type: AnsweredQuestion
score: 2
tagged with: dynamic
upvote count: 3
downvote count: 1
possible better answer: http://stackoverflow.com/a/28575208
type: Question
has answer: http://stackoverflow.com/a/28575061
has answer: http://stackoverflow.com/a/28575208

http://stackoverflow.com/a/28546771
score: 0
type: AcceptedAnswer
has body: you are missing ; after each alert try this code Register Below Username: Password: Re-type Password: Firstname: Lastname: Age: Email: Address: Lot/Block# Brgy/Subd City/Municipality Country: Contact#: Area Code Number Submit
accepted answer of: http://stackoverflow.com/q/28546474
type: Answer
has comment: http://stackoverflow.com/comment/45407379
answers question: http://stackoverflow.com/q/28546474

http://stackoverflow.com/comment/45461381
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28575847
has text: Any idea how to make the "ionic serve" server handle POST requests. I tried adding headers in the php file to allow for CORS
score: 0

http://stackoverflow.com/q/28530579
answer count: 2
upvote count: 1
tagged with: window
tagged with: insert
tagged with: jquery
has comment: http://stackoverflow.com/comment/45376189
has answer: http://stackoverflow.com/a/28530658
favorite count: 0
accepted answer: http://stackoverflow.com/a/28530684
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28530658
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/45377283
score: 1
has answer: http://stackoverflow.com/a/28530684
has comment: http://stackoverflow.com/comment/45376200
type: Question
has title: insert script to new window with jquery html()
tagged with: javascript
has body: I usually insert html+scripts returned from ajax request to the document using jQuery html() method, which also executes the scripts. Means that if I write: $(document.body).html(" in a string does not work.) The problem - if I do the same for a new opened window, it does not work. i.e. the scripts are not executed. why?

http://stackoverflow.com/comment/45376814
type: Comment
has text: Take a look at this link: http://stackoverflow.com/questions/17255786/localstorage-store-large-size-data
type: AnswerComment
comment on: http://stackoverflow.com/a/28529751
score: 0

http://stackoverflow.com/a/28535827
has comment: http://stackoverflow.com/comment/45387111
upvote count: 2
answers question: http://stackoverflow.com/q/28535783
type: Answer
score: 2
downvote count: 0
has body: Why are you declaring variables twice: var ITEMNAME = "NULL";//first function updateName() { var ITEMNAME = document.getElementById("name").value; ^^^==========&gt;second } Just do this: var ITEMNAME = "NULL"; function updateName() { ITEMNAME = document.getElementById("name").value; }

http://stackoverflow.com/comment/45596360
has text: Please cache the results of traversing the DOM in a variable, instead of traversing again and again at each step of the loop. And consider `querySelectorAll`.
comment on: http://stackoverflow.com/a/28616499
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45445119
type: Comment
comment on: http://stackoverflow.com/q/28437566
type: QuestionComment
score: 0
has text: Do you have any source code I could look at? My hunch is that you are missing a semicolon which actually can matter sometimes when minifying or there is a variable that isn't being used. Example: `function (v1, v2) {alert(v1)}` notice that v2 is not used, that type of thing can break minimized angular code.

http://stackoverflow.com/comment/45482239
score: 0
type: AnswerComment
has text: @devqon , Updated to target proper div
type: Comment
comment on: http://stackoverflow.com/a/28587300

http://stackoverflow.com/comment/45219829
type: AnswerComment
comment on: http://stackoverflow.com/a/28445069
score: 0
type: Comment
has text: I was able to solve it by just adding a parseInt to take of the decimals for filtering like so return parseInt(eq.magnitude) === data; . Thank you for your help!

http://stackoverflow.com/comment/82044610
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/33817605
type: Comment
has text: For me I had to and add the https origin (and remove the http origin)

http://stackoverflow.com/comment/45337937
comment on: http://stackoverflow.com/q/28490399
type: QuestionComment
has text: Dave: post as the answer and I'll vote it.
score: 0
type: Comment

http://stackoverflow.com/comment/45469453
type: Comment
has text: yes that worked for me,but now the problem is that when i am displaying product on homepage it is showig like this: "xyz" but it should not.
comment on: http://stackoverflow.com/a/28580488
type: AnswerComment
score: 0

animation
tags question: http://stackoverflow.com/q/28478833
tags question: http://stackoverflow.com/q/28482043
tags question: http://stackoverflow.com/q/28571325
tags question: http://stackoverflow.com/q/28489523
tags question: http://stackoverflow.com/q/28510806
tags question: http://stackoverflow.com/q/28487120
type: Tag
tags question: http://stackoverflow.com/q/28549129
tags question: http://stackoverflow.com/q/28518284
tags question: http://stackoverflow.com/q/28521104
tags question: http://stackoverflow.com/q/28580947
tags question: http://stackoverflow.com/q/28579800
tag name: animation
tags question: http://stackoverflow.com/q/28445516
tags question: http://stackoverflow.com/q/28485396
tags question: http://stackoverflow.com/q/28544715
tags question: http://stackoverflow.com/q/28543320
tags question: http://stackoverflow.com/q/28478342
tags question: http://stackoverflow.com/q/28593369
tags question: http://stackoverflow.com/q/28486247
tags question: http://stackoverflow.com/q/28523633
tags question: http://stackoverflow.com/q/28505652
tags question: http://stackoverflow.com/q/28582436
tags question: http://stackoverflow.com/q/28551988
tags question: http://stackoverflow.com/q/28587691
tags question: http://stackoverflow.com/q/28517533

http://stackoverflow.com/comment/45327743
score: 0
type: Comment
has text: @RickHitchcock that is quite clever tbh. Again makes me wonder if there are resource gains to be had by using split. (I am mostly wondering if using `split()` once is faster than to repeating `indexOf()` - I dont know if its better or worse, or how to measure the speed of execution, I'm just wondering)
comment on: http://stackoverflow.com/a/28503130
type: AnswerComment

http://stackoverflow.com/q/28488433
has body: In my chrome app, I've successfully downloaded image files from the network and stored them in the Chrome App persistent filesystem storage. For example, the app might download a file named foo.png and store it in the file system with that same name. The app is then able to read the file from the file system using the same name. However, if the javascript tries to set the 'src' on an using the same name it fails: $('#image').attr('src', 'foo.png'); If instead, I read the file and store its contents in a blob, then use the blobURL it works. However, if instead of an image, I'm setting the src for an iFrame, and the contents of the iFrame have links to other assets, the app fails to load the other assets (as it doesn't seem able to access the assets with their vanilla file names).
answer count: 0
tagged with: javascript
tagged with: jquery
tagged with: google-chrome-app
type: Question
tagged with: html5-filesystem
score: 0
linked to: http://stackoverflow.com/q/16280428
has comment: http://stackoverflow.com/comment/45302795
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45302863
has title: How do I use files in the Chrome file storage in javascript for images src's, etc

http://stackoverflow.com/comment/45351368
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28517050
has text: I've looked into `socket.io`. Some of the concerns I have is that the Express module for it `express.io` appears to only work with version 4 of the framework.

http://stackoverflow.com/comment/45415528
score: 0
type: AnswerComment
has text: Thank you for your time, i will try it out and if i manage to solve the problem i will mark as correct answer
type: Comment
comment on: http://stackoverflow.com/a/28551027

http://stackoverflow.com/q/28528322
tagged with: each
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28528427
has title: change below items with same name
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45371968
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28528399
accepted answer: http://stackoverflow.com/a/28528399
score: 0
possible better answer: http://stackoverflow.com/a/28528427
tagged with: onchange
has body: I have a set of items on same column in a table each item in a row (text_item). on changing one of them, I need to change all below items for example if I changed the value of item1 to 1 then item2, item3 etc.. changes to 1. all the items have same name. I worked out below code but it is not working: $('input[name=textName]').change( $(this).nextAll('input[name=textName]').each(function(){ $(this).val(1) }) ); I don't know why it is not working and what went wrong. any help will be appreciated

http://stackoverflow.com/q/28555424
type: Question
has body: In my application, I have a loader image which should be displayed on link click for sorting. But the image doesn't appear for the first two clicks initially. The image appears after the third click. How can I show the loader image from the first click onwards? My code: function pleaseWait() { $.blockUI({ message: '&lt;h2 style="padding:10px"&gt;&lt;img src="../resources/images/ToolTip/ajax-loader.gif"/&gt;Loading...&lt;/h2&gt;', timeout: 50000 }); } $('#ContentPlaceHolder2_GVMerchantByDivisionWithContact tbody th a').click(function (event) { $('#txtConformMessageValue').val("No"); pleaseWait(); });
tagged with: jquery-ui
tagged with: javascript
has comment: http://stackoverflow.com/comment/45423270
score: 0
tagged with: jquery
has title: Loading image appears only after 3rd click
type: UnansweredQuestion
tagged with: css
answer count: 0
has comment: http://stackoverflow.com/comment/45423434

http://stackoverflow.com/comment/45376306
type: AnswerComment
comment on: http://stackoverflow.com/a/28530585
type: Comment
has text: I think DATA is supposed to be an array of arrays because it's simulating multiple rows.
score: 0

http://stackoverflow.com/comment/45370461
score: 0
type: AnswerComment
has text: @Bodhi1: You might try a SQLite database or, if it's not a lot of data, maybe even store it as XML or JSON. Anything standardized is better than what you have, really.
type: Comment
comment on: http://stackoverflow.com/a/28506964

http://stackoverflow.com/q/28461696
score: 0
tagged with: reactjs
has comment: http://stackoverflow.com/comment/45249724
answer count: 1
has answer: http://stackoverflow.com/a/40394374
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45249450
type: Question
has comment: http://stackoverflow.com/comment/45249649
has body: var Timeframe = React.createClass({ getInitialState: function() { return { tfs: getParameterByName('tfs'), tfe: getParameterByName('tfe') } }, formatTime: function(time) { var full = new Date(time); console.log(time); console.log(full); return (full).toString('dddd, MMMM ,yyyy'); }, render: function () { return ( Timeframe: {this.formatTime(this.state.tfs)} - {this.formatTime(this.state.tfs)} ); } }); I have an outside js function called getParameterByName which, in these cases, is going to return a time in unix time. As far as I know, Date() works very well with these numbers, and in my experience outside of React, I've never had any trouble with this. When I try using Date within my react function, it's returning invalid date. Does anybody know why this might be happening?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45249377
tagged with: date
has title: React invalid date

http://stackoverflow.com/comment/45256280
has text: You shouldn't have `:` after `return`.
comment on: http://stackoverflow.com/q/28465287
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28484706
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28495139
type: Question
has title: How to know if a div is fixed to bottom?
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28495139
has body: http://jsfiddle.net/juveo1d7/ Is there any reliable way to know if a fixed div is positioned by setting its bottom property or its top property? My best bet would have been getComputedStyle and thought I would know if the div is "clipped" to bottom by looking at its top property (if it's not set then the div is clipped to bottom) but even if I don't set the top property, it still returns a value in pixels. a simple div &lt;div id="fixed"&gt;&lt;/div&gt; the css #fixed { width: 50px; height: 50px; position: fixed; bottom: 30px; right: 30px; background: red; } and the javascript var fixed = document.getElementById('fixed'); var position = window.getComputedStyle(fixed).position; var top = window.getComputedStyle(fixed).top; var bottom = window.getComputedStyle(fixed).bottom; I know it's a minor difference but I need to reproduce the same behavior on another div using only javascript.
tagged with: css

http://stackoverflow.com/q/28536763
tagged with: firefox
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45387998
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28537047
has title: Chrome, Firefox converting ":" to "-" and "_" respectively in their file save dialog
has body: I am trying to save a file using FileSaver library which will save the file using Chrome's and Firefox's Save As dialog. Ex: I have certain filename like testing:testing1:testing2.csv. Now when the Save As dialog pops up, I am seeing filename converted to testing-testing1-testing2.csv for Chrome and testing_testing1_testing2.csv for Firefox. Is there any way we can suppress this conversion of characters? Thanks
upvote count: 1
tagged with: google-chrome
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28537047
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28536792
accepted answer: http://stackoverflow.com/a/28536792

http://stackoverflow.com/q/28452467
has comment: http://stackoverflow.com/comment/45233619
type: Question
tagged with: ember-data
downvote count: 0
has comment: http://stackoverflow.com/comment/45233093
tagged with: javascript
tagged with: api
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45233240
has comment: http://stackoverflow.com/comment/45233589
has comment: http://stackoverflow.com/comment/45233904
type: UnansweredQuestion
has title: Structuring ember.js code
tagged with: ember.js
upvote count: 1
has comment: http://stackoverflow.com/comment/45233673
has comment: http://stackoverflow.com/comment/45233548
score: 1
has answer: http://stackoverflow.com/a/28456418
has body: I'm trying to figure out the "right" way to structure a part of my Ember app A basic overview: Let's say I have a Course model defined similarly: var Course = DS.Model.extend({ videos: hasMany('video', { async: true }), categories: hasMany('category', { async: true }) }); Each video has a category associated with it. In my CourseView or CourseController, how am I supposed to get a list of the videos for each category? First, I tried using a computed property, but any call like this.get('model').get('videos') returns a Promise – not what I want. Next, I saw some posts about using that and then setting properties on the controller after the Promise resolves, so the View would update when the properties changed, but this involves a lot of almost-callback hell and I'm hoping there's a better way to approach the problem. Is there any way I can "load" the videos/categories before the view gets rendered? Ideally I'd be able to do something like: {{#each category in categories}} // render category-related stuff and only videos in this category {{/each}} Would it be better to have all of the videos on the Category? Is there any way I can define/add properties to a model without having them be sent to the server? I guess this can be seen as a general question about API design as well – should videos be under categories? Essentially there'll be a list of Courses, each with its own set of categories. Every video must fall under one category. After typing it out this way it makes sense for videos to be under categories if all of them must be under some category... Edit: Here's an implementation I just went with for the sake of time: My Category model now looks something like this: var Category = DS.Model.extend({ name: attr('string'), description: attr('string'), videos: hasMany('video', { async: true }) }); In the Course template: ... {{#each category in model.categories}} {{render "course/category" category}} {{/each}} ... In the course/category template: &lt;h2 class="sub-tit…
has comment: http://stackoverflow.com/comment/45233137

http://stackoverflow.com/a/28562969
upvote count: 3
answers question: http://stackoverflow.com/q/28562742
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28562742
score: 3
type: AcceptedAnswer
type: Answer
has body: Don't optimize prematurely. Unless some profiling shows that these things in the code actually cause some sort of bottleneck, or disproportionate resource use, don't bother optimizing them along theories on performance. As for the actual performance: object attribute lookups (such as Math.floor or this.currentX) are o(1) operations, as they are effectively hashmap lookups. Saving them to a variable as such looks like more of a readability enhancement than anything.

http://stackoverflow.com/a/28526135
has body: I think I know how: They're loading the Tiles after positioning the markers, something like : markers = L.marker([lat, lng], {icon: iconMarker}).addTo(map); L.tileLayer('https://{s}.tiles.mapbox.com/v4/MapID/{z}/{x}/{y}.png?access_token=Token').addTo(map);
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28525918

http://stackoverflow.com/a/47689524
downvote count: 2
has body: you can use QtTest import QtTest 1.0 import QtQuick 2.9 ApplicationWindow{ id: window TestEvent { id: test } function delay_ms(delay_time) { test.mouseClick(window, 0, 0, Qt.NoButton, Qt.NoModifier, delay_time) } }
score: 0
has comment: http://stackoverflow.com/comment/114638929
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/28507619

http://stackoverflow.com/q/28558459
answer count: 1
has comment: http://stackoverflow.com/comment/45429035
accepted answer: http://stackoverflow.com/a/28560671
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28560671
type: Question
has body: I'd like to have some advice on how to call different database queries based on the path in the url using express.js. Here's a working example code but I'm not sure if that is the good way of doing it: server.js var express = require('express'), app = express(), Promise = require("bluebird"), db = require('./db/managedb'); // database modules for sequelize.js app.get('/p/:section/:optional?', function(req, res){ var section = req.params["section"]; var optional = req.params["optional"]; if(section == "index"){ Promise.props({ main: db.db.query('CALL sp1()'), second: db.db.query("CALL sp2()") }).then(function(obj){ res.render(section+'.html',obj) }).catch(function (error) { }) }else if(section == "overviews"){ var page = req.query.page || 0; Promise.resolve(db.db.query('CALL sp3(:page)',{page:page})).then(function(d){ res.render(section+'.html',d) }) }else if(section == "reviews"){ var page = req.query.page || 0; var review_id = req.query.review_id || 1; Promise.resolve(db.db.query('CALL sp4(:review_id,:page)',{review_id:review_id,page:page})).then(function(d){ res.render(section+'.html',d) }) } }) Is it an okay solution? My concern is that if I kept adding more conditions for new sections, it might be quite messy, but is there a better way to call different database queries based on the path? Any suggestion is appreciated.
tagged with: javascript
tagged with: express
has title: Better way to run different db queries based on path in node.js and express
score: 0

http://stackoverflow.com/q/28461096
type: Question
tagged with: brackets
tagged with: javascript
has body: I have a form with some fields - &lt;input name=store[0] value="1"&gt; &lt;input name=store[1] value="2"&gt; When a save button is clicked the script picks up all the fields to be sent to a $.post() inputs.each(function() { field = this.name; value = $(this).val(); jsonString[field] = value; )}; $.post("/someScript.php", { fields : jsonString }); When that script receives the data it comes through as [storeId[0] = 1 [storeId[1] = 2 Instead of (as I expected it to) [storeId[0]] = 1 [storeId[1]] = 2 EDIT : Ok so silly me - jsonString = JSON.stringify(jsonString); This passed over easily and I wasn able to decode it on the other end. Thanks for the help!
tagged with: variables
score: 0
has comment: http://stackoverflow.com/comment/45251743
has comment: http://stackoverflow.com/comment/45248344
has title: Javascript - setting a property name using a variable that contains brackets
answer count: 0
type: UnansweredQuestion
tagged with: properties
has comment: http://stackoverflow.com/comment/45253906

http://stackoverflow.com/comment/45263555
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28469188
has text: Have you placed the tag inside the tag?
type: Comment

http://stackoverflow.com/q/28555463
has answer: http://stackoverflow.com/a/28555531
tagged with: ajax
possible better answer: http://stackoverflow.com/a/28555506
tagged with: php
has comment: http://stackoverflow.com/comment/45423374
type: AnsweredQuestion
type: Question
has title: responseText array not parsing properly
has answer: http://stackoverflow.com/a/28555533
accepted answer: http://stackoverflow.com/a/28555533
tagged with: responsetext
has body: I'm using ajax to retrieve an json_encode() array from my php parser. The responseText is ["4.wav","2.wav","3.wav","6.mp3","1.mp3","5.wav"] If I place this in and array like this: var myArray = ["4.wav","2.wav","3.wav","6.mp3","1.mp3","5.wav"]; myArray will return 4.wav, 2.wav, 3.wav, 6.mp3, 1.mp3, 5.wav with an myArray.length count of 6 as expected right? But if I place my responseText in a var and like this: var myArray = event.target.responseText; myArray will return ["4.wav","2.wav","3.wav","6.mp3","1.mp3","5.wav"] and an myArray.length count of 49. Can someone kindly explain what the heck is going on here? Here is how I made the ajax call: var ajax = new XMLHttpRequest(); ajax.addEventListener("load", function(event){ var response = event.target.responseText;}); ajax.open("POST", "parser.php"); ajax.send(); Thanks in advance :)
has answer: http://stackoverflow.com/a/28555506
tagged with: javascript
score: 0
answer count: 3

http://stackoverflow.com/comment/45210243
comment on: http://stackoverflow.com/q/28440262
has text: There are tons of references to streaming in the API doc: http://webaudio.github.io/web-audio-api/#the-mediastreamaudiosourcenode-interface Besides, why not just download and try it? Might be quicker than waiting for an answer here.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45284882
comment on: http://stackoverflow.com/a/28480002
type: AnswerComment
has text: Shaun, no the length can be anything. I am thinking perhaps I could figure out the speed of input? The barcode scan enters the data inhumanly fast. I am just not sure how i would do that. Unless I could use some other event?
type: Comment
score: 0

http://stackoverflow.com/q/28485943
has answer: http://stackoverflow.com/a/28486397
has body: How can I change this from hover to click? $(function(){ $('ul#menu li').hover(function(){ //$('#drop' , this).css('display','block'); $(this).children('ul').delay(20).slideDown(600); }, function(){ $(this).children('ul').delay(20).slideUp(600); }); }); Fiddle
has title: Javascript - From hover to click
favorite count: 0
possible better answer: http://stackoverflow.com/a/28485967
has comment: http://stackoverflow.com/comment/45294656
has answer: http://stackoverflow.com/a/28485967
linked to: http://stackoverflow.com/q/4943886
accepted answer: http://stackoverflow.com/a/28486397
downvote count: 1
tagged with: hover
type: AnsweredQuestion
score: -1
type: Question
answer count: 2
upvote count: 0
tagged with: javascript
tagged with: click

http://stackoverflow.com/comment/45404508
has text: Why are you saying "We"? You haven't said anything useful
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28545398
type: QuestionComment

http://stackoverflow.com/comment/45288833
has text: Thanks @dfsq. But I still having some issues. When I refresh the browser, the page goes blank and the "#!/" don't go the / route. Can you help-me?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28463386
type: Comment

http://stackoverflow.com/comment/45352960
type: QuestionComment
score: 0
has text: Whats wrong with the `daysIWork.indexOf(dayToday) !== -1` ?
comment on: http://stackoverflow.com/q/28517594
type: Comment

http://stackoverflow.com/comment/56641786
score: 0
has text: Hello, no. What about you?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28584960

http://stackoverflow.com/q/28540322
type: Question
accepted answer: http://stackoverflow.com/a/28541592
answer count: 2
has title: Tablesorter does not sort "-" symbol
has comment: http://stackoverflow.com/comment/45394547
downvote count: 0
tagged with: javascript
has body: tablesorter doesn't work on Subject column, when column contain's "-" such as: Name Subject Anton - Max "dfdsrv" Anna "fdsf" but if I add string with spec symbol, it will work correctly! Name Subject Anton - Max "&lt;dfdsrv&gt;"//correctly working Anna "fdsf" P.S Unforunately we are using old tablesorter version 2.0.5. How I could resolve this problem? I replaced "-" for empty string but it still not work.Maybe I mistaked somewhere? textExtraction: function(node) { if (node.innerHTML.text == "-"){ return " "; } }
favorite count: 0
has answer: http://stackoverflow.com/a/28541592
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28547166
tagged with: tablesorter
has answer: http://stackoverflow.com/a/28547166
score: 1
upvote count: 1

http://stackoverflow.com/q/28472830
has comment: http://stackoverflow.com/comment/45269721
has answer: http://stackoverflow.com/a/28474918
accepted answer: http://stackoverflow.com/a/28474918
type: AnsweredQuestion
has title: form validation for empty radio input, empty text input and highest value
tagged with: forms
type: Question
tagged with: javascript
tagged with: jquery
score: 0
has body: I'm not confident with JS. I need to check different things to prevent a form being submitted if: input radio "colorT" and "colorB" are empty input text field "length" and "height" are empty input field "height" is over "400". How is it possible? LENGTH: HEIGHT (max 400): EDIT: Thx. I try to be more clear: user must not be able to send the form if something is missing or if the Height field is more than 400. Something like this (or a easier way, if possible):
tagged with: validation
answer count: 1

http://stackoverflow.com/a/28497742
score: 4
answers question: http://stackoverflow.com/q/28484130
upvote count: 4
downvote count: 0
type: Answer
has body: Answering the OP question for the sake of knowledge, even known a solution was found. The syntax for non capturing group in JavaScript regular expression is: (?:pattern) as stated in https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references Also you should take a look at the lookahead assertions (e.g. x(?=y) and x(?!y)) in the same page as it may help.

http://stackoverflow.com/comment/45370354
has text: User [T.S.](http://stackoverflow.com/users/1226267/t-s) has just debugged that issue via the follow-up question [jQuery-line → $(this).nextAll('.toggled:first') ← works in Stack Snippet and JSFiddle, but not on site](http://stackoverflow.com/questions/28526651/)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28521062
type: AnswerComment

http://stackoverflow.com/comment/45360565
score: 0
type: Comment
has text: Ok, this solves _part_ of the problem... But what if the first document was within an ` `?
comment on: http://stackoverflow.com/a/28521750
type: AnswerComment

http://stackoverflow.com/comment/45236897
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28454998
has text: Key / value pairs like that are notoriously cumbersome to work with. You d be better off with something like `language = { 'a': 1, 'b': 2...}`. Or, even better yet, `localeCompare`.

http://stackoverflow.com/comment/45297309
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/28487629
type: Comment
has text: in the css calculate the height of the carousel. For example: .carousel{height: calc(100% - 333px);} 333px is the total height of header and footer. If it doesn't help please add an example of your code or create jsfiddle so that we can see the problem.

http://stackoverflow.com/comment/45254460
score: 0
type: Comment
type: QuestionComment
has text: This is going to be a Phonegap Mobile app, so we need to use Token Authentication
comment on: http://stackoverflow.com/q/28464207

http://stackoverflow.com/comment/45476358
comment on: http://stackoverflow.com/a/28583646
has text: What do you do when you want variables that supports $watch and use them in ng-model or any other way? I think its just fine to use $rootScope
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28574354
type: AnsweredQuestion
has body: When I try to show the google calendar in webview , it show some error: [INFO:CONSOLE(0)] "Refused to display 'https://accounts.google.com/ServiceLogin?service=cl&passive=1209600&continue=https://www.google.com/calendar/embed?src%3Detlwhk@gmail.com%26ctz%3DAsia/Hong_Kong&followup=https://www.google.com/calendar/embed?src%3Detlwhk@gmail.com%26ctz%3DAsia/Hong_Kong&btmpl=mobile&ltmpl=mobilex&scc=1' in a frame because it set 'X-Frame-Options' to 'DENY'.", source: about:blank (0) And this is the html code And for the android side it is some simple webview code StringBuilder sb = new StringBuilder(); sb.append(" "); sb.append(page.page_content_chi.toString()); sb.append(" "); webview.loadDataWithBaseURL("file:///android_asset/", sb.toString(), "text/html", "utf-8", null); How to fix the error? Thanks for helping.
tagged with: android-webview
tagged with: webview
type: Question
accepted answer: http://stackoverflow.com/a/28676290
tagged with: javascript
answer count: 2
has title: Refused to display a frame because it set X-Frame-Options to 'DENY in android webview
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
score: 8
upvote count: 8
tagged with: android
possible better answer: http://stackoverflow.com/a/63393817
has answer: http://stackoverflow.com/a/28676290
has answer: http://stackoverflow.com/a/63393817

http://stackoverflow.com/q/28450328
has comment: http://stackoverflow.com/comment/45229310
has answer: http://stackoverflow.com/a/28450542
has body: I have a two Iframe in my HTML page. I want to use one single jquery file which is loaded on parent page. The code give below is working fine every browser but it has one issue with chrome with ctrl+f5 key. When page is loading first time and when we are pressing ctrl+f5 the it is giving error in chrome otherwise it is working fine. Here is some snapshot. Parent page and iframe are in same domain. if (typeof(jQuery) == "undefined") { var iframeBody = document.getElementsByTagName("body")[0]; var jQuery = function (selector) { return parent.jQuery(selector, iframeBody); }; var $ = jQuery; }
has title: Use parent jquery library in child Iframe
type: UnansweredQuestion
tagged with: iframe
score: 1
has comment: http://stackoverflow.com/comment/45228824
type: Question
has comment: http://stackoverflow.com/comment/45228698
upvote count: 1
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/28440170
has comment: http://stackoverflow.com/comment/71382634
upvote count: 9
has answer: http://stackoverflow.com/a/28458091
answer count: 5
has comment: http://stackoverflow.com/comment/45210135
accepted answer: http://stackoverflow.com/a/28458091
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/50053020
score: 7
has body: I want to open / read docx file using client side technologies (HTML/JS). I have found a Javascript library named docx.js but personally cannot seem to locate any documentation for it. (http://blog.innovatejs.com/?p=184) The goal is to make a browser based search tool for docx files and txt files.
possible better answer: http://stackoverflow.com/a/56459721
tagged with: http://stackoverflow.com/tag/docx
has answer: http://stackoverflow.com/a/74093368
has answer: http://stackoverflow.com/a/56459721
downvote count: 2
has comment: http://stackoverflow.com/comment/71413462
has answer: http://stackoverflow.com/a/72649441
has title: Get docx file contents using javascript/jquery

http://stackoverflow.com/comment/45298127
has text: Perhaps in this simple script you're right, but in my more complicated app I am setting (example) statCounter to some object like, statCounter = { prop1 : 1, prop2 : 2}; I pass the statCounter but instead it passes the Div! I console.log(statCounter.prop2) and get 2! I console.log(statCounter) and get the div!
comment on: http://stackoverflow.com/q/28488149
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28547238
linked to: http://stackoverflow.com/q/14903542
answer count: 1
favorite count: 0
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
score: 2
has title: Drag and Drop Directives - Events Not Firing in IE
has comment: http://stackoverflow.com/comment/45407925
has answer: http://stackoverflow.com/a/28549217
type: Question
tagged with: angularjs-directive
downvote count: 0
tagged with: javascript
tagged with: dom-events
has comment: http://stackoverflow.com/comment/45407606
has body: I've been trying to avoid importing jQuery and jQuery UI for just one feature, so I'm working on a custom set of drag and drop directives for an application I'm developing. Everything works as predicted in Chrome, Firefox, Opera and Safari, but in both IE 9 and 11 (I haven't tested on 10, but I assume it's the same), the dragover and drop events don't fire. dragstart, dragend, dragenter, and dragleave fire, although adding the 'over' class doesn't seem to have any effect -- the class appears in classlist, but the browser seems to ignore it. I'm including a pastebin with the directives. If anyone has any ideas, I'd appreciate hearing them. http://pastebin.com/xbC1vPTr
has comment: http://stackoverflow.com/comment/45411404

http://stackoverflow.com/comment/45392590
type: Comment
score: 0
type: AnswerComment
has text: I suspect `$(this).find('.animation, img')` idea is based on "there is either `.animation` or `img`". So it will work incorrectly if there are both `.animation` and `img`.
comment on: http://stackoverflow.com/a/28539246

http://stackoverflow.com/comment/45339441
has text: This isn't really a duplicate question - I read through the entire post you linked, and there's some great info it, so thank you. Still, I say it's not a duplicate because my question is not answered anywhere in that post.
comment on: http://stackoverflow.com/q/28509939
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/45384323
score: 0
has text: @DominiqueFortin It is no problem. Thanks for trying to help :)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28533150

http://stackoverflow.com/q/28541795
tagged with: tinymce-4
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45400560
has title: json.net object from directory
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28547911
tagged with: c#
linked to: http://stackoverflow.com/q/26364635
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has body: Tinymce is a fairly common WYSIWYG editor that allows users to purchase an image/file management system or build your own. I want to upgrade my Content Management system from tinymce 2x to 4x. In 4x the images need to be presented to the tinymce call as a json object in the image_list declaration: http://www.tinymce.com/wiki.php/Configuration:image_list Based on this format, the goal is to have .Net read the image folder and present the title and value as the filename and 'images/filename' of each file. I've worked at it the past few days and I've made some headway but not to the point of a functional sample. This seems like it would be something that others using .Net and Tinymce would want to use if they roll their own image management system (which I have to do in this case). This example (see link) seems to get close but my test (see code below) returns null values for the title and value. When I tried to include the other two variables in the example I get error messages that the variables are inaccessible or not available. Converting List of Files into JSON array in C# Here is the C# script I'm trying to use in creating the JSON variable of image references: &lt;%@ Import Namespace="Newtonsoft.Json" %&gt; &lt;script runat="server"&gt; public class FileInformation { [JsonProperty(PropertyName = "title")] public string actualFileName {get;set;} public string value {get;set;} } public string image_list() { string[] arr = new string[3]; // Initialize arr[0] = ".jpg"; // Element 1 arr[1] = ".png"; // Element 2 arr[2] = ".gif"; // Element 3 var imgPath = Server.MapPath("~/images/"); var list = new List&lt;FileInformation&gt;(); //string[] fileNames = Directory.GetFiles(imgPath, "*", SearchOption.TopDirectoryOnly); string[] fileNames = Directory.GetFiles(imgPath); foreach (string filename in fileNames) { FileInfo fileInfo = new FileInfo(filename); string actualFileName = fileInfo.Name; string value = fileInfo.Name; list.Add(new FileInformation(){}); } var yourJSONStr…

http://stackoverflow.com/comment/45353943
type: AnswerComment
has text: @Tigrokonvel for example no conflict in library name :-)
type: Comment
comment on: http://stackoverflow.com/a/28518196
score: 1

http://stackoverflow.com/q/28581641
upvote count: 0
score: -2
has body: I am having difficulty in place my jquery variable inside my html tag. For some reason the variable is being displayed outside of my div. I have the following code: This produces the following result: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | | | Time runs out in | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| 30 seconds What I want to have is: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | | | Time runs out in 30 seconds | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| Can someone please show me where I am going wrong?
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45471414
favorite count: 0
linked to: http://stackoverflow.com/q/3099030
tagged with: http://stackoverflow.com/tag/html
has title: Display a jQuery variable inside html?
has answer: http://stackoverflow.com/a/28581757
answer count: 4
has answer: http://stackoverflow.com/a/28581771
has answer: http://stackoverflow.com/a/28581883
downvote count: 2
possible better answer: http://stackoverflow.com/a/28581681
has answer: http://stackoverflow.com/a/28581681
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28581771
type: Question

http://stackoverflow.com/q/28473990
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45273468
possible better answer: http://stackoverflow.com/a/28474255
has answer: http://stackoverflow.com/a/28474257
has title: Responsive background images
type: Question
has answer: http://stackoverflow.com/a/28603631
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28603631
has body: Currently I'm working on building a solution for having responsive background images set via JavaScript. I am using Picturefill to create cross-browser support. What do I need? There is an element on my page which needs a pretty little background photo. On the page there is a picture element which loads conditionally images. However I specified one default image source if the browser doesn't have proper picture element support. With MooTools I check what photo is supposed to show up on domready, on window resize I check my image 'src' again to replace my current picture if needed (with a bigger or smaller one). In FireFox the picture element replaces the image 'src' in the DOM, it works perfect! Chrome (and IE) don't replace the image 'src' so my photo will always have the default photo dimensions according to MooTools. However, when you hover over the image 'src' via the Chrome developer tools it does show the correct image source for that media query. I can get in way too many details but trust me I really need to do it like mentioned above, who want to help me with this? :) &lt;script&gt; var Placeholder = $('Placeholder'); var CoverImage = $('MyCover').getElement('img').src; Placeholder.setStyle('background-image', 'url(' + CoverImage + ')'); var $timer = null; window.addEvent('resize', function(){ var ResponsiveImage = function(){ var $ResponsiveImage = $('MyCover').getElement('img').src; $('Placeholder').setStyle('background-image', 'url(' + $ResponsiveImage + ')'); }; clearTimeout($timer); $timer = ResponsiveImage.delay(250, this); }); &lt;/script&gt; &lt;picture&gt; &lt;source media="all and (max-width: 30em)" srcset="1.jpg"&gt; &lt;source media="all and (min-width: 30.063em) and (max-width: 48em)" srcset="2.jpg"&gt; &lt;source media="all and (min-width: 48.063em) and (max-width: 80em)" srcset="3.jpg"&gt; &lt;source media="all and (min-width: 80.063em)" srcset="4.jpg"&gt; &lt;img src="2.jpg"&gt; &lt;/picture&gt; Thanks for the possible solutions, I am very g…
score: 0
tagged with: picturefill
tagged with: mootools
tagged with: responsive-design
has answer: http://stackoverflow.com/a/28474255
tagged with: javascript
has answer: http://stackoverflow.com/a/28517117

http://stackoverflow.com/q/28490814
has title: Using svg.js and svg-pan-zoom how can I get current "viewport" center point?
has answer: http://stackoverflow.com/a/53462949
type: Question
downvote count: 0
tagged with: javascript
score: 1
has body: I'm using svg.js and the great svg-pan-zoom plugin ( https://github.com/ariutta/svg-pan-zoom ). Now I want to have a button that when I click on it it draws a circle on the current center point of the viewport am I seeing (so the position is dynamic depending on the pan/zoom I've done). I setup a quick example here that draws the circle statically on a specified position. Please note I have some specific needs: I'm showing a "background" image with a scaling factor like this: var map = mainWindow.group(); map.addClass('seatMap'); map.image('http://upload.wikimedia.org/wikipedia/commons/b/b3/World-map-2004-cia-factbook-large-1.7m-whitespace-removed.jpg').loaded(function () { map.cx(viewboxW / 2); map.cy(viewboxH / 2); }).scale(0.70); So how can I get the current center point?
favorite count: 0
has answer: http://stackoverflow.com/a/28493660
has answer: http://stackoverflow.com/a/28504077
answer count: 3
accepted answer: http://stackoverflow.com/a/28493660
possible better answer: http://stackoverflow.com/a/28504077
tagged with: svg.js
tagged with: http://stackoverflow.com/tag/svg
upvote count: 1
type: AnsweredQuestion
tagged with: svgpanzoom

http://stackoverflow.com/q/28480192
has answer: http://stackoverflow.com/a/28480246
has title: call $scope.watch function only after focusout of the field
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45282795
has answer: http://stackoverflow.com/a/28480314
answer count: 4
score: 2
has answer: http://stackoverflow.com/a/28480312
downvote count: 0
has answer: http://stackoverflow.com/a/28480405
type: Question
has body: im new to angular and im looking for a way to call function, currently called after every change, only after focus is out of that field. the purpose of this function its to check if user changed the data in certain and only if he changed data function should execute. problem is now every key press calls the function so if use adds 2 chars to string in the it will execute twice. this is my table: {{user(user_id)}} {{script(script_id)}} and this are the functions: $scope.$watch('cron_format',function(x,old){ if(x!=old){ } }); $scope.saveCron = function(userId,scriptId,cronFormat){ $.post("updateCronChange.php", "user_id="+userId+"&script_id="+scriptId+"&cron_format="+cronFormat, function(data){ //inside post alert('cron format changed to:'+cronFormat); }); } any angular way i can call saveCron() only after focus out of the field (cron_format)??
tagged with: javascript
upvote count: 2

http://stackoverflow.com/comment/45450895
type: QuestionComment
type: Comment
score: 1
has text: I think you are going about this all wrong. Pretty sure you can't access an html outside of the browser dom (Can't access that html if its not loaded in the browser). What you need to do is do some more php work. It looks like you want to change a link if the user is logged in?
comment on: http://stackoverflow.com/q/28570392

http://stackoverflow.com/q/28545552
has body: Here I have variable that has an object whose one value is an array of objects eg. var test = { "key1": val1, "key2": [{"a":1, "b":[{},{}] }, {"a":1, "b":[{},{}] }] }; I am now unable to understand why following piece of code iterates two times. Shouldnt it just iterate once as only 1 array element is present? code snippet: for( index in test.key2)
type: Question
possible better answer: http://stackoverflow.com/a/28545634
tagged with: javascript
has title: Understanding For-in Loop
has comment: http://stackoverflow.com/comment/45404403
answer count: 2
has comment: http://stackoverflow.com/comment/45404248
linked to: http://stackoverflow.com/q/500504
has comment: http://stackoverflow.com/comment/45404261
score: -6
favorite count: 0
has answer: http://stackoverflow.com/a/28545613
accepted answer: http://stackoverflow.com/a/28545613
has answer: http://stackoverflow.com/a/28545634
downvote count: 6
type: AnsweredQuestion
upvote count: 0

http://stackoverflow.com/a/28459303
downvote count: 0
answers question: http://stackoverflow.com/q/28459121
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45245030
upvote count: 2
has body: For modern browsers I would recommend mutation observers: var observer = new MutationObserver( myFunction ); // configuration of the observer: var config = { attributes: false, childList: true, characterData: true, subtree: true }; // pass in the target node, as well as the observer options observer.observe(contentDiv, config); This adds a mutation observer to your element. You can configure the options to which the observer needs to listen. Jquery doesn't support this natively (yet). This will fire when there is content added to the contentDiv. Or changes to the child elements in the contentDiv. childList Set to true if additions and removals of the target node's child elements (including text nodes) are to be observed. attributes Set to true if mutations to target's attributes are to be observed. characterData Set to true if mutations to target's data are to be observed. subtree Set to true if mutations to not just target, but also target's descendants are to be observed. attributeOldValue Set to true if attributes is set to true and target's attribute value before the mutation needs to be recorded. characterDataOldValue Set to true if characterData is set to true and target's data before the mutation needs to be recorded. attributeFilter Set to an array of attribute local names (without namespace) if not all attribute mutations need to be observed. Source: MDN Which browsers support this: CanIuse Read more here: MDN MutationObserver is a powerful tool. It also provides information about the changes in the element. I suggest to read up with the possibilities. For now it will do the thing you want. As a fall back for IE9 and 10 you can use: contentDiv.addEventListener ('DOMNodeInserted', myFunction, false); This, however, will not host the same functionality as the mutation observer and its use is discouraged by MDN.
accepted answer of: http://stackoverflow.com/q/28459121
type: AcceptedAnswer

http://stackoverflow.com/comment/45225003
score: 0
type: Comment
has text: I would suggest you to use classes as on the first answer. It's cleaner.
comment on: http://stackoverflow.com/a/28448133
type: AnswerComment

http://stackoverflow.com/a/28525732
has body: var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); if (isMobile) { $('head').append('&lt;link rel="stylesheet" href="css/StyleSheet-ipad.css"&gt;'); //Append ipad specific stylesheet }
type: Answer
has comment: http://stackoverflow.com/comment/45406700
answers question: http://stackoverflow.com/q/28525649
score: 0

http://stackoverflow.com/a/28574255
has comment: http://stackoverflow.com/comment/45458211
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45458035
has comment: http://stackoverflow.com/comment/45458690
has comment: http://stackoverflow.com/comment/45458087
has comment: http://stackoverflow.com/comment/45458499
has comment: http://stackoverflow.com/comment/45459112
has comment: http://stackoverflow.com/comment/45458259
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45457995
has body: You may need to tweak this a bit: http://jsfiddle.net/6zcyfrqp/1/ HTML Popover on right this is my awesome content includes a save button JS $(function () { var options = { content: function () { return $("#content").html(); }, placement: "right", container: "body", toggle: "popover", title: 'My Title', html: true }; $('.btn').popover(options); });
accepted answer of: http://stackoverflow.com/q/28573965
has comment: http://stackoverflow.com/comment/45459126
answers question: http://stackoverflow.com/q/28573965
has comment: http://stackoverflow.com/comment/45458758
has comment: http://stackoverflow.com/comment/45458126
has comment: http://stackoverflow.com/comment/45459144
has comment: http://stackoverflow.com/comment/45458555

http://stackoverflow.com/comment/45218549
has text: @adeno - the cookie is always set with `path=/;`. I don't see anything related to domains in any of the code.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28444378

http://stackoverflow.com/a/28529220
has comment: http://stackoverflow.com/comment/45373941
has comment: http://stackoverflow.com/comment/45374085
type: Answer
has comment: http://stackoverflow.com/comment/45374015
downvote count: 0
has body: Since you refer to both "private" and "getter", it's not entirely clear what you want. If what you want is that the outside world can obtain the value, but cannot set the value directly, then there are a couple ways to do that: Taking from Crockfords fairly old article on the topic of private member variables, you can create a method that has access to the private variable, but there is no other external access to the private variable (e.g. it cannot be set from the outside): function Product(sku) { this.getSku = function() { return sku; } } var p = new Product(1234); console.log(p.getSku()); The variable itself is private and cannot be set from the outside. But it's value can be retrieved with the getSku method. The idea is that any variables that are local to the constructor function (including the arguments) are accessible only to the constructor itself and to any functions defined in the constructor, but not accessible to the outside world. So, if you define some methods on the object in the constructor, then those methods and only those methods can access those local variables. As such, they are essentially private member variables because they are private and per-instance. It is the concept of Javascript closures that make this work. This works with all browser versions. Or, if you want sku to work like a read-only property where you can read it's value with property syntax rather than method syntax, you can define only a getter for it using Object.defineProperty() in the constructor like this: function Product(sku) { Object.defineProperty(this, "sku", { get: function() { return sku;}, writable: false, // default value, doesn't have to be specified configurable: false, // default value, doesn't have to be specified enumerable: false }); } var p = new Product(1234); console.log(p.sku); P.S. Object.defineProperty() requires IE9 or higher.
has comment: http://stackoverflow.com/comment/45373971
score: 5
has comment: http://stackoverflow.com/comment/45374033
accepted answer of: http://stackoverflow.com/q/28529060
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28529060
upvote count: 5

http://stackoverflow.com/a/28476381
type: Answer
answers question: http://stackoverflow.com/q/28476313
score: 0
has body: var res_arr = arr.filter( function filterByValue(element){ if (element != "bar"){ return element } });
upvote count: 1
downvote count: 1

http://stackoverflow.com/a/28539185
score: 0
has body: I found the answer, I've changed my controller into this public ActionResult Read([DataSourceRequest] DataSourceRequest request, string searchbox) { var waybill = db.WayBills.Where(x =&gt; x.Status == 1 &amp;&amp; x.WaybillNumber.Contains(searchbox)); var result = waybill.ToDataSourceResult(request, o =&gt; new { WaybillNumber = o.WaybillNumber, ETD = o.ETD, ETA = o.ETA, PIB_Date = o.PIB_Date, Description = o.Description, CurrencyID = o.CurrencyID, PIB_PaymentDate = o.PIB_PaymentDate, ShipmentID = o.ShipmentID, Status = o.Status }); return Json(result, JsonRequestBehavior.AllowGet); } and my view &lt;div class="table"&gt; @(Html.Kendo().Grid&lt;COGS.Models.WayBill&gt;() .Name("grid") .DataSource(DataSource =&gt; DataSource .Ajax() .PageSize(100) .Model(model =&gt; model.Id(data =&gt; data.WaybillNumber)) .Read(read =&gt; read.Action("Read", "Home").Data("addSearch")) .Sort(sort =&gt; sort.Add(product =&gt; product.ETA).Descending()) ) .Columns(columns =&gt; { columns.Template( @&lt;text&gt; @Html.ActionLink(@item.WaybillNumber, "home", "details", new { id = @item.WaybillNumber }) &lt;/text&gt; ).ClientTemplate("&lt;a href='home/details/#=WaybillNumber#'&gt;#=WaybillNumber#&lt;/a&gt;").Title("Waybill"); columns.ForeignKey(data =&gt; data.ShipmentID, (System.Collections.IEnumerable)ViewData["shipment"], "ShipmentID", "Content").Title("Shipmnet Type"); columns.ForeignKey(data =&gt; data.CurrencyID, (System.Collections.IEnumerable)ViewData["currency"], "CurrencyID", "Content").Title("Currency"); columns.Bound(data =&gt; data.Description); columns.Bound(data =&gt; data.ETD).EditorTemplateName("Date").Format("{0:MM/dd/yyyy}"); columns.Bound(data =&gt; data.ETA).EditorTemplateName("Date").Format("{0:MM/dd/yyyy}"); columns.Bound(data =&gt; data.PIB_Date).EditorTemplateName("Date").Format("{0:MM/dd/yyyy}").Title("PIB Date"); columns.Bound(data =&gt; data.PIB_PaymentDate).EditorTemplateName("Date").Format("{0:MM/dd/yyyy}").Title("PIB Payment Date"); } ) .Pageable() .Sortable(…
type: Answer
answers question: http://stackoverflow.com/q/28538135

http://stackoverflow.com/comment/45433187
comment on: http://stackoverflow.com/q/28560856
type: QuestionComment
score: 1
has text: Please post some code
type: Comment

http://stackoverflow.com/comment/45328619
type: Comment
comment on: http://stackoverflow.com/a/28504700
score: 1
type: AnswerComment
has text: Anytime, Dont forget to mark it as correct answer... Cheers!

http://stackoverflow.com/a/28459491
has comment: http://stackoverflow.com/comment/45247300
downvote count: 0
has body: Well to start with, you're right that the line where you reference the cell is wrong. And you won't be able to reference a cell by quite the way you're doing it. Not that you should anyways. Here is another way of achieving this task which, by the way, is something most of us using HOT do anyways. I don't know your database structure so it's hard to say, so let's say that you're using SQL and that each row is a physical row on some table in your db. Now, as you may know, each row in SQL should have a unique primary autoincrementing key which you can use to reference rows by, this comes in handy when you start shuffling around rows in HOT. Now let's say you have a simple JS with the HOT instance as you described. The data object is the one supplying the data to the HOT instance but more importantly, it's a highly mutating object. As the user makes changes to the cells, this object is mutated. What this means is that you could add a Submit button somewhere that would grab the object at that time and send it to your db. This is one approach used frequently. Here is where the unique SQL id comes in handy. Your data object could be appending this ID to existing rows and making it a hidden column (no need to show the user this info). If the user creates a new row, then you can append a negatively decrementing integer (to represent a "new" row in the db), and when the user submits, you simply iterate through the data object and do an UPDATE on rows that have a positive ID, and an INSERT on rows with negative IDS. That's about it. Another option is that you can use the afterChange event to automatically save to the DB every change as it happens. Your function would say something like afterChange: function(changes, source) { // changes is an array of changes, where each change has 4 values, in order: // row index, col index, old value, new value changes.forEach(function(change) { var row = change[0]; var col = change[1]; var newVal = change[3]; var hiddenIdIndex = data[row].…
answers question: http://stackoverflow.com/q/28452224
has comment: http://stackoverflow.com/comment/45249246
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/28446128
linked to: http://stackoverflow.com/q/500431
has comment: http://stackoverflow.com/comment/45221659
accepted answer: http://stackoverflow.com/a/28446196
tagged with: javascript
has title: Why doesn't my context get shared?
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/45221711
has body: I thought I understood how call worked in javascript, but apparently not. function bear(){ var a = 1 pig.call(this) } function pig(){ alert(a) //throws an error, 'a is not defined' } bear() http://codepen.io/anon/pen/jEYGOv Why doesn't this work? How could I make it work (without passing a as a variable)
has answer: http://stackoverflow.com/a/28446160
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28446196
possible better answer: http://stackoverflow.com/a/28446752
has answer: http://stackoverflow.com/a/28446752
type: Question

sails.js
tags question: http://stackoverflow.com/q/28494848
type: Tag
tags question: http://stackoverflow.com/q/28446892
tags question: http://stackoverflow.com/q/28529338
tags question: http://stackoverflow.com/q/28534703
tags question: http://stackoverflow.com/q/28526187
tags question: http://stackoverflow.com/q/28490045
tags question: http://stackoverflow.com/q/28475056
tag name: sails.js
tags question: http://stackoverflow.com/q/28568480
tags question: http://stackoverflow.com/q/28456559

http://stackoverflow.com/comment/45283974
type: Comment
comment on: http://stackoverflow.com/a/28480757
score: 0
type: AnswerComment
has text: Thanks this is what I was trying to achieve

http://stackoverflow.com/q/28477592
has answer: http://stackoverflow.com/a/28480034
has body: im going crazy , im not so good on js or html so plz try to help me. on my blog on blogger i want to 1) Automatically create a short link using goo.gl service 2) share this short link on twitter by its button the js code im using to make the link short the code for twitter button Tweet this just share the current page url so it seems that my code does nothing. Any Solution?
tagged with: http://stackoverflow.com/tag/html
tagged with: getelementbyid
favorite count: 0
upvote count: 1
type: AnsweredQuestion
has title: Html tag attribute value from javascript value
score: 1
tagged with: tags
accepted answer: http://stackoverflow.com/a/28480034
type: Question
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/28471406
type: Question
has body: I am calling a url to get content in div. I am using javascript function to call it. I am using this code &lt;div class="portlet" data-id="prt2"&gt; &lt;div class="portlet-header"&gt;Reporting&lt;/div&gt; &lt;div class="portlet-content" id="divEmployeeReportingWidget"&gt;&lt;/div&gt; &lt;/div&gt; &lt;script&gt;AjaxPage('../home/pages.php?page=Dashboard_EmployeeReporting', 'divEmployeeReportingWidget');&lt;/script&gt; and the function is here: function AjaxPage(url, containerid) { $("#"+containerid).html('&lt;br /&gt;&lt;br /&gt;&lt;div align="center"&gt;&lt;img src="images/loading.gif" /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;'); var j = $("#"+containerid).load(url); } and the page.php is here: if($_REQUEST['page'] == 'Dashboard_EmployeeReporting'){ echo '&lt;div class="portlet-content" id="divEmployeeReportingWidget"&gt;&lt;table border="0" cellspacing="0" cellpadding="3" width="98%" align="center"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td style="width:100px;" valign="top"&gt;Report To:&lt;/td&gt;&lt;td class="main2"&gt;&lt;span style="font-weight:bold;"&gt;&lt;img src="../images/icons/iconUser.gif" style="float:left"&gt;&amp;nbsp;John Smith&lt;br&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;Reporting To Me:&lt;/td&gt;&lt;td class="main2"&gt;&lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;'; } I am unable to get content. How can I do that ?
has comment: http://stackoverflow.com/comment/45267531
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45267284
has title: how to call a url through load() function in php
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
answer count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/45267371
type: UnansweredQuestion
tagged with: php
score: 2

http://stackoverflow.com/comment/45479058
score: 0
comment on: http://stackoverflow.com/q/28583497
type: QuestionComment
has text: @BoltClock Reading back my comment, I meant that doing it the way HAML does is good, instead of CSS notation or using a css-file as reference.
type: Comment

http://stackoverflow.com/q/28579763
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28579871
favorite count: 0
tagged with: php
has answer: http://stackoverflow.com/a/28579958
type: AnsweredQuestion
downvote count: 2
has answer: http://stackoverflow.com/a/28579871
type: Question
has comment: http://stackoverflow.com/comment/45467888
has body: I am unable to set parameter in a JavaScript function,below is my code: var product=&lt;?php echo json_encode($product); ?&gt;; var uniqueid=&lt;?php echo json_encode($shop_uniqueid); ?&gt;; var shop_photo=&lt;?php echo json_encode($photo); ?&gt;; var price=&lt;?php echo json_encode($price); ?&gt;; var author=&lt;?php echo json_encode($author); ?&gt;; //onmouseover='this.width='someWidth'; this.height='someHeight'" onmouseout="this.width='originalWidth'; this.height='originalHeight'' $('#'+&lt;?php echo $count; ?&gt;).html("&lt;div class='div1'&gt;&lt;img class='shopperspic' src='b2b/Product Images/"+uniqueid+"/"+shop_photo+"' alt='' /&gt;&lt;/div&gt;&lt;div class='div2'&gt;&lt;span style='font-weight:bold;'&gt;"+product+"&lt;/span&gt;&lt;/div&gt;&lt;div class='div3'&gt;By: &lt;span style='text-decoration:underline'&gt;"+author+"&lt;/span&gt;&lt;/div&gt;&lt;div class='in_div'&gt;&lt;div class='div_price'&gt;&lt;img src='header/images/rupee.png' /&gt;"+price+"&lt;/div&gt;&lt;div&gt;|QTY&lt;select&gt;&lt;option value='1'&gt;1&lt;/option&gt;&lt;option value='2'&gt;2&lt;/option&gt;&lt;option value='3'&gt;3&lt;/option&gt;&lt;option value='4'&gt;4&lt;/option&gt;&lt;option value='5'&gt;5&lt;/option&gt;&lt;/select&gt;&amp;nbsp;&lt;input type='button' id='add_"+div.id+"' value='Add to cart' onClick='add_to_cart()'/&gt;&lt;/div&gt;&lt;/div&gt;"); I want to pass parameter var product in onClick='add_to_cart()'
accepted answer: http://stackoverflow.com/a/28580488
score: -2
has title: How to set parameter in JavaScript function?
has comment: http://stackoverflow.com/comment/45467801
tagged with: javascript
answer count: 3
has answer: http://stackoverflow.com/a/28580488
upvote count: 0

http://stackoverflow.com/q/28472054
has body: I've been struggling with converting an Array of objects to JSON, or any other PHP readable format so I can send it over AJAX. I'm using localStorage and I save an object into it, I save it using JSON.stringify(data) Now when I loop through all the localStorage data, I add it to an array using the following code var locations = new Array(); for(var i = 0; i &lt; localStorage.length; i++){ locations[i] = JSON.parse(localStorage.getItem(localStorage.key(i))); } The end result looks like this. This is my $.ajax request $.ajax({ type: "POST", url: "store.php", dataType: "json", data: locations, success: function(data) { console.log(data); } }); The only problem is that I can't seem to convert it to a readable format to send to PHP Any clues? Thanks!
tagged with: arrays
has answer: http://stackoverflow.com/a/28472587
tagged with: javascript
has answer: http://stackoverflow.com/a/28472445
possible better answer: http://stackoverflow.com/a/28472514
has title: Array of objects for PHP (AJAX)
has comment: http://stackoverflow.com/comment/45268586
has comment: http://stackoverflow.com/comment/45268539
has answer: http://stackoverflow.com/a/28472514
score: 0
has comment: http://stackoverflow.com/comment/45268656
has comment: http://stackoverflow.com/comment/45268773
has comment: http://stackoverflow.com/comment/45269154
has comment: http://stackoverflow.com/comment/45268833
has comment: http://stackoverflow.com/comment/45268481
tagged with: php
has comment: http://stackoverflow.com/comment/45268231
answer count: 4
has comment: http://stackoverflow.com/comment/45268495
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28472331
has comment: http://stackoverflow.com/comment/45268248
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45269024
type: Question
accepted answer: http://stackoverflow.com/a/28472331
tagged with: object

http://stackoverflow.com/comment/45378168
type: Comment
type: QuestionComment
has text: @abraham: I don't think I'm the one jumping or, as Occam put it, "multiplying entities," but whatever. :-)
comment on: http://stackoverflow.com/q/28524138
score: 0

conflict
tag name: conflict
tags question: http://stackoverflow.com/q/28504001
type: Tag

http://stackoverflow.com/comment/45271184
score: 3
comment on: http://stackoverflow.com/q/28473688
type: Comment
type: QuestionComment
has text: Wrap it in `setInterval`?

http://stackoverflow.com/q/28481101
answer count: 3
has answer: http://stackoverflow.com/a/28503782
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has body: So, I understand this is an odd question. I have 2 pages, one that somebody fills out w/ a bunch of inputs. The next page would be a "print to pdf" type deal w/ Coldfusion. However, I want to send all the info to the next page and not lose what the person entering data has put in. Is there a way with jQuery (or some other option in CF that I haven't seen) to potentially grab the $('body') and pass it to sub in on the next page so it keeps the &lt;input&gt; values? I don't want to do a form submit, as there are a bunch of calculations that also take place based off those inputs that are shown, using javascript, and &lt;cfdocument&gt; has trouble with javascript after the fact.
has answer: http://stackoverflow.com/a/28481264
accepted answer: http://stackoverflow.com/a/28481264
tagged with: coldfusion
type: AnsweredQuestion
downvote count: 0
has title: Passing DOM elements to another page with JQuery
possible better answer: http://stackoverflow.com/a/28503782
score: 1
has answer: http://stackoverflow.com/a/28498431
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28480253
answer count: 0
has body: I'm currently doing the following: var item1 = new Object(); item1.name = 'a &amp; b'; item1.description = 'Do a &amp; then do b'; item1.untouched = 'Dont touch this'; var item2 = new Object(); item2.name = 'c'; item2.description = 'Do something else'; item2.untouched = 'Dont touch this'; uppercaseProperties = function( properties, obj ) { properties.forEach( function( p ) { obj[ p ] = obj[ p ].toUpperCase() } ); return obj; } [item1, item2].map( function( item ) { return this.uppercaseProperties( ['name', 'description'], item ); }, this ); For brevity and expressiveness, I'd much rather use map instead of forEach, i.e. something like uppercaseProperties = function( properties, obj ) { properties.map( function( p ) { return obj[ p ].toUpperCase(); } ); return obj; } but that doesn't work, as it only returns the modified properties, not the entire objects. So what I'd need to do here is functionally access obj's member x. Now I could obviously write a function that does that, but I wonder if JavaScript does have anything native for that? (FWIW, C++ has.)
tagged with: javascript
type: UnansweredQuestion
type: Question
favorite count: 0
score: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/45283195
downvote count: 1
has comment: http://stackoverflow.com/comment/45399314
has comment: http://stackoverflow.com/comment/45283418
has comment: http://stackoverflow.com/comment/45282865
has comment: http://stackoverflow.com/comment/45283277
has title: Access an object property functionally

http://stackoverflow.com/q/28454865
tagged with: node.js
has comment: http://stackoverflow.com/comment/45244027
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45274312
tagged with: javascript
has comment: http://stackoverflow.com/comment/45397765
type: Question
score: 0
tagged with: webkit
has body: Is there a way to toggle the default toolbar in a nodewebkit app using js ? My app shouldn't display the toolbar as it's set in the package.json and it works fine in most cases. But for some reasons, in an embedded windows xp distribution it display's the toolbar anyway.. So I would like to try to hide it dynamically after the app is launched. And I don't find any window functions to do that in the documentation. Any ideas ?
has title: Node Webkit window hide toolbar dynamically in js
has comment: http://stackoverflow.com/comment/45378594
has comment: http://stackoverflow.com/comment/45274903
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45389934
has comment: http://stackoverflow.com/comment/45390520
tagged with: node-webkit

http://stackoverflow.com/comment/45404481
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28545168
has text: now I've using jquery, and it almost works. but when I move the mouse around sometimes the animation goes up and down. http://test.lundbeckconsulting.no/ContentBox/default.html
type: AnswerComment

http://stackoverflow.com/comment/45272930
comment on: http://stackoverflow.com/q/28474598
type: Comment
score: 1
type: QuestionComment
has text: What the heck is `else if` at start of function?

http://stackoverflow.com/comment/45430236
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28559319
has text: why would you escape that?

http://stackoverflow.com/comment/45453948
has text: I fail to see any livereload related things in your gulpfile.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28570834

http://stackoverflow.com/a/28575208
has body: The problem is the first click is initializing the plugin, but that won't show the datepicker since the datepicker click handler is added after the click event. So $("body").on('click', '.startNew', function () { if (!$(this).hasClass('hasDatepicker')) { $(this).datepicker({ dateFormat: "yy-mm-dd 00:00:00", numberOfMonths: 2, onSelect: function (selected) { $(".endNew").datepicker("option", "minDate", selected) } }).datepicker('show'); } }); $("body").on('click', '.endNew', function () { if (!$(this).hasClass('hasDatepicker')) { $(this).datepicker({ dateFormat: "yy-mm-dd 00:00:00", numberOfMonths: 2, onSelect: function (selected) { $(".startNew").datepicker("option", "maxDate", selected) } }).datepicker('show'); } }); In this case, you are trying to initialize the plugin lazily, but a better solution will is to initialize the plugin after the target element .startNew and .endNew is created.
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45484775
answers question: http://stackoverflow.com/q/28575014

http://stackoverflow.com/comment/45346162
has text: @LarsHöppner it was for ds.data, it wasn't an array instead I should have passed data.data, not just data. +1
score: 0
comment on: http://stackoverflow.com/q/28500217
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28569421
tagged with: javascript
tagged with: express
tagged with: node.js
has body: I am using a wildcard route to access files in my node app. Some files start with a period. In this case I get 403 Forbidden. Whats the problem with these paths? Update: I am using a wildcard route that looks like app.get('/:area/:place/blob*', function (req, res, next) { so a route that is causing problems would be one like /my/area/.git
type: UnansweredQuestion
tagged with: url-routing
has title: Getting 403 when using period in Node Express Routes
type: Question
score: 0
has answer: http://stackoverflow.com/a/28569593
answer count: 1

http://stackoverflow.com/q/28537894
tagged with: android
answer count: 0
score: 0
type: Question
has title: clicked listview to open detail view in android
has comment: http://stackoverflow.com/comment/45389827
tagged with: javascript
has comment: http://stackoverflow.com/comment/45391289
has body: I have an XML file that consists of a title, a link to the image, and description. exp. <?xml ?> Title link of image Descrioption Title link of image Descrioption Title link of image Description I want the title shown on Listview which when clicked will open a detail page complete with titles, pictures, and descriptions . examples such as those found at the following link Google's developer: http://developer.android.com/design/material/videos/ContactsAnim.mp4 this is my full code Anggra.java (this is main activity of my project) package com.tolhedo.akew.anggra; import java.util.Locale; import android.support.v7.app.ActionBarActivity; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.os.Bundle; import android.support.v4.view.ViewPager; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import com.viewpagerindicator.TitlePageIndicator; public class Anggra extends ActionBarActivity { SectionsPagerAdapter mSectionsPagerAdapter; ViewPager mViewPager; TitlePageIndicator titlePageIndicator; private static final int numPages = 3; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_anggra); mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); mViewPager = (ViewPager) findViewById(R.id.pager); mViewPager.setAdapter(mSectionsPagerAdapter); titlePageIndicator = (TitlePageIndicator)findViewById(R.id.titles); titlePageIndicator.setViewPager(mViewPager); } @Override public void onBackPressed() { if (mViewPager.getCurrentItem() == 0){ super.onBackPressed(); } else { mViewPager.setCurrentItem(mViewPager.getCurrentItem() - 1); } } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_anggra, menu); return true; } @Override public boolean on…
tagged with: http://stackoverflow.com/tag/xml
type: UnansweredQuestion

http://stackoverflow.com/comment/45402239
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28525480
has text: It works perfectly on my website. Be sure to include your script in the .php file (I wrote "scriptFile.js") and (obviously) be sure to use a .php file.
score: 0

http://stackoverflow.com/a/28566865
downvote count: 0
answers question: http://stackoverflow.com/q/28566748
type: AcceptedAnswer
has body: You could do something like this: var a = moment().endOf('month'); var b = moment(); if(a.diff(b, 'days') &lt;= 13) { //do something }
type: Answer
score: 11
upvote count: 11
accepted answer of: http://stackoverflow.com/q/28566748

http://stackoverflow.com/comment/45468399
type: QuestionComment
comment on: http://stackoverflow.com/q/28579491
score: 0
type: Comment
has text: See my answer, try beforeShow(), it won't iterate as beforeShowDay.

scope
tags question: http://stackoverflow.com/q/28532915
tags question: http://stackoverflow.com/q/28562861
tags question: http://stackoverflow.com/q/28576817
tags question: http://stackoverflow.com/q/28438912
tags question: http://stackoverflow.com/q/28554867
tags question: http://stackoverflow.com/q/28509869
tag name: scope
tags question: http://stackoverflow.com/q/28534476
tags question: http://stackoverflow.com/q/28462158
tags question: http://stackoverflow.com/q/28491419
tags question: http://stackoverflow.com/q/28516232
type: Tag
tags question: http://stackoverflow.com/q/28543691
tags question: http://stackoverflow.com/q/28592127
tags question: http://stackoverflow.com/q/28475106
tags question: http://stackoverflow.com/q/28448417
tags question: http://stackoverflow.com/q/28519093
tags question: http://stackoverflow.com/q/28538322
tags question: http://stackoverflow.com/q/28443313
tags question: http://stackoverflow.com/q/28494415

http://stackoverflow.com/comment/45469270
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28580504
has text: ow its nice ,new infromation +1 for that
type: Comment

http://stackoverflow.com/q/28488478
type: UnansweredQuestion
tagged with: firebase
tagged with: firebase-security
score: 2
has answer: http://stackoverflow.com/a/36560987
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/45329555
answer count: 1
tagged with: javascript
has title: How can I prevent other sites/apps from accessing my Firebase?
linked to: http://stackoverflow.com/q/18890330
favorite count: 0
has body: I'm building a simple sample app that essentially just allows all users to the site to chat with each other, like a chat room. Firebase let's me authenticate users anonymously, which is what I want, since I only want users who are on my app to use it. The following code provides authentication as per Firebase docs: var ref = new Firebase("https://&lt;your-firebase&gt;.firebaseio.com"); ref.authAnonymously(function(error, authData) { if (error) { console.log("Login Failed!", error); } else { console.log("Authenticated successfully with payload:", authData); } }); That's cool. It works. Great. But here's my question. What's to prevent someone from simply copying my javascript code from my sources and running their own app against my Firebase? Since the authentication method is on the client side within my app, one can simply copy-paste and start reading and writing onto my Firebase and modifying everything. I have my rules set in my dashboard as such { "rules": { ".read": "auth !== null", ".write": "auth !== null" } } I really am lost as to how secure this really is. I can't use secret tokens since it's all client-side. What am I missing?
downvote count: 0

jquery-mobile
tags question: http://stackoverflow.com/q/28448246
tags question: http://stackoverflow.com/q/28558495
tags question: http://stackoverflow.com/q/28563598
type: Tag
tags question: http://stackoverflow.com/q/28529925
tags question: http://stackoverflow.com/q/28511873
tags question: http://stackoverflow.com/q/28539828
tags question: http://stackoverflow.com/q/28446871
tags question: http://stackoverflow.com/q/28520324
tags question: http://stackoverflow.com/q/28484194
tags question: http://stackoverflow.com/q/28499324
tags question: http://stackoverflow.com/q/28569349
tags question: http://stackoverflow.com/q/28586438
tags question: http://stackoverflow.com/q/28586613
tags question: http://stackoverflow.com/q/28451851
tags question: http://stackoverflow.com/q/28555417
tags question: http://stackoverflow.com/q/28504902
tags question: http://stackoverflow.com/q/28495875
tags question: http://stackoverflow.com/q/28457966
tags question: http://stackoverflow.com/q/28518455
tags question: http://stackoverflow.com/q/28591496
tags question: http://stackoverflow.com/q/28497069
tags question: http://stackoverflow.com/q/28494814
tags question: http://stackoverflow.com/q/28492536
tags question: http://stackoverflow.com/q/28444020
tag name: jquery-mobile
tags question: http://stackoverflow.com/q/28559835
tags question: http://stackoverflow.com/q/28513804

http://stackoverflow.com/comment/45356008
comment on: http://stackoverflow.com/a/28519505
type: AnswerComment
type: Comment
score: 0
has text: Right.. You see I am a bit lazy.

http://stackoverflow.com/a/28568193
upvote count: 2
has comment: http://stackoverflow.com/comment/45447865
score: 2
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28567160
has body: On a cshtml page (per your post, _Layout.cshtml), you need to double up the @ symbol: var filter = /^([\w-]+(?:\.[\w-]+)*)@@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; Here's screenshots showing the difference: HTH, -Ted
type: Answer
accepted answer of: http://stackoverflow.com/q/28567160

http://stackoverflow.com/q/28527052
has body: Javascript click() event working perfectly but only if the link is not a new window or tab... Working example : Visit PUACTION But this is not working (add : target="_blank") : Visit PUACTION What is it about open a new tab (or window) that reject the click event and how do I solve it ?
tagged with: hyperlink
tagged with: javascript
has comment: http://stackoverflow.com/comment/45369918
has comment: http://stackoverflow.com/comment/45369761
score: 0
has comment: http://stackoverflow.com/comment/45369899
has comment: http://stackoverflow.com/comment/45369961
has comment: http://stackoverflow.com/comment/45370439
tagged with: http://stackoverflow.com/tag/html
tagged with: getelementbyid
has comment: http://stackoverflow.com/comment/45369846
has comment: http://stackoverflow.com/comment/45370002
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
has title: Javascript:: click is working (only if it's not a new window or tab)?
has comment: http://stackoverflow.com/comment/45369888
has comment: http://stackoverflow.com/comment/45369842
has comment: http://stackoverflow.com/comment/45369785
downvote count: 1
type: Question
tagged with: href

http://stackoverflow.com/comment/45438586
has text: Thanks for the suggestion. I tried to make asynchronous call but when I do this, the progress bar is full while the treatment is not finished.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28558444
score: 0

http://stackoverflow.com/q/28463482
type: Question
has title: I would like to build a code that checks my imported mail in Gmail in Google Apps Script, how do I find this function?
score: -1
tagged with: google-schemas
tagged with: google-apps-script
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has body: As you might know, Gmail has the feature to check other email accounts (using pop3). I am using this feature a lot, but the annoying thing is it only checks the email once every 50 minutes of you have to do this manually in the settings, and the settings aren't available on mobile. I would like to build something to check this mail automatically every minute. The best would be a Google Apps Script, because it is linked with Gmail and it can automatically run from the cloud every minute. The only problem is that I don't know how to make a javascript that automatically does the 'get mail now' feature. How would I build this?
has answer: http://stackoverflow.com/a/28470698
tagged with: gmail
type: UnansweredQuestion
downvote count: 1

http://stackoverflow.com/q/28496152
tagged with: javascript
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28496875
has body: I have a list contains 20 transactions. The requirement is,using ng-repeat when I click the button 5 transactions should append again when I click the button next 5 transactions should append and so on.. can anyone plz help on this..... thanx
upvote count: 0
favorite count: 0
tagged with: angularjs
score: -3
has comment: http://stackoverflow.com/comment/45312066
has answer: http://stackoverflow.com/a/28500600
type: UnansweredQuestion
downvote count: 3
has title: Iteration ng-repeat only n times in AngularJs

http://stackoverflow.com/comment/45348906
type: AnswerComment
has text: Sorry, but it's not a general JS question. It's about Meteor DOM changes and triggering subsequent code, in this case a dropdown plugin. The above plugin API methods don't suffice. The onChange() for example is for when a user selects a new value, but I need to reset the plugin based on the underlying DOM change due to Meteor reactivity.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28515347

http://stackoverflow.com/q/28505265
has title: Pass data from text file loaded from the server to a JavaScript Variable
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/45329728
has comment: http://stackoverflow.com/comment/45330929
has body: Here's what I wanted to do. 1. Load a text file (server side) say testJSON.txt [DONE] 2. Load the content from text file [DONE] 3. Dump the loaded data into an array for JavaScript [??HOW??] Code snippet : var data2, externalData; $.get("testJSON.txt",function(externalData){ // Pop an alert showing the typeof the object taken from text file [WORKS] alert("Data from JavaScript file: " + externalData + "typeof object " + typeof externalData); // Convert the string from text file into JavaScript array [WORKS] data2 = eval('['+ externalData + ']'); }); // **DOESN'T WORK** alert(data2);
type: Question
has comment: http://stackoverflow.com/comment/45330628
has comment: http://stackoverflow.com/comment/45329730
has comment: http://stackoverflow.com/comment/45330301
score: 0
duplicate of: http://stackoverflow.com/q/14220321
tagged with: javascript
has comment: http://stackoverflow.com/comment/45329767
linked to: http://stackoverflow.com/q/14220321

http://stackoverflow.com/a/28556264
answers question: http://stackoverflow.com/q/28556119
score: 0
type: Answer
has body: $(".datepicker").datepicker({ beforeShowDay: function(date) { var day = date.getDay(); return [(day != 1 &amp;&amp; day != 3 &amp;&amp; day != 0), '']; } }); The days of week go as 0 - Sunday, 1 - Monday and so on. So day != DayNumber will solve it for you. Fiddle

http://stackoverflow.com/q/28475230
has comment: http://stackoverflow.com/comment/45320811
tagged with: signalr.client
tagged with: javascript
has comment: http://stackoverflow.com/comment/45311338
has comment: http://stackoverflow.com/comment/45315184
tagged with: asp.net
has title: Calling Group SignalR Function from Hub Class
type: UnansweredQuestion
has body: I had created a Hub Class. All the data gets fetched but when Clients.Group(spokeCode).broadCast(message); function is called by api it does not execute the broadcast function on my ASP.NET Web Page (Client Page). 1. I had checked that /signalR/hubs is correctly generating. 2. OnConnected() gets successfully called [MethodImpl(MethodImplOptions.Synchronized)] public void BroadCastMessage(string spokeCode, String constr) { lock (this) { string procedureName = "procedureName"; string message = "message goes here "; DataAccessLayer dal = new DataAccessLayer(); //DataSet ds = dal.Executedataset(constr, procedureName); DataSet ds = dal.ExecuteDataset(constr, procedureName, new object[] { spokeCode }); foreach (var set in ds.Tables[0].AsEnumerable().GroupBy(c =&gt; c["SpokeCode"])) { try { DataTable dt = set.CopyToDataTable(); //for (int i = 0; i &lt; dt.Rows.Count; i++) //{ foreach (var r in set) { message += r.Field&lt;string&gt;("BatchNo") + " Lot No " + r.Field&lt;string&gt;("LotNo"); Clients.Group(spokeCode).broadCast(message); //Clients.Group(r.Field&lt;string&gt;("SpokeCode")).BroadCast(message); } } catch (Exception ex) { ErrorLogging log = new ErrorLogging(); log.EventLog(ex.Message); //Clients.Caller.executeError("An Error has Occured Contact System Administrator"); Clients.Group(spokeCode).executeError("An Error has been Occured, Contact Administrator"); } } } Here is the following client code written in JavaScript connectionHub.client.broadCast = function (message) { alert(message); };
has comment: http://stackoverflow.com/comment/45290799
has comment: http://stackoverflow.com/comment/45308812
answer count: 0
tagged with: signalr-hub
score: 0
tagged with: signalr
type: Question
has comment: http://stackoverflow.com/comment/45303001

http://stackoverflow.com/a/28458743
has body: I definitely would recommend using "each", as noob described in his updated answer. Here is a simplified example showing how to log each textbox value: $(".inputDate").each(function() { console.log($(this).val()); });
type: Answer
answers question: http://stackoverflow.com/q/28458191
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/q/28544585
has title: DOJO Build how to create a layer?
has body: I have the following profile for a DOJO custom build (boilerplate from https://github.com/csnover/dojo-boilerplate). I need to create a layer for my custom code with result as a single .js file for my custom code. At the moment the code take all files for custom, and process theme (minification) but the output it is always not concatenated. What am I doing wrong here? var profile = { basePath: '../src/', action: 'release', cssOptimize: 'comments', mini: true, optimize: 'closure', layerOptimize: 'closure', packages: [ 'dgrid', 'dijit', 'dojo', 'dojox', 'put-selector', 'xstyle', 'custom' ], stripConsole: 'all', selectorEngine: 'lite', layers: { 'custom/': { include: ["custom/bootstrap"] }, }, staticHasFeatures: { 'dojo-trace-api': false, 'dojo-log-api': false, 'dojo-publish-privates': false, 'dojo-sync-loader': false, 'dojo-xhr-factory': false, 'dojo-test-sniff': false } };
upvote count: 1
has answer: http://stackoverflow.com/a/28544818
type: Question
score: 1
accepted answer: http://stackoverflow.com/a/28544818
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: dojo-build
tagged with: dojo
type: AnsweredQuestion

http://stackoverflow.com/comment/45372760
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28528505
has text: Array.prototype instanceof Object = true

http://stackoverflow.com/comment/45372294
has text: Yes, step 3 builds a tree by iterating over all the data and adding each person to their parent's children collection.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28520943
type: Comment

http://stackoverflow.com/q/28438330
has title: Getting a single Variable from the URL in javascript
has comment: http://stackoverflow.com/comment/45206473
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45333057
answer count: 1
tagged with: url
has body: So I need to get a variable from a url, a site name, and I have some code, but I keep getting an undefined return. Here's my code to get the variable. function getSite(variable){ var query = window.location.search.substring(1); var vars = query.split("&amp;"); for(var i=0; i&lt;vars.length;i++){ var pair = vars[i].split("="); if(pair[0] == variable){ return pair[1]; } } } So any help? The url for example is: localhost/findsite.html?siteId=external1
has answer: http://stackoverflow.com/a/28438586
accepted answer: http://stackoverflow.com/a/28438586
has comment: http://stackoverflow.com/comment/45206797
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/28557161
type: Question
has comment: http://stackoverflow.com/comment/45426835
has body: I'm using Ajax Mini File Upload Form to allow users to drag'n'drop files to upload to the server. Client side the form and the script are the same, the difference is in the upload.php. In order to allow the upload the user needs credentials. And i can't find out how to add sending login and password to the upload.php page. Edit : I've tried reading the source code to understand where i could add the parameters i need, but so far i've only found that the parameters are stored in formData. Since i'm in a rush, i've hardcoded the login and password in the upload page so i could continue coding on the server side (it's the current focus) until i can add code client side to include those 2 parameters. Below is only the html part of the page with the main script since all the scripts are too big to post here You need to login in order to use the servicer Login : Password : Above is the div containing the login form from which i get the login and password Drop Here Browse Above is the form used by the script to upload files. $(function(){ var ul = $('#upload ul'); $('#drop a').click(function(){ // Simulate a click on the file input button // to show the file browser dialog $(this).parent().find('input').click(); }); // Initialize the jQuery File Upload plugin $('#upload').fileupload({ // This element will accept file drag/drop uploading dropZone: $('#drop'), // This function is called when a file is added to the queue; // either via the browse button, or via drag/drop: add: function (e, data) { var tpl = $(' '); // Append the file name and file size tpl.find('p').text(data.files[0].name) .append('' + formatFileSize(data.files[0].size) + ''); // Add the HTML to the UL element data.context = tpl.appendTo(ul); // Initialize the knob plugin tpl.find('input').knob(); // Listen for clicks on the cancel icon tpl.find('span').click(function(){ if(tpl.hasClass('working')){ jqXHR.abort(); } tpl.fadeOut(function(){ tpl.remove(); }); }); // Automatically upload the file once it is add…
has title: Mini Ajax file upload form
score: 0
tagged with: javascript
tagged with: jquery
tagged with: file-upload
has comment: http://stackoverflow.com/comment/45426624
has comment: http://stackoverflow.com/comment/45426340
type: UnansweredQuestion
answer count: 0

http://stackoverflow.com/comment/45444333
has text: go forward what output is for : `var_dump($comment->data->children[0]->data->replies->data);` ?
score: 0
comment on: http://stackoverflow.com/q/28566884
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28496480
answers question: http://stackoverflow.com/q/28496321
downvote count: 0
has comment: http://stackoverflow.com/comment/45314289
score: 1
has comment: http://stackoverflow.com/comment/45314227
has comment: http://stackoverflow.com/comment/45312792
has comment: http://stackoverflow.com/comment/45313185
has comment: http://stackoverflow.com/comment/45312854
has body: The following code works fine for me: Example Click me! If your code is not running: Check the browser console. Are there any errors? Is jQuery included on your page? Are you attaching the #button function when the page is ready? You might be attempting to add an event before the button is created. Have you declared an nclick variable and initialised it to zero? EDIT Okay, the question has now been clarified - the ad script appears as soon as the page is loaded, but you want to delay it until a button has been clicked 7 times. The solution is basically the same as the above, though: ads.js alert("hello, world!"); example.htm Example Click me! Simply add the script into the page once the counter reaches 7.
has comment: http://stackoverflow.com/comment/45313530
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45313320
type: Answer
accepted answer of: http://stackoverflow.com/q/28496321
has comment: http://stackoverflow.com/comment/45313704

http://stackoverflow.com/a/28550325
type: Answer
score: 2
downvote count: 0
upvote count: 2
has body: I think you can only call FormApp.getActiveForm() from a script attached to a form, whereas your script is contained in a GSheet. I couldn't find a way to easily gets forms that used this sheet as its destination so what I've did was get all of the forms and then looked at the destination id of each and checked if it is the same as this spreadsheet. Once you've got your Form object you can get the responses. Feels a bit long winded would love to know if anyone knows a quicker way. There are also a few exceptions that FormApp throws that you have to cope with. Here's the function I use: /** * Find the first form that is linked to a specific spreadsheet * * @param {string} spreadsheet id * @return {object} Form or null */ function getFormByDestinationId_(spreadsheetId) { var formFiles = DriveApp.getFilesByType('application/vnd.google-apps.form'); var form; var formFile; var formId; var destinationId; while (formFiles.hasNext()) { formFile = formFiles.next(); formId = formFile.getId(); // Throws an error if ID invalid try { form = FormApp.openById(formId); } catch (error) { if (error.name === "Exception") { // Just ignore it } else { throw error; } } // Form.getDestinationId() throws an error if there is no destination id try { destinationId = form.getDestinationId(); } catch (error) { if (error.name === "Exception") { // Just ignore it } else { throw error; } } if (destinationId !== spreadsheetId) { continue; } return form; } return null; } // getFormByDestinationId_()
answers question: http://stackoverflow.com/q/28548802

http://stackoverflow.com/q/28549620
tagged with: css
has answer: http://stackoverflow.com/a/28549958
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45412468
type: Question
has comment: http://stackoverflow.com/comment/45412427
accepted answer: http://stackoverflow.com/a/28549958
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
has title: Setting div elements in front
tagged with: http://stackoverflow.com/tag/html
has body: I have the following code. What I would like to have happen is when an item is checked a new div is created at the top of the page. The new div contains an image set larger that the other images. My ccs code: a>div { display: none; } a:hover>div { display: block; } img { margin: 10px 5px; position:absolute; } Dynamically created code from js: Div element with the other images. I have already tried: Changing the img css position property from absolute to relative Set the z-index on the second div to -1 I am trying to make the dynamically created div containing the image to stay in front of all other images. Attempt at JSfiddle: http://jsfiddle.net/0f5u620u/ Test link http://thenerdservice.com/dining/index.php Full Code: Welcome <?php echo $username; ?> Please select any items below to add to your wish list. Also be sure to set your priority on each 1 = I really want it, 2 = I would like it, 3 = If its still left around ill take it. Dining Room Candels Left Plate Right Plate Tea Pot Left Mug Right Mug Bell Salt and Pepper Shaker

http://stackoverflow.com/q/28547288
tagged with: javascript
has answer: http://stackoverflow.com/a/59115490
upvote count: 114
has answer: http://stackoverflow.com/a/36798078
has comment: http://stackoverflow.com/comment/72843846
has answer: http://stackoverflow.com/a/67357808
tagged with: cors
has answer: http://stackoverflow.com/a/62674121
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28548756
has comment: http://stackoverflow.com/comment/45408062
favorite count: 0
tagged with: ajax
has title: No 'Access-Control-Allow-Origin' header is present on the requested resource error
has answer: http://stackoverflow.com/a/49623455
linked to: http://stackoverflow.com/q/3102819
has answer: http://stackoverflow.com/a/73697546
has answer: http://stackoverflow.com/a/38000615
linked to: http://stackoverflow.com/q/20035101
has answer: http://stackoverflow.com/a/28548756
has answer: http://stackoverflow.com/a/54592701
has answer: http://stackoverflow.com/a/39881491
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45407916
has answer: http://stackoverflow.com/a/55708492
answer count: 12
possible better answer: http://stackoverflow.com/a/38000615
downvote count: 0
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/69192128
has comment: http://stackoverflow.com/comment/45408312
score: 114
has comment: http://stackoverflow.com/comment/109117673
type: Question
has body: I'm trying to fetch the feed of a news website. Thought I'd use google's feed API to convert the feedburner feed into json. The following url will return 10 posts from the feed, in json format. http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&amp;num=10&amp;q=http://feeds.feedburner.com/mathrubhumi I used the following code to get the contents of above url $.ajax({ type: "GET", dataType: "jsonp", url: "http://ajax.googleapis.com/ajax/services/feed/load", data: { "v": "1.0", "num": "10", "q": "http://feeds.feedburner.com/mathrubhumi" }, success: function(result) { //..... } }); but it's not working and I'm getting the following error XMLHttpRequest cannot load http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&amp;num=10&amp;q=http%3A%2F%2Ffeeds.feedburner.com%2Fmathrubhumi. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. How do I fix this?
has answer: http://stackoverflow.com/a/50045327

http://stackoverflow.com/a/28492283
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28492262
upvote count: 2
score: 2
has body: Because it is infact undefined - definitions is an Array. To get the output you expect from your question - console.log(parsedJSONquery.definitions[0].text); You would use the usual Array functions to work with it - for example, to call console.log on all of them - obj.definitions.forEach(function(el) { console.log(el.text); });

http://stackoverflow.com/q/28592766
has comment: http://stackoverflow.com/comment/45492319
type: Question
has comment: http://stackoverflow.com/comment/45493431
answer count: 1
has title: angular - index.html recognize only functions defined in the default route
tagged with: javascript
has comment: http://stackoverflow.com/comment/45492562
has body: I have wired problem in angular. in my index.html I have nav bar with ng-click="go('')" for each tab. 'go' is function which defined in each of my controllers. var sheepApp= angular.module('sheepApp', [ 'ui.bootstrap', 'ngRoute', 'firebase' ]); sheepApp.config(['$routeProvider', function($routeProvider) { $routeProvider. when('/home', { templateUrl: 'pages/home.html', controller: 'homeCtrl' }). when('/vision', { templateUrl: 'pages/vision.html', controller: 'visionCtrl' }). when('/about', { templateUrl: 'pages/about.html', controller: 'aboutCtrl' }). when('/gallery', { templateUrl: 'pages/gallery.html', controller: 'galleryCtrl' }). when('/videos', { templateUrl: 'pages/videos.html', controller: 'videosCtrl' }). otherwise({ redirectTo: '/home' }); }]); the problem is that the 'go' function (and all others) only recognized if I'm now in the route defined as 'otherwise' (In my case -'home') Why it can happen? thanks EDIT all my conntollers defined in ctrls.js example of one of the ctrls: sheepApp.controller('joinUsCtrl', ['$scope','$rootScope','$location', function ($scope, $rootScope,$location) { $rootScope.go = function ( path ) { $location.path( path ); }; $rootScope.isActive = function(tabName){ return $location.path() == tabName; }; $scope.he = he; }]);
score: 0
has answer: http://stackoverflow.com/a/28593521
has comment: http://stackoverflow.com/comment/45493506
has comment: http://stackoverflow.com/comment/45492054
has comment: http://stackoverflow.com/comment/45493087
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45493411
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45492087
has comment: http://stackoverflow.com/comment/45492535

http://stackoverflow.com/q/28526372
has title: Using fork of Reactjs in a different project
has answer: http://stackoverflow.com/a/28531886
tagged with: npm
has body: I'm having trouble determining how to reference my react fork in a project I want to use it in while a PR request I made is being reviewed. Since the root package.json is react-tools, I can't use the npm github references. I also haven't had success making a local path reference to any of the react subdirectories I've tried. How can i use my version of react in my separate project?
tagged with: node.js
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/15806152
accepted answer: http://stackoverflow.com/a/28531886
type: Question
tagged with: reactjs
answer count: 1
tagged with: javascript
score: 0

http://stackoverflow.com/q/28527258
answer count: 1
has answer: http://stackoverflow.com/a/28534407
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has title: IndexedBD select objects from upper to lower?
tagged with: indexeddb
accepted answer: http://stackoverflow.com/a/28534407
tagged with: select
has body: For example: const customerData = [ { id: 444, name: "Bill", age: 35, email: "bill@company.com" }, { id: 5555, name: "Donna", age: 32, email: "donna@home.org" }, { id: 666, name: "Cat", age: 2, email: "cat@home.org" }, { id: 888, name: "Gandalf", age: 21000, email: "gandalf@home.org" } ]; function getDataByRange(db, table, index, lower, upper, fun){ var data = []; var tx = db.transaction(table, "readonly"); var store = tx.objectStore(table); var index = store.index(index); var boundKeyRange = IDBKeyRange.bound(lower, upper, false, false); var request = index.openCursor(boundKeyRange); request.onsuccess = function() { var cursor = request.result; if (cursor) { data.push(cursor.value); cursor.continue(); } else { fun(data); } }; } How to get next results: Gandalf, Bill, Donna, Cat? Now I get something like: Cat,Donna, Bill, Gandalf. Thanks for any suggestions!
type: Question
tagged with: database
tagged with: javascript
score: 0

cors
type: Tag
tags question: http://stackoverflow.com/q/28568370
tag name: cors
tags question: http://stackoverflow.com/q/28521356
tags question: http://stackoverflow.com/q/28515351
tags question: http://stackoverflow.com/q/28539320
tags question: http://stackoverflow.com/q/28522600
tags question: http://stackoverflow.com/q/28547288
tags question: http://stackoverflow.com/q/28568794
tags question: http://stackoverflow.com/q/28538199
tags question: http://stackoverflow.com/q/28451459
tags question: http://stackoverflow.com/q/28569347

http://stackoverflow.com/q/28465387
tagged with: javascript
has comment: http://stackoverflow.com/comment/45257352
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45257684
tagged with: jquery
has comment: http://stackoverflow.com/comment/45257799
has answer: http://stackoverflow.com/a/28465565
has comment: http://stackoverflow.com/comment/45257816
type: UnansweredQuestion
has title: Weird results from radio button
has comment: http://stackoverflow.com/comment/45256519
has comment: http://stackoverflow.com/comment/45257378
has answer: http://stackoverflow.com/a/28481807
has comment: http://stackoverflow.com/comment/45285403
has comment: http://stackoverflow.com/comment/45256983
type: Question
has body: I have a page with some radio buttons as well as a graph and legend. When the radio buttons change on onchange method is called and this should do two things: 1. change which portion of the legend is showing 2. redraw the graph using the appropriate data. Here is a clip of the HTML: Total Hours Customer-Facing Non-Customer Facing Here is a clip of the function: switch($('input[name=radTotalHours]:checked').val()) { case 'Total': $('#rowDailyCFGraphsLegend').show(); $('#rowDailyNCFGraphsLegend').show(); break; case 'CF': $('#rowDailyCFGraphsLegend').show(); $('#rowDailyNCFGraphsLegend').hide(); break; case 'NCF': $('#rowDailyCFGraphsLegend').hide(); $('#rowDailyNCFGraphsLegend').show(); break; } Ok so here is the weirdness... The value I'm getting isn't the value of the radio button that is selected but the previous radio button. After a bit of searching, I added some console.log lines to check: console.log('val1: ' + $('input:radio[name=radTotalHours]').val()); console.log('val2: ' + $('input:radio[name=radTotalHours]:checked').val()); console.log('val3: ' + $('input[name=radTotalHours]').val()); console.log('val4: ' + $('input[name=radTotalHours]:checked').val()); val1 and val3 always display "Total" while val2 and val4 always match but display the previous radio button's value. I even added the following: $('input', '#divDailyRadioButtons').each(function(){ if($(this).attr('checked') == 'checked') console.log('val: ' + $(this).val()); else console.log('xxx'); }); But here the if statement always passes for 'Total', no matter which radio is selected. As a side note, I am forced to use IE9 for this. Anyone know what is going on here?
has comment: http://stackoverflow.com/comment/45256650
tagged with: internet-explorer-9

http://stackoverflow.com/comment/45408955
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/28547971
has text: FWIW, `.toggleClass('dimmer')` could replace that entire `if()` statement.
type: Comment

http://stackoverflow.com/q/28558637
answer count: 0
type: UnansweredQuestion
tagged with: css
downvote count: 0
score: 1
has title: putting an image on top of another with jquery
type: Question
has body: im using 2 images for my blog, the main image and an image when the user rolls over, right now the second image replaces the first, is it possible to have the second image hover over the first on hover? this is the code i have: &lt;a href="blog-inner.html" title="blog title"&gt;&lt;img src="images/blogpost2.jpg" alt="blog post title" class="img-responsive imghover"&gt;&lt;/a&gt; jquery: &lt;script type='text/javascript'&gt; $(document).ready(function(){ var blog1 = ''; $(".imghover").hover(function() { //save previous image in variable blog1 = $(this).attr('src'); $(this).attr("src","images/imghover.png").animate(800); }, function() { $(this).attr("src",blog1); }); }); &lt;/script&gt;
has comment: http://stackoverflow.com/comment/45429094
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45429135
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/45429668
has comment: http://stackoverflow.com/comment/45429014

http://stackoverflow.com/q/28438265
has answer: http://stackoverflow.com/a/28438391
has comment: http://stackoverflow.com/comment/45206472
has answer: http://stackoverflow.com/a/28438539
type: Question
score: 0
answer count: 2
has body: I have a background I want to use that contrasts nicely with my content, except for the bottom 25% or so of the image. How can I align that 25% position with either the bottom of the content, or a set distance from the bottom of the div? The height of the content varies with page width, and the background has size cover HTML content here CSS .firstPanel { background-image: URL("path-to-background"); background-position: 50% 70%; background-repeat: no-repeat; background-size: cover; width: 100%; padding: 20px; padding-bottom: 100px; }
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has title: How do I align a div background with the bottom of its contents
tagged with: css
has comment: http://stackoverflow.com/comment/45206902
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45208955

http://stackoverflow.com/q/28445994
has answer: http://stackoverflow.com/a/28446042
answer count: 3
has body: I'm really scratching my head at this one. I'm getting an error that calculateHelper is undefined... but.... isn't it right in the function?? I first thought it was an order thing, so I've even moved the entire var calculateHelper to above the if(valuesArr) statement, or moved it outside the buy_vs_rent event handler, none of that helped. $('#buy_vs_rent_calculate').on('click', function(){ if(valuesArr.length === 1){ setTimeout("calculateHelper(valuesArr[0])",100); } else { alert("Please set three of the four values using the sliders; leave only one field blank to be calculated") } var calculateHelper = function(valueToCalc){ ... }; });
favorite count: 0
has comment: http://stackoverflow.com/comment/45221311
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/28446018
has comment: http://stackoverflow.com/comment/45221767
upvote count: 3
has comment: http://stackoverflow.com/comment/45221346
type: Question
has comment: http://stackoverflow.com/comment/45221629
has title: Javascript undefined but formula is present
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28446138
possible better answer: http://stackoverflow.com/a/28446042
accepted answer: http://stackoverflow.com/a/28446018

http://stackoverflow.com/comment/45375233
has text: add events - nothing change ... casper.on("resource.error", function(errorCode, errorString, url, id){ this.echo(errorString); }); casper.on("page.error", function(msg, trace){ this.echo(msg); }); casper.on("remote.message", function(message){ this.echo(message); }); @Artjom B
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28524723

http://stackoverflow.com/q/28556285
type: UnansweredQuestion
has title: kendo ui grid loading indicator not showing
has comment: http://stackoverflow.com/comment/45428145
has comment: http://stackoverflow.com/comment/45428229
type: Question
has body: I am using kendo grid in my html page and every thing working perfectly but one issue i am facing when page loads and i send request to get data it takes 1 or 2 seconds meanwhile grid should show loading indicator as we can see in demo . This is what i am doing $.ajax({ type: "GET", contentType: "application/json; charset=utf-8", url: api/getdata, dataType: 'json', cache: false, headers: { 'ccode': compCode }, async: false, data: '?&amp;tableName=' + table + '&amp;userId=' + userId + '&amp;fromDate=' + dateFrom + '&amp;toDate=' + dateto + '&amp;isSearchForClient=' + true, success: function (result) { var data = []; if (result) { result = result.replace(/&amp;/g, "'"); var jsonResult = JSON.parse(JSON.parse(result)); for (var i = 0; i &lt; jsonResult.length; i++) { data.push({ Log: jsonResult[i]["Log"], TransactionId: jsonResult[i]["TransactionId"] }); } var grid = $("#logs").kendoGrid({ dataSource: { data: data, schema: { model: { fields: { TransactionId: { type: "string" }, Log: { type: "string" } } } }, pageSize: 10 }, height: 405, scrollable: true, detailInit: detailInit, detailExpand: function (e) { this.collapseRow(this.tbody.find(' &gt; tr.k-master-row').not(e.masterRow)); }, pageable: { input: true, numeric: false }, columns: [ { field: 'Log', title: "Audit Logs", encoded: true }] }); //grid.dataSource.read(); } } });
score: 0
has comment: http://stackoverflow.com/comment/45428368
tagged with: kendo-grid
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45426417
tagged with: kendo-ui
tagged with: telerik
answer count: 0

http://stackoverflow.com/comment/45462019
type: Comment
has text: @cycloidistic Could you elaborate on what you mean by "Begins with http://"? In the `conditional.php` file you would `echo` whatever you like and then access with `httpRequest.responseText`. I used the response code in your case because it is a clearer way to test the result of your conditional in your PHP and is available in AJAX with `httpRequest.status`. You can echo a JSON payload like you were doing before if that is comfortable. As for the `http_response_code()` if you have PHP 5.4 or better, you are set. If not, [use the header() function](http://php.net/manual/en/function.header.php)
comment on: http://stackoverflow.com/a/28575989
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45642605
score: 0
type: Comment
has text: If it is empty the Javascript probably does not work. Can you check if the browser finds the Javascript (e.g. with Firebug or depending on what browser you use)? I have not worked with Grapelli (yet). I had put it on the bottom of the template just before the final {% endblock %} statement.
comment on: http://stackoverflow.com/a/28587207
type: AnswerComment

http://stackoverflow.com/comment/45423634
score: 0
comment on: http://stackoverflow.com/q/28554349
type: QuestionComment
has text: I tried moving the brand inside the first `ul`. It doesn't work either. However it worked when it was nested within the `navbar-header`. Maybe it does have something to do with the `preventDefault()`, but I am not looking to override the bootstrap js file.
type: Comment

http://stackoverflow.com/a/28818634
downvote count: 1
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28520840
upvote count: 3
has body: gulp-usemin currently has a bug which prevents you from using multiple &lt;!-- build:name ... --&gt; comments with the same name. If there are two &lt;!-- build:css ... --&gt; sections in the same file this will also trigger the bug. I wound up using useref instead, and I didn't even have to change my HTML.
has comment: http://stackoverflow.com/comment/46804240

http://stackoverflow.com/a/28567818
score: 0
type: Answer
has body: Or you can do it with jQuery: apples oranges bananas
answers question: http://stackoverflow.com/q/28565503

http://stackoverflow.com/q/28469853
has answer: http://stackoverflow.com/a/28535816
score: 0
answer count: 2
tagged with: jquery
has comment: http://stackoverflow.com/comment/64139320
has body: I am using jsplumb to draw dynamic state machine diagram. On click of a button I need to add new box in a drawing area and allow user to position it as per their need. I am not getting any proper easy to understand documentation for this. I tried few things: var i=8; function AddDiv() { var obj = new Date(); var Div = $('&lt;div/&gt;', { 'class':'box ui-draggable ui-draggable-handle ui-droppable', 'id':'box_'+i, 'html':'BOXESNEW' }).appendTo('.statemachine_cont'); jsPlumb.addEndpoint($(Div), targetEndpoint); $(Div).draggable( { drag: function(){ jsPlumb.repaint($(this)); // (or) jsPlumb.repaintEverything(); to repaint the connections and endpoints // jsPlumb.addEndpoint($(this)); } }); $(Div).addClass('box ui-draggable ui-draggable-handle ui-droppable'); } var a = $("#a"); //Setting up drop options var targetDropOptions = { activeClass: 'dragActive' }; //Setting up a Target endPoint var targetColor = "#BEBEBE"; var targetEndpoint = { anchor: "BottomCenter", //Placement of Dot endpoint: ["Dot", { radius: 8}], //Other types are rectangle, Image, Blank, Triangle paintStyle: { fillStyle: targetColor }, //Line color isSource: true, //Starting point of the connector // scope: "green dot", connectorStyle: { strokeStyle: "#5C96BC", lineWidth: 2 }, // Means Bridge width and bridge color connector: ["Bezier"], //Other properties Bezier maxConnections: -1, //No upper limit isTarget: true, //Means same color is allowed to accept the connection dropOptions: targetDropOptions //Means when the drag is started, other terminals will start to highlight }; jsPlumb.bind("ready", function () { //Set up endpoints on the divs jsPlumb.addEndpoint($(".box ui-draggable ui-draggable-handle ui-droppable"), targetEndpoint); jsPlumb.addEndpoint($(".box ui-draggable ui-draggable-handle ui-droppable"), sourceEndpoint); jsPlumb.draggable($(".box ui-draggable ui-draggable-handle ui-droppable")); jsPlumb.animate($("#a"), { "left": 50, "top": 100 }, { duration: "slow" }); }); Not sure what I have done…
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/64144088
possible better answer: http://stackoverflow.com/a/28492301
type: AnsweredQuestion
has title: Jsplump dynamically draw state machine diagram
type: Question
accepted answer: http://stackoverflow.com/a/28535816
has comment: http://stackoverflow.com/comment/45305175
tagged with: javascript
tagged with: jsplumb
has answer: http://stackoverflow.com/a/28492301

http://stackoverflow.com/comment/45358799
type: Comment
comment on: http://stackoverflow.com/a/28513318
score: 0
type: AnswerComment
has text: @RokoCBuljan Update: I changed the inside div to position: relative and had to set top postion to top: -400. It is working perfect now. If you can think of a better way to do this or give me any reasons of why I shouldn't do it the way I did it please let me know. Otherwise thanks for the help!

http://stackoverflow.com/q/28516586
favorite count: 0
has body: I'm trying to create a price range, by using two range elements like this: CSS code: .first{ position : relative; top :10px; left :10px; margin : 0; padding : 0; border : 1px solid red; border-top : 4px solid transparent; border-radius :3px; z-index:0; } .next{ position : relative; top :0px; left :-153px; margin : 0; padding : 0; border : 1px solid red; border-bottom : 1px solid transparent; border-radius :3px; z-index : 4; } HTML code: price : Is it possible to style a theme to look like a jQuery range slider?
type: UnansweredQuestion
tagged with: css
score: 3
tagged with: rangeslider
upvote count: 3
has title: How can I create a dual range slider using CSS3 and Javascript?
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28518000
answer count: 1

http://stackoverflow.com/q/28462673
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28462901
accepted answer: http://stackoverflow.com/a/28462901
has title: Display slideToggle is not working
type: Question
has comment: http://stackoverflow.com/comment/45251327
has comment: http://stackoverflow.com/comment/45251266
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I created a slideToggle section and it work perfectly but I don't do what when I click on #login bottum section comes down and go up fast and I can't show it this is my code $("#login").click ( function() { $("#loginForm").slideToggle(600) } ) and HTML ورود به حساب کاربری <%= form_for "user" , :url => {controller: "user", action: "login"}, :html => {:method => :post} do |f| %> <%= f.text_field(:email, :class => "input__field input__field--haruki" ) %> ایمیل <%= f.password_field(:password, :class => "input__field input__field--haruki" ) %> رمز عبور <%= f.submit("ارسال", :class => "buttom") %> <% end %>

http://stackoverflow.com/a/28507075
type: Answer
answers question: http://stackoverflow.com/q/28506968
score: 0
has body: When you refresh the page in a browser, all stored data within Javascript variables are lost. If you need to refresh the page, the data needs to be stored in a database and you need to request that data on page load using something like AJAX. If you are looking to change 'pages' within your AngularJS app you should use routing and multiple views to simulate multiple web pages. This will enable you to pull up different pages while maintaining any data that is stored within your service. Check out routing inside of the AngularJS tutorial.

http://stackoverflow.com/comment/45252697
has text: So iteration is better than recursion?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28463292
type: Comment

http://stackoverflow.com/comment/45245791
type: Comment
type: QuestionComment
has text: You cannot set headers after any content is written?
comment on: http://stackoverflow.com/q/28459823
score: 0

http://stackoverflow.com/comment/45216071
has text: No luck with that either, I don't get the unknown provider error anymore but param is undefined (also tried with $routeParams & that's undefined too)
comment on: http://stackoverflow.com/q/28442865
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28584476
accepted answer of: http://stackoverflow.com/q/28583330
has comment: http://stackoverflow.com/comment/45479145
score: 0
answers question: http://stackoverflow.com/q/28583330
has comment: http://stackoverflow.com/comment/45476304
type: Answer
has comment: http://stackoverflow.com/comment/45476814
has comment: http://stackoverflow.com/comment/45476336
has comment: http://stackoverflow.com/comment/45478333
type: AcceptedAnswer
has body: This work as designed: &lt;xp:listBox id="listBox1" value="#{sessionScope.pending}"&gt; &lt;xp:selectItem itemLabel="A"&gt;&lt;/xp:selectItem&gt; &lt;xp:selectItem itemLabel="B"&gt;&lt;/xp:selectItem&gt; &lt;/xp:listBox&gt; &lt;xp:button value="OK" id="button1"&gt; &lt;xp:eventHandler event="onclick" submit="true" refreshMode="complete"&gt; &lt;/xp:eventHandler&gt; &lt;/xp:button&gt; I know, it does not populate values with JQuery, but it should not make a difference... Disclaimer: There might be a problem with model update - if the component submits values not defined via sources - &lt;xp:selectItem&gt;. This usually happens with comboboxes - submitted values must match any value generated by XPage. I suppose there is a choice to pre populate listbox options natively. If not, try a workaround: You can use CSJS to put selected value into hidden input binded to sessionScope. That one will be submited. Notice the binding is moved from listBox1 to inputHiden1. &lt;xp:button value="Refresh" id="button1"&gt; &lt;xp:eventHandler event="onclick" submit="true" refreshMode="partial" refreshId="inputHidden1"&gt; &lt;xp:this.script&gt;&lt;![CDATA[var lb = dojo.byId("#{id:listBox1}"); var hi = dojo.byId("#{id:inputHidden1}"); hi.value = lb.options[lb.selectedIndex].innerHTML;]]&gt;&lt;/xp:this.script&gt; &lt;/xp:eventHandler&gt; &lt;/xp:button&gt; &lt;xp:inputHidden id="inputHidden1" value="#{sessionScope.pending}"&gt; &lt;/xp:inputHidden&gt; Script copying value from listbox to hidden input can be run in onChange of listBox to avoid the need of button click. See also: XPages - Client side code to set viewScope value?

http://stackoverflow.com/comment/45339636
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28509855
has text: Can you be a tad bit more specific on that? I was thinking about middleware to handle that but I'm still not exactly sure how that works.

http://stackoverflow.com/a/28544191
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28543711
has body: Here is a makeshift answer. I would use bootstrap for positioning though. You can use bootstrap. JSFiddle is that what you are looking for? use col-sm-{x/12} to size and resize your positions.

http://stackoverflow.com/a/28516824
has comment: http://stackoverflow.com/comment/45350967
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28516497
has comment: http://stackoverflow.com/comment/45351838
has comment: http://stackoverflow.com/comment/45351247
score: 0
has comment: http://stackoverflow.com/comment/45351331
answers question: http://stackoverflow.com/q/28516497
has comment: http://stackoverflow.com/comment/45352234
type: Answer
has comment: http://stackoverflow.com/comment/45351887
has body: you can check value it self without isNan. Here is it: function check() { var jname, jpass, jpre_pass, jmail; jname = document.getElementById("name").value; jpass = document.getElementById("pass").value; jpre_pass = document.getElementById("pre_pass").value; jmail = document.getElementById("mail").value; var emailExp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([com\co\.\in])+$/; var isValid = true; if (!jname) { document.getElementById("cname").innerHTML = "enter the name first"; document.getElementById("lcheck").innerHTML = "false"; isValid = false; } if (!jpass) { document.getElementById("cpas").innerHTML = "enter the password "; document.getElementById("lcheck").innerHTML = "false"; isValid = false; } if (!jpre_pass) { document.getElementById("cpre_pass").innerHTML = "enter the pre_pass"; document.getElementById("lcheck").innerHTML = "false"; isValid = false; } else if (jpre_pass != jpass) { document.getElementById("cpre_pass").innerHTML = "passwords not matches"; document.getElementById("lcheck").innerHTML = "false"; isValid = false; } if (!jmail) { document.getElementById("cmail").innerHTML = "enter the mail"; document.getElementById("lcheck").innerHTML = "false"; isValid = false; } else if(jmail.match(emailExp)) { document.getElementById("cmail").innerHTML = "invalid mail"; document.getElementById("lcheck").innerHTML = "false"; isValid = false; } return isValid; } You have to make sure that the id names are exists in the rendered page(in the browser). As I know server controls id names will be changed after rendered page. before all, you need to attach event to onsubmit. Here it is: document.forms[0].attachEvent("onsubmit", check);

http://stackoverflow.com/a/28449658
downvote count: 1
answers question: http://stackoverflow.com/q/28449430
score: 0
type: Answer
upvote count: 1
has body: Select http://localhost:3000 Find the snippet you want to debug. Click the line number where you want to place the breakpoint. Nice. You just set a breakpoint in your embedded JS. Assuming that http://localhost:3000 shows you the html you loaded. If not, there will be some tab in that list which does that.

http://stackoverflow.com/q/28481611
has comment: http://stackoverflow.com/comment/45285686
has comment: http://stackoverflow.com/comment/45285482
answer count: 1
downvote count: 0
has body: It's been three weeks since I worked on my code, but I'm pretty sure last time I opened it, it worked. Now it doesn't. Either I'm going insane and having false memories (wishful thinking maybe), or something inexplicable has happened. My code: Start conversation So when they click on the button, it should start playing a video and simultaneously activate the scriptcam recorder. netbeans debugger : undefined is not a function (.play) undefined is not a function (onclick) Any idea what is going on? edit/ it appears to be a problem in CHrome; How can I get it to work in Chrome?
favorite count: 0
accepted answer: http://stackoverflow.com/a/28481744
type: AnsweredQuestion
score: 1
has title: .play .onclick stopped working
upvote count: 1
type: Question
tagged with: function
has answer: http://stackoverflow.com/a/28481744
tagged with: javascript

http://stackoverflow.com/a/53938014
score: 3
downvote count: 0
type: Answer
has body: If the purpose for adding a function within the .append() is to have a conditional statement, then you have to make sure to have a return for every case. You can't choose to append a div only sometimes. A DOM element has to always be returned otherwise you will get the same error. For example this will fail: .append(function(d) { if(sometimesTrue) { return document.createElement('div'); } }); An else {} is required to return some other DOM element for the .append() to work properly. This is something I saw with D3.v3 so not sure if handled better in newer versions. Hope that helps someone.
upvote count: 3
answers question: http://stackoverflow.com/q/28485046

http://stackoverflow.com/q/28492349
favorite count: 0
type: AnsweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/28496405
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28496405
answer count: 1
downvote count: 0
score: 1
has title: In kendodropdownlist selected value redirect to another page
tagged with: jquery
has body: In kendo dropdown list when select a one dropdown value it should redirect to another page and get those values I have a kendo dropdown like this $("#txt-ddl").kendoDropDownList({ dataTextField: "name", dataValueField: "id", dataSource: { transport: { read: { url: "/XXXX/XXXX", dataType: "json" } } } }) i have a kendo dropdown like this.

http://stackoverflow.com/comment/45660498
type: AnswerComment
comment on: http://stackoverflow.com/a/28584087
score: 0
type: Comment
has text: that's strange, I see that you could either hide the line or the bars, but not both. Since I'm kind of lost in your code, I'd suggest you to do the following: Set up a 'g' element, give it the clip path, and plot the elements inside it, both the line and the rectangles, this way it should work! I believe that's because of this, even with graphic programs you can't mask multiple items with the same mask, unless they are grouped, and since we're working with svg the principle should apply as well

http://stackoverflow.com/q/28590770
upvote count: 1
tagged with: jquery
type: Question
has title: Losing selected tabs after asp post back
has comment: http://stackoverflow.com/comment/45496217
score: 1
has comment: http://stackoverflow.com/comment/45494268
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45488463
tagged with: asp.net
favorite count: 0
has body: This is driving me crazy since two days. I have a aspx page with dropdowns. Each dropdown changes dynamically based on other dropdown selection. The code is <asp:UpdatePanel id="UpdatePanel1" runat="server" UpdateMode="Always" ChildrenAsTriggers="true"> Filter Configuration <asp:DropDownCheckBoxes ID="DdlProject" runat="server" OnTextChanged="DdlProject_TextChanged" AddJQueryReference="true" AutoPostBack="true" OnSelectedIndexChanged="DdlProject_SelectedIndexChanged" > <Texts SelectBoxCaption="Project" /> </asp:DropDownCheckBoxes> Additional Parameters Users Powertrain <asp:DropDownCheckBoxes ID="DdlOperator" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DdlOperator_SelectedIndexChanged" > <Texts SelectBoxCaption="Operator" /> </asp:DropDownCheckBoxes> <asp:DropDownCheckBoxes ID="DdlEngine" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DdlEngine_SelectedIndexChanged" > <Texts SelectBoxCaption="Engine"/> </asp:DropDownCheckBoxes> Javascript for navigation tabs function showUsersDiv() { $("#users").show(); $("#powertrain").hide(); $("#dyno").hide(); $("#hex").hide(); resetActiveParamButtons(); $("#users-btn").addClass("active"); } function showPowerTrainDiv() { $("#users").hide(); $("#powertrain").show(); $("#dyno").hide(); $("#hex").hide(); resetActiveParamButtons(); $("#powertrain-btn").addClass("active"); } In an updatePanel I placed two bootstrap panels One panel has few dropdowns. The other panel has navigation tabs. And each navigation tabs has dropdowns. All these dropdowns from both panels depend on each other's selection. So I cannot place those two panels in different UpdatePanels. No matter which tab I select, after postback it is resetting to Users tab. How can I do this. Any help appreciated. Thanks
has comment: http://stackoverflow.com/comment/45505251
has comment: http://stackoverflow.com/comment/45494226
answer count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion

http://stackoverflow.com/q/28561690
upvote count: 1
downvote count: 1
has body: I have a scenario, if I click a next button on an html page it opens a popup. The popup has username and password. After providing username and password if I click submit button, the popup should close and go to a next html page. Using only JavaScript or jQuery. My Code: HTML: JS: My Code: HTML: JS: function myFunction() { var myWindow = window.open("", "MsgWindow", "width=279, height=150"); myWindow.document.write(" User ID: "); myWindow.document.write(" Password: "); myWindow.document.write(" "); }
tagged with: popup
has comment: http://stackoverflow.com/comment/45434491
tagged with: onclick
has title: Open popup onclick and closing it on submit and display relevant html page
has answer: http://stackoverflow.com/a/28562017
has comment: http://stackoverflow.com/comment/45439046
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45434321
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/28471483
type: Answer
has comment: http://stackoverflow.com/comment/45272825
has body: You right this don't work... You need for use "live" bind, because when you include it directly it load in not same time as your script: $('#Layer_2').live('click', function() { alert('Thanks'); }); I have found this solutions first for read, second for read To access svg.contentDocument it must be loaded from the same domain, and it will be null otherwise. There working DEMO. for simlify your use svg as inside you must start your code after loading all svg objects: &lt;object id="mysvg1" data="./test.svg" type="image/svg+xml" width="100%" height="100%"&gt;&lt;/object&gt; &lt;object id="mysvg2" data="./test.svg" type="image/svg+xml" width="100%" height="100%"&gt;&lt;/object&gt; ... var my_start_function = function(){ // start your code here } ... var svg_objects = ['mysvg1','mysvg2'], load_counter = 0; for (var i in svg_objects) { document.getElementById(svg_objects[i]).addEventListener("load",function() { load_counter++; if (load_counter == svg_objects.length) my_start_function(); }, false); } and access to svg elements throught a little function: var svg_inside = function(svg_id,elem_id) { return $($(document.getElementById(svg_id.substr(1)).contentDocument).find(elem_id)[0]); } ... svg_inside('#mysvg1','#Layer_2').click(function() { alert('Thanks'); });
has comment: http://stackoverflow.com/comment/45271411
accepted answer of: http://stackoverflow.com/q/28471368
has comment: http://stackoverflow.com/comment/45272159
has comment: http://stackoverflow.com/comment/45273986
has comment: http://stackoverflow.com/comment/45272914
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28471368
score: 0
has comment: http://stackoverflow.com/comment/45272709

http://stackoverflow.com/comment/45252746
comment on: http://stackoverflow.com/q/28462851
score: 0
has text: Does window.fetch have wide support? I don't see it at w3schools.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45380873
has text: Thanks @Daniel . Worked instantly!!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28532963
type: Comment

http://stackoverflow.com/a/28457281
type: AcceptedAnswer
downvote count: 0
has body: (function () { 'use strict'; angular .module('priceApp') .factory('filterService', filterService); function filterService() { var service = { getValidated: getValidated } return service; function getValidated(list, variants) { return list.filter(function (item) { var validated = false, i, length = variants.length; for (i = 0; i &lt; length; i++) { if (item.name === variants[i]) { validated = true; } } return validated; }); } } })(); Simply inject this filterService to your controller and then use it as in example here: $scope.selectedProductAttributes = filterService .getValidated($scope.listOfAttributes, $scope.listOfProductVariants) I followed John Papa's AngularJS Style Guide. Make sure to choose a better name than filterService. : )
answers question: http://stackoverflow.com/q/28456854
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/28456854

http://stackoverflow.com/q/28482065
upvote count: 3
downvote count: 2
has comment: http://stackoverflow.com/comment/45286241
type: Question
has comment: http://stackoverflow.com/comment/45286698
score: 1
has answer: http://stackoverflow.com/a/28482096
accepted answer: http://stackoverflow.com/a/28482096
has title: How to remove words from string using jquery?
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45289809
has body: I need to remove characters from string if characters number &gt; than 10 and insert three dots ... I need remove characters I need remov...//like this text
type: AnsweredQuestion

http://stackoverflow.com/comment/45331731
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28499803
has text: any errors in the developer console?
score: 0

modal-dialog
tag name: modal-dialog
tags question: http://stackoverflow.com/q/28531652
tags question: http://stackoverflow.com/q/28538503
type: Tag
tags question: http://stackoverflow.com/q/28498958
tags question: http://stackoverflow.com/q/28491577
tags question: http://stackoverflow.com/q/28453521
tags question: http://stackoverflow.com/q/28566056
tags question: http://stackoverflow.com/q/28540199

http://stackoverflow.com/a/28453435
has body: i applied inline styles, i think the following code may be helpful .. soluzione tokenid: 11
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28452746

http://stackoverflow.com/comment/45392698
type: AnswerComment
comment on: http://stackoverflow.com/a/28538094
type: Comment
has text: I edited my answer. That's all I can think of right now. Gotta crash though. Good luck.
score: 0

xmlhttprequest
tags question: http://stackoverflow.com/q/28577640
tags question: http://stackoverflow.com/q/28524485
tags question: http://stackoverflow.com/q/28459465
tags question: http://stackoverflow.com/q/28503282
tags question: http://stackoverflow.com/q/28462851
tag name: xmlhttprequest
tags question: http://stackoverflow.com/q/28482579
type: Tag
tags question: http://stackoverflow.com/q/28513842
tags question: http://stackoverflow.com/q/28466858
tags question: http://stackoverflow.com/q/28551082
tags question: http://stackoverflow.com/q/28584773
tags question: http://stackoverflow.com/q/28539320
tags question: http://stackoverflow.com/q/28584315

http://stackoverflow.com/a/28494244
downvote count: 0
has comment: http://stackoverflow.com/comment/45310157
has body: Change your CSS as below. Workin JSFIDDLE Here CSS .button { position: relative; width: 50px; height: 50px; border: 1px solid; border-radius: 50%; background: #2E3F47; z-index: 10; } .line { background: #ccc; width: 15px; height: 5px; margin: 2px auto; } .line__first { margin-top: 15px; } .menu { z-index: 1; float: left; width: 100%; } .menu__list { width: 100%; margin-left:-110px; margin-top:-10px; } /* Animation keyframes for the drop down */ @keyframes drop { from { top: 0px; } 70% { top: 85px; animation-timing-function: ease-in; } to { top: 70px; animation-timing-function: ease-out; } } @-webkit-keyframes drop { from { top: 0px; } 70% { top: 85px; -webkit-animation-timing-function: ease-in; } to { top: 70px; -webkit-animation-timing-function: ease-out; } } li { position: relative; list-style: none; padding-bottom: 0px; top: 0px; } li a { text-decoration: none; color: grey; text-align: center; font-size: 0.7em; font-family: 'Open Sans', sans-serif; } Working Demo Here Update 1 : See the Updated Link here Update 2: Working Demo with large font
accepted answer of: http://stackoverflow.com/q/28493694
has comment: http://stackoverflow.com/comment/45308664
has comment: http://stackoverflow.com/comment/45308818
answers question: http://stackoverflow.com/q/28493694
score: 1
has comment: http://stackoverflow.com/comment/45309398
upvote count: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/45437215
score: 0
type: Comment
type: AnswerComment
has text: Thanks @Quentin - I forgot that variables aren't hoisted the way functions are. Such a basic mistake - I appreciate you providing the examples.
comment on: http://stackoverflow.com/a/28509906

loopbackjs
tags question: http://stackoverflow.com/q/28439002
type: Tag
tag name: loopbackjs

http://stackoverflow.com/comment/45211197
has text: If it's in the same element, you could use `$(this).parent().find('ul') ...` see updated answer
type: Comment
comment on: http://stackoverflow.com/a/28440459
score: 0
type: AnswerComment

http://stackoverflow.com/q/28516330
has body: I'm trying to show an image on index.html after uploading it using node.js, express and multer. The multer implementation is based on a tutorial. The upload works. The image shows up in "/uploads" and the console.log is done as expected. The index.html shows "File uploaded." from the message var. Dev tools console says: GET http://127.0.0.1:3000/uploads/test1423920987055.jpg 404 (Not Found). I've tried to get the picture directly via < img > but it doesn't show. I would be really grateful if I could get an explanation so that I understand what I'm missing. Here's my server.js: app.use(express.static(__dirname + '/uploads')); app.use(multer({ dest: './uploads/', rename: function (fieldname, filename) { return filename+Date.now(); }, onFileUploadStart: function (file) { console.log(file.originalname + ' is starting ...') }, onFileUploadComplete: function (file) { console.log(file.fieldname + ' uploaded to ' + file.path) message = " File uploaded. " message += " "; done=true; } })); app.get('/',function(req,res){ res.sendfile("index.html"); }); app.post('/api/photo',function(req,res){ if(done==true){ console.log(req.files); res.end(message); //res.end("File uploaded."); } }); app.listen(3000,function(){ console.log("Working on port 3000"); }); and my index.html: File upload Node. Thank you for every hint in advance.
answer count: 0
downvote count: 0
has comment: http://stackoverflow.com/comment/45349964
tagged with: javascript
has comment: http://stackoverflow.com/comment/45351201
type: UnansweredQuestion
tagged with: express
has title: Node.js Express image won't show after upload
has comment: http://stackoverflow.com/comment/45352764
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/5924072
score: 1
has comment: http://stackoverflow.com/comment/45351079
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/45351131
has comment: http://stackoverflow.com/comment/45351319
tagged with: node.js
has comment: http://stackoverflow.com/comment/45352905
has comment: http://stackoverflow.com/comment/45351034
upvote count: 1

http://stackoverflow.com/a/28519892
has body: Unfortunately, the Chrome notification system is quite rigid. You can't directly access the HTML of the notification, and you're limited to the options provided. So, a "basic" type notification will only have an icon and some text. There is, however, an "image" type notification: It has the same format as a normal notification, plus an extra image provided by the imageUrl parameter. This may or may not help you.
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28519112