Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7

Thread: Coding help

  1. #1
    New Coder
    Join Date
    Jun 2006
    Posts
    70
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Coding help

    Hi there can anyone tell me whats wrong with the following code?

    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

  • #2
    Senior Coder ahallicks's Avatar
    Join Date
    May 2006
    Location
    Lancaster, UK
    Posts
    1,134
    Thanks
    1
    Thanked 57 Times in 55 Posts
    Make sure you are using the response.write method correctly, see here 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
    "write it for FireFox then hack it for IE."
    Quote Originally Posted by Mhtml View Post
    Domains are like women - all the good ones are taken unless you want one from some foreign country.
    Reputation is your friend

    Development & SEO Tools

  • #3
    New Coder
    Join Date
    Nov 2006
    Posts
    59
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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

  • #4
    Senior Coder ahallicks's Avatar
    Join Date
    May 2006
    Location
    Lancaster, UK
    Posts
    1,134
    Thanks
    1
    Thanked 57 Times in 55 Posts
    Quote Originally Posted by webdiv View Post
    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
    "write it for FireFox then hack it for IE."
    Quote Originally Posted by Mhtml View Post
    Domains are like women - all the good ones are taken unless you want one from some foreign country.
    Reputation is your friend

    Development & SEO Tools

  • #5
    New Coder
    Join Date
    Nov 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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
    Code:
    <% 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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #7
    New Coder
    Join Date
    Nov 2006
    Posts
    59
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by ahallicks View Post
    That would be because he's closing the javascript
    Ahaa

    webdiv


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •