Home › Forums › Weaver Xtreme Theme › Script
- This topic has 16 replies, 3 voices, and was last updated 10 years, 1 month ago by
Weaver.
-
AuthorPosts
-
August 28, 2016 at 21:57 UTC - Views: 1 #19520
merlojh
ParticipantI need to put some <script type=”text/javascript” language=”JavaScript“> to make the form work on this page http://www.inspirepossibility.com/wordpress/self-assessment-test/ the script is quit long is this possible if so where would I place it?
August 28, 2016 at 22:00 UTC - Views: 8 #30583scrambler
ModeratorIf it is only for a single page, you can put the script in a page custom filed named header. If you are not familiar with page custom field, read below
If it is for more than one page, you can put it in Advanced options > Head Section
August 28, 2016 at 23:21 UTC - Views: 1 #30584merlojh
ParticipantI went to the the area called custom filed and put in header but what would I use for a value?
August 28, 2016 at 23:33 UTC - Views: 1 #30585scrambler
ModeratorDid you read the thread on custom field I referenced?
You put your content (in this case your script) in the value box of the custom field that you create.
To make sure you are creating the custom Field properly, also add some text in there. Like that if the text shows, you will know the custom field was created properly.
You can then edit the custom field and remove the text.For example
TEST TEXT TEST TEXT TEST TEXT <script….>……</script>
August 28, 2016 at 23:49 UTC - Views: 1 #30586merlojh
ParticipantI put the script into the value area but form does not work. There may be a script for the body area where would I put this?
August 29, 2016 at 00:02 UTC - Views: 1 #30587scrambler
ModeratorThe header HTML Insertion area is the best place for any HTML using the script within the page. So if it does not work, you did something wrong with the custom field.
Did you do what I said, and add both text AND the script in the header to first make sure you created the custom Field properly?
If not, please do so and post back so I can see it.
To test the script, you can also place the script in the content of the page itself before the form. Just make sure you switch your content editor to TEXT mode and that you check the options “Allow Raw HTML And Script”August 29, 2016 at 01:02 UTC - Views: 1 #30588Weaver
KeymasterJavascript can be VERY tricky to add properly. There are normally TWO components to any JavaScripts.
1. The script itself – usually a file accessed by a <link>, or actual script inside <script>….</script>.
2. The code in the content HTML that uses that script – often a <form> or <input> or a special class name for a <div> or similar.
If a <link> to a file is used, that should be in the <head> section – via the appropriate insertion area.
If it is an actual inline <script>, that can actually go anywhere – like right inline with the HTML content and whatever HTML that uses that script.If you get anything wrong – even one tiny typo or wrong name, it is almost certain that nothing works.
This forum is not intended to teach people how to program in JavaScript, or debug issues you might have using some canned JavaScript. But we can tell you where and how to add scripts assuming you really understand what you are trying to do with that script.
August 29, 2016 at 01:45 UTC - Views: 1 #30589merlojh
ParticipantI am a little confused you said put the java script into a custom field area which I did here http://www.inspirepossibility.com/wordpress/wp-admin/post.php?post=684&action=edit in the custom field area pasted the code into the value area. The custom field I made is called header.
August 29, 2016 at 03:45 UTC - Views: 1 #30590scrambler
ModeratorWould you please pay attention to what I am saying….
I asked you to put both some text AND the script in the value box of the custom field, so I could see if you created it properly (the text would show in the header HTML Insertion area)
Your linked page http://www.inspirepossibility.com/wordpress/self-assessment-test/
Still does not show any text, so either you did not do what I asked, or you created the custom filed wrong, and you need to re read the thread I gave you.August 29, 2016 at 19:25 UTC - Views: 15 #30591Weaver
KeymasterSorry to step in here, but what I said about how scripts work is very relevant here.
First, the proper field to use for adding the script is page-head-code and not header. But that shouldn’t matter unless you are using <link> to add the script.
See the help file:
For even more advanced control on a per page basis, Weaver will recognize other options that you must manually define in the Edit Page Custom Fields box. These options match equivalent global settings found on the Advanced Options tab, but apply on a per page basis.Define page-head-code, and the value contents will be added to the <HEAD> section. This will be inserted into the <HEAD> Section after the settings in the global <HEAD> Section on the Advanced Options tab. You can include specific CSS rules here, but you must wrap them in a <style>…</style> block.Perhaps instead of focusing on getting the script loaded for a single page, it would be more productive to just get the script loaded using the more typical site-wide method of adding the script to the general Advanced Options -> <HEAD> Section box. That will load the script for every page, but that shouldn’t matter. It will then let you test the script on any page or post. Then you can move that to the per page page-head-code custom field for the pages you want to use it on.
August 29, 2016 at 19:47 UTC - Views: 3 #30592scrambler
ModeratorGood to know there is an actual technical limitation between page-head-code and header
If using page-head-code custom field, please still add some text at first with the script, so it will show in the page and confirm the custom field was created properly.August 29, 2016 at 22:28 UTC - Views: 1 #30593merlojh
ParticipantI pasted the script in the advanced options <HEAD> section I also have this plugin installed Weaver Xtreme Theme Support plugin I just pasted the java code right into the HEAD section <script type=”text/javascript” language=”JavaScript”> this is just the top part of the code it is really long. i also tried it in the custom field area and added test test test like you said but where is that going to show up?
August 29, 2016 at 22:39 UTC - Views: 1 #30594merlojh
ParticipantWell I did check the page and TEST TEST TEST TEST TEST TEST shows up at the top of the page but the self assessment test still does not work it should give me a score at the bottom http://www.inspirepossibility.com/wordpress/self-assessment-test/??
August 29, 2016 at 23:34 UTC - Views: 1 #30595scrambler
ModeratorOK, so we know the custom field is created properly, so you can remove the text.
Also it appears to work but only partially, calculating the score does not work, but the reset button does clear the selected answers.
So you are going to have and debug the script with whoever provided it.
If the script is not too long, you may want to paste the full content of the custom field here so we can check if there are any obvious issue, like the fact that if using jQuery instruction like $(…) they should be replaced by jQuery(….)
August 29, 2016 at 23:43 UTC - Views: 1 #30596Weaver
KeymasterI don’t see anything obviously wrong, but this is beyond the help we can provide here.
I suggest that you go back to the source of this quiz and ask THEM what might be going wrong. After all, they created the fairly complex script and form, and they should know how it works. We are now beyond the point of this being theme related any more.
August 30, 2016 at 04:28 UTC - Views: 1 #30597merlojh
ParticipantThanks for your help I figured that would be the case.
-
AuthorPosts
- You must be logged in to reply to this topic.

