Questions tagged [src]

SRC is a common attribute in HTML used to identify the location of a resource which relates to an element.

Within HTML, several elements may make use of the src attribute in order to identify a resource to which the element may relate. It is normally a "valid non-empty URL potentially surrounded by spaces".

Questions often arise relating to the attribute due to confusion between absolute and relative URLs, how src URLs relate to the location of files, and browser caching.

Some examples of elements which use the src attribute are:

  • IMG

    Specifies a URL referencing a non-interactive, optionally animated, image that is neither paged nor scripted.

  • IFRAME

    Gives the address of a page that the nested browsing context is to contain.

  • SCRIPT

    Gives the address of the external script resource to use.

  • EMBED

    Gives the address of the resource being embedded.

  • VIDEO

    The URL for the video.

  • AUDIO

    The URL for the audio stream.

  • TRACK

    Gives the address of the timed track data. This attribute must be present.

There are other elements which may make use of the src attribute, which may be discovered at the W3C Community Wiki.

Related tags: , , , ,

1799 questions
0
votes
2 answers

How to replace a link url without messing up the image src attribute

I'm trying to replace a small image with a larger one, and replace the href link in the wrapping element with a url I saved to a variable. I can replace the image just fine, but when I try to replace the url in the href, it then replaces the large…
Gary D
  • 153
  • 1
  • 10
0
votes
0 answers

Getting error 403 (forbidden) on local server, when trying to add a image dynamically to a html page

I have around 20 images and instead adding them manually to the HTML page I want to add them dynamically via JAVASCRIPT. I get the image path from a json file. So far so good. See in the example below how I add the image and where I get the error…
user3495886
0
votes
3 answers

Changing src of dynamically loaded images with jquery

I have a div that is loaded dynamically with one or more images. Initially, all these images are crops. The aim is, when a when a user clicks on a cropped image, its src is replaced by the full sized version. Click the full sized version to return…
sideroxylon
  • 4,338
  • 1
  • 22
  • 40
0
votes
1 answer

Can't upload images to my website

So, I looked it up but couldn't find a previous forum hat addressed my issue so hopefully you lovely people can help me out. I can't upload images on the site that I'm trying to build. This is the code I'm using: On my computer I've set up a my…
Sam
  • 1
  • 4
0
votes
4 answers

JavaScript replace img src with External src

I'm having a strange problem that I can't quite figure out. I have a normal image on a web page and I have some javascript code to replace the image source function…
TheLovelySausage
  • 3,838
  • 15
  • 56
  • 106
0
votes
1 answer

audio tag won't read files from the computer

So, when I make something like that:
Agen
  • 63
  • 5
0
votes
0 answers

How can I display mail image using html src tag for a page in Outlook ?

I am using a web page to log something, before displaying image in a mail. Html is; Here is the code for page load on abc.aspx: getLink =…
romando90
  • 37
  • 1
  • 7
0
votes
1 answer

Java Script Src Tag Issue?

Setup Basically I have a set of Javascript inclusions like this inside of my JSP: Problem However when I load this page I get an error…
Ace
  • 1,501
  • 4
  • 30
  • 49
0
votes
2 answers

Detect current img src within div

I have a div (id="chart") that houses many images. How do I detect the img src within the div and assign a var to it. Here's what I have tried so far. $(document).ready(function() { $('#Stopbutton').hide(); var imgref =…
wxchic
  • 7
  • 5
0
votes
1 answer

changing all images src when clicking on a link

I want to change all my images src by clicking on a link. (#GoList) my original images have data informations like this :
mmdwc
  • 1,095
  • 6
  • 27
  • 53
0
votes
2 answers

Fitting images to width

I have many img src="xxxx" border="0" style="font-size: 11px;" after another. But they all have a width that exceeds the maximum width of the table. I was wondering if there is a way to <.....> them all in and give a single command to change all…
0
votes
2 answers

Javascript replace image url with text box

I am using this code to be able to change text overlay on an image by typing into a box.