What's the problem in the code.why it showing failed to fetch.tried all ways.please help.
async function searchJobs(searchTerm) { try { const response = await fetch(`https://jobs.github.com/positions.json?description=${encodeURIComponent(searchTerm)}`); if (!response.ok) { throw new Error(`Failed to fetch: ${response.status} ${response.statusText}`); } const data = await response.json(); displayResults(data); } catch (error) { console.error('Error fetching data:', error.message); resultsDiv.innerHTML = `<p>Error fetching data: ${error.message}</p>`; } } function displayResults(jobs) { resultsDiv.innerHTML = ''; if (jobs.length === 0) { resultsDiv.innerHTML = '<p>No jobs found.</p>'; } else { jobs.forEach(job => { const jobElement = document.createElement('div'); jobElement.classList.add('job');