Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 21st, 2006, 03:44 AM
Friend of Wrox
Points: 1,075, Level: 12
Points: 1,075, Level: 12 Points: 1,075, Level: 12 Points: 1,075, Level: 12
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2005
Location: , , United Kingdom.
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.
Reply With Quote
  #2 (permalink)  
Old June 21st, 2006, 03:50 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
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)
Reply With Quote
  #3 (permalink)  
Old June 22nd, 2006, 08:36 AM
Friend of Wrox
Points: 1,075, Level: 12
Points: 1,075, Level: 12 Points: 1,075, Level: 12 Points: 1,075, Level: 12
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2005
Location: , , United Kingdom.
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!!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 02:20 PM.


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