SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Enthusiast hombre_de_las_ca's Avatar
    Join Date
    Apr 2005
    Location
    Bangalore, India
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation problem with double quotes of javascrpit within ASP

    i got to place a loop to create a call to javascript with different ID' s generated by asp like in the following code
    <A class=menuBarLink onclick="return !showMenu('1', event);" ><img src='ADD.gif' align='left' alt='ADD MACHINE' width='24' height='16' border=0></A> <div class=menu id=menu1 onClick=event.cancelBubble ='true;"'><a class=menuBarLink onClick="return !showMenu('1', event);" ><img src='ADD.gif' align='left' alt='ADD MACHINE' width='24' height='16' border=0></a></div>
    but for that i will have to remove the " and place a ' but this gives an error and the javascript does not work....how can i rectify the error...
    Caveman
    Don't ask what your Country can do for you,
    Ask what you can do for your Country.

  2. #2
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you double up your quotes then ASP will still write a single " mark, e.g:

    <A class=menuBarLink onclick=""return !showMenu('1', event);"">



    While I'm on the subject, you should tidy your HTML. For example, the line above should be:

    <a class=""menuBarLink"" onclick=""return !showMenu('1', event);"">


Bookmarks

Posting Permissions

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