The main things are the missing semicolons at the end of each command.

var x = 0;
do_something();
container.fn = function() { do_something(); };

You don't need semicolons at the end of conditional blocks:

if (condition) { do_something(); }
while(condition) { do_something(); }

Or at the end of try/catch:

try { do_something(); }
catch(e) { do_somethingelse(); }

What I've done is, pack the files with Dean.Edwards packer, and then test the script on a page with Firebug. The console is extremely helpful for identifying the offending code and it will say exacly what is wrong (e.g. "missing ;") and show you exactly where the problem is in the code, even if your code is only 1 line long (no linefeeds).

JK
----- Original Message ----- From: "Brook Davies" <[EMAIL PROTECTED]>
To: <jquery-en@googlegroups.com>
Sent: Wednesday, October 03, 2007 10:06 AM
Subject: [jQuery] RED: [jQuery] Re: Packed version of BlockUI?




On this topic, what are the rules to write JS that will pack without error?
I know you need a ";" at the end of every line, but what else?

BrookD



-----Original Message-----
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Rey Bango
Sent: October 3, 2007 8:15 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Packed version of BlockUI?


Andy,

Just take the code and drop it into Dean Edward's Packer or YUI compressor.

Rey

Andy Matthews wrote:
I'm in need of a simple page overlay, which I'll be using to display
help messages. I found BlockUI, but it's 15k. Is there a packed version
of it, or a simpler version that just allows for a page overlay?

*
____________________________________

Andy Matthews
*Senior ColdFusion Developer

Office:  877.707.5467 x747
Direct:  615.627.9747
Fax:  615.467.6249
[EMAIL PROTECTED]
www.dealerskins.com <http://www.dealerskins.com/>





Reply via email to