PDA

View Full Version : js including



insei
02 May 2010, 03:52 PM
hi

i downloaded a script and im trying to understand the code, while trying to edit it as i want it. The script inside the php file is included in the body section.

like this:



<body>

<script type="text/javascript">
//<![CDATA[

some functions

//]]>
</script>


when i try to take this code into a separate file and adding it into the head section, the whole thing ONLY works on firefox :S none other browser which is very odd.

what could it be?
and what is that //<![CDATA[ //]]> thingy?

this is the script:
http://www.webmotionuk.co.uk/php-jquery-image-upload-and-crop-v11/

i want the js to be in a separated file but then it wont work on any other browser except for firefox :S

<CrGeary.com/>
02 May 2010, 05:13 PM
CDATA is a sequence of characters from the document character set and may include character entities. User agents should interpret attribute values as follows:

Replace character entities with characters,
Ignore line feeds,
Replace each carriage return or tab with a single space

( Taken from: http://www.w3.org/TR/html4/types.html )

And you have about 25 sets of javascript, which one doesn't work?, I can go round and check them all.