You can add inline JavaScript using the wp_head action like so:
add_action('wp_head','zoho');
function zoho() {
$output="<script type="text/javascript">
var $ZC = jQuery.noConflict();
var trackingText="ZCFORMVIEW';
$ZC(document).ready( function($) {
$ZC("#zc_trackCode").val(trackingText);
$ZC("#fieldBorder").val($ZC([changeItem='SIGNUP_FORM_FIELD']").css("border-color"));
_setOptin(false,function(th){
/*Before submit, if you want to trigger your event, "include your code here"*/
});
/*Load Captcha For this*/
loadCaptcha('https://campaigns.zoho.com/campaigns/CaptchaVerify.zc?mode=generate');
/*Tracking Enabled*/
trackSignupEvent(trackingText);
});
</script>';
echo $output;
}
You’d have to properly escape your strings to make this work though.
Related Posts:
- Adding javascript to child theme
- Loading different JS for http and https
- What is the “proper” way to generate a javascript variable depending on a custom field value?
- get_header() in backend – but keep JavaScript and CSS files
- adding script tag in head of specific pages
- WOW.js Script Tag Initialization Header/Footer
- PHP or JS for header image rotator?
- Javascript not working on index.php but it is working on single post’s page
- Check if a string has a certain piece of text [duplicate]
- How to convert a string to an integer in JavaScript?
- How do I make the first letter of a string uppercase in JavaScript?
- window.location.href and window.open () methods in JavaScript
- Define a global variable in a JavaScript function
- Can’t bind to ‘ngModel’ since it isn’t a known property of ‘input’
- Cross-Origin Read Blocking (CORB)
- How to create an associative array in JavaScript literal notation
- Include another HTML file in a HTML file
- Cannot open local file – Chrome: Not allowed to load local resource
- How to read a local text file?
- Compare dates with javascript
- Javascript Uncaught SyntaxError: Unexpected identifier
- “document.getElementByClass is not a function”
- How can I create a two dimensional array in JavaScript?
- How can I refresh a page with jQuery?
- forEach is not a function error with JavaScript array
- Short circuit Array.forEach like calling break
- Bootstrap Dropdown menu is not working
- String.prototype.replaceAll() not working
- What does the className attribute mean in JSX?
- How do I check for null values in JavaScript?
- How do I format date in jQuery datetimepicker?
- Express Render not working return error: No default engine was specified and no extension was provided
- Remove Object from Array using JavaScript
- Angular4 – No value accessor for form control
- What is the difference between ( for… in ) and ( for… of ) statements?
- TypeError: Cannot read property “0” from undefined
- How to use npm jquery module?
- Jquery swipe left or right on mobile
- NodeJs : TypeError: require(…) is not a function
- Sort array by firstname (alphabetically) in Javascript
- Sorting arrays in javascript by object key value
- How do I get an element to scroll into view, using jQuery?
- Uncaught SyntaxError: Unexpected token :
- How do I check if string contains substring? [duplicate]
- Objects are not valid as a React child. If you meant to render a collection of children, use an array instead
- Error: ENOENT: no such file or directory, stat ‘/public/main.html’ at Error (native)
- JavaScript – cannot set property of undefined
- How does AJAX work?
- How to remove all duplicates from an array of objects?
- Finding the average of an array using JS
- Creating a div element in jQuery
- e.target.value on an input field ReactJs, how does it work?
- How do you convert a JavaScript date to UTC?
- Force div to be topmost element of any and all webpages
- moving an element in JS
- Why is jquery show() not working in example
- console.log showing contents of array object
- How can I use jQuery to run MySQL queries?
- Using setTimeout on promise chain
- Regular Expression to reformat a US phone number in Javascript
- One liner to flatten nested object
- Positioning element at center of screen
- Get hours difference between two dates in Moment Js
- JQuery Number Formatting
- How to add jQuery in JS file
- Get query string parameters url values with jQuery / Javascript (querystring)
- Add JavaScript object to JavaScript object
- “Uncaught TypeError: Illegal invocation” in Chrome
- trying to enqueue script in wordpress
- Check user logged in with JS
- Does javascript have an equivalent to PHP’s preg_replace_callback?
- WP REST – video and audio players
- Inserting ads within content
- Theme Customiser not live previewing changes on pseudo elements
- Instantiate TinyMCE via JS ( rather than PHP/wp_editor )
- Move all the JS files to the bottom|footer, the right way
- the Customizer – proper way to instantiate an image upload control via javascript
- How to handle Gutenberg wp.data async errors?
- How do I access site and block editor state data and use `useSelect()` or `withSelect()` to bind it to my components?
- wp_enqueue_scripts is not working in my plugin
- How can I use CKEditor with WordPress and let clients edit the content?
- Google PageSpeed Enable Compression isn’t working?
- How can I add Javascript in the header of all post pages and only post pages
- esc_js() breaks unicode sequences by removing the slash ‘\’ character
- wp_enqueue_script not loading my custom js file
- Gutenberg getBlockIndex in save() function
- Widgets and Post/Page edit/new blank, console errors only, no server errors
- Custom JS text area in customizer is being formatted wrong in document
- Add captcha validation to my custom form for Frontend posting
- AddThis Sharing Bar Not Displaying on Custom Page Template – JS conflict?
- how to prevent added meta box from being injected with style=”position: fixed; top: 56px;” at scroll down
- Add JavaScript-Library “Fitty” to WordPress
- Access checks with custom REST endpoints and backbone
- How to use value from modal tinymce windowManager?
- early enqueueing javascript file in page template, not in functions.php
- Wysiwyg editor not working on 4.2.2
- jQuery + more won’t load in header
- Cannot get custom javascript to execute on page
- JavaScript errors
- Uncaught SyntaxError: missing ) after argument list [duplicate]