Results 1 to 3 of 3

Thread: Problem Quoting

  1. #1
    Join Date
    Dec 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Problem Quoting

    I'm having a little trouble with my script and I've narrowed it down, hopefully, to this line of code. I believe it is because the quoting is wrong. I'm having a little bit of trouble getting it right, can someone give me a hand?

    Code:
    var tempcontainer=galleryarray[i][3]!=""? '<a href="javascript:popImage('+galleryarray[i][3]+','+galleryarray[i][1]+')">' : ""
    The end result should look like this as the link:
    javascript:popImage('photo_album/1.jpg','optional title')

    The array is setup as follows:
    Code:
    var galleryarray=new Array()
    galleryarray[0]=["photo_album/1.jpg", "optional title", "optional description", "photo_album/1.jpg"]

  2. #2
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,626
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    Code:
    var tempcontainer=galleryarray[i][3]!=""? "<a href=\"javascript:popImage('"+galleryarray[i][3]+"','"+galleryarray[i][1]+"');\">" : ""
    The above mentioned item will give you

    Code:
    <a href="javascript:popImage('photo_album/1.jpg','optional title');">

  3. #3
    Join Date
    Dec 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks! Works perfectly.

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
  •