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?

1
  • I would recommend showing us some code and the community can assist you better. Commented Aug 22, 2012 at 14:19

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

2 Comments

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!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.