Results 1 to 3 of 3

Thread: Passing File Name with a Space to Document.Write

  1. #1
    Join Date
    Oct 2007
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Passing File Name with a Space to Document.Write

    The following code is crapping out giving me a 'Unterminated String Constant' error when the page loads. When I debug, the offending line is further down the HTML. I have tracked it down to the presence of the spaces in the string. Taking out the spaces eliminates the error. Any ideas?

    test = "C:\Documents and Settings"
    document.write("<li style='list-style-image:url(xls.ico);'><span onClick=openFile('" & test & "')>Exhibitor Services Schedule</span></li>")

  2. #2
    Join Date
    May 2007
    Location
    USA
    Posts
    373
    Thanks
    2
    Thanked 4 Times in 4 Posts

    Default

    Try
    Code:
    test = "C:\Documents and Settings";
    document.write("<li style='list-style-image:url(xls.ico);'><span onclick='openFile(\" & test & \")'>Exhibitor Services Schedule</span></li>")
    Trinithis

  3. #3
    Join Date
    Oct 2007
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Trinithis View Post
    Try
    Code:
    test = "C:\Documents and Settings";
    document.write("<li style='list-style-image:url(xls.ico);'><span onclick='openFile(\" & test & \")'>Exhibitor Services Schedule</span></li>")

    Its VBScript. Hence no ';' and at then end of the document.write statement.

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
  •