+ Reply to Thread
Results 1 to 5 of 5

Thread: Hyperlinks in Tabbed Info Window

  1. #1
    Emily LaMunyon
    Join Date
    Sep 2010
    Posts
    169
    Points
    6
    Answers Provided
    1


    0

    Default Hyperlinks in Tabbed Info Window

    Hello,

    I am using the following example (http://resources.esri.com/help/9.3/a...drilldown.html)

    for info windows with tabs. Everything seems to working fine except for the hyperlink. I need to create a url string that uses 3 attributes from the layer, and what I have so far is not working. I have tried so many variations with no luck. Does anyone have any insight as how to make this url string work?

    content+="<td>"+" <a href="http://surveyor.slco.org/javamap/mrs_test.cfm? + layerResults.features[i].attributes['POINT_NAME'] + layerResults.features[i].attributes['LATITUDE_DD']+ " target=_blank ;'>Mon. Ref Sheet</a></td>";

    Thanks for any help, this is driving me crazy!!

  2. #2
    Betsy Schenck-Gardner
    Join Date
    Jan 2010
    Posts
    65
    Points
    4
    Answers Provided
    0


    0

    Default Re: Hyperlinks in Tabbed Info Window

    I think you got your double quotes and single quotes messed up. Try this:

    content+="<td><a href="http://surveyor.slco.org/javamap/mrs_test.cfm?"+layerResults.features[i].attributes['POINT_NAME']+layerResults.features[i].attributes['LATITUDE_DD']+ " target="_blank">Mon. Ref Sheet</a></td>";

  3. #3
    Emily LaMunyon
    Join Date
    Sep 2010
    Posts
    169
    Points
    6
    Answers Provided
    1


    0

    Default Re: Hyperlinks in Tabbed Info Window

    Thanks for the reply Betsy!

    Unfortunately this does not work either, I am getting a Firebug error that says:
    missing ; before statement
    http://surveyor.slco.org/javamappdf/index_tabs.html
    Line 514

  4. #4
    dan becker
    Join Date
    Apr 2010
    Posts
    182
    Points
    21
    Answers Provided
    3


    1
    This post is marked as the answer

    Default Re: Hyperlinks in Tabbed Info Window

    building html strings can be tricky; use of double vs single quote

    this should work
    Code:
    content+="<td><a href='http://surveyor.slco.org/javamap/mrs_test.cfm?"+layerResults.features[i].attributes['POINT_NAME']+layerResults.features[i].attributes['LATITUDE_DD'] + " target='_blank'>Mon. Ref Sheet</a></td>";
    In js, you can't have a string containing double quote "; the string has to contain single quote ' like this
    Code:
    var str = "<a href='myurl'>text</a>"; // <-- single quotes around href attribute, inside of " "

  5. #5
    Emily LaMunyon
    Join Date
    Sep 2010
    Posts
    169
    Points
    6
    Answers Provided
    1


    0

    Default Re: Hyperlinks in Tabbed Info Window

    Thanks, that worked!!! I appreciate your time

+ Reply to Thread

Posting Permissions

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