Results 1 to 2 of 2

Thread: Alert including a string in JS

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049

    Question Alert including a string in JS

    How can I make an alert in JS that includes text a variable? I have tried this code, but something is wrong.
    Code:
    text1 = "This is a string";
    				alert("This is another string\n" && tekst);

  2. #2
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    Hi,

    its + for strings, and also for integers. Also try using ' instead of "

    Code:
      text1 = 'This is a string';
      alert('This is another string\n' + text1);
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

Posting Permissions

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



Click Here to Expand Forum to Full Width