Skip to content

Tag: javascript

Changing a state of a variable in a function

I have two fonts one if the app is in arabic and one if the app is in English. My thinking is declare the state at the top but when the user changes the font it reverts the false state. The state is declared true when the user triggers the i18 .on function, but the app refreshes and changes the

JavaScript accessing a variable in a different file

So i am trying to access an array in index.js a different file called countries.js. However when i check the console it says that countries is not defined? index.js countries.js index.html All the scripts are in the index.html so im stuck as to why i cant access the variable? Answer At the time you are execut…

D3 text in alignment with rect

I have rect and a description text above chart – Issue is description text is not getting properly aligned with rects. Description is getting mixed into rects. I want to start text after rect ends. I have below code – HTML getting generated for color rect and description text – How can I avo…

Unselect last pallet when selecting a new Pallet

I’ve been kind of stuck on this for a little bit and im in need of some assistance. I’m trying to make it where when I select a pallet it unselects the last selected pallet then selects the new one. I had an idea to do it but I feel like there’s a more efficient way going about this. If

How to limit jQuery appending to form

I have added this link for adding new row to my form: And here is the jQuery code: And it works fine. But I need to determine that add new row only one time and not several times. So I tried checking if(i == 1){ in the jQuery, but does not seem to be working and user still can adds