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
4 answers

Can I see the actual javascript code from a given source in script tag?

I am really sorry if the question already exists, but I have been searching everywhere for 30 minutes with no result. So I am wondering if I can see the actual javascript code, which is linked in the script tag, so I can learn from it. For example,…
Boyan Hristov
  • 1,067
  • 3
  • 15
  • 41
0
votes
1 answer

jquery: Can if statements firing sequentially?

This code fires at the same time jumping from 01 to 04 immediately. I'm trying to get it to fire the second if statement on the second .mouseover of that image, and fire the 3rd if statement on the 3rd .mouseover etc. Can't seem to figure it…
JCUZ
  • 5
  • 1
0
votes
2 answers

Check if an image is displayed and if not call a function?

apologies if this is a stupid question, but I'm not too good with JavaScript yet, I'm trying to make a page that will fetch a random image from puu.sh and display it on a page, sort of inspired by this. I know it is probably not the most elegant…
anon
0
votes
1 answer

Wordpress image['url'] is returning an empty screen after migrating a website

I was working on a Wordpress website in our development server and everything was showing up correctly. I migrated the site to the live server and now NONE of the images are showing up. I have migrated a lot of Wordpress sites, but this time I can't…
sayra90
  • 21
  • 2
  • 6
0
votes
3 answers

How to change the source of a child element with JavaScript?

I'm looking to change the source attribute of an image element when my parent element is clicked. The child/image element is actually nested within two div's which complicates things slightly and I have a suspicion this is where i'm going wrong in…
0
votes
1 answer

JS is changing src, but image is not changeing in firefox

I'm strugling with a quite simple code. I want to change an image every 2.5s, as a little slideshow of pictures. It is doing the right thing in the source(code inspector in the browser), but the picture is not changing in firefox and opera. IE,…
aisler
  • 1
  • 1
0
votes
3 answers

Best method for posting page source across domains?

I'm try to figure out if there is a way to pass the page source across domains using javascript or another method each time a page is loaded? I know in javascript I can output the page source in to variables using the code below, but how would I go…
mike
  • 2,722
  • 6
  • 31
  • 46
0
votes
3 answers

jQuery - only fires on second click when changing iframe src

I'm trying to change the src of an iframe upon submitting a form. The iframe src won't change unless I hit the submit button twice. However, if I just change the input 'type' for my submit button to 'text', it works on the first click - but…
johnboy
  • 77
  • 1
  • 2
0
votes
1 answer

Why it does not change image inside this "loop"?

I have a problem changing pic src attribute on mouseover using jquery, all works fine when I do this: $(this).attr('src',currURL+"_0"+currPicID+'i.jpg'); but when the loop starts src attribute changes too, but picture (I means visually) does…
Mark
  • 684
  • 2
  • 9
  • 25
0
votes
2 answers

Random Array Item and Set as Embed SRC

I'm attempting to creating a music player that plays a random song by choose a random item from an array and setting it and other things, via concatenation, as the embed's src.