Page 1 of 1

Getting JS Into <head>

Posted: Thu Mar 31, 2011 2:14 pm
by dealfiles
Hi all,

I am having a heck of a time getting a javascript call into the <head> section of my template. I have tried using a user created tag, and I have tried a {literal}{/literal} tag, all to no avail.

Here is what I have now:

Code: Select all

{literal}
<__script__ type="text/javascript" src="http://tacomaautorepairshop.com/js_vid/mootools.js"></__script>
<__script__ type="text/javascript" src="http://tacomaautorepairshop.com/js_vid/swfobject.js"></__script>
<__script__ type="text/javascript" src="http://tacomaautorepairshop.com/js_vid/videobox.js"></__script>
<link rel="stylesheet" href="http://tacomaautorepairshop.com/css/videobox.css" type="text/css" media="screen" />
{/literal}
But when I view the page in my browser and view the source code, this is all that's showing up:

Code: Select all

<style type="text/css" media="screen">
    object { outline:none; }
</style>
Hopefully someone can tell me EXACTLY what I'm doing wrong, and PRECISELY how to implement this, because I am not a neophyte when it comes to html and js, but CMS Made Simple really has me stumped.

Thanks in advance for any and all help provided.

Tom

Re: Getting JS Into <head>

Posted: Thu Mar 31, 2011 4:43 pm
by Dr.CSS
When I put the link to those JS files in my browser I get a file not found error, check and make sure all paths are correct...

The only time you need {literal} tags is when you are using something with { } in it...

Re: Getting JS Into <head>

Posted: Thu Mar 31, 2011 5:21 pm
by dealfiles
OK, thanks for the reply... I have fixed the paths so that all the files are accessible, and I have removed the {literal}{/literal} tags, but the code still isn't showing up in "View Source" in my browser.

I am certain I'm still missing something.

Re: Getting JS Into <head>

Posted: Thu Mar 31, 2011 5:44 pm
by Wishbone
Dr.CSS wrote:When I put the link to those JS files in my browser I get a file not found error, check and make sure all paths are correct...
It doesn't make sense to me that the fact that the files are missing would cause it to be removed from the source.

Re: Getting JS Into <head>

Posted: Fri Apr 01, 2011 7:27 am
by M@rtijn
Could it be that you've put those JS calls in different template than the one you are using right now?

Re: Getting JS Into <head>

Posted: Fri Apr 01, 2011 11:35 am
by dealfiles
Color me VERY red... That's exactly the problem. I was putting it into the DEFAULT template, never realizing it wasn't the template for the page I was working on.

Much appreciation for helping me. Many blessings!

Tom

Re: Getting JS Into <head>

Posted: Fri Apr 01, 2011 2:45 pm
by M@rtijn
It happens to the best ;D

Re: Getting JS Into <head>

Posted: Fri Apr 01, 2011 4:14 pm
by Wishbone
I tend to put all common template snippets into non-WYSIWYG GCBs.. so that similar templates have NOTHING in common, except for the GCB calls. Edit the GCB and you have updated all templates that use it. Good catch M@rtijn!