The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript console error with angular markup in image src

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #251553

    I’m using angular on my portfolio website:

    The image locations are inserted into the image src like so: <img ng-src="{{content.image}}">
    They are loading correctly, but I keep getting a console error: Failed to load resource: the server responded with a status of 404 (Not Found)

    I’ve searched online, and everythign I’ve read states that the problem is cause by using src instead of ng-src, but I’m using ng-src and the issue persists?

    Does anyone have an idea as to what may be causing the error, and how to fix it?


    Wish I could shed some light on that…

    Have a look at the page with FF though, the browser that supports scroll-behavior (interesting, wasn’t aware) throws an error because the element it is supposed to target for adding a supported class doesn’t exist.


    It looks like you figured out the problem of the images not working… wrong directory?

    But now if you click on the page, a javascript error pops up:

    functions.js: 170 Uncaught TypeError: Cannot read property ‘tagName’ of null

    You can fix it by adding a check on the n parameter:

    function isInPageLink(n) {
      return n && n.tagName.toLowerCase() === 'a' &&
          n.hash.length > 0 &&
          stripHash(n.href) === pageUrl;

    Yeah, the original error I posted about seems to be resolved… I didn’t do anything to fix it though, lol. Maybe it was a chrome bug or something? I’m pretty sure I saw the error in other browser too though…

    Thanks for posting that other fix though… the smooth scrolling isn’t working in firefox, so maybe thats the cause.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.