HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


about java script

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#60647 (In Topic #13167)
Avatar

Well-settled

I need a little help … im tryng to insert a java script in a comcode page, but im a little confused…
I have try in many different form and never was the right one!
where i upload the "source files", in which directory? how i put the code?? between the semihtml ?and the part that i must put in the head?
sorry, are many questions…
thanks very much to all!!!
Back to the top
 
Posted
Rating:
#60648
Avatar

Community saint

HEADER.tpl is where you can find the

Code

<head>.....</head>
tag.

That's where you enter the javascript code that needs to be there.

Your *.js files should be placed in the directory of the page that is calling the script… which you are correct with the

Code

[semihtml].....[/semihtml]
tag.



If you share what javascripting you're trying to add, maybe someone can help you further with more detailed instructions. :thumbs:

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#60650
Avatar

Well-settled

Thanks Eric!
here share the script.
I was tryng to do it as u too write, but by the moment nothing! the script is a menu that i want insert in a new page that i have created, named :catnat
so i upload the script for u take a look!
Attachment
menujs zipped
» Download: menujs.zip (33 Kb, 132 downloads so far)

lol!
Back to the top
 
Posted
Rating:
#60651
Avatar

Well-settled

and i have put it as the follow
header

Code

<script type="text/javascript" src="stmenu.js"></script>


body

Code

[semihtml][title]Naturopatía[/title]
<script type="text/javascript" src="../menujs/menujs.js"></script>
[block]main_comcode_page_children[/block]
[/semihtml]
Back to the top
 
Posted
Rating:
#60701
Avatar

Well-settled

any help? thanks!!!!!
Back to the top
 
Posted
Rating:
#60702
Avatar

Make sure the paths are correct for those files, relative to what you're viewing. It's generally not a good idea to use relative links, especially if short URL's are enabled. I'd do like…

Code

<script type="text/javascript" src="{$BASE_URL*}/stmenu.js"></script>
and then have the file in the ocPortal root directory.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#60706
Avatar

Well-settled

thanks very much Chris! i try it !!!!
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: