Results 1 to 2 of 2

Thread: assume that dalia[i].email is known

  1. #1
    Join Date
    Oct 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default assume that dalia[i].email is known

    "<a href='dalia[i].email'>'dalia[i].email'</a>"

    whats wrong with the sentence
    basically, i want to have a working clicking link to dalia[i].email come out to be whatever email is at instance i in array dalia

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    There is almost nothing wrong with it as a string variable, assuming as you say that dalia[i].email is known. It should however be expressed with + signs in the appropriate places to distinguish between quoted literals and quoted variables. Also, just for clarity's sake, the delimiter for the string should be the single quote (') freeing up the double quote(") for use as a literal in the string. Like so:

    Code:
    '<a href="'+dalia[i].email+'">'+dalia[i].email+'</a>'
    If your object is to generate a mailto: link, then include that:

    Code:
    '<a href="mailto:'+dalia[i].email+'">'+dalia[i].email+'</a>'
    For it to appear on a page though. It needs to be written to the page as it is loading using document.write() or similar or be inserted into the page after it has loaded using an element's innerHTML object. It could simply be assigned as a variable for later use. It could also be appended to the page using the DOM but, not directly from its value as a string.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •