I am trying to insiert a variable into a javascript return value and it wont parse

Discussion in 'Programming' started by IamNed, May 3, 2012.

  1. #1
    I am trying to insiert a variable into a javascript return value and it wont parse

    it just shows +'randomnumber' instead of the actual random number
    
    http://www.facebook.com/connect/prompt_feed.php?api_key=882a8490361da98702bf97a021ddc14d%20&attachment={%22name%22:%20%22Get%20A%20FREE%20Pair%20of%20Oakleys!!%20(limited%20time%20only)%22,%22description%22:%20%22To%20Celebrate%20the%20Summer,%20We%20are%20Giving%20Away%20Free%20Oakleys%20To%20All%20Facebook%20Users!%22,%22href%22:%20%22http://t.co/8hJLJpV%22,%22media%22:%20[{%22type%22:%20%22image%22,%22src%22:%20%22http://i.imgur.com/kdNX3.jpg%22,%22href%22:%20%22http://t.co/d8hJdLJpV%22},{%22type%22:%20%22image%22,%22src%22:%20%22http://'+randomnumber+'.jpg%22,%22href%22:%20%22http://facebook.com%22}]}
    Code (markup):
     
    IamNed, May 3, 2012 IP
  2. e-abi

    e-abi Member

    Messages:
    122
    Likes Received:
    1
    Best Answers:
    3
    Trophy Points:
    38
    #2
    Try using double quotes (") instead of single quotes (').
    Otherwise it is not possible to help you, since you only pasted part of the javascript snippet and I cannot understand, which kind of quotes did you use to surround this snippet.
     
    e-abi, May 3, 2012 IP