How do I add javascript?

  • 1
  • Problem
  • Updated 6 years ago
  • Acknowledged
How do I add javascript? I tried typing some JS in HTML editor & doesn't work.
My site
Photo of Ken

Ken

  • 12 Posts
  • 0 Reply Likes
  • undecided

Posted 9 years ago

  • 1
Photo of Emmy

Emmy

  • 5892 Posts
  • 299 Reply Likes
Hello Ken,

You can paste snippets of Java Script code into the HTML Widget, does the code possibly need something in the Head section of the page? If you would like to tell me what the code is for and what the instructions say for implementing it, and paste it in here I will try it on a test site and see how it functions.

If you paste it in here please wrap it in <!-- at the beginning and --> at the end, this will make it possible for us to see if on the page.

Kind Regards,
Emmy
Photo of Ken

Ken

  • 12 Posts
  • 0 Reply Likes
Thanks Emmy,

The code is below. The whole thing is in the body.



Name:
E-mail address:
Alternative e-mail address (if available):



Item
Price
Select

Practice MCAT Test I - Answers (89 KB, 22 pages)
U.S. $5.00

Practice MCAT Test II - Answers (127 KB, 32 pages)
U.S. $5.00

Preparation for MCAT Verbal Reasoning - Answers (51 KB, 9 pages)
U.S. $6.00

Skilled Reading for Standardized Tests - full version (630KB)
U.S. $5.00

Flashcards for MCAT Org. Chem. Rxns. - full version (1.77MB)
U.S. $5.00



Currency 
U.S.

Canadian Dollar

Australian Dollar
Total in USD: $
Please send:

Ken
my site






Photo of Ken

Ken

  • 12 Posts
  • 0 Reply Likes
Sorry, the JS is below.
Ken My site
Photo of Monique

Monique, VP of Customer Support

  • 6294 Posts
  • 446 Reply Likes
You should be able to add that code by dragging an HTML widget onto your page and pasting the code. Let us know if this doesn't work for you.
Photo of Ken

Ken

  • 12 Posts
  • 0 Reply Likes
Hi Monique,

When I tried that on this page, I get error msg "oops, error in javascript ...".

Thanks.

Ken
My site
Photo of Ken

Ken

  • 12 Posts
  • 0 Reply Likes
Hi Monique,

Do you need more info?

Ken
site
Photo of Emmy

Emmy

  • 5892 Posts
  • 299 Reply Likes
Hi Ken,
Monique is currently offline so I can assist. That code is working as it should, I have tested it on a test site and this is what it produces for me:


Can you try again, make sure that you copy the entire portion of code into the HTML Widget. If it does not work, can you leave the code on the page and Save and Update, then give us a URL so that we can take a look.

Thanks,
Emmy
Photo of David Farmer

David Farmer

  • 2 Posts
  • 0 Reply Likes
Well, I tried the same things as Ken did and I am getting that same error message. What can I do? Should I just copy and paste the code here as well?
Photo of Ken

Ken

  • 12 Posts
  • 0 Reply Likes
Hi Emmy,

After re-pasting the code it now works. Thank you.

Another question I have is the HTML editor tends to put code all on one line. How can I prevent this?

Ken
site
Photo of Jun Sanchez

Jun Sanchez

  • 2 Posts
  • 0 Reply Likes
is there something wrong with yola builder now? seems i cant save anymore script to html widget..
Photo of Jun Sanchez

Jun Sanchez

  • 2 Posts
  • 0 Reply Likes
text "Sorry, somethings went wrong" appeared with rounded red background
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
Try again in a little while Jun
Photo of Stefan

Stefan, Official Rep

  • 4448 Posts
  • 190 Reply Likes
Hello Jun

Please log out of your Yola account, clear your browser's cache and cookies or use a different browser, log in again and retry. If it is still not working, could you please provide the code you want to add on this thread, so that we will be able to check it in your Yola Sitebuilder? Please let us know on which website and on which page you were trying to add it.