How to use packed js in <head> section so code executes?

M

Mike Scirocco

I've been asked to pack a very simple javascript function that resides
in the <head> section of a page. I have the function working the way I
want, but when I pack it using this packer:

http://joliclic.free.fr/php/javascript-packer/en/index.php

it doesn't execute at all. My procedure:

1. enter javascript code between <script
type='text/javascript>...</script> tags into packer.

2. paste packed code between <script type='text/javascript>...</script>
tags in <head> section of page.

The code won't run. The code looks like this (shortened):

eval(function(p,a,c,k,e,d){e=function(c){return
c.toString(36)};if(!''.replace(/^/,String)){while(c
<snip>
noPop|if|function|var|location|n'.split('|'),0,{}))

Is there something basic that I'm doing wrong?
Mike
 
M

Mike Scirocco

Randy said:
Mike Scirocco said the following on 9/12/2007 9:20 PM:

The eval is part of your problem.


From the looks of it, all the "packer" does (Deans anyway) is remove
whitespace. You probably have a missing ; somewhere. Try JSLint and
JSMin instead.

Randy,

JSLint is very useful, I cleaned up my code and found a way to make it
work.

Thank You,
Mike
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top