0

I have an image inside a div tag so that on clicking this image, javascript shows/hides another div tag each time this image is clicked. This scripting is used in a Widget on Wordpress, so it is present on every page of the website.

The problem is, the image inside this div tag doesn't show. I have right clicked the 'no image' icon and chosen 'open image in new tab' and the URL is saying: www.DOMAIN.com/www.DOMAIN.com/image rather than what is written in the img src, which is www.DOMAIN.com/image.

If I change it the src URL to =image it works, but if I try this from any other page, it includes that page too i.e. www.DOMAIN.com/contact/image and this isn't where the image is found.

Is there a bit of coding I can put in the div tag, a tag or img tag or similar that will use the absolute location that I have specified?

Manolo
  • 24,020
  • 20
  • 85
  • 130

1 Answers1

3

Use http:// in front of your src attribute. For example, src="http://DOMAIN.com/image instead of src="DOMAIN.com/image".

Waleed Khan
  • 11,426
  • 6
  • 39
  • 70
  • After all day searching and it was as simple as that! Thanks that worked. I have also found a work around of setting a base href around the image tag. (was just about to list it on here and saw your answer) Thanks arxanas! – user1617173 Aug 22 '12 at 14:37
  • Don't use the `base` tag. http://stackoverflow.com/questions/1889076/is-it-recommended-to-use-the-base-html-tag – We Are All Monica Aug 22 '12 at 14:57