Loading...
 
Features / Usability

Features / Usability


Inserting javascript

posts: 102
Someone sent me a javascript program to use on my site. Is there any way for me to insert it?
posts: 102

> > Someone sent me a javascript program to use on my site. Is there any way for me to insert it?
>
> yup, use JS wiki plugin ( see http://mods.tikiwiki.org/ )

Thanks. I'll have to hand-install it tonight. For some reason, I get errors when I try doing it using the Mods Admin page.

posts: 102

> > > Someone sent me a javascript program to use on my site. Is there any way for me to insert it?
> >
> > yup, use JS wiki plugin ( see http://mods.tikiwiki.org/ )
>
> Thanks. I'll have to hand-install it tonight. For some reason, I get errors when I try doing it using the Mods Admin page.

Okay, I think I have it installed but how do you use it. There's no instructions or anything.

posts: 4656 Japan


> Okay, I think I have it installed but how do you use it. There's no instructions or anything.

See PluginJS (search is your friend ;-) ). Looks like you can either enclose the javascript itself with the plugin (as data) or point to the location of the js file (as a parameter).

-- Gary - zukakakina.com

posts: 102

>
> > Okay, I think I have it installed but how do you use it. There's no instructions or anything.
>
> See PluginJS (search is your friend ;-) ). Looks like you can either enclose the javascript itself with the plugin (as data) or point to the location of the js file (as a parameter).
>
> — Gary - zukakakina.com

Be nice if the instructions were clearer....

I tried one and got this error:

WARNING: No such module JS!

How can I tell if this module is installed and if it isn't, how can I install it?

posts: 4656 Japan

> How can I tell if this module is installed and if it isn't, how can I install it?

That error message indicates that the module isn't installed. But the JS plugin doesn't use a module. You simply put the plugin syntax in the page, as shown in the examples on the PluginJS page — either point to the javascript file or enclose the complete script within the plugin itself.

This plugin only works for scripts that don't have a component that goes in the head section of the web page. If the script you were given can go in the body if the page and no part needs to go in the head section, then the plugin should work. Otherwise, you have to edit the header.tpl file.

-- Gary


posts: 102

> Someone sent me a javascript program to use on my site. Is there any way for me to insert it?

I did just insert what it said with the appropriate changes and I stil get that error.


posts: 4656 Japan

> Someone sent me a javascript program to use on my site. Is there any way for me to insert it?

Can you be more specific? What javascript is involved? What does you complete plugin code look like, with the javascript? Please post it or give a link. Without knowing the specific details, it's hard to know what might be going wrong.

-- Gary


posts: 102

Here is the javascript I want to use:



var ebayscroll = {
query: 'Michael Ironside',
width: 300,
height: 250
}

posts: 4656 Japan

Putting that it the JS plugin produces this in the page
(Javascript angle brackets replaced here with parentheses for viewing purposes):

Copy to clipboard
(script type="text/javascript")var ebayscroll = { query: 'Michael Ironside', width: 300, height: 250 }(/script)


When I tested it, the page displays without errors (note that no module is involved, the JS plugin goes directly in the wiki page, and the javascript is its data). But it doesn't do anything, either. It only specifies a variable; there's no statement/command. The problem here doesn't seem to be Tiki. Trying your javascript in an ordinary HTML page would probably have the same result.

-- Gary - zukakakina.com


Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting