I am troubleshooting this line of code: e is of type image(img) and b is of type link(a). It seems to be concatenating the local host to e.src and not doing just a direct copy of the string.
Where is reference material located on the Mozilla Development Network that lists object properties, particularly the .src property of my image?
You need to assign a proper
hrefattribute if you want to extract thehostname.Instead of:
you should do:
or at least:
Then you’ll be able to extract the hostname. Otherwise the browser assumes
www.ay.comis a local file or directory.If for some reason you can’t change the
href, then you’ll need to usegetAttribute()to be able to retrieve it unmodified.