1
jezjones24
Is Javascript a dirty word around here?
  • 2009/2/23 14:33

  • jezjones24

  • Just popping in

  • Posts: 17

  • Since: 2009/2/23


Hi everyone,

I have gone through much of the online (wiki / forum) and offline (PDF) documentation and i cannot find mention of javascript anywhere.

One place i would have expected something was in the module development documentation but nothing.

Maybe i am missing something (would not be the first time), but i would like to know how I would add a JS file to a module (i.e. one that i am developing), and how i would call it to be included in my head section of the page.

Any tips or pointers to which document has it would be much appreciated.

Thanks.

2
ghia
Re: Is Javascript a dirty word around here?
  • 2009/2/23 15:11

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Quote:
i cannot find mention of javascript anywhere.
Did you search for it?

One way is:
include 'header.php';
$xoops_module_header .= '<script src="'.XOOPS_URL.'/some/path/yourscript.js" type="text/javascript"></script>';


3
jezjones24
Re: Is Javascript a dirty word around here?
  • 2009/2/23 15:34

  • jezjones24

  • Just popping in

  • Posts: 17

  • Since: 2009/2/23


Thanks very much although that did not work.
I am guessing that something should be writing out the $xoops_module_header var, but i do not see what, since it is after the inclusion of the header.
I am not seeing the JS tag output to the HTML or the functionality of the JS file showing up in my page.

Also I did search for it!
I am not trying to be critical, only point out that it could be more easy to find.

For instance, i searched on the forum here, and in the PDF;- ModuleBuilding.pdf
Also in the Coding standards documentation, the developer wiki .... really i did search.., perhaps having so many places that need to be searched is why i could not find it.

Is there a single piece of documentation? If not how would i find out whether the info i need is in "Theme anatomy" or "Module Building"????????

In the module building pdf there is seriously no mention of javascript atall, yet that is what i would expect to be doing if i was writing javascript, don't you agree?


4
ghia
Re: Is Javascript a dirty word around here?
  • 2009/2/23 15:51

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Add <{$xoops_module_header}> to your theme.html in the head section.

Most module articles concentrate on php. Check out some working modules and search for .js .

5
jezjones24
Re: Is Javascript a dirty word around here?
  • 2009/2/23 15:53

  • jezjones24

  • Just popping in

  • Posts: 17

  • Since: 2009/2/23


Many thanks, your help is much appreciated... i will take a look at the theme stuff.

Login

Who's Online

133 user(s) are online (83 user(s) are browsing Support Forums)


Members: 0


Guests: 133


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits