Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

How to stop img src from using current URL plus URL in script

Writer Matthew Barrera

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: rather than what is written in the img src, which is .

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. 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

1 Answer

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

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy