-
Notifications
You must be signed in to change notification settings - Fork 0
01-JS-DOM-APIs #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
e53f157 to
0ced08b
Compare
01-JS-DOM-APIs/js/scripts.js
Outdated
| let newElement = document.createElement('p'); | ||
| let separatingElement = document.createElement('hr'); | ||
| newElement.textContent = "ERROR:" + error["status"]; | ||
| newElement.style.color = "#C00"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sería mejor si le agregaras una clase, y que desde el CSS elijas el color
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check my correction 👍 da46a34
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All styles now, are added by classes 👍
cb43949
01-JS-DOM-APIs/js/scripts.js
Outdated
| let jsonResponse = JSON.parse(response); | ||
| this.handleResponse(jsonResponse, within); | ||
| }) | ||
| rtn.catch((error) => this.handleError(error, within)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Un temita que tenemos que corregir:
El ejercicio dice que la función debe retornar una promise. Tu función no retorna nada.
La idea es que tu función pueda ser usada de forma
myRequest({method: 'GET', url: 'url'})
.then()
.catch()There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, i'll change this function to return a promise. And the promise returned it will be used in the function (handleResponseRepositories).
Perfecto, cambiaré esta función para devolver una promesa. Y la promesa devuelta se usará en la función (handleResponseRepositories).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
01-JS-DOM-APIs/js/scripts.js
Outdated
| let id = document.getElementById("repositoriesList"); | ||
| id.appendChild(li); | ||
|
|
||
| let separatingElement = document.createElement('hr'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esto no es necesario arreglarlo, pero para el futuro. No uses hrs. Si querés que haya espacio entre un elemento y otro, usá márgenes, y siempre desde CSS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check my correction 👍
25752df
01-JS-DOM-APIs/js/scripts.js
Outdated
| } | ||
|
|
||
| function CloseModal() { | ||
| document.getElementById('openModal').style.display = 'none'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tanto el color que le asignás a los elemetos, como esta regla display que agregás, deberían en realidad ser clases, y todos los estilos en un archivo de CSS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All styles now, are added by classes, please cheack my correction 👍
cb43949
01-JS-DOM-APIs/js/scripts.js
Outdated
| if (document.getElementById("repositoriesList") == undefined) { | ||
| alert("Don't exists list of repositories to search."); | ||
|
|
||
| } else if (toSeek == "" || toSeek === " ") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fijate que a veces usás == y a ves ===. Sabés la diferencia? Deberías usar siempre ===
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
La diferencia es "==" compara los datos, y "===" compara los datos y el tipo de dato.
Por lo que "===" es mas estricto y en cambio el "==", operaciones como (5=="5") dan como resultado TRUE.
En resumen sabia la diferencia pero sin querer me saltee un "=" de menos ahí, ya lo corrijo !..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
01-JS-DOM-APIs/js/scripts.js
Outdated
| tr.appendChild(td); | ||
| } | ||
| } | ||
| table.style.border = "1px solid black"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esto mandalo a un archivo CSS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check my correction 👍
ffee632
| document.getElementById('openModal').style.display = 'none'; | ||
| } | ||
|
|
||
| function matrixDraw(matrix, within) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Para qué están los parámetros? matrix está siendo pisada y within no se está usando
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check my correction 👍
57b50c0
intii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me interesa que arreglemos dos cosas:
1- La función que hace un request, para que retorna la promesa
2- Sacar todas las referencias a estilos de los archivos de JavaScript
… a param to change the color text)
…ted, now to add separation uses padding in style.css)
…larized in style.css and the function (handleSeek) now used the param colorText to change the color of your results)
…, return a promise, and the function handle use this promise)
…s been created to draw a matrix example and use the function matrixDraw)
Matiassimone
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All troubleshooting are fixed now !
01-JS-DOM-APIs/js/scripts.js
Outdated
| let newElement = document.createElement('p'); | ||
| let separatingElement = document.createElement('hr'); | ||
| newElement.textContent = "ERROR:" + error["status"]; | ||
| newElement.style.color = "#C00"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All styles now, are added by classes 👍
cb43949
Exercise N1, Complete!