Loading...
 
Skip to main content

Features / Usability


Inserting javascript

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

> 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/Question )

> > 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/Question )

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.

> > > 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/Question )
>
> 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.


> 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.comQuestion

>
> > 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.comQuestion

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?

> 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


> 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.


> 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


Here is the javascript I want to use:



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

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.comQuestion