text stringlengths 46 37.3k | title stringlengths 12 162 |
|---|---|
JS : This question is particularly pointed at other C # devs coming over to TypeScript in VS Code.I fell in love with the code completion in VS C # . To illustrate , say I 'm trying to write : Using C # , I would have : type `` con '' a list of suggestions would appear , probably starting with `` console '' since that ... | Can VS Code code completion be configured to accept a suggestion on punctuation ? |
JS : I have a problem when I try to overwrite a file with gulp . To make you understand my problem here 's an example of what I am trying to do : My project file path : Copy the base source to dist.Copy the custom client source and overwrite what 's in the dist folder.What am I doingThe actual problemThe problem is tha... | Gulp is not overwriting JS files |
JS : I have a test that is comparing two sets , and when it fails the output is of the form : I find this very hard to read as it 's just a text diff and the real discrepancy is obscured ( the sets differ by 2 elements but the output makes it hard to tell which ) This is an app I created via create-react-app , and I 'm... | show entire output of expected and received in failed test |
JS : I am working on a parallel coordinates graph with d3.js and I am trying to plot some multiple dimensional data from an external json file.This is how the data in the json file is structured : And this is how so far I am handling the domain and how the graph plots the items data : The console does not give me any t... | Parallel coordinates multidimensional data not visualised in D3 |
JS : In JavaScript you can compose objects using some kind of extend function . For example I might have an observable class that exposes a set of public methods ( get , push , set , increment , get , etc ) In this case the observable also happens to be an EventEmitter so it also exposes a further set of public methods... | How to avoid name clashes when composing objects |
JS : Number ( ) function returns incorrect values on some arguments , like this : I tested this on Firefox , Chome , IE and Node.js . Why is this happening ? <code> Number ( '10000000712224641 ' ) returns 10000000712224640Number ( '10000000544563531 ' ) returns 10000000544563532 | Why does Number ( ) return wrong values with very large integers ? |
JS : I use iron-list from google Polymer . I kwon you can use Polymer.IronA11yKeysBehavior but even with the example I have no idea how I add it in JavaScript to my iron-list.Using Vaadin Polymer GWT lib . In this lib you have When I check the current values of the key bindings I defined a print function to log a varia... | Handle Keyboard events for iron-list in GWT ? |
JS : On my website I do n't want to bundle but instead use ES6 modules directly ( works for the audience ) I try importing fabric.js byimport { fabric } from `` ../node_modules/fabric/dist/fabric.js '' ; like I do when I bundle ( for bundles it works fine ) .however when starting the website I get `` Uncaught SyntaxErr... | fabric js as ES6 import in Chrome does n't work |
JS : I am having a slight issue with using dragabilly in angular , the problem is odd because it was working until I made some changes to how the content using packery is loaded in , specifically adding a level of nested repeats . When I do this , packery still runs correctly , however it seems dragabilly only runs on ... | angular , nested repeat breaking directive ( packery + dragabilly ) |
JS : I have already gone through the thread Any difference between await Promise.all ( ) and multiple await ? , so I am clear about Promise.all and multiple awaits.Still , I am not very clear about the below 2 scenarios.In Case 1 why does it execute sequentially ( takes 10s ) whereas in Case 2 it executes in parallel (... | What makes ` async/await ` statements run sequentially vs in parallel in ES6 ? |
JS : The StoryWe 've been using Protractor framework extensively and have established a rather large test codebase . We 've also been following the Page Object pattern to organize our tests.Recently , we 've started to use the Galen framework to fill the gap of visual/layout/responsive design testing . We really like t... | Combining Galen and Protractor frameworks |
JS : I 've heard that using global variable is bad in JavaScript . Since let is block-scoped can I use it within a block that includes all other functions and use it in a similar way to global variables ? <code> { var b = 10 ; let c = 20 ; function foo ( ) { return c ; } } | Using let variable instead of using Global variables |
JS : As we all know , we can define functions with and without a name : Where foo 's function has n't got it 's own name , but bar does.Is it possible to define the name of a function after defining it ? So doing something makes console.log ( foo.name ) return something else than `` <code> var/let/const foo = function ... | Set function name after defining it |
JS : In JavaScript , I noticed that the ES6 for ... of loop has a much different performance than the traditional for ( start ; stop ; step ) loop.BenchmarkResults ( Tested using Node.js v10.11.0 ) As you can see , as n increases , the speed of the for-of loop decreases at a faster rate than the standard for loop . Why... | Why is for-of loop faster than standard for loop for small arrays and slower for larger arrays ? |
JS : Most DOM query methods are available on both Documents and Elements . For example , However , getElementById is only available on Document : Why is this so ? The WHATWG DOM Living Standard tells us that : Web compatibility prevents the getElementById ( ) method from being exposed on elementsThe W3C DOM4 Recommenda... | Why is n't getElementById ( ) available on Elements ? |
JS : I 'm using flow to annotate types in my code.Is there any way to teach flow to report a warning or an error for comparisons with non matching types ( string in my case ) ? here is the example for testedit : so it seems not to be possible to do it with enums . but , since this is actually an error I encountered , I... | Comparing enum values in Flow |
JS : I 'm working with a project nuxt.js , I need to run a shell script on every changed file , that is , every webpack build.so I 'm using the Webpack HooksI created my Webpack Plugin/plugins/NamedExports.jsplugins/shell.jsthis script is to make named exports within each folder in the component directory , examplecomp... | how to break loop in webpack hook |
JS : My question is quite similar to What is the purpose of a self executing function in javascript ? , however it concerns userscripts ( specifically for GreaseMonkey ) instead.I see that some userscripts are distributed with this pattern , and some are not.Example of script with the IIFE pattern : ( source ) Example ... | Is the Immediately-Invoked Function Expression ( IIFE ) pattern really necessary when writing userscripts ? |
JS : I have the following problem , my function accepts an array that contains 4 arrays , each element is a number . The functions must return the largest element of each array . Results : Apparently it works , but when I tried with the last array [ 1000 , 1001 , 857 , 1 ] , in which 1000 and 1001 are larger than 857 I... | Why is 857 larger than 1000 and 1001 ? Javascript |
JS : I 'm looking for an approach to splitting a four sided shape into a grid . For example : Ultimately I need to be able to convert the resulting shapes to SVG , but I 'm happy to handle conversion to/from another library or coordinate system . What I 'm looking for is how to approach the calculation.Assume the shape... | Subdivision of Four-Sided , 2D Shape |
JS : In this introductory course of Reduxhttps : //egghead.io/lessons/javascript-redux-store-methods-getstate-dispatch-and-subscribe ? series=getting-started-with-redux , the presenter says that the following two lines are identical I 've just searched for ES6 const documentation , and it does not quite answer my quest... | beginner 's : const definition in Redux confusing |
JS : Why do n't getElementsByName , getElementsByTagName , and getElementsByClassName return an HTMLCollection ( W3C , MDN ) instead of a NodeList ( W3C , MDN ) ? All three return a live NodeList of only elements : NodeLists are great , but HTMLCollections are more specific as they can only contain HTML elements . It s... | Why do n't document.getElementsBy__ methods return an HTMLCollection ? |
JS : I have a SVG I am trying to animate with animejs.Basically its a selection path drawing . I managed to animate but the result is wrong.I want this : <code> var lineDrawing = anime ( { targets : 'path ' , strokeDashoffset : [ anime.setDashoffset , 0 ] , easing : 'easeInOutCubic ' , duration : 4000 , begin : functio... | How to animate my SVG path |
JS : GoalI am trying to mimic a List Control Component in React and Redux based on the Google Material Design layout.The list control will allow you to create , rename and delete items in the list without navigating to a new page.The actions for renaming and deleting a list item will be shown in a popup menu component ... | Using React how do I toggle the visibility of a nested component from a container component ? |
JS : Why does the following return false ? <code> Object.prototype instanceof Object | Why is Object.prototype instanceof Object false ? |
JS : Is it possible to have user code executed between a promise resolution and a promise await return ? Does the specification enforces that Promise callbacks are called immediatly ? I wonder if an event could be handled by the virtual machine between the 2 points , possibly causing side-effects . <code> function a ( ... | JavaScript ES6 - Possible race condition between promise resolution and event ? |
JS : Not quite grasping what 's going on here . Given the array ( arr ) : And the object ( obj ) : Why would arr.indexOf ( obj ) return -1 ( especially since I retrieved the object from the array using it 's 'id ' parameter earlier in the function ) ? <code> [ { `` first_name '' : `` Dan '' , `` last_name '' : `` Woods... | Javascript oddness with array of objects and indexOf |
JS : I have encountered a very strange bug in Firefox.I have a javascript function in an external file that works perfectly on regular complexity websites . However I have been putting together a few demonstration examples and come across something odd.With html formatted like this ( in an editor ) : The Javascript wor... | Very strange error caused by html whitespace |
JS : I have a Bootstrap Carousel with a lot of social embeds from Facebook all containing videos.I wo n't go into specifics of the Bootstrap Carousel as the problem is already visible on this simple jsfiddle and is due to Facebook embed.If you load this page : https : //jsfiddle.net/1L95vqn4/ , and look on Chrome Dev t... | Prevent huge amount of xhr/ajax calls on Facebook embed iframe |
JS : Reading underscore 's source , I noticed the use of void 0 instead of undefined . I know in some browsers undefined can be overwritten , and that a solution to this , in many cases , is just omitting an argument when calling a function , or return ; -ing . In fact , for minification purposes , it makes much more s... | var undefined = void 0 ; vs jquery 's closure vs ... ? |
JS : I 'm fetching some data with $ .getJSON that I want to asynchronously bind to controller context . I 've come up with this in my route - which works , but I 'm not happy with it : Then , in my template , I can , for example , use : And it works just fine . Is there a better way to write this ( perhaps without prom... | Ember.js : Proper way to cast Em. $ .getJSON into a promise and bind response to controller context ? |
JS : I 'm serving an embeddable < script > that users can copy/paste into their websites and have content displayed.The script loads a stylesheet and renders some HTML that is injected into the host page.I 'm facing problems displaying special characters ( ü , ö , ä , you name it ) when the host pages are encoded in en... | What 's a working strategy to serve umlauts generated by JS and CSS to all possible host page encodings |
JS : How to merge JSON objects using plain ( without jQuery ) JavaScript ? Requirement is to : Convert from : Convert To : <code> chartData= [ { `` date '' : '' 2014-05-1 '' , '' CAT1 '' :0.1 } , { `` date '' : '' 2014-05-1 '' , '' CAT2 '' :0.2 } , { `` date '' : '' 2014-05-1 '' , '' CAT3 '' :0.3 } , { `` date '' : '' ... | How to merge JSON objects using JavaScript ? |
JS : Imagine I have the following code : This immediately outputs the results . Now , how do I put a timed delay between each message as a way of back-pressure ( note that I do n't want a buffer ; instead , I want a and b to become Cold Observables ) , like : And have the exact same answer : Alternative : If backpressu... | How can I apply timed back pressure in RxJS5 ? |
JS : I tried to recursion those arrays to find odd/even numbers then push them to newArr but the result , not an array , that result is the string with numbers the result after found the odd/even numbers.this is the code i wrote , if i do n't write return result + odd ( nums.slice ( 1 ) ) ; the result nothing / undefin... | recursion in array to find odd numbers and push to new variable |
JS : This is kind of a doozy . This issue is most likely server related and so my first recourse was AskUbuntu over here.I 'm trying to have crontab or rc.local or init.d to start a forever script on boot . It attaches a server to a port I can ping with some information and have it run a headless browser for me.That sa... | Node 's spawn ( ) silently failing when called from a forever script scheduled on boot |
JS : This tutorial by Dan Abramov suggests that the advantage to using selectors that act on global state ( rather than a slice of state ) is that they allow containers to be decoupled from knowledge of the state structure.If that 's the case , should n't we also avoid directly mapping state values to props , and use s... | React / Redux : Should containers have any knowledge of state structure ? |
JS : SetupTwo WSGI servers running locally on different ports . One server returns an html page containing javascript that does a cross-origin ajax request to the other WSGI server using jQuery.origin_server.py Serves the html at http : //localhost:9010.cors_server.py Serves the cross-origin resource that the javascrip... | Excessive Latency on CORS AJAX Request to Local WSGI Server in Chrome |
JS : I was messing around with transitions and I noticed some stuttering and flickering when the transitions are applied to the selection in a different function . If , however , the transition is applied with method chaining , it works exactly as prescribed . Below is small example ( Fiddle ) of simply moving some tex... | Why do transitions flicker/stutter when applied in a separate function ( D3 ) |
JS : I have URLs in JSON feed n each URL contains one image . I want to validate those URLs which have image or not ( NULL ) . How to validate this using javascript . since I 'm a beginner , i do n't know , how to validate this . thanks <code> JSON feed with image n NULL { previewImage : '' http : //123.201.137.238:606... | How to validate a content in URL ( Javascript ) |
JS : I 'm developing an iOS app and now I 'm stuck with Firebase deploy functions . I 'm trying to send push notifications and I prepared the codes like below.Database structure : And this is the error message.Also in the log , I get errors like : Is the error occurring because I 'm not fetching fcmToken right ? I 've ... | Error with Firebase deploy function to send push notifications |
JS : I am using Patrick Springstubbe multiselect pluging and it works fine . But now I would like to use it for single select . I know I need to set the select to mulitple for the plugin to work . But is there a way to limit the number of option to 1.I have tried This gives the desired effect when you select an option ... | How to use PATRICK SPRINGSTUBBE jQuery multiselect plugin for single select |
JS : I have a video tag in which I pass video data i.e src and vtt dynamically , I want to keep vtt for the current video only , and remove all other textTracks.Right Now on switching the video , all vtt related to previously played videos start playing inside the video tag.vtt is subtitle <code> function addVttInvideo... | Remove all other 'vtt cues ' from video tag |
JS : In his Eloquent Javascript , Haverbeke claims that ( page 16 ) : '' In a JavaScript system , most of this data is neatly separated into things called values . Every value has a type , which determines the kind of role it can play . There are six basic types of values : numbers , strings , Booleans , objects , func... | Are functions objects or types in Javascript ? |
JS : Is there a c # library that can help to write and indent Javascript code.It 's because I 'm writing some c # code that generated some Javascript code . Something like this : And I find that generated a lot of ugly code.So , I thought that maybe a existing library can help me doing that ? <code> js += `` < script t... | Library to write javascript code |
JS : I 'm curious to know whyreturns true butreturns falseIs the inclusion of the greater than operator coercing the values differently ? <code> null == undefined null > = undefined | null and undefined inconsistent comparison |
JS : this is my first post , but i 'm excited to join this community . I have a question regarding JavaScript which I am completely stumped about . I 'm writing a JavaScript application which pulls data from a server using ajax and adds it to a chart . I 'm using Jquery and Highcharts as the framework and then writing ... | JavaScript method begins w/ variables assigned ? ? very confused |
JS : i have started with react native project , earlier was in native code.i wanted to add Amazon Lex so followed below steps from linkhttps : //aws-amplify.github.io/docs/js/interactionsbelow is my App.js filei have just set up amplify library and added interaction for LEX , but started getting below error as i try to... | Haste module naming collision : react native app with AWS Service ( Amplify Project ) |
JS : I try to implement the continuation monad in Javascript to handle continuation passing style and asynchronous control flows . Here is my continuation monad for learning : Apart from cont.ap , whose benefit does n't reveal itself to me , everything works fine.Now I 'd like to mimic the throw/catch mechanism of sync... | How to apply callcc so that it provides an escape continuation mechanism for use with the continuation monad |
JS : I created a Wordpress theme and now I am working on an editor-stylesheet for the block editor to better reflect the look of the theme in the editor . For this , I need to be able to address different post types in there.For the frontend , there is the body_class ( ) function to be used in templates , which inserts... | Wordpress : Is it possible to use post-type as part of a css selector in block editor stylesheet ? |
JS : I 'm a JavaScript developer who 's learning Lua . I 'm stuck with a problem of getting a function 's arity in the Lua language.In JavaScript , it 's simple : How is it possible to do it this easily in Lua ? <code> function test ( a , b ) { } console.log ( test.length ) // 2 function test ( a , b ) endprint ( # tes... | Get arity of a function |
JS : Given an array or object with n keys , I need to find all combinations with length x . Given X is variable . binomial_coefficient ( n , x ) .Currently I 'm using this : The output is : So if I want the binomial coefficient x=3 from n=4 I select all the strings with length equal to three . { abc , abd , acd , bcd }... | Efficient algorithm to get the combinations of all items in object |
JS : Project I 'm working on uses jQuery.I have a series of Ajax calls being made that load ( ) other HTML fragments which in turn load ( ) other fragments . The whole thing is confusing . I did n't write the code . Is there any tool which will allow me to walk the callstack so I can figure what is calling a method ? a... | Complex JavaScript . What called me ? |
JS : Our application has a list of tasks , which can grow quite large . The main tasks list has a sidebar , and when a task is selected , it can be edited in the sidebar - which uses a different controller ( TasksSidebarCtrl rather than TasksCtrl that displays the list ) . The selected task is copied , and then merged ... | Force splice of ng-repeat array whilst using track by |
JS : Is it safe to assume that the last script element* in the document when the script runs** is the currently running script ? For example , I want to create a script that can be dropped anywhere in the body of of a page and display an element in the same place . I 'm doing something like this : Assuming the script i... | Is it the last ` script ` element the currently running script ? |
JS : I was trying to extract strings with using an enum such as : and then later wanted to have a cost scale for the ingredientsbut i wanted to extract coffee to use the string : INGREDIENT.COFFEE like so : but it was showing an error that . is incorrect.I was resorting to : Is there something i am doing , preventing m... | Writing the Key of JSON with an enum |
JS : I want to push functions with params to an array without getting them executed . Here is what i have tried so far : But in this way functions gets executed while pushing . This Question provides similar example but without params . How can I include params in this example ? <code> var load_helpers = require ( '../... | Add Functions with params to Array Javascript ( Node.js ) |
JS : I quite often have to bind ? some function that requires arguments . The solution I use is wrapping the function to bind inside an anonymous function.Is there a more elegant way of doing this ? <code> function foo ( arg_0 ) { // do stuff with : arg_0 } function bar ( ) { var abc ; // stuff happens abc = 'some valu... | Javascript prevent anonymous function ? |
JS : So I have an API that will be deployed in a docker container . This API has the authentications controller , simple and not something special.When I start up the API in development mode on my local machine , the auth controller will be found and everything is working fine . Same for building and running it on my l... | NestJS controller not mapped |
JS : I 'm currently studying javascript by following the `` you dont know js '' series . In section `` this & object prototype '' , the author came up with an way to soft bind this . However , I am extremely confused by the code . So I was wondering if someone could kindly explain it to me , steps by steps , what the c... | confusion over how `` softBind '' function works |
JS : I am using jquery 1.10 . I want to know what the difference is between these three functions.Which function is better and why ? What is the purpose of the delegate function ? Can anybody explain me ? <code> $ ( `` .dropdown-menu '' ) .on ( `` click '' , `` .show_opt_menu '' , function ( ) { alert ( `` hello '' ) ;... | What is the difference between jquery on with / without selector parameter and jquery delegate ? |
JS : What 's happening here and why ? <code> document.write ( 0154 ) ; // === 108 | Why does 0154 === 108 ? |
JS : I 've been tasked with rewriting this terrible piece of code which is meant to sequentially fade in layers on a map ( they are all transparent pngs ) on a web page . It needs to operate in a sequence , then loop back to the start where no layers are visible , and fade back in one at a time . This sequence should r... | How to reduce nested callbacks in javascript/jquery |
JS : I am injecting javascript into a PHP website to avoid a pop-up , to submit a form automatically . Also , there is an issue with jquery so I am using plain javascript.This is the form on the page : This is my javascript : When I manually click on the form , I know that these values are setBut when my javascript sub... | Php differentiating between javascript and user click ? |
JS : I am loading some JS from an external source right before my < /body > tag . I am experimenting to see what happens if the server hangs while trying to serve this third party JS . It seems that everything on my page works just fine , but the browser still spins as though the page is still loading . Is there a way ... | JS loaded asynchronously in body keeps browser in `` loading '' mode |
JS : I need to have a sort on two strings take the > and < symbols into consideration . So , for example , the sort might look likeSo basically all the strings with < are first , followed by a normal sort , followed by all numbers with a > symbol . I 'd also like the sort to respect the exact order shown ( e.g . > 100 ... | How do I sort taking greater than and less than into consideration ? |
JS : i have a node.js server that i want to be able to handle exceptions without crashing , and i 've got code kinda like the below . What i 'm wanting to know , with all the event-driven awesomeness and callbacks and lambdas and all that , will my exceptions still be caught by my main entry point ? Thanks <code> try {... | Do exceptions get caught in lambdas in javascript / node.js ? |
JS : I have arrays of arrays which contains something like this : I 've tried .map ( ) and Object.assign but I dont know how to implement it . I want this as an output : What should I use ? This is what Im came up so far : <code> var values = [ [ 1 , 2 , 3 ] , [ 3 , 2 , 1 ] ] values = [ { 'up ' : 1 , 'middle ' : 2 , 'd... | Convert arrays of arrays to object with key |
JS : In directive bind method , there is a vnode.context. $ watchand every time that directive added to HTML , it is also adding another watcher with previous watcher . Because of that same watchers are calling more than once . Is there any way to destroy the previous watcher when directive unbind method called . <code... | destroy watch in vnode context in vuejs2 |
JS : My scenario is : On clicking a button , import datas on a html into a PDF file.Since this PDF must have some complicated required style , so my first step is to transfer this page into a image using html2canvas.js and then import this image to a PDF with jsPDF.js And when the data is too large the PDF must be spli... | Import long html into split PDF |
JS : I 've got several divs on my page that look like this : When the user hovers over them and scrolls with the scroll wheel they scroll fine . The trouble is that , when the user reaches the bottom , the page itself starts scrolling instead . Is there a way to stop this happening ( using javascript if necessary ) , s... | How can I prevent the page scrolling when I have scrolled to the bottom of a div inside it ? |
JS : If I open JS console and write : and after : console show me ( rightly ) Now ... sometimes I need to inject my code inside an existing script and I do n't have tool to determinate if a let variable is already defined.I try with this code , but there is evident problem with JS scope and logic ... . ( comment the co... | JS : How to prevent let double declaration ? / determine if let variable is defined |
JS : I have code something like the above . I need to add a class for the ul tag generated after the Accounts label . Something like the following does n't work : My purpose is to have a mega menu for the navigation . To add functionality to it I need to have classes within the generated menu code . <code> < configdata... | Zend navigation with XML file |
JS : I 'm trying to follow the ReactJS tutorial at https : //reactjs.org/tutorial/tutorial.html . I 'm using Emacs to edit index.js , and when I edit the file ( add a newline , let ` s say ) , even without saving the file , instantly the server crashes and I get this output : I 've checked for the file . # index.js and... | ReactJS local server crashes after editing file in Emacs even without saving |
JS : The above code was run in Google Chrome Version 62.0.3202.94 ( Official Build ) ( 64-bit ) on macOS Sierra Version 10.12.6.As you can see , the behaviour does not depend on whether or not you specify the radix.Note : I usually use ~~ instead of using parseInt , it looks safer.Why am I getting these results ? <code... | Strange and inconsistent behaviour of parseInt on decimal fractions |
JS : I apologize in advanced if this question is too broad . In fact it 's 4 different questions , but all related to the same piece of code , and I think they all revolve around the same principle.I decided today , after using JS for years , to actually start learning how JS works instead of treating it like C that ru... | Javascript : What Does This Code Do ? |
JS : I was plundering some recent react repos this weekend and I came across an example using ES6 class syntax for component composition that went a little something like this.notice the : :this.submit in lieu of this.submit.bind ( this ) it works , and I can not find documentation anywhere on this feature , I feel lik... | Mysterious syntax onClick= { : :this.submit } |
JS : i 'm trying to learn how to work with angular firmly and i 'm having trouble understanding some of the syntax used in the guides and examples on the official website.when defining a button form control i saw this template : my question is : what is the meaning of `` : : '' before the `` to.type '' and `` to.btnTyp... | meaning of : : in angular formly |
JS : My markup is set up like so : I have 2 buttons using jquery to show and hide ( which act as a show more show less ) the two tags within my h5 tag . However I ca n't seem to use this code to ensure that the strong tag with id= '' head2 '' is not displaying . I 've tried I 've also triedIm unsure if this has anythin... | How to display : none between parent and sibling tags when using show more show less Jquery |
JS : The issue seems to be that certain letters like g , y , q , etc . that have a tail that slopes downwards , do not allow for vertical centering . Here 's an image to showcase the problem .The characters in the green box are basically perfect , as they have no downward tail . Those in the red box demonstrate the pro... | How to vertically align all text in CSS ? |
JS : I am using an extension of HashLocation to implement a hashbang url type for Ember.js.Here is the code snippet : I use this by reopening the Router : However , on running the application , i 'm hitting the following deprecation : I ca n't find any information on how to do this . Does anyone have any implementation... | Ember.js deprecation of registerImplementation in favour of App.initializer |
JS : I 'd like to output some values from this site . With the browser inspector I located the URL to the JSON that has that information that I want . Once with the JSON , I can extract the values just fine.The issue is that the URL to the JSON only works for a limited amount of time . If I try to access it later ( via... | How to get around a 401 unauthorized error ? |
JS : Can anyone explain why these bullets will change color correctly in Firefox and IE , but not in Chrome ( my current version is 47.0.2526.106 ) ? Why do the bullets in the first ul stay white , but the others change initially ? Note that I get the same behavior whether I bind to class or use the ng-class attribute.... | Bullet colors do n't display correctly in Chrome when changed by Angular |
JS : I have the following code . It 's a JavaScript module.I do n't understand the section : I think it is creating an object referencing 'this ' module and then assigns the Cahootsy variable to a global Cahootsy variable . What I do n't understand is why 'this ' needs to be assigned to Cahootsy.scope <code> ( function... | Javascript Modules |
JS : I want to avoid data multiplication , so i wanted to create a loop for calling my dataprovider for different site_id 's . I created a while loop and set the state values within this while loop . What I realized that from my 2 element array ( I have 2 sites ) only 1 is being set in the state , but the other one not... | React setState does not set state during a while loop |
JS : Setting a property descriptor like this : ... should , as far as I know , make the someFunction property of window non-writable . It works for function expressions as I expect , whether the function is directly assigned to the object property ... fiddle ... or assigned to a global variable : fiddleHowever , it doe... | Why does a function declaration override non-writable properties of the global object ? |
JS : I want to create a javascript library , so I thought making it an immediately self executing function would be a nice thing to do to ensure scope safety and everything.But now I 'm running into a problem with using the `` this '' keyword that I do n't quite understand.How can I make a code like this work correctly... | Immediately self executing function and `` this '' |
JS : In Chai , you can do stuff like the following : exist is not a function call , but this still works in testing frameworks . The opposite ( expect ( { } ) .to.not.exist ) causes tests to fail , but again , exist is not a function call.How do these assertions work without making me call a function ? In fact , if I t... | How do assertion libraries such as Chai work without forcing a call to a function ? |
JS : for example , If value is array , it have to be Array constructor . It 's not an array like object . because array like object just has array property , not like [ ] .How can it be ? add : If you can , show simple example code , please.like <code> $ ( document ) // [ # document ] : document object in arraytypeof $... | jQuery 's return value is Array , but constructor is Object . how ? |
JS : I recently upgraded to protractor 2.5.1 and all of my tests are now failing . I suspect it is something to do with Jasmine but I 'm not sure how to fix . Any help would be appreciated , thank you in advance.Here is the error I receive : Here is my test , however the browser never even navigates to the baseUrl , it... | Protractor 2.5.1 ReferenceError : testFn is not defined |
JS : When trying to create a login form with outlined text fields in Vutify , the chrome autocomplete overlap with labels , you can regeneare here please fill and submit , then go back . <code> < v-text-field v-model= '' email '' label= '' e-mail '' name= '' email '' outlined prepend-icon= '' mdi-account '' type= '' te... | How fix issue with chrome auto complete overlap with labels in vuetify ? |
JS : I just found really interesting behaviour in ie8 . It turns out null is not always null.Anyone has an explanation for that ? <code> // just normal , casual null hanging out in the sunvar nullA = null ; // query for non existing element , should get null , same behaviour also for getElementByIdvar nullB = document.... | IE8 querySelector null vs normal null |
JS : i 'm developing a phonegap app using a lot of javascript . Now i 'm debugging it using Safari Developer Tool , in particular i 'm focused on some button that on the device seems to be a bit luggy.So I 've added some console.timeEnd ( ) to better understand where the code slow down , but the `` problem '' is that w... | Javascript run faster if console opened |
JS : I am using https : //github.com/glslify/glslify to share code between glsl shaders.I have a vert shader that is trying to include a module at the top the vert has : decodeJointAndPalette is also dependent on the JointAndPalette struct as its return definitionJointAndPalette looks like : decodeJointAndPalette looks... | glslify how to share a struct between modules |
JS : I am basically quite sure this pattern must exist and possess a name ... for now I will call it `` gate pattern '' ... Here it is : In my webpage 's javascript , I have to trigger various asynchronous processes . Let 's not discuss how trully async js is , but anyway I have to trigger 2 or 3 AJAX calls , must be s... | Is there a name for this pattern ? |
JS : I have been trying recently to make a slide of divs , using a script named Owl-Carousel , where divs are spaced by 10 px each so dragging looks nice.I made the whole code for showing purpose : http : //codepen.io/anon/pen/VLZmWdI tried modifying the margins without success.The CSS is as follow : How can I space sl... | Spacing between superposed divs , without affecting width |
JS : In laravel I used to call ajax for my select box ( it is like binary tree , ex : cat1 , cat2 are parent id then cat3 , cat4 , cat5 are childs of parent cat1 , cat6 , cat7 are childs of cat2 and so on.. ) .Onchange function is also working , but showing ajax error Uncaught TypeError : $ .ajax is not a functionThis ... | In laravel blade page saying $ .ajax is not a function |
JS : I have an angular directive that I 'm using to place a button form . The template is hidden until the user needs to see it . It 's a simple template that works by itself , but when I combine it into the larger form the template does not appear . Here is the directive : Then the html that works : And the html snipp... | Angular Template Not Showing with ng-hide |
JS : Many times , I needed to write such a lazy asynchronous loading in Javascript : Here , myvar would be some attribute of a hash , not a local variable . loadMyVarAsynchronously loads asynchronously the value for myvar ( with , for example , a Promise or a JQuery Deferred ) Is there a pattern to avoid having to writ... | How to avoid this async lazy pattern ? |
JS : Let 's say we have a function that looks like this : This function should return the value of x where x is available in the global scope . Initially this is undefined but if we define x : Then we can expect fn to return 42.Now let 's say we wanted to render fn as a string . In JavaScript we have toString for this ... | Is there a simple method of turning a global var into a local var ? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.