Portfolio Development#2
Conversation
jayceb04
left a comment
There was a problem hiding this comment.
Can you add a screenshot of the parts of the portfolio you edit to the commit description. It makes it really helpful to be able to see the visual outcome produced by the code.
| </div> | ||
| <img id='facepic' src="/images/face.jpeg" /> | ||
| <div class="wordsContainer"> | ||
| <p>My name is Isabel Báez and I am a sophmore at MIT. I'm majoring in Computer Science and minoring in Design. My favorite food is sushi and I'm currently obsessed with Criminal Minds. This is my portfolio.</p> |
There was a problem hiding this comment.
When possible, try to wrap long lines of texts. It helps make the code a little easier to read (no side scrolling).
https://google.github.io/styleguide/htmlcssguide.html#HTML_Line-Wrapping
n into JavaScript using JSON.
| /** ONE HARD CODED STRING | ||
| * @Override | ||
| public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { | ||
| response.setContentType("text/html;"); | ||
| response.getWriter().println("I did it!"); | ||
| } | ||
| } */ |
There was a problem hiding this comment.
Go ahead and remove commented code if you don't plan to use it.
| Gson gson = new Gson(); | ||
| String json = gson.toJson(sentences); |
There was a problem hiding this comment.
I would just use this in your doGet method and remove both the helper methods convertToJson and convertToJsonUsingGson
| async function showString() { | ||
| const responseFromServer = await fetch('/string'); | ||
| const textFromResponse = await responseFromServer.text(); | ||
|
|
||
| const stringContainer = document.getElementById('string-container'); | ||
| stringContainer.innerText = textFromResponse; | ||
| } |
There was a problem hiding this comment.
It looks like this isn't used anymore?
| stringsListElement.innerHTML = ''; | ||
|
|
||
| stringsListElement.appendChild( | ||
| createListElement(strings[getRndString(1, 4)])); |
There was a problem hiding this comment.
If you use gson.toJson, then I think you can use strings[Math.floor(Math.random() * strings.length)] here.
jayceb04
left a comment
There was a problem hiding this comment.
The code looks great. Could you add a couple of screenshots to the PR descriptions that show:
- Your input boxes on your website and what appears after a request.
- An example of the site before and after a translation
|
|
||
| <div class="Names"> | ||
| <p>First Name:</p> | ||
| <textarea class=textBox name="first-input">John</textarea> |
There was a problem hiding this comment.
OPTIONAL: You may want to use the input tag here instead of textarea. If you do, you can add type annotations so will automatically check the validity of the input for you. Here's and example: https://www.w3schools.com/html/html_form_input_types.asp
| @@ -0,0 +1,12 @@ | |||
| { | |||
There was a problem hiding this comment.
I think you can include this file in your .gitignore file. When you run the code locally from your Cloudshell it should still be able to read the file.
No description provided.