Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2002

    Unanswered: escape characters in javascript

    Dear All

    I have this script

    var s = "my string 1|my stirng 2".split('|');

    document.write ('<TD>')
    for (var i = 0; i < s.length; i++)
    document.write('<a onclick="alert(\'ggg\' +s[i] )">'+s[i]+'</a>');
    document.write ('</TD>');

    But i get an undefined error message in the alert function. i want to display the s[i] in an alert but getting confused with the string

    can anyone help???????????

  2. #2
    Join Date
    Dec 2002
    don't worry fixed meself - just being a bit thick on a monday morning!

Posting Permissions

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