473,410 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

.js file garbled and unreadable(yet it works!)

Hi,

I need to remove some items from a Javascript drop down menu coded by
someone else. The menu is contained within a single .js file. I'm not
very fluent in javascript, but I know what it looks like and can usually
edit pre-existing code effectively.

When I open this particular .js file in either Dreamweaver (MX) or
notepad, even if I rename the extension, the code has no line breaks and
the part of it that writes the menu's html is full of squares, making it
very difficult to wade into and take out the parts I need to remove. For
example, I can't tell where one menu item stops and another one starts.
However, it still seems to work on the web site, despite all these funky
characters.

Is there a utility or editor that can properly format or parse a large
chunk of Javascript code like this:

!Partners
125px;+177px Partnersfrmt
125px;+177px EFEFEF;border-%8 4&8 4(8 4bottom:8 4 solid 
$%0px;(0px;)127;+24;>;14;normal;norma l3F3F3F-.
EFEFEF#29_ _/partners/index.aspself9px;(5px;)105px;+
14-4;%0px$Overview%0px;(22px;)127;+
24;>;14;normal;normal3F3F3F-. EFEFEF#30_
_/microsoftself9px;(5px;)105px;+14-4;%0px$Microsoft%
0px;(44px;)127;+24;>;14;normal;normal 3F3F3F-. EFEFEF#
31_ _/partners/featured/index.aspself9px;(5px;)105px;+14-
4;%0px$Featured partner%0px;(66px;)127;+
24;>;14;normal;normal3F3F3F-. EFEFEF#32_
_/partners/services.aspself9px;(5px;)105px;+14-4;%0px
$Services%0px;(86;)127;+24;>;14;norm al;normal3F3F3F-
. EFEFEF#33_ _/partners/reseller.aspself9px;(5px;)
105px;+14-4;%0px$Reseller%0px;(110px;)127;+
24;>;14;normal;normal3F3F3F-. EFEFEF#34_
_/partners/business.aspself9px;(5px;)105px;+14-4;%0px
$Business%0px;(132px;)127;+
24;>;14;normal;normal3F3F3F-. EFEFEF#35_
_/partners/technology.aspself9px;(5px;)105px;+14-4;%0px
$Technology%0px;(154px;)127;+
24;>;14;normal;normal3F3F3F-. EFEFEF#36_
_/contact/contact_partners.aspself9px;(5px;)105px;+14-4;%
0px$Contact!
It's much much longer than that, but you get the idea.

What's up?

Thanks.
Jul 23 '05 #1
4 2929
Ivo
"Byron" said
I need to remove some items from a Javascript drop down menu coded
by someone else. <snip> the code has no line breaks and
the part of it that writes the menu's html is full of squares, making it
very difficult to wade into and take out the parts I need to remove. For
example, I can't tell where one menu item stops and another one starts.
However, it still seems to work on the web site, despite all these funky
characters.

$Technology%0px;(154px;)127;+
24;>;14;normal;normal3F3F3F-. EFEFEF#36_
_/contact/contact_partners.aspself9px;(5px;)105px;+14-4;%
0px$Contact!

It's much much longer than that, but you get the idea.
What's up?


The original author was probably working on a different platform than you
are. His or her linebreaks and who knows what other characters render as
those funky squares when viewed on your system. IIRC this happens when
translating from Linux to Windows. See if you can find out the name of the
menuwriting function, then load a page which uses it into your browser, and
type in the addressbar:

javascript: document.open( 'text/plain' ); document.write( functionname );

That should give the complete code, correctly encoded for your system.

hth - if not, can you post the url to the .js file here?
ivo
http://4umi.com/web/javascript/

Jul 23 '05 #2
In article <42***********************@news.wanadoo.nl>, no@thank.you
says...
"Byron" said
<snip>
$Technology%0px;(154px;)127;+
24;>;14;normal;normal3F3F3F-. EFEFEF#36_
_/contact/contact_partners.aspself9px;(5px;)105px;+14-4;%
0px$Contact!

It's much much longer than that, but you get the idea.
What's up?


The original author was probably working on a different platform than you
are. His or her linebreaks and who knows what other characters render as
those funky squares when viewed on your system. IIRC this happens when
translating from Linux to Windows. See if you can find out the name of the
menuwriting function, then load a page which uses it into your browser, and
type in the addressbar:
javascript: document.open( 'text/plain' ); document.write( functionname );
That should give the complete code, correctly encoded for your system.
hth - if not, can you post the url to the .js file here?
ivo
http://4umi.com/web/javascript/

Thanks ivo. That partially helped, but there's so much within the .js
file that I need to reformat, that the command you gave me only helped
with a fraction of it. It looks like its divided into many functions and
subfunctions. Anyway to run a command like that on an entire js file?
Jul 23 '05 #3
JRS: In article <MP************************@newshost.allthenewsgro ups.c
om>, dated Thu, 7 Jul 2005 14:18:21, seen in news:comp.lang.javascript,
Byron <sp*******@dorrk.com> posted :

Thanks ivo. That partially helped, but there's so much within the .js
file that I need to reformat, that the command you gave me only helped
with a fraction of it. It looks like its divided into many functions and
subfunctions. Anyway to run a command like that on an entire js file?


Try opening the .js file in better editors; if it looks OK, save it,
perhaps after making an unimportant change to "dirty" it.
Otherwise, run it through, for example, MiniTrue; example 14 of the Help
should do what is needed.

--
© 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
Byron wrote:
[...] Anyway to run a command like that on an entire js file?


Use an editor capable of handling UNIX line breaks, like Metapad or
any Eclipse plugin. Even Microsoft Wordpad can be used to read such
text files.
PointedEars
--
#define QUESTION ((bb) || !(bb))
// William Shakespeare (if he would have been a hacker ;-))
Jul 23 '05 #5

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

Similar topics

5
by: Brandon Walters | last post by:
I wrote a file download module for my website. The reason for the file download module is that my website downloads work on a credit based system. So I need to keep track of and limit daily...
8
by: Peter Abel | last post by:
Hi all, I'm working under W2k with Python 2.2.2 (#37, Oct 14 2002, 17:02:34) on win32 I have a file *test_data.txt* with the following content: 0123456789 0123456789 abcdefghi...
2
by: Frostillicus | last post by:
I'm trying to get an ASP to return a zip file to the remote browser from an Image (BLOB) field in SQL Server 2000 but Internet Explorer keeps saying: Cannot open C:\Documents and...
1
by: Moi | last post by:
I have tried repeatedly to import a MS Works database (simple address database) into Access, but I am having little luck. I have saved the Works file as DbaseIII DbaseIV and neither is seen by the...
3
by: I_AM_DON_AND_YOU? | last post by:
In my program I am using the notepad file to read/write data. I don't want that someone should be able to delete/change the contents of that file by opening that file in Notepad or other editor. ...
3
by: mo | last post by:
I have an application that uses Reporting Services. When the user chooses to print a report, they are taken to a window that allows them to fill in parameters for the report. They then click a...
0
by: Jordan | last post by:
Hi. Hoping I can get some advice... I have an XML format Word document stored on the server. When I open it from the server, it opens fine in Word. When I attach it to an email, and send it to a...
1
by: Alex Chun | last post by:
I have an Access database -- a .mdb file -- on a server on our network. When the file is in use -- i.e. there is an associated .ldb file -- I cannot open the database by double-clicking its icon;...
2
by: ChristianBurn | last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8"...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.