Posts by mauricio-andre • 498 points
26 posts
-
1
votes1
answer893
viewsA: How to create private routes with nextJs
The answer was right in front of me the whole time, sessionStorage and localStorage cannot be accessed in the functions executed on the server, but cookies can, so the solution if you want to create…
-
1
votes1
answer893
viewsQ: How to create private routes with nextJs
Hello, I would like a help for creating private routes using Nextjs. All files deposited inside the directory pages become accessible routes, in my application some of these must be accessible when…
-
0
votes0
answers35
viewsQ: When to use Javascript’s createContextualFragment function?
I am refactoring a function that uses Jquery to use pure javascript only, the function is very simple, it performs a request ajax which takes back an HTML structure that can contain a tag script,…
javascriptasked mauricio-andre 498 -
1
votes2
answers96
viewsA: Assign jQuery function to variable in ternary operator
Be possible is, now if this is a good thing I no longer know, I understand why this might sound interesting but the reading of the code can later be impaired. Anyway, you can do this by following…
-
2
votes1
answer48
viewsA: Consuming Mysql with javascript
No, you should not make requests to the database in the frontend of your application, to many reasons not to do something like this and security is perhaps greater. The Ajax function in particular…
-
0
votes1
answer24
viewsA: Taking the data from the value field dynamically in Jquery
There are two main problems in logic, the first is in creating an element with an id that will be repeated on screen, ideally ids should be unique in DOM. If you create elements in a repeat…
-
0
votes2
answers107
viewsA: Error in searching collection points
It seems your variable points is getting the value undefined and therefore cannot perform the function map. You own a console.log(response.data) in the function that searches the points on the map,…
-
0
votes1
answer190
viewsA: How to instruct Eslint to solve absolute paths with Babel-plugin-root-import in monorepos
The problem occurs because of the structure of monorepo of the project. In the file settings Eslint the parameter of rootPathSuffix of Babel-plugin-root-import part of the project root and NOT of…
-
-1
votes1
answer190
viewsQ: How to instruct Eslint to solve absolute paths with Babel-plugin-root-import in monorepos
I own a repository monorepo done with Yarn and in this I have a project frontend created with the command create-react-app. I installed the libs React-app-rewired and customize-Cra to inject the…
-
1
votes2
answers49
viewsA: I started studying Java Script, and I’m having a problem with my code ( from an exercise). And I have no idea how to solve the problem
The problem is because your code is entering the following condition: else if(x !== undefined && y !== undefined) That’s because the two checks of if are satisfied for it to run, to resolve…
-
1
votes1
answer852
viewsA: Code gives Document.getElementById error is not a Function
Javascript is a language case sensitive, This means that it differentiates between upper and lower case characters. In your code you wrote getELementById with uppercase L, when the correct is…
-
3
votes2
answers148
viewsA: String handling with Regex
A question when we work with regular expression and say the same that it should take any character zero or more times .*, is that it will do this even for special characters, and when we put some…
-
3
votes2
answers163
viewsA: How to tag with javascript
To get a list of all the HTML elements of a given tag use the function getelementsbytagname, it will return you a list of all page elements document.getElementsByTagName('img'); To take this listing…
-
0
votes1
answer275
viewsA: Testing whether a key contains a value within a json
If I understand your question correctly, you want to check if an object has a certain property, and you need it because there is an error in your code in the excerpt MONTHS.indexOf(value_param.mes)…
javascriptanswered mauricio-andre 498 -
0
votes2
answers34
viewsA: Link Event to TAG Class exclusion
You can do this simply using the function Closest. It allows you to find a parent element using querySelector, assuming all your tags tr have the class product, you could use a code similar to this:…
-
1
votes1
answer50
viewsA: Problems with mobile version on my site
I checked your HTML code above and there are several inappropriate and out of order closing tags in your menu for example the tag a is opened before the tag div but when they are closed this order…
-
2
votes1
answer47
viewsA: Problem with javascript function uses class
I’ll assume you’re getting undefined for the buttons you added as HTML code of your question, this is because your code does not have the elements with the classes product_name and price that also…
-
0
votes1
answer45
viewsA: Load using Target
Hello, the method load jquery is a very simple way of fetching server data and assigning it to an html element, in it just provide the destination url address of the page you want to load to the…
-
0
votes2
answers71
viewsA: I would like to know how to put this form to read only numbers like this [1,70] and [66.2]
Hello, the best thing to do is to change your type="text" for type="number". This change will first make your input does not accept alphabetic or special characters, and in the second place will…
javascriptanswered mauricio-andre 498 -
0
votes1
answer33
viewsA: Blocked forms for editing
Hello, the problem is on the line with createelement, cannot declare the element by defining the type property as it is being done input:number. To do this create the element only with input, and…
-
3
votes3
answers88
viewsA: How to execute a given function using onmouseover?
Hello, the problem here is that when using the function setAttribute to change the value of the squares background color you remove all the contents of the property style, this includes the…
javascriptanswered mauricio-andre 498 -
0
votes1
answer22
viewsA: Perform Same Operations with Different Values in the Filter Method
Hello, you can replace the function some for includes. Some will test all the alternatives until finding a positive value, if the country compared is "North America" for example, it will return…
javascriptanswered mauricio-andre 498 -
4
votes1
answer118
viewsA: Call ASYNC - AJAX
You can use the Promise concept to do this. You can read more about it here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise For your specific case change…
-
1
votes2
answers53
viewsA: cannot with Number,sent the text on the screen
It seems to me that its variable "res" is with the value of the result of the calculation "(weight / (height ** 2)). toFixed(2)" and not with the desired gift element, because res.innerHTML does not…
-
0
votes1
answer186
viewsA: Monorepo with Yarn for React Native projects, Bundle error
I found the solution to the problem, so that the app can find all project dependencies need to include the parameter watchFolders to the archive metro.config.js, the final result of this file is as…
-
0
votes1
answer186
viewsQ: Monorepo with Yarn for React Native projects, Bundle error
I want to create a monorepo with Yarn to work with React-Native, this is necessary because I want to keep backend frontend and app in the same repository. My problem occurs when loading the app to…