squishing javascript
- Started
- Last post
- 6 Responses
- elwolverton
OK, I got this here javascript code:
http://www.csun.edu/~wolvert/oveā¦
I need-ta make it fit in:
- 1 line (no breaks), and
- the body, rather than head, of a documentCan it be done?! bum Bum BUM!!
- elwolverton0
ummmmmmmm, does this mean no?
- jgjh1510
can't u do all that in the head and put it in a var or function. then write the var into the body tag? Then u don't have to put all that on one line.
just an idea
- elwolverton0
Unfortunately, I don't have the liberty of choosing where and what to do with this script.
I am fitting it into a field on an automated form that will not allow me to edit the head of the document. So I gotta put it in the body somewhere, and the edit field is just one big long line. Icky, huh.
- elwolverton0
bumpety bump
? alguien ?
- meph5040
if all your lines are terminated by a semicolon I don't see why you can't put it all on one line, and java script doesn't care if it is in the body or the head as long as the function call is after the functions def.
I would personally suggest putting it into a .js file then import it where you need it, that way the code can be edited later with out it being a nightmare.
- elwolverton0
ah yes. if I were to make it a .js file, how would i call upon that file from the html doc?