Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Integrating JavaScript. Some characters are converted which shouldn't 1

Status
Not open for further replies.

kaeserea

Programmer
Feb 26, 2003
164
DE
Hello!

In order to make a more stylish and dynamic prompt I didn't use PROMPT but the following:

I wrote a HTML form and Javascript commands within -HTMLFORM BEGIN and -HTMLFORM END and on submit, submitted all the variables the user set to another report. This other reprot generates the actual output.

I tested the JavaScript outside WebFocus to make sure it works. But when I copied it into WebFocus and ran the report, two strange character conversions occured (I looked at the generated HTML source code):

|| became !! and
\ became Ö

I used the ladder because many of my lines within the JavaScript exceeded the length of 80 characters. So I set a \ at character number 80 and continued the JavaScript statement in the next line. This works fine within HTML but the \ always becomes Ö within JavaScript.

Does anybody know how I can suppress this strange automatic character conversion?

Eva
 
Try not to give a linebreak on the 80th position. And if this has to be, you probably can break the statement (string) into several components and concatenate these by using the plussign.
Frank van de Kant
 
Hello Frank,

If do'nt break the line after 80 characters, the rest is simply cut and thus ignored.

I now tried your advice about using + for concatenation and splitting lines according to JavaScript syntax. This works fine, but the problem that || becomes !! still remains. Do you know how this can happen? Or how I can avoid this?

Eva
 
Hi Eva,

If you put your javascript-code in a separate document the problem will not occur. You can include the javascript-code onto your WebFocus-page by starting the page with this:
Code:
 <head>
  <script language=&quot;JavaScript&quot; src=&quot;/js/validations.js&quot;></script> 
 </head>
By doing this you increase your performance as well. Your browser will load this document once, until it is changed on the server or on your client it is deleted. Your advantage is that you can reuse the same code on several WebFocus-pages. Frank van de Kant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top