Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 21st, 2006, 03:44 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default Unterminated String Constant

Hi All,
function call_song(song, artist){
    document.write('<html><body>');
    document.write('<OBJECT ID="mediaPlayer" CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" STANDBY="Loading Microsoft Windows Media Player components..." TYPE="application/x-oleobject">');

Apparently There Is Something Wrong with this statment and it is saying 'Unterminated String Constant' Why??

document.write('<PARAM NAME="fileName" VALUE="N:\Music Manager\Music\' + artist + '-' + song + '.mp3">');

        document.write('<PARAM NAME="animationatStart" VALUE="true">');
    document.write('<PARAM NAME="transparentatStart" VALUE="true">');
    document.write('<PARAM NAME="autoStart" VALUE="false">');
    document.write('<PARAM NAME="showControls" VALUE="true">');
    document.write('</OBJECT>');
    document.write('</body></html>');
}

Cheers Anyone who can help me!!
__________________
Apocolypse2005, I'm a programmer - of sorts.
 
Old June 21st, 2006, 03:50 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Because a backslash in JavaScript is an escape character so you need to double them up:
N:\\Music Manager\\ etc.

--

Joe (Microsoft MVP - XML)
 
Old June 22nd, 2006, 08:36 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default

Cheers m8,
        Thats amazing, god i've been loking for that for ages
Thanks very much!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unterminated string constant cnottingham Classic ASP Databases 8 October 28th, 2011 01:43 PM
unterminated string constant Stubby HTML Code Clinic 1 February 3rd, 2005 05:56 AM
Unterminated String Constant Ben Horne Javascript 7 October 21st, 2004 11:26 AM
Unterminated String Constant Ben Horne Javascript 2 April 9th, 2004 02:26 PM
unterminated string constant mariakovacs Classic ASP Basics 3 January 26th, 2004 03:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.