Quote Help

Discussion in 'ASP General' started by scott, Jul 20, 2005.

  1. scott

    scott Guest

    I'm trying to get my double quotes correct in LISTING 1. Can someone correct
    the quotes surrounding the sURL variable. Also, I'd appreciate it all of the
    quotes were double quotes instead of single quotes. LISTING 2 just shows the
    code working with a hard-coded url. Thanks for any help.


    LISTING 1: (causes js unterminated string)

    'Response.Write ("<input type=button value=""Continue&nbsp;&gt;&gt;""
    onclick='javascript:document.location=" & sURL & ";""'></td></tr></table>")



    LISTING 2: (Works)
    Response.Write ("<input type=button value=""Continue&nbsp;&gt;&gt;""
    onclick=""javascript:document.location='calendar_admin.asp';""'></td></tr></table>")
     
    scott, Jul 20, 2005
    #1
    1. Advertising

  2. > 'Response.Write ("<input type=button value=""Continue&nbsp;&gt;&gt;""
    > onclick='javascript:document.location=" & sURL &
    > ";""'></td></tr></table>")


    Response.Write "<input type=button value='Continue &gt;&gt;'
    onclick='javascript:location.href=""" & sURL & """;'></td></tr></table>"

    Or to make it easier to follow,

    sURL = """" & sURL & """"

    Response.Write "<input type=button value='Continue &gt;&gt;'
    onclick='javascript:location.href=" & sURL & ";'></td></tr></table>"

    Or just call a function in the onclick handler and dump the URL into the
    function.

    Response.Write "<input type=button value='Continue &gt;&gt;'
    onclick='go();'></td></tr></table>"
    %>
    <script>
    function go()
    {
    location.href="<%=sURL%>";
    }
    </script>

    A
     
    Aaron Bertrand [SQL Server MVP], Jul 20, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    13,244
  2. Stimp
    Replies:
    2
    Views:
    2,272
    Stimp
    Sep 20, 2006
  3. Eric Layman
    Replies:
    3
    Views:
    630
    Rad [Visual C# MVP]
    Apr 14, 2007
  4. Replies:
    6
    Views:
    441
    Stefan Ram
    Jun 15, 2008
  5. Valery Khamenya
    Replies:
    3
    Views:
    716
Loading...

Share This Page