Unterminated String Constant

I

IveCal

Hello, I have this functions which opens a new window. The function
works fine if lines 6 and 7 are omitted. But those lines are important
for the next processes so I cant just erase it. Somebody help. It's
been almost 1 day.

1 function test()
2 {
winReport=window.open('','winReport','width=900,height=500,left=50,top=100,menubar=0,toolbar=0,status=0,scrollbars=1,resizable=0,titlebar=0');
3
4 winReport.document.write('<html>');
5 winReport.document.write('<head>');
6 winReport.document.writeln('<script language=javascript src="..\\js
\\format.js"></script>');
7 winReport.document.writeln('<script language=javascript src="..\\js
\\utility.js"></script>');
8 winReport.document.writeln('<title>Testing</title>');
9 winReport.document.writeln('<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">');
10 winReport.document.writeln('</head>');
................................
}
 
I

Ian Collins

IveCal said:
Hello, I have this functions which opens a new window. The function
works fine if lines 6 and 7 are omitted. But those lines are important
for the next processes so I cant just erase it. Somebody help. It's
been almost 1 day.

1 function test()
2 {
winReport=window.open('','winReport','width=900,height=500,left=50,top=100,menubar=0,toolbar=0,status=0,scrollbars=1,resizable=0,titlebar=0');
3
4 winReport.document.write('<html>');
5 winReport.document.write('<head>');
6 winReport.document.writeln('<script language=javascript src="..\\js
\\format.js"></script>');
7 winReport.document.writeln('<script language=javascript src="..\\js
\\utility.js"></script>');
8 winReport.document.writeln('<title>Testing</title>');
9 winReport.document.writeln('<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">');
10 winReport.document.writeln('</head>');
................................
}
I suggest you learn how to use the DOM methods to build dynamic content,
rather than using document.write.
 
E

Evertjan.

Ian Collins wrote on 02 apr 2007 in comp.lang.javascript:
I suggest you learn how to use the DOM methods to build dynamic
content, rather than using document.write.

Using the DOM to populate an empty new window seems impossible to me,
however, having a filled window available for downloading is far mor
reliable.

Do not use language=javascript but the typed version:
type='text/javascript',

.... and do var any new variables,

.... and most important, methinks,
not use '</script>' inside a script but '<'+'/script>'.
 
A

Andrew Poulos

Randy said:
Why? Both are deprecated.
Yes, but
<url: http://www.jibbering.com/faq/faq_notes/script_tags.html >
has this for HTML 4.01:

<!ELEMENT SCRIPT - - %Script; -- script statements -->
<!ATTLIST SCRIPT

type %ContentType; #REQUIRED - content type of script language -

and the note that:

"So for the present, and probably many years to come, text/javascript is
the only viable value for use with the type attribute when using
javascript."

Andrew Poulos
 
R

RobG

I'll accept that in HTML the language attribute is deprecated for
script elements, but do you (Randy) have a reference in regard to
"text/javascript"?

Yes, but
<url:http://www.jibbering.com/faq/faq_notes/script_tags.html>
has this for HTML 4.01:

<!ELEMENT SCRIPT - - %Script; -- script statements -->
<!ATTLIST SCRIPT

type %ContentType; #REQUIRED - content type of script language -

and the note that:

"So for the present, and probably many years to come, text/javascript is
the only viable value for use with the type attribute when using
javascript."

What Randy is referring to is the fact that although the type
attribute is mandatory for valid HTML, the impact of omitting it is
negligible provided one has not previously convinced IE that the
script language in use is VBScript.

He is also obliquely referring to the fact that in April 2006 the
following RFC appeared:

<URL: http://tools.ietf.org/html/rfc4329 >

which proposes:

- text/javascript (obsolete)
- application/javascript
- text/ecmascript (obsolete)
- application/ecmascript

It caused something of a stir.

The bottom line is that you can nearly always safely omit the type
attribute, but if valid HTML counts, include type="text/javascript"
and accept that while there is no official sanction for text/
javascript, nearly any other value will cause the content to be
ignored in at least some browsers.
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]>,
Close but backwards. I was obliquely referring to IE's cluster-screw
with VBScript (which I don't use and it would require an idiot to use
it on the web)

It seems perfectly appropriate to use, on the Web, VBscript in articles
dealing with the use of VBscript in the Web and/or in WSH and/or
elsewhere.

It demonstrates, for example, the errors affecting 2007-12-31 and
2101-01-02.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,228
Latest member
MikeMichal

Latest Threads

Top