SHARE
TWEET

Untitled

a guest Jan 20th, 2020 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function () {
  2.     $("a.nav-link").click(function () {
  3.         $("a.nav-link").removeClass("active");
  4.         $(this).addClass("active");
  5.     });
  6.  
  7.     $(window).load(function () {
  8.         fetch('http://127.0.0.1:5000/jobs')
  9.             .then(res => res.json())
  10.             .then(data => {
  11.                 jobs = data.jobs;
  12.                 for (var i = 0; i < jobs.length; i++) {
  13.                     html = `<div class="job">
  14.                     <h4 class="job-title font-weight-bold">${jobs[i].title}<span class="company-name font-weight-normal"> | ${jobs[i].company}</span></h4>
  15.                     <h6 class="meta"><span class="location">${jobs[i].location}</span> | <span class="source"><a href="${jobs[i].source_link}" target="_blank">${jobs[i].source}</a></span>
  16.                     </h6>
  17.                     <a class="apply" href="${jobs[i].link}" target="_blank">Apply</a>
  18.                 </div>`;
  19.                     $("#job-listing").append(html);
  20.                 }
  21.             })
  22.             .catch(error => console.log(error))
  23.     });
  24. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top