473,513 Members | 3,076 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

files with the .js extension

I have recently bought the book: JavaScript & DHTML Cookbook. As I
opened the .js files with note pad, I asked myself why was the code
formated in such a way. The code looks as if it had been produced by
some kind of programs instead of a person. I also noticed a lot of
little squared zeros; what are those all about?

I have also noticed code formated in a similar way, when viewing some
of the source code of the web pages on the MSN web site. If someone
knows anything about this machine-like formating, I would love to hear
from you.
Jul 20 '05 #1
3 1476
On 27 Feb 2004 13:21:52 -0800, Pierre <pf********@sympatico.ca> wrote:
I have recently bought the book: JavaScript & DHTML Cookbook. As I
opened the .js files with note pad, I asked myself why was the code
formated in such a way. The code looks as if it had been produced by
some kind of programs instead of a person. I also noticed a lot of
little squared zeros; what are those all about?

I have also noticed code formated in a similar way, when viewing some
of the source code of the web pages on the MSN web site. If someone
knows anything about this machine-like formating, I would love to hear
from you.


You will usually see this when a text file has been created on another
operating system. Windows, Macs and Unix-based OSs all use different
combinations of two characters to represent new lines. When programs like
notepad don't recognise the combination, they display that character you
see[1].

It's nothing to worry about, but it does make reading difficult.

You could try using a different editor. There are many free ones available
designed for Web development. I use HTML-Kit. If you search the Google
Groups archives, you find that editor recommendations have been asked
frequently in the past. You might want to try some of the ones listed in
those threads.

Mike
[1] The character used, a square (filled or outlined, depending on the
font), is used in Windows to represent non-printable characters.

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 20 '05 #2
Pierre wrote:
I have recently bought the book: JavaScript & DHTML Cookbook. As I
opened the .js files with note pad, I asked myself why was the code
formated in such a way. The code looks as if it had been produced by
some kind of programs instead of a person. I also noticed a lot of
little squared zeros; what are those all about?


The file is likely to have been saved under UNIX, a UNIX derivative
(short: *n*x, e.g. GNU/Linux) or under MacOS (Apple Macintosh).
Those operating systems use different newline delimiters than Windows
(Windows: \r\n; Unix: \n; Mac: \r). Notepad is unable to read the
UNIX and Mac format (thus displayes the "squared zeroes" for those
undisplayable control characters), use an editor that is capable, like
metapad (freeware) or UltraEdit (shareware). If you have installed
Cygwin or have (SSH/Telnet) access to a *n*x system, you can also use
the `unix2dos' program (a `recode' wrapper) on those files.

Another possibility is that the code has been "line-optimized" or
"uglified" (which is bad for a tutorial); you can use a JavaScript
beautifier to make it readable. Ask Google about "JavaScript formatter".
HTH

PointedEars
Jul 23 '05 #3
JRS: In article <40**************@PointedEars.de>, seen in
news:comp.lang.javascript, Thomas 'PointedEars' Lahn
<Po*********@web.de> posted at Wed, 7 Apr 2004 20:57:39 :
Pierre wrote:
I have recently bought the book: JavaScript & DHTML Cookbook. As I
opened the .js files with note pad, I asked myself why was the code
formated in such a way. The code looks as if it had been produced by
some kind of programs instead of a person. I also noticed a lot of
little squared zeros; what are those all about?


The file is likely to have been saved under UNIX, a UNIX derivative
(short: *n*x, e.g. GNU/Linux) or under MacOS (Apple Macintosh).
Those operating systems use different newline delimiters than Windows
(Windows: \r\n; Unix: \n; Mac: \r). Notepad is unable to read the
UNIX and Mac format (thus displayes the "squared zeroes" for those
undisplayable control characters), use an editor that is capable, like
metapad (freeware) or UltraEdit (shareware). If you have installed
Cygwin or have (SSH/Telnet) access to a *n*x system, you can also use
the `unix2dos' program (a `recode' wrapper) on those files.

Another possibility is that the code has been "line-optimized" or
"uglified" (which is bad for a tutorial); you can use a JavaScript
beautifier to make it readable. Ask Google about "JavaScript formatter".


