Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-08-12 23:03:01

healcode
New Member
Registered: 2011-08-12
Posts: 1

How do I insert JavaScript onto a Textpattern site?

I’ve tried inserting it via the HTML section, but it won’t allow for that. The code is as follows:

<script type=“text/javascript”> // Healcode Schedules for Moksha Yoga Calgary West : MYCW Schedule id = “rq877m16m”; name = “schedules”; document.write(unescape(“%3Cscript src=‘https://healcode.com/javascripts/hc_widget.js’ type=‘text/javascript’%3E%3C/script%3E”));
</script>
<noscript>Please enable Javascript in order to get <a href=“http://healcode.com” target=”_blank”>HealCode</a> functionality</noscript>

When placed on the backend of the site it should render a schedule, but it does not do anything as the code isn’t being read.

Offline

#2 2011-08-12 23:16:32

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 596
Website

Re: How do I insert JavaScript onto a Textpattern site?

I’ve tried inserting it via the HTML section, but it won’t allow for that.

Edit: Oh, nevermind, can you paste your HTML at pastebin.com and share the link here?

Last edited by maruchan (2011-08-12 23:21:04)

Offline

#3 2011-08-12 23:24:24

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: How do I insert JavaScript onto a Textpattern site?

Try adding notextile.. before your javascript code if you are placing it in an article. Like this:

notextile.. <script type="text/javascript"> // Healcode Schedules for Moksha Yoga Calgary West : MYCW Schedule id = "rq877m16m"; name = "schedules"; document.write(unescape("%3Cscript src='https://healcode.com/javascripts/hc_widget.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<noscript>Please enable Javascript in order to get <a href="http://healcode.com" target="_blank">HealCode</a> functionality</noscript>

To start a paragraph after notextile you have to use a p.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#4 2011-08-13 00:13:48

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,477

Re: How do I insert JavaScript onto a Textpattern site?

Did you use a code editor? Because, your quotes are typographical quotes.

Offline

#5 2011-08-13 00:35:25

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: How do I insert JavaScript onto a Textpattern site?

GugUser wrote:

Did you use a code editor? Because, your quotes are typographical quotes.

Quotes on the post are from Textile. In the original code, which you can see by quoting healcode’s post, quotes are just fine.

Offline

#6 2011-08-13 00:52:45

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,477

Re: How do I insert JavaScript onto a Textpattern site?

Ah, yes … Thanks for the tip.

Offline

Board footer

Powered by FluxBB