[Solved] JavaScript is Not Working When I Put It Directly Into Template HTML


#1

Hello. Can somebody help me. Then i put this code

<script type="text/javascript">

document.write(unescape('%3C%61%20%68%72%65%66%3D%22%68%74%74%70%3A%2F%2F%6C%65%69%73%74%6F%6E%65%2E%62%6C%6F%67%73%70%6F%74%2E%63%6F%6D%2F%22%20%74%61%72%67%65%74%3D%22%5F%62%6C%61%6E%6B%22%3E%53%68%61%62%6C%6F%6E%20%70%65%72%65%76%65%6C%20%44%61%6E%74%65%3C%2F%61%3E%3C%2F%64%69%76%3E'));
//-->
</script>

in HTML/Javascript it works fine, but then i put it on Teplate - Edit HTML before or after </head> it dosn’t work. Can anybody tell me what i doing wrong?


#2

Did you got any error while saving this script? If no, try to put this script above </head> because the scripts which work inside <body> section always work if putted on <head> section but the scripts which work inside <head> section probably not work in <body> section.


#3

Try to add your javascript in the following way:

    <script type='text/javascript'>
//<![CDATA[   /*Paste Your Code Here*/    //]]> </script>

#4

Thanks. i don’t know, what was the problem but the code is already work.