In attempting to give a complete explanation, Pointy-Head has again
demonstrated limits of his experience by giving only a partial answer.
A full answer would be encyclopaedic; but an adequate answer would be
more useful.

WordPad - at least in Win98 - transforms both CR & LF endings to CRLF;
given that Notepad is available, WordPad could well be the best
solution.

MiniTrue, for DOS-16, Win32, UNIX, has line-end correction as an example
(and is a very useful tool in general, and so worth fetching, for those
who can operate at the command-line).

The stated conditions for UNIX2DOS are unnecessarily limited; it is
*IIRC* distributed with other software, and one can surely get it over
the Net from FTP archives such as Garbo.

It is better not to fully reformat code provided as an example if there
is any prospect of the associated material referring to it in a layout-
dependent manner,

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
I find MiniTrue useful for viewing/searching/altering files, at a DOS prompt;
free, DOS/Win/UNIX, <URL:http://www.idiotsdelight.net/minitrue/> Update hope?
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
13325
by: Berislav Lopac | last post by:
I know how to set Apache to send files with any extension to PHP before sending a response. Is there a way to do so for files with no extension whatsoever? I don't want *all* files to be parsed by PHP, but only those without extension (and, of course, with some selected extensions). Berislav -- If the Internet is a Marx Brothers movie,...
1
5150
by: hokiegal99 | last post by:
This is not really a Python-centric question, however, I am using Python to solve this problem (as of now) so I thought it appropiate to pose the question here. I have some functions that search for files that contain certian strings and if the files found to have these string do not already have a filename extension (such as '.doc' or...
3
2099
by: Mike Meyer | last post by:
I've got a package that includes an extension that has a number of header files in the directory with the extension. They are specified as "depends = " in the Extension class. However, Distutils doesn't seem to do anything with them. If I do an sdist, the include files aren't added to the tarball. If I do a bdist_rpm, the source files get...
6
6638
by: J. Shrimp, Jr. | last post by:
Following code exports tables as text files: For Each tdf In db.TableDefs StrTblName = tdf.Name Me.txtProgName = StrTblName Me.txtProgName.Requery tblAtt = tdf.Attributes moddate = tdf.LastUpdated If Left(StrTblName, 3) <> "tbl" And tblAtt = 0 Then strSQL = "INSERT INTO tmpExport ( Code ) SELECT _
2
1638
by: Kenneth Myhra | last post by:
Hi all, We are trying to make an ISAPI Filter, in .NET by implementing the IHttpModule interface, that will authorize the request for certain binary file types (GET), this is working fine. But we also want it to authorize the upload of binary files (PUT), The problem with the PUT-scenario is that the file is *not* uploaded when its extension...
1
2837
by: Aaron via DotNetMonster.com | last post by:
I am testing for several file types in a directory by creating an array of masks and for each mask in the array, I execute a GetFiles. My issue is that the VB code: myDirectoryInfo.GetFiles("*.asp") is returning not only .asp files, but .aspx files in the directory as well!!! A test from the Windows command line found that the command...
6
2033
by: B | last post by:
Hi, I'm developing a web application where users can upload multiple files to the website. I'm using asp.net 2.0 with FileUpload control and can upload 1 image to the server, but I would like to upload 5 images in total. Can someone help me in writing a VB.NET part on how I can upload these multiple files using the FileUpload control?
13
11608
by: kbperry | last post by:
Hi all, Background: I need some help. I am trying to streamline a process for one of our technical writers. He is using Perforce (version control system), and is constantly changing his word documents, and then converts them to both .pdf and "Web page" format (to publish to the web). He has a licensed copy of Adobe Acrobat Professional...
1
2233
by: nayjdk | last post by:
I have just started converting some AutoCAD (.dwg) files into Autodesk's version of a pdf file which carries a .dwf file extension. I use Access to manage all of my files and have started loading records of each of these files into my database. Each record has a hyperlink that is supposed to open the drawing but when I click on the link...
21
34330
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most obvious of which is the sharing of files. For example, you upload images to a server to share them with other people over the Internet. Perl comes ready...
0
7269
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7394
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7559
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7123
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
4756
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3248
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3237
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1611
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.