Jump to content

Jack

Moderators
  • Content Count

    3,408
  • Joined

  • Last visited

  • Days Won

    16

Jack last won the day on November 28

Jack had the most liked content!

About Jack

  • Rank
    ?
  • Birthday 08/23/1991

Users Experience

  • Experience
    Advanced
  • Area of Expertise
    Web Developer

Profile Information

  • Gender
    Male
  • Location
    Jersey Channel Islands

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Jack

    CSS Div in dropdown not displaying correctly

    I'm generally curious why you didn't approach them for a re-build? This site is barely going to work properly on mobile devices, I would actually expect the desktop version to be better to navigate with pinch and zoom. As for the nav, it's pretty straight forward and would be easier to write again from scratch. Then you can remove the legacy code. I wouldn't attempt to work off of the existing code at all.
  2. The UK has plenty of jobs and they're well paid in good companies. As for experience, people have commented on this for you numerous times already. If this was truly the case, no one on this forum would be employed. You need to continue to learn on every job, going to college isn't enough learning to sustain your career for the rest of your life. You're also not a professional when you graduate, you have a lot more to learn, so you're probably putting yourself in a bracket that you're not part of yet. If you're struggling to find a job, then it's probably because you're trying to do "just enough" when everyone else is outdoing you. Many graduates going into the web industry for the first time are excited to do so, they often go well above to make themselves employable.
  3. The click method is deprecated in newer versions of jQuery, you should use .on() method instead. The reason why your code isn't working, is because the first argument to .click is a callback, where you can pass in a parameter to capture the event. $('#button').click(function(e) { console.log(e) }) Here's an example of what you're trying to do, but it's extremely dangerous. Like @rbrtsmith said, any malicious script in the textarea could be injected directly into the frame. You can try this yourself by dropping <script>alert()</script> into the textarea and submitting.
  4. Jack

    Please don't repeat yourself

    Yeah sorry, I'm used to the ES6 way. If you're not using Babel, I can rewrite it in ES5 if you want. Basically the process is this: Get all items from querySelectorAll and assign to a variable called removeFilteredListItems. Both querySelector and querySelectorAll can replace older methods like getElementByID. Variable removeFilteredListItems will return a NodeList, which is not an array (even though it looks like one), so we need to convert it to an array before mapping over the items. That's what the three dots inside brackets are doing, but there are many other ways to do this https://toddmotto.com/a-comprehensive-dive-into-nodelists-arrays-converting-nodelists-and-understanding-the-dom. Map, essentially takes an array, applies a callback to each item in the array (in this case removing an item), and returns a new array when all elements have been traversed. It's incredibly useful, here's an ES5 example of map. var add = function(a, b) { return a + b } var nums = [2, 5, 6, 8] var addNums = nums.map(function(num) { return add(num, 2) }) console.log(addNums) // [4, 7, 8, 10] There are other ways to do this too, you could use the filter() method, or have the items in an object with a 'visible' property that gets toggled. This example works for the code above well enough though.
  5. Jack

    Please don't repeat yourself

    You could create a function to clear the current list items: const removeFilteredListItems = () => { let listItems = [...document.querySelectorAll('#demo ul li')] if( listItems.length > 0 ) { listItems.map(item => item.parentNode.removeChild(item)) } } Then you can call that function before you add new items. function concat(x) { removeFilteredListItems() let ul = document.createElement('ul'); document.getElementById('demo').appendChild(ul); x.forEach(function(list) { let li = document.createElement('li'); ul.appendChild(li); li.innerHTML += list; }); }
  6. The mainly integration over unit approach seems fine, but some things in UI testing I still think are a bad idea at a glance. For example, testing specific text values and class / attribute names, your tests will need to be refactored with any component re-design. I don't know a way around it, I guess you could test less specific values, and do string.includes('remove') or something, but that's not ideal either. I'll take a look at that video, we probably need to get the TDD thread back up and running at some point.
  7. No one woke up one day and suddenly became a surgeon. Perseverance is a key still in basically every job, if you don't know something, you should be compelled to find a route that will get you to understanding it better, otherwise you might not be as passionate about it as you think.
  8. Basically this. You have to break something you don't know into the smallest possible set of tasks, and tackle each one individually. TDD is pretty good for this. You're often testing in isolation, so you're not really concerned about the entire app all at once. Instead you can focus on smaller, manageable units of code, and smaller features. Trying to keep everything in your head is problematic, there are too many things you won't consider as part of the build or test phase.
  9. It's totally possible to have a working knowledge of more than one language. Most languages are just evolved versions of previous languages. Javascript, for example, has features of many languages, like Small Talk. I haven't seen a language that isn't based on some principle of the last 30+ years. For the most part, they all have variables, arrays, data structures, as these concepts are universally accepted as a good idea.
  10. Jack

    Sub-domains: How It Can help a website to Rank

    Aren't subdomains ranked independently to the main website? That's what I always heard anyway. In that case, a company blog would surely be better on the main domain, rather than blog.domain.com.
  11. Jack

    Inherited Website Need Speed Help

    Time to first byte is incredibly high too. I would take a look to see how many redirects are setup, and if traffic goes through multiple domains. If not, your host could be letting you down here, because 2.4s is extremely high latency for a single request.
  12. Jack

    Front End or Full Stack Course?

    Many of the job listings like this will either be "nice to have" items, or the recruiter has put them in without knowing the role well enough. An interview will typically be with someone that knows the job well, usually another developer, and they won't expect a front-end developer to know mySQL or Java, for example.
  13. Jack

    Recursive?

    What are you trying to do here? Your count is likely off somewhere, or you're mutating the i variable causing the loop to be off.
  14. Jack

    background music

    Some browsers no longer allow this. If you have an autoplay attribute on a video element that has audio, or audio element, it won't automatically play. I know this is the case on IOS Safari (apparently Chrome too), but it seems like most browsers will follow shortly because it's such a bad user experience.
  15. I have never used any of them. Our host has their own server-side caching system that we use instead based on something called memcached. That's exactly how it should work. When something changes, you need a way of invalidating the current cache on the server. It sounds like before you touch anything on the server, you need to improve the frontend performance of your site, then look at cache control headers, which are client-side not server-side. Focus on frontend and client-side performance before anything else.
×