Broken Links in JavaScript-Rendered Sites: What an HTTP Check Can and Cannot Find

Compare HTTP checks with rendered-page discovery and learn how to test SPA routes, navigation, redirects, and browser errors in a test environment.

Published
Reading time
8 min read
Broken Links in JavaScript-Rendered Sites: What an HTTP Check Can and Cannot Find
On this page

To check broken links on a JavaScript website, you need to answer two different questions: does a known URL return an acceptable HTTP response, and can a visitor discover and use the link in the rendered application? A status check helps with the first question; browser-based testing is needed for the second.

This guide compares the two approaches and gives QA teams a workflow for testing both direct entry and navigation through a JavaScript-heavy site.

Key Takeaways

  • A direct HTTP check starts with a URL you already know. It does not necessarily discover links generated by JavaScript.
  • A rendered-page check can discover links in the current browser state, but it can still miss links hidden behind interactions, permissions, or different data.
  • A successful status does not prove that the intended content rendered or that a visitor can complete the page journey.
  • Test important routes both by navigating within the application and by opening or reloading their URLs directly.
  • Record console errors, failed network requests, redirects, and visible outcomes alongside status results.

Direct URL checks versus rendered-page discovery

QuestionDirect HTTP checkRendered-page discovery
What does it start with?A known URLA page opened in a browser or rendering tool
What can it reveal?Response status, redirects, and request failures for that URLLinks present in the rendered state and failures encountered during browser navigation
What can it miss?Client-side rendering errors, application state, and whether the link appears in the UILinks requiring other states, interactions, accounts, or data; direct-entry server behavior
Does it prove a journey works?NoNot by discovery alone; the journey must also be exercised and checked

For example, a page might generate an account link only after JavaScript loads the user's profile. A checker given that account URL can request it, but it has not established that the link appeared or that clicking it works. Conversely, finding the link in the browser does not prove that a copied URL will work when opened directly.

Advertisement

Why an HTTP status can be misleading

A status code describes an HTTP response, not the complete experience of using a page. Consider these cases:

  • Application shell with a missing route: A server may return the same successful HTML response for many paths so the client-side router can handle them. The application may then display a not-found screen for one of those paths.
  • Successful page response, failed data request: The initial HTML may load successfully while a later API request fails, leaving the page empty or incomplete.
  • Redirect to sign-in: A protected URL may redirect to a sign-in page that returns a successful status. That does not establish that the protected content was accessible.
  • Client-side navigation: Moving between routes may update the address bar without requesting a new HTML document for each route. A separate server response for the destination may not exist during that navigation.
  • Fragment links: A link such as /help#billing can load /help successfully even if the expected section is missing. The fragment identifies a location within the resource and is not sent as part of the HTTP request for the page.

Redirects are not automatically defects, and an error response is not always unexpected: a deliberately retired page may correctly return an error status. Compare the response and final destination with the intended behavior for that route.

Diagnostic workflow for a test environment

Use an environment and accounts you are authorized to test. Select a small route set first: the home page, a key journey, a protected page if applicable, a parameterized page, and a known missing route. Include a deep link that a visitor might open from an email or bookmark. Use representative test data and avoid actions that change real customer data.

The browser steps below use common developer-tools concepts. Official browser documentation was not available to consult for this article, so panel names and controls may differ in your browser or version.

1. Check known URLs directly

For each selected URL, request it with your team's HTTP checker or another approved client. Record the request method, initial status, redirect chain, final URL and status, or the failure if no response is received. Note whether the request was authenticated.

Where a tool supports both methods, remember that a HEAD response does not include the response body. A GET request can provide more context, but it still does not execute the application like a browser. Servers can also handle the two methods differently, so compare like with like.

Do not treat a final successful status as a pass on its own. If the response lands on a login page, a generic application shell, or an unexpected destination, flag it for browser investigation. Also document timeouts, connection failures, and rate-limit responses rather than classifying all of them as permanently broken links.

2. Test direct entry in a browser

Open each important URL in a fresh tab or an appropriate clean browser session. For protected routes, test with the intended account and, separately, an unauthenticated session if that behavior is in scope. Reload the page as well as opening it directly.

Check that the expected page and meaningful content appear, not just a loading spinner or application frame. Confirm that the URL is still the intended one and that any redirect is expected. A route that works only after navigating from the home page may have a direct-entry, session, or server-configuration problem.

3. Discover and exercise internal navigation

Starting from a representative entry page, follow the actual navigation a visitor would use. Inspect menus, links revealed after loading, and links visible only after relevant interactions. Check that each important link leads to the expected content and that browser back and forward navigation behaves as intended.

Repeat important journeys for relevant roles, viewport sizes, and application states. A single rendered snapshot is not an inventory of every possible link: data, permissions, feature settings, and user actions can all change what appears. Record both the source page and destination for a failure so developers can distinguish a bad link from a broken destination.

4. Inspect console and network activity

Open the browser's developer tools using the browser menu, then use the console and network panels while repeating the failing journey. Look for uncaught JavaScript errors, failed document or API requests, unexpected redirects, and requests that remain pending or time out. Correlate the timing with the visible failure; not every console message explains a broken link.

Capture enough evidence to reproduce the problem: browser and environment, account role, starting page, steps, target URL, observed page, relevant request status, and a redacted error message. Network captures can contain cookies, tokens, or personal data, so sanitize them before sharing.

Advertisement

5. Compare outcomes and retest

Use the combined evidence to classify the failure:

  • Direct request fails; internal navigation works: Investigate direct-entry routing, authentication, redirects, and server handling of deep links.
  • Direct request succeeds; page shows an error: Inspect client-side routing, JavaScript errors, and data requests; the initial response may only be an application shell.
  • Destination works directly; navigation fails: Inspect the source link, event handling, application state, and any request made during the transition.
  • Both paths fail: Investigate the destination, its dependencies, and whether the route or test data is valid.

After a fix, repeat both the direct-entry and in-app tests. Include the original browser, account state, and route in the retest, then check other representative states where appropriate.

Constraints that affect coverage

Authentication and authorization. A checker without the right session may see a login redirect or an access-denied response instead of the destination. Test with accounts appropriate to each role, and distinguish expected denial from a defect. Do not put credentials or session tokens into reports or unapproved tools.

Robots restrictions. A discovery crawler may be configured to respect robots.txt and therefore skip paths that a normal browser can open. Record the crawler's policy and coverage; a skipped URL is not evidence that the destination is broken. Follow the site's access rules and test authorization.

Rate limits and temporary failures. Automated requests can encounter throttling, timeouts, or transient service errors. Keep request volume within the test environment's limits, identify the client where appropriate, and retry cautiously according to the site's policy. A rate-limit response should be reported as such, not silently converted into a broken-link verdict.

Incomplete rendering and discovery. A rendering tool may inspect the page before delayed content appears, or may not perform the interactions needed to expose links. State what it waited for and what it actually visited. A manual journey and an automated discovery pass can complement each other, but neither automatically proves complete coverage.

Common Mistakes

  • Treating every successful HTTP response as proof that the intended page is usable.
  • Checking only links found in initial HTML and overlooking links created after rendering or interaction.
  • Testing only in-app transitions and missing deep links that fail on refresh or direct entry.
  • Following redirects without recording that the final page is a login screen or other unexpected destination.
  • Calling every inaccessible URL broken without considering permissions, robots policy, throttling, or temporary failures.
  • Assuming a successful document request validates fragment targets, API calls, or the rest of the user journey.

Best Practices

Maintain a representative route and journey list with expected outcomes for each account role. Combine direct checks with browser testing, and prioritize paths that users enter from bookmarks, search results, and external messages. Keep test runs within authorized scope and retain redacted evidence that makes failures reproducible.

Conclusion

A direct HTTP check is useful for assessing a known URL's response, while rendered-page discovery helps reveal links produced by the application. Use both, then exercise the visitor journey: neither a status code nor a discovered link alone confirms that the destination works.

What would your domain sell for?

A free TidyURLs account unlocks the Domain Estimator. It prices a name from 191,011 real domain sales.