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"; |
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.
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.
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).
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.
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
01-JS-DOM-APIs/js/scripts.js
Outdated
| } | ||
|
|
||
| function CloseModal() { | ||
| document.getElementById('openModal').style.display = 'none'; |
There was a problem hiding this comment.
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.
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.
Fijate que a veces usás == y a ves ===. Sabés la diferencia? Deberías usar siempre ===
There was a problem hiding this comment.
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 !..
01-JS-DOM-APIs/js/scripts.js
Outdated
| tr.appendChild(td); | ||
| } | ||
| } | ||
| table.style.border = "1px solid black"; |
| document.getElementById('openModal').style.display = 'none'; | ||
| } | ||
|
|
||
| function matrixDraw(matrix, within) { |
There was a problem hiding this comment.
Para qué están los parámetros? matrix está siendo pisada y within no se está usando
intii
left a comment
There was a problem hiding this comment.
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.
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.
All styles now, are added by classes 👍
cb43949
Exercise N1, Complete!