...

View Full Version : Coding help



malhyp
12-18-2006, 10:48 AM
Hi there can anyone tell me whats wrong with the following code?



Response.Write("<a href=""main.asp""> <img src="images/guarantee.gif" alt="Guarantee" width="130" height="130"></a>")
I cant get the image to show.

Cheers

ahallicks
12-18-2006, 10:51 AM
Make sure you are using the response.write method correctly, see here (http://www.intellidimension.com/default.rsp?topic=/pages/rdfgateway/reference/script/response_write.rsp) for more details. Try document.write first and see if that works. Plus, why do you have two " between your link location? Take that out too

webdiv
12-18-2006, 11:24 AM
I don't know if this helps, but, why do you have closing quotes " after </a> and then a bracket ) ? i.e. you have </a>") ?

webdiv

ahallicks
12-18-2006, 01:39 PM
I don't know if this helps, but, why do you have closing quotes " after </a> and then a bracket ) ? i.e. you have </a>") ?

webdiv

That would be because he's closing the javascript ;)

blueskyz
12-18-2006, 02:09 PM
Shouldn't it read:

Response.Write("<a href='main.asp'> <img src='images/guarantee.gif' alt='Guarantee' width='130px' height='130px'></a>")

Using single quotes ( ' ) within the double quotes ( " )

and also adding px to your heights and widths

_Aerospace_Eng_
12-18-2006, 06:33 PM
You don't need to add the px unit because in HTML that is the default. Though I agree about the quotes. Also Response.write() is not javascript, its ASP. The correct syntax would be

<% Response.Write "<a href=""main.asp""><img src=""images/guarantee.gif"" alt=""Guarantee"" width=""130"" height=""130""></a>" %>
In ASP to escape the double quotes you use a double quote in front of it.

webdiv
12-20-2006, 10:59 AM
That would be because he's closing the javascript ;)

Ahaa :o

webdiv



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum