Posts by guicompeng • 114 points
5 posts
-
1
votes1
answer40
viewsA: Postman returns JSON, but Fetch request returns status 204 in browser
It seems that you are being blocked by your browser’s Cors policy. This is probably because an api is being accessed that has a different domain than your fetch code. When you use Postman, there is…
-
0
votes4
answers72
viewsA: Get minutes between two times
Function with Pure js (without Moment) function diffMin(start, end) { var diff = 0; start = start.split(':'); end = end.split(':'); diff = (new Date(null, null, null, start[0], start[1]).getTime() -…
-
0
votes1
answer30
viewsA: Validation of data with JS but if there is an error remain in the html page and do not proceed to the php page
Try removing this part of the tag action="PHP\conexao.php" and add that to your validate() function, after all validations have been made: document.getElementById("registo_form").action =…
-
1
votes1
answer124
viewsA: How to calculate the response time of a Node application?
When you use the method to pick up the current time in the frontend, the time returned will be whatever the browser is configured. When you use this same method, only in Node.js, then the server…
-
4
votes1
answer249
viewsA: How do I "hide" the key to an API before putting the project into Github?
If you’re going to put it on Github, then you can use Github Pages with a private repository, but that doesn’t solve your problem, because every time this API is called, anyone can see the…