Results 1 to 3 of 3

Thread: Mixing Javascript with ASP in Overlib..

  1. #1
    Sublime HEXUS.net
    Join Date
    Jul 2003
    Location
    The Void.. Floating
    Posts
    11,819
    Thanks
    213
    Thanked
    233 times in 160 posts
    • Stoo's system
      • Motherboard:
      • Mac Pro
      • CPU:
      • 2*Xeon 5450 @ 2.8GHz, 12MB Cache
      • Memory:
      • 32GB 1600MHz FBDIMM
      • Storage:
      • ~ 2.5TB + 4TB external array
      • Graphics card(s):
      • ATI Radeon HD 4870
      • Case:
      • Mac Pro
      • Operating System:
      • OS X 10.7
      • Monitor(s):
      • 24" Samsung 244T Black
      • Internet:
      • Zen Max Pro

    Mixing Javascript with ASP in Overlib..

    Lo peeps, got a bit of a weird one..

    I'm building a new page for our current website, which is fully database driven (at last), and there's a section of the page where we have a bunch of thumbnails so potential customers and see a few pictures of the holiday cottage etc. With the old static pages they used to open in a multitude of pop-up windows, but I thought I'd do something nicer and have them use the overlib library..

    This works pretty well in just about all cases, except for this one image, where it refuses to pop the layer up, and the javascript console then wibbles about this:

    Error: missing ) after argument list

    This is the code that generates the thumb+pop layer:

    Code:
    onclick="return overlib('<p class=\'popup_caption\'><img src=\'../cottage_images/<%=rsCottages("FileName")%>.jpg\' alt=\'Larger image: <%=rsCottages("Caption")%>\' class=\'photo_popup\'><br /><%=rsCottages("Caption")%></p>', FGCOLOR, '#FFFFFF', WIDTH, 400, HEIGHT, 330, STICKY, CAPTION, 'Hoseasons Country Cottages - <%=strSiteName%> - Larger Picture', CENTERPOPUP, SHADOW, SHADOWOPACITY, 60, SHADOWY, 10, SHADOWX, 10, CLOSECLICK);"
    and this is the data that populates the variables:

    FileName = "A927_4_E2269-DEV-05DISK"
    Caption = "View of water garden from Bella & # 39 ; s Cottage patio."

    (spaces so the entity actually displays in vbulletin)

    Now I presume that this is due to the non-escaped html entity in the caption, the question is, how the heck do I escape it for javascript when it's in the middle of a database entry, without having to fanny about with string replacements?
    Last edited by Stoo; 12-09-2005 at 04:16 PM.
    (\__/)
    (='.'=)
    (")_(")

  2. #2
    Ex-MSFT Paul Adams's Avatar
    Join Date
    Jul 2003
    Location
    %systemroot%
    Posts
    1,926
    Thanks
    29
    Thanked
    77 times in 59 posts
    • Paul Adams's system
      • Motherboard:
      • Asus Maximus VIII
      • CPU:
      • Intel Core i7-6700K
      • Memory:
      • 16GB
      • Storage:
      • 2x250GB SSD / 500GB SSD / 2TB HDD
      • Graphics card(s):
      • nVidia GeForce GTX1080
      • Operating System:
      • Windows 10 x64 Pro
      • Monitor(s):
      • Philips 40" 4K
      • Internet:
      • 500Mbps fiber
    Without string replacement?
    Not entirely sure you can get away with it, you might have to put in this:

    <%=replace(rsCottages("Caption"),"&#39;","'\")%>

    (There is a hidden small space in there so watch copy/pasting!)

    This sounds like exactly what you are trying to avoid doing, but at least I tried

    Javascript & VBScript string replacement aren't my strong points - I'm more at home with C
    ~ I have CDO. It's like OCD except the letters are in alphabetical order, as they should be. ~
    PC: Win10 x64 | Asus Maximus VIII | Core i7-6700K | 16GB DDR3 | 2x250GB SSD | 500GB SSD | 2TB SATA-300 | GeForce GTX1080
    Camera: Canon 60D | Sigma 10-20/4.0-5.6 | Canon 100/2.8 | Tamron 18-270/3.5-6.3

  3. #3
    Sublime HEXUS.net
    Join Date
    Jul 2003
    Location
    The Void.. Floating
    Posts
    11,819
    Thanks
    213
    Thanked
    233 times in 160 posts
    • Stoo's system
      • Motherboard:
      • Mac Pro
      • CPU:
      • 2*Xeon 5450 @ 2.8GHz, 12MB Cache
      • Memory:
      • 32GB 1600MHz FBDIMM
      • Storage:
      • ~ 2.5TB + 4TB external array
      • Graphics card(s):
      • ATI Radeon HD 4870
      • Case:
      • Mac Pro
      • Operating System:
      • OS X 10.7
      • Monitor(s):
      • 24" Samsung 244T Black
      • Internet:
      • Zen Max Pro
    Well, without fannying around with it (had a brain-drain yesterday)

    ta chap
    (\__/)
    (='.'=)
    (")_(")

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. javascript not displaying in firefox
    By ZigZag in forum Software
    Replies: 3
    Last Post: 11-09-2005, 12:05 PM
  2. Replies: 4
    Last Post: 18-03-2005, 05:03 PM
  3. ASP Help required
    By TomWilko in forum Software
    Replies: 1
    Last Post: 27-10-2004, 02:36 PM
  4. Learning ASP
    By TomWilko in forum Software
    Replies: 9
    Last Post: 02-10-2004, 04:28 PM

Posting Permissions

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