text stringlengths 46 37.3k | title stringlengths 12 162 |
|---|---|
JS : When building our production app in Gatsby , I see something like this : Is it possible to hash these paths instead of printing them out ? We don ‘ t want to expose too much from what is happening in the back.I tried setting these configs in webpack : And it successfully hashes .js files but not the template paths... | Rename webpack/gatsby chunkmapping strings |
JS : Edit : Simpler repro case ; the following code : …produces the output : Try it yourself : http : //jsfiddle.net/Fjwsg/ ( Original question follows ) Given the following code ( or code like it ( fiddle ) ) : I see the following in the Developer Console when I focus the `` p '' input and type 1 backspace 2 : Once I ... | Unexplained behavior in Safari with negative array indices |
JS : I have a sine wave in my canvas that is animated , swaying left and right . What I am trying to achieve is that the start and end points stay fixed . How to achieve that ? Here is the Code Pen <code> function start ( ) { var canvas = document.getElementById ( `` canvas '' ) ; var context = canvas.getContext ( `` 2... | Animate sine wave , fixed start and end points |
JS : My foundations in Javascript are n't the strongest and I 'm curious how others would go about the current challenge I 've created for myself.I 'm playing around with paper.jsThe following code creates this The eye reacts to mouse events in the same way as the eyes here ( learned from that code ) — www.arc.id.au/XE... | Creating unique variables |
JS : I often find myself having to build long chains before mapping over an array to check if it 's defined : If I leave out the this.props.photos & & and this.props.photos.activePhotos.length & & my entire application will crash if photos or activePhotos is undefined.Is there a way to check for these props without hav... | How to check for deeply nested props |
JS : Let 's say I have a function that does a standard AJAX request : This code will cause the browser to start an AJAX request , but at what point in the function does the request actually start ? According to this post : https : //blog.raananweber.com/2015/06/17/no-there-are-no-race-conditions-in-javascript/ [ Callin... | At what point in a function call is an AJAX request actually initiated by the browser ? |
JS : I 'm aware that arrays in JavaScript differ from your traditional arrays in the sense that they are just objects under the hood . Because of this , JavaScript allows for sparse arrays to behave in a similar manner to dense arrays when it comes to memory management . When working with a sparse array , is there a wa... | How to get next element in a sparse array |
JS : Table structure : Collectionname ( String ) Imagecollection ( Pointer < Collection > ) url ( String ) position ( Number ) Image class has the column collection which is a pointer to the Collection class.position is used to sort Images within a Collection.What would be the most efficient way in Cloud Code to accomp... | Relational queries in Cloud Code ( parse.com ) |
JS : I am using dojo.gridx to display my values . Sometimes user can create a new row . So that I have added a new button when click newRow button , will call onclick method.In that method has create new row codes . My codes are below.addRow : By this code I am able to create a new row but I want to focus my mouse curs... | How to focus second Cell when add a new row in dojo.gridX |
JS : How can I sum vertically all data from an array of arrays ? The output should be the vertical sum of arrays . [ 3,6,9,12,15,18,21,24 ] The problem is that array1 return always as undefined . <code> arrayOfArrays = [ { label : 'First Value ' , data : [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ] } , { label : 'Second Value ' ,... | Sum array of arrays ( matrix ) vertically |
JS : I am really struggling with implementing The Coral Talk Project commenting system into my app.I am attempting to implement it into a project that is primarily Meteor and React . It 's on GitHub I think the main issue is that this is the first time I have needed to use a Script Tag in React.I have attempted doing i... | Using Coral Talk with React and Meteor |
JS : Our application can share code . For example user is sharing the html code as followswhich is not in a perfect format ... . Now i need to achieve the ( auto ) code formatting ... i.e . after auto code format click , it should look like So , is there ready made plugin available or is there any way ( s ) to achieve ... | How to achieve ( auto ) code format selection of any html code via jQuery / C # ? ( Any solution ) |
JS : I have run across a condition statement which I have some difficulties to understand . It looks like ( please note the +-sign on the right-hand-side ) this : obj.length === +obj.length.Can this condition and its purpose/syntax be explained ? Looking at the statement ( without knowing it ) provokes the impression t... | How to understand `` if ( obj.length === +obj.length ) '' Javascript condition statement ? |
JS : I have been tasked with combining two if statements in Js for a papercut script . It is a print management software . I have everything I need I believe in the script below . The problem is combining these two if 's into one statement I believe . I am not familiar with Javascript as well as I am with python . I am... | Combining Javascript if statements for papercut |
JS : I am trying to replace some text in an input field using JS but the view model overrides my commands each time . This is the HTML I start with : I run this JS : And I 'm left with the following HTML : The problem is that each time I click the input field the value is reverted to what it was when the page loaded.I ... | Overriding difficult view model |
JS : Basically call stack will start to pop out the function calls one by one when the last-in function call returns . But when ever I try to create a call stack nearer to the size of its maximum , An uncaught expression is getting raised.So the above code is throwing an exception for me in chromium Version 49.0.2623.1... | Recursion - Call stack fails to pop when testing the maximum stack size |
JS : I am having a weird problem with my code , I have a styled component div that wraps around another component like this : ( Bookday returns an empty div so this should not be a problem ) My styled component ContentWidget is an empty styled component div and is declared like this : The weird thing is I have more con... | React styled component causes build error in production , but runs fine in development |
JS : The story behindI am creating a voice controlled application using x-webkit-speech which is surprisingly good ( the feature , not my app ) , but sometimes the user ( me ) mumbles a bit . It would be nice to accept the command if some reasonable part of the word matches some reasonable part of some reasonable comma... | Algorithm of the greatest intersect of word in set of words |
JS : I 'm working on a `` small '' bot for fun and currently trying to create a blackjack command . The first half works fine , but the problem appears when I want to update the embed that was already posted by the bot . I keep getting an error : UnhandledPromiseRejectionWarning : DiscordAPIError : Can not edit a messa... | discord.js how to edit/update embed ? |
JS : I need to detect mouseup event after mousedown on the document.I have tried to add an event listener to document and document.documentElement with no success.I need possibly a cross platform solution without jquery.Notes : problem appears on not all browsers using alert ( ) .http : //jsfiddle.net/0f7vrzh7/8/ <code... | mouseup event on document.documentElement does not fire with alert |
JS : In my htm page i want to use a button which submit my form by using function . I use validations on my fields and when i press submit button it displays error message but doesnot retain last values it refresh my form . I just want that the values that i entered will be exist there and just the field that has only ... | do n't want to refresh & retain last inserted values |
JS : I have an image larger than viewport that I 'm trying to pan on the x plan according to device Acceleration value . I can get to semi-decent results but nothing like great . From my understanding I need to : get the acceleration value get the object position combine these two value ( maybe with frequency ? ) Apply... | JS use DeviceAcceleration.x to pan image seamlessly |
JS : I have an Express.js web app that is serving one of my domains . The app.js file looks like this : I would like to use one of my own functions within the app.js file , so I thought I 'd put the function in a separate file ( as a module , i.e . module.exports = stuff ) and then require it in the app.js file : Howev... | How expensive is it to require ( ) something within an Express.js app ? |
JS : If I wish to change the opacity of a < div > irregularly over time , I can use CSS animation and @ keyframes : But what if I want to change the volume of an < audio class= '' my-audio '' > element irregularly over time in an identical manner ? I know I can begin with : But how can I change the volume to 0.99 , whe... | Can I `` transition '' the volume of an < audio > element , using javascript ? |
JS : Creating independent stopwatches . I have two elements named A andB . When I click on the A element , its descriptionHello and stopwatch will appear . When I click on the B element , itsWorld description and stopwatch will appear . I have a problem with stopwatches . When I click on the element A and start the sto... | Creating independent stopwatches for each item in array . Setting the stopped time , based on data returned by the API |
JS : This example from Mike Bostock : https : //bl.ocks.org/mbostock/34f08d5e11952a80609169b7917d4172The following line confuses me and i was wondering if someone could clear it up.Why is x2 being passed in as a second argument ? As far as I know the second parameter is the optional thisArg argument , but as invert doe... | Map function in D3 , confused about multiple functions passed in |
JS : With ES6 we can now utilize object shorthand notation for creating objects ... Is it possible to combine shorthand notation with regular notation ? In other words , is the following legit ? And if so , are there any gotchas I should be aware of ? <code> var a = 1 , b = 2 , c = 3 ; var obj = { a , b , c } ; var obj... | Can ES6 object shorthand notation be combined with regular object notation ? |
JS : In almost every Backbone/Require.js project you will see models and views that look similar to this : But , assuming that you set up your Require.js shims correctly ( with the Backbone shim including something like deps : [ `` underscore '' , `` jquery '' ] ) you only need to define Backbone -- defining Backbone a... | Why include jQuery and underscore in every JS file in Backbone/Require.js project |
JS : Hi guys so i am trying to make a nutrtrion label just like this : ExampleCurretnly have my db all set up . trying to get it to work one thing at the moment and then can do it with the rest . My db looks like : The problem i am having right now is huge . I have been stuck on it for the last 3 days and no one seems ... | jQuery.remove ( ) deleting the wrong element |
JS : I 'm working on a script where all I want it to do ( right now ) is redirect the user based on which button they press . Eventually it will take form input and incorporate that into the redirect , but right now I 'm just trying to get the buttons to send the user off to the appropriate site . However , My redirect... | Page Redirection |
JS : I need to perform clearRect ( ) after performing clip ( ) in canvas . Unfortunately , It does not working for me . If I exclude clip ( ) means , clearRect ( ) is working fine me . I need to perform clearRect ( ) after performing clip ( ) . Is this possible ? Please find the fiddleIf I called clearRect ( ) after ca... | How do I perform clearRect ( ) in canvas after clip ( ) ? |
JS : I 'm trying to gain a deeper understanding of how Javascript works and the following code is bugging me : In Chrome , the first two document.writelns execute as expected , then I get `` Uncaught ReferenceError : doesThisWork is not defined '' in Chrome . Why ca n't I call the second function by the name doesThisWo... | Why does function name disappear when assigned to a var ? |
JS : This is the third question I have posted today so forgive me but I am just running into things I ca n't seem to figure out.Here is my code for angular : And some simple stripped down HTML : Here is what that returns : But I need it to look like this : How can I split up ng-repeat and allow me to separate the value... | angularJS - splitting up ng-repeat into multiple HTML elements |
JS : When a user performs a tap and hold gesture to select a word and then drags their finger towards either the top or bottom edges of the screen , the page automatically scrolls in order to accommodate the selection.here is a short clip demonstrating itI would like to prevent this behavior inside a WKWebView.Here is ... | WKWebView - prevent automatic scrolling triggered by user text selection |
JS : i 'm using this jquery date picker function , it works fine if i remove `` year range:1930 '' from it , but does n't work if i include year range . i dont know how to deal with this problem . help me . <code> < script type= '' text/javascript '' > jQuery ( function ( $ ) { $ ( 'input [ name= '' dob1 '' ] ' ) .date... | JQuery date picker function is n't working |
JS : I have a long running Javascript function , that looks like this : My function calls another synchronous function very often ( I used 500 in this example ) and while the user waits for the task to complete , i 'd like to implement something like a loading bar but I demonstrated it with updating a span in my case h... | Updating DOM during Javascript function execution |
JS : Is there a shorthand version of the following : Many thanks . <code> ( a > 0 & & a < 1000 & & b > 0 & & b < 1000 & & c > 0 & & c < 1000 ) | Javascript Shorthand |
JS : I am using wkhtmltopdf to convert part of a HTML page to a PDF document that may be several pages long ( depending on the text the user inputs to be converted ) .The wkhtmltopdf is working correctly . I am now wanting to indicate to the user where the page breaks will occur before the user creates their PDF docume... | JQuery - find height of div then create loop to overlay div |
JS : got some problem with this code . The map did not become `` undraggable '' on Firefox immediately after mousedown on div , but on Chrome is ok.Here is a fiddle https : //jsfiddle.net/benderlio/njyeLujs/FF version is 54.0.1 windows 10On chrome the map is not draggable after mouse down on white box , but on FF you c... | google.maps.event.addDomListener mousedown on Firefox |
JS : I 've ran into a weird issue today , I 'm hoping someone else can help me figure this out.The project that I 'm working on is more-or-less a jQuery slideshow . I have a super simple file that I 'm loading to test everything out , it looks something like this : Again , nothing even remotely fancy here.Now , in jQue... | jQuery selector not behaving as expected in parsed HTML from ajax |
JS : I am trying to implement a timer . I learned this idea from a SO post . This is my php code . My php , html and JS codes are in the same page . I have a button in my html . When a user clicks on the html page , It will call a Ajax functionIt will call setCountDown ( ) method , which contains a line at the very beg... | How do i make my php variable accessible ? |
JS : I was looking at this fiddle for MobX and I 've seen these two ways of defining React Components in ES6 other places as well , like Dan Abramov 's egghead redux video series . My question is , when is it appropriate to use each type ? It seems like the simpler components are able to use the simpler syntax , but I ... | Two ways of defining ES6 React Components |
JS : I have two fileA.htmlB.htmlWhen I move to b.html , can we use mywindow variable with all its window properties . So that I can still play around with child window from b.html . <code> < a href= '' B.html '' > B < /a > < script > var mywindow = open ( `` child.html '' , '' child '' , `` height=200 , width=200 '' ) ... | Passing window object from a.html to b.html via javascript |
JS : I 'm looking for something like this : Does this exist ? I 'm using jQuery and would rather not import a whole plugin or another library just for this ability , so I 'm only interested in a short solution . <code> var div = document.createElement ( 'div ' ) ; div.id = 'proprioceptiveDiv ' ; $ ( div ) .on ( 'append... | Bind `` insertion into DOM event '' for not-yet-appended element |
JS : I have this < li > to sort by id : The code I use : The result is : The < li > are no not sorted correctly , what can cause the problem ? <code> < ul id= '' members-list '' > < li id= '' member_8 '' > < li id= '' member_4 '' > < li id= '' member_7 '' > < li id= '' member_12 '' > < li id= '' member_11 '' > < li id=... | Jquery incorrectly sort < li > by id |
JS : I 'm simply send notifications using the node-notifier package . Also , when I click on the notification , it has to go to a link . But I ca n't listen the click event . The events provided by the package do nothing . This is my code : And this is my notification : I can use any other package . I just want to list... | How can I listen click event on Windows notifications ? |
JS : I was wondering if there is a neat way of doing this : This is really long and `` ugly '' .I found out that Angular2 has something really great for cases like this . But I think it 's only for templates : This got me really exited because I have a lot of code that looks just like the first example . It get 's the ... | Is there a JavaScript undefined property handling like in Angular2 templates |
JS : Let 's start with a definition : A transducer is a function that takes a reducer function and returns a reducer function.A reducer is a binary function that takes an accumulator and a value and returns an accumulator . A reducer can be executed with a reduce function ( note : all function are curried but I 've cat... | Is my understanding of transducers correct ? |
JS : Reading the `` recommended way '' of dealing with ENUM Type in Javascript , I am still uncertain because I can compare the value with a forged value , while I should compare only to a `` enum '' type value : The strings I made the switch to compare against ( `` monday '' , `` tuesday '' , `` blahblahday '' ) are t... | Is there a way to have/lock unique index values of the Enum object in Javascript ? |
JS : Here is my situation : I dynamically added 2 scripts throughThen I found they would be loaded in sequence instead of parallel from chrome console.However , they could be loaded in parallel if I use either native jsor jQuery function : getScript I searched a lot and found that jQuery actually will remove the script... | How to use jQuery to handle dynamically added script tags in parallel |
JS : I am developing a JavaScript module , which knows nothing about the environment in which it will be used in.And , technically speaking , I want to implement the next function : element is an HTMLElement and the parent of this element may be unknown during the module initialization . callback is a function , which ... | Having a reference to an element , how to detect once it appended to the document ? |
JS : I 'm running my test suite using mocha , via gulp-jsx-coverage and gulp-mocha . All my tests run and pass/fail as expected . However , some of my modules being tested make HTTP requests to my API via the superagent library . When in development , I 'm also running my API at localhost:3000 alongside my client-side ... | Mocha test suite errorring out when attempting to connect to API |
JS : This was an interview question which I have n't yet been able to figure out . Consider the following : Now I was asked to write a function that will take n number of arguments and work the same way by logging the final summation of the argument values . Meaning : How can such a function be written ? I have tried t... | Recursion with dynamic arguments |
JS : I 'm trying to code this poem with nested divs and basic jQuery . My idea was to start with one div of class .active that has display : block and all the other divs being children of the first div with display : none . Now , when you click on the first div , it removes the class .active from itself ( adds to itsel... | jQuery : How can I use event delegation with classes added to nested divs ? |
JS : I have a table structured like this : So that structure repeats Y amount of times.I 'm trying to make a script that hides the tbody.variants of the row selected.What I have so far is this : but this hides the variants from ALL the rows.Is there a way to select the childs of the specific row ? Also how can I start ... | select child element jQuery |
JS : I have two circles that intersect and I want to make the intersecting area have a color , even when the two circles are transparent . I thought I could find some way to do this with css mix-blend-mode property but I have had no success with it . Of course , I could make the circles have color and decrease their op... | Fill in overlapping circle area |
JS : I 'm implementing the Inline Checkout from Bambora . The authorization step works without any problem . But when it comes to capturing the payment I always get the error Transaction not found.This is what I do : I also tried making the request with included transactionoperations : I get the same error when trying ... | `` Transaction not found '' when Capturing payment transaction with Bambora |
JS : Trying to create a function mCreate ( ) that given a set a numbers returns a multidimensional array ( matrix ) : When this functions handles just 2 levels of depth ie : mCreate ( 2 , 2 ) // [ [ 0 , 0 ] , [ 0 , 0 ] ] I know to do 2 levels , you can use 2 nested for loops but the problem I 'm having is how to handle... | Creating multidimensional arrays & matrices in Javascript |
JS : I 'm using React Native 's Image.getSize ( uri , ( width , height ) = > { } ) method to get the dimensions of a remote image and set it to a component 's state with setState ( ) : However , sometimes the component unmounts before the getSize ( ) request has returned , and this leads to the following error when set... | How do I cancel an Image.getSize ( ) request in React Native ? |
JS : On Mandrill 's Template API page , I plug in the following JSON to test the Render method upon clicking `` Try it '' : The test results come back with my template but the one merge_var I 'm testing has not been merged , i.e . the result still contains { { invoice_number } } : Does Mandrill 's Render API ignore mer... | Does Mandrill 's Render API ignore merge_vars that map to Handlebars variables ? |
JS : I have normally learned that function implementation can have any name for function arguments as long as it is supplied in the right order . This makes the function abstracted from the outside world and the local names have no effect on the output . Implementer has all the rights for local variables . However in A... | Why does Angular Controller need `` $ scope '' |
JS : I have a jsTree which I am trying to bi-directionally `` connect '' to a Meteor collection . Right now I automatically trigger a jsTree.refresh ( ) whenever the collection updates with the help of .observeChanges : I want to allow editing of the database by dragging things around in jsTree . Here 's how it would l... | Meteor avoid double refreshes when third party widget changes it 's own reactive datasource |
JS : I have a very simple component with a text field and a button : It takes a list as input and allows the user to cycle through the list . The component has the following code : This component works great , except I have not handled the case when the state changes . When the state changes , I would like to reset the... | Which of these strategies is the best way to reset a component 's state when the props change |
JS : I came across this quirk while trying to optimise string pluralisation in a game of code golf . I had the idea to write strings as plurals and then use substr to cut the last character off , conditionally : It 's fine - it does what I wanted . But looking at the MDN docs for String.prototype.slice ( ) , I thought ... | In String.prototype.slice ( ) , should .slice ( 0 , -0 ) and .slice ( 0 , +0 ) output the same result ? |
JS : Considering that you have this situation : The element .componentB has a directive called move-to which does simply move the contents of this element , collecting them with a jQuery children wildcard selector ( like var contents = $ ( '.componentB ' ) .find ( ' > * ' ) ; ) , when any of those breakpoints , defined... | Is there scope issues if I move one element from one container to another ? |
JS : I 'm trying to build a regular expression that places a limit on the input length , but not all characters count equal in this length . I 'll put the rationale at the bottom of the question . As a simple example , let 's limit the maximum length to 12 and allow only a and b , but b counts for 3 characters.Allowed ... | Regex character count , but some count for three |
JS : On hovering over the first column in table , a tooltip appears , on click of the button dialog box opens up which has edit json sectionI have provided 2 functionalities : - [ Please select a row from left section in dialog box ] 1 ) The json can be edited ( In this scenario user clicks on row from left section , s... | To update a formgroup formcontrol value from different formgroup but I do not to want to change the values permanently ( Angular ) |
JS : To double the width of the img , i can do this in jQuery : that works fine , but i really like to use shorthand assignments like : Since element.height returns the height function in jQuery , i ca n't use shorthand assignments . Is there no way to do shorthand assignments in jQuery for element attributes ? <code> ... | Using shorthand assignment in jQuery for element attributes |
JS : I am trying to edit/understand the source of a modal plugin written in ES6 , link HERE . I initialize the plugin like so : JS file ( main.js ) Now if I want to debug the source code of the plugin , I directly edit the index.js inside the /src folder , is this the right way to do it or should I use some build versi... | How to debug the source of a modal plugin written in ES6 ? |
JS : Is there a better way to write the following function ? Having the ' # ' + div_id just looks wrong to me . <code> function hide_div ( div_id ) { $ ( ' # ' + div_id ) .hide ( ) ; } | is there an alternative to ' # ' + div_id ? |
JS : Consider the following ES6 Classes : My understanding is that both should be true , and in Firefox and Chrome they are , however Node says es instanceof ExtendString is false . It 's the same with other constructors , not just String.Software I used : Node v5.11.0 with the -- harmony flag.Chrome 50Firefox 45Which ... | ES6 Class extending native type makes instanceof behave unexpectedly in some JavaScript engines ? |
JS : I have a popup that slides up into view when clicked . The way I 've made the header is with the following css : which I am adding/removing based on click using jQuery . But when the ellipsis class is removed , the header just `` POPS '' into view . So my question is : Is it possible to ease the transition from hi... | make slideDown ( ) on header when overflow class is removed |
JS : The following checks an item code submitted through an input composed of 35 characters consisting of letters A-F and numbers 0-9 , as well as three dashes ( `` - '' ) . An example of a valid item code would be this : 16FA860F-E86A457B-A28A238B-2ACA6E3D The following works well , except for if an item code is 35 ch... | Need to Pass a Condition If Length is Null |
JS : I am programming a page with a Map where I need to capture the location of the Tap/Click on a map and store the coordinates . I am using OpenLayers js . On desktop browsers ( IE/FF/Chrome ) , this is working fine . On mobile devices , the tap is getting captured correctly on the default Android browser ( both in r... | OpenLayers latitude inaccurately captured in Webkit Mobile browsers |
JS : Firebase Functions onCall not workingI was recently following the Firebase tutorial series by The Net Ninja YouTube channel.The Net Ninja Firebase Function PlaylistFirebase Functions Tutorial # 5 - Callable FunctionsAnd I got stuck in the firebase functions part , first I was not even able to deploy them because b... | Firebase Functions not able to use oncall functions in app , returns internal error |
JS : I have a problem with some javascript in Internet Explorer.It works fine in other browsers.I have the following method , that changes the src property of an images and when this happens a download of that image should start . See below : The problem is that in when changing this property Internet Explorer starts a... | Endless looping when src value is changed in Internet Explorer |
JS : This is my first question here , so please point out any of mistakes that I made . I was obliged to create a web page that looks like a flag of a team . I 've managed to do such , but only with fixed size of elements : On other resolutions it just does n't fit the screen.Code : htmlcssHere 's a jsfiddle of my flag... | Creating resizable website with lack of CSS skills - CSS shapes |
JS : I have been learning web application security penetration testing . The scenario is , there is a cross site scripting vulnerability in a test environment demo web application which is developed for practicing . I have a xss payload which is javascript expressions based : I know the expressions are deprecated since... | Alternative to define in-line javascript expressions |
JS : UPDATED WITH FULL CODEI 'm trying to dynamically add a div onto some other DIV 's stored in an array The array which contains DIV 's is named categoryData which contains an attribute with its category nameThe shop-row div 's ( categoryData ) is empty at the beginning.I 've got another array which contains the prod... | Javascript AppendChild Issue |
JS : DOM4 makes NodeLists iterable : According to WebIDL , this means Objects implementing an interface that is declared to be iterable support being iterated over to obtain a sequence of values . Note : In the ECMAScript language binding , an interface that is iterable will have “ entries ” , “ forEach ” , “ keys ” , ... | Can HTMLCollections be iterated with for ... of ( Symbol.iterator ) ? |
JS : For example : When i invoke this example ( ) function , I get an error that b is undefined , but when I remove the 2nd line that invokes with function b defined inside the if block It 's all ok ? <code> function example ( ) { console.log ( `` outside the if block above function b declaration '' +b ( ) ) ; function... | Does if block create a new local scope inside a function scope ? |
JS : I am using SugarCRM 6.5.x CE version . I want to make a dependent functionality where I have a dropdown field with list of email template name . And according to the selection of email template , textarea should be filled with email template body text . So , I have achieved the result.Now , instead of normal texta... | How to create dependent tinymce textarea according to the selection of email template name ? |
JS : I seem to be observing at least one case where a callback function passed to a jQuery effect function will execute repeatedly if there 's an error while it 's executing.For example , see this JS Fiddle , featuring the following code : log appends whatever 's passed to it to a div ... but dieInAFire does n't exist ... | jQuery callbacks apparently repeat on failure ? |
JS : I had an idea to store code as lists ( arrays ) in Node and execute them , but this is harder than I thought : if I make a list with a function in the beginning or in the end , .pop or .shift removes but omits it and returns the next element : I noticed this in Node v0.4.9 , but it is still present in 0.6.10.Is th... | Array.pop in Node skips and forgets a function item |
JS : In my project I want to fix a div element to a certain position on the screen . Not the window , the screen . So if the browser is resized the div stays put and if the browser is moved the div stays put . Possible ? Here is my basic html page that contains just a dot at the center of the screen.I know I can use wi... | Fix div to screen |
JS : According to specifications , Node JS ( ES5 ) should use current dts rules when working with Date objects . Current means `` for now '' , not for a particular date . That 's not perfect , but enough for me at this moment.Currently that rules are wrong ( due to law changes in Chile ) . Simple probe : shows `` ( Chi... | Node JS current DST rules for Chile |
JS : I 'm developing an app that uses a certain site to make payments easier , and the way it handles payments requires to import some javascript from this url https : //bridge.paymill.com/ that contains the script.The fact is , I 'm using require js to load all the scripts , in my main.js configuration , I 'm trying t... | How do I make Require.js fetch a script that does not end in ` .js ` ? |
JS : In my spelling game new words will be added all the time so there is always a fresh selection of words to spell.Each word added to the game has a `` src '' to an image and a sound that will prompts the user into getting the spelling correct in gameplay.When I have completed making the game , the job of adding the ... | Adding new words to the game |
JS : I am trying to upload a file in an electron app which works perfectly for electron v9.3.0 but as soon as I use electron v10.1.1 , it gives the following errorUncaught TypeError : Can not read property 'dialog ' of undefined at this line const dialog = electron.remote.dialog ; see the screenshot below.The content o... | electron v10.1.1 gives Uncaught TypeError : Can not read property 'dialog ' of undefined , but same code works in electron v9.3.0 |
JS : I am using the YouTube API and I 'm using Python urllib2.urlopen ( ) to send a GET request . Then I pass the result to Javascript . ( I 'm using Django ) So , something like this : I 'm using jQuery to parse the JSON formatted response , however some YouTube videos/descriptions have double quotes and this breaks t... | Ca n't figure out a way to escape quotes in json in YouTube API |
JS : I just developed a little code to create a 24x60 table . I want to print the id of each < td > on mouseover : The code works , but now I 'm concerned if it is optimized ? Am I creating 1440 event handling functions in the nested loops ? Or is the JavaScript interpreter smart enough to only create one function and ... | Efficiency of creating an event handler in a nested loop : am I creating 1440 functions here ? |
JS : Question : in firefox- > console it shows : ( an empty string ) , why ? <code> < style > body { margin : 10px } < /style > < body > < script > console.log ( document.body.style.marginTop ) ; < /script > < /body > | got ( an empty string ) when trying to get marginTop value in js |
JS : I have the problem with update chart js in angular . I am using for it ngrx store.In selector subscriber ( run in ngOnInit ) I tried update the chart data : And my chart data : Register charts : And I call it in constructor.I know , that I need run chart.update ( ) . But still I have got an error about chart is un... | Update charts in chartjs and angular |
JS : I have been messing around with the Google 's JavaScript code and I saw in their code that they define array in different way.What 's so unique in writing array like that ? why is the `` ( ) '' in that code , it could be fine either like that : is it have purpose ? Thank you in advance . <code> var arr = ( [ ' b '... | JavaScript : define array in different way |
JS : I have a webview that opens from a messenger bot.From the webview I want to send image data to the conversation ( no URL - data coming from the canvas ) .I tried to use Messenger SDK beginShareFlow with file data attachment : But I get an error : Would appreciate help = ] EDIT : I found out that filedata is used t... | Use Messenger SDK to send file data |
JS : I am binding a single click event to a large container using jquery ( event delegation ) .I have many different items within that container that are clickable.The problem I am dealing with is that if I have 20 clickable items , I need to do a if else block x 20 in the container on click handler . Is there a way to... | JavaScript Event Delegation code organization |
JS : I 'm reading the article about functions on the MDN , and I reached the Recursive part but I do n't understand the last part that talks about using the stack-like behavior.The example is that one : On that function , I understand when the begin log is shown but I do n't when the end log is shown . Can someone help... | Trying to understand the stack-like behaviour on recursive functions |
JS : Say I have a sequence of items and I want to perform a reduce operation via myReducer function ( whatever it is ) . If my items are in an array ( say myArray ) , it 's easy : What if , however , my sequence is quite large and I do n't want to allocate an array of all of it , only to immediately reduce it item afte... | Reduce a sequence of items provided by a generator in JavaScript |
JS : I have the following components : WHen I call network.current.filter ( [ ... ] ) , it will set the filterNodes state . Also , it should set the filterNodesRef inside the useEffect.However , the filterNodesRef.current remains to be empty array.But when I call network.current.filter ( [ ... ] ) the second time , onl... | useRef current getting its value only on second update |
JS : When binding to a click event for a checkbox input , the checkbox is already toggled by the time my event handler runs and , more oddly , the toggle is reversed after my event handler runs if I specify event.preventDefault ( ) ; [ tested in chrome and firefox ] JSFiddle for that codeThe alert will respond `` true ... | Is this a core misunderstanding of the default click event on checkbox inputs , or flawed code ? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.