A client side scripting language useful for making interactive web sites

learn more… | top users | synonyms

0
votes
0answers
5 views

How to use the below javascript code in wordpress website?

How to use the below javascript code in wordpress website (Avada theme running)? <script type="text/javascript"> function isNum(args) { args = args.toString(); if (args.length == 0) return ...
0
votes
1answer
21 views

Custom Javascript not working?

Basically I want the effect to look as it does here But mine won't do the effect I currently have a button but it won't activate the effect for the menu to pop open. site that I'm using to test it ...
0
votes
0answers
14 views

How to use plugin only for specifict page template

I installed welcome message for wordpress like text which is fading out after some seconds automatically and it has no option to set it only on a main page. I'm interesed is there a way to use this ...
0
votes
0answers
7 views

How to run onclick in text editor? (Follow-up question)

This is a follow up question from How to wp_enqueue_script with html? I have html tags with onclick. I place it on a page, but the divs with onlick are not properly working. How to fix this? Here's ...
4
votes
1answer
52 views

Keyboard shortcut for updating a page or post?

What is the keyboard shortcut key for updating a page or post? It could save me a lot of time as rolling down a page draft is time consuming.
0
votes
0answers
25 views

Toggle Visibility of Separate Javascript Files on Same Wordpress Page

Let me preface by saying my knowledge of JS is lacking at best and the concept of installing/loading/enqueueing a function on one area of the site and then calling that function in another area of the ...
0
votes
1answer
66 views

Enqueueing a script and a style sheet not working

I am trying to enqueue both a child theme style sheet and a child theme script. I need to enqueue the script because I put CDN links in there for Bootstrap. I know my enqueue isn't working correctly ...
0
votes
1answer
32 views

Is there a way to enable Cross-Origin Resource Sharing for WordPress' ajaxurl?

WordPress already has a default URL for jQuery-WordPress application calls and it's well known as the ajaxurl. However, there are cases wherein one would need to enable Cross-Origin Resource Sharing ...
0
votes
0answers
8 views

openbtn.addEventListener is not a function?

Someone has helped me with this script in Codepen where it worked fine, until i tried to implement it into my Wordpress website. The two sets of grey dots are buttons. Each button will open it's own ...
0
votes
1answer
22 views

How to get this jQuary script working?

I've searched for it, but I just getting more confused. I want to use this script to show a menubar after scrolling down 200px: ...
0
votes
0answers
24 views

After wordpress widget save (ajax call) tinymce editor gone, data not saved

I have made tinymce editor for textarea fields in widgets. I'm enquing scripts: wp_enqueue_script('tinymce', home_url() . '/wp-includes/js/tinymce/tinymce.min.js'); wp_enqueue_script('tiny', ...
0
votes
0answers
30 views

WordPress Caching

I try something on my local machine. I have a custom JS and CSS file which I included in the functions.php of my theme (twenty fifteen) like this: function load_my_stuff() { wp_enqueue_script( ...
0
votes
2answers
59 views

Show/Hide Div for Login Mask

I've been trying around a lot to get this working, however every method I tried just didn't want to do as I wanted it to. So here I am. I have a login-Mask that's only visible if the user is not ...
0
votes
0answers
10 views

I want to invoke a javascript function after shortcode

I created a shortcode that loads 6 posts in a custom design with a filter. But i'm getting a JS error because its looking for a dom elements that don't exist yet: jQuery(document).ready(function(){ ...
0
votes
0answers
9 views

Create multiple Instances of Ajax function and Control Variables from Template file

I received some help previously in order to build a Wordpress Ajax Load more function, However the site I am building is using different variances of this on different pages pages. The issue I'm ...
0
votes
1answer
15 views

Unserialize WP_Options options programatically?

I need to programatically unserialize the wp_options options. I'm creating a Java App to change database information, such as some options on wp_options, so that I won't need to access the panel to do ...
0
votes
1answer
12 views

how to prevent all css and javascripts files from loading

I'm looking for a way to prevent all css and js files from being loaded (default theme and plugins). Is there any way to do that? at least reach to minumim file load... .
0
votes
0answers
27 views

how to include js in widget?

I know about wp_enqueue_script. i just wanted to make sure that it applies here. I built a custom widget that uses a lot of js. Most of that js is included in a separate file that gets included from a ...
0
votes
0answers
28 views

Flexslider + Tabs + WP default query script issues

I'm having some issues with flexslider and tabs to work together. Example 1 - if i add google cdn to header above all works fine. Now the thing is, i know it's not a proper way of adding jquery ...
1
vote
1answer
70 views

Javascript not working?

2 days ago my javascript was located in my footer folder running correctly, until suddenly it stopped working. I was lazy to do the proper way of enqueueing, so I officially did that to see if it ...
-3
votes
0answers
44 views

Post rating without plugins?

Is there any simple post rating snippet which will work when page is cached. There is many functions, for example this: <form method='POST' action=""> <input type=hidden name=rate ...
0
votes
1answer
36 views

get_header() in backend - but keep JavaScript and CSS files

I replaced the header and footer in the backend with those from the frontend by the following code: /* add header to backend */ function header_backend() { get_header(); } ...
1
vote
2answers
46 views

Click loads template via ajax

I'm trying to load a template via ajax if the user clicks on a button. This is the code I'm using: On functions.php: function phantom_scripts() { global $child_dir; /* Ajax Requests */ ...
0
votes
0answers
3 views

make a pluign javascript run windows load instead of document ready [migrated]

I have a plugin which is displaying wrapped in a document ready function, but i need to have it wrapped in a window load function. Can this be done using a hook or something? Its getting displayed ...
0
votes
1answer
40 views

Jquery in Child Theme

I am new to Wordpress and I need help with integrating my own jquery into a child theme. I have this jquery tooltip which works but I want to include it into my wordpress child theme. Have a look ...
1
vote
1answer
40 views

How do you filter the list of states when country is selected? [closed]

Seeing as there is no StackExchange site (or any other forum, that I can tell) made for WooCommerce questions, I'll run the risk of being shot down for being "off-topic". I need to add a third ...
0
votes
2answers
40 views

Best use adding user generated JS/CSS to a theme with a plugin

I want to know the best use of adding custom JS/CSS to a theme. I have built a small plugin which has a section to allow users to add CSS/JS to their theme. Now I am trying to figure out is which is ...
0
votes
1answer
57 views

How to call javascript function (jquery) in a shortcode?

Before asking here, I've searched a while and found a tutorial about creating a wordpress plugin with shortcode and javascript calling. But I'm not able to make it work on my side. The tutorial is ...
0
votes
0answers
20 views

why is this ajax function not working as expected?

so my class looks like this: class Myclass{ private $nonce; public function __construct(){ if( get_current_screen()->id == 'nav-menus' ){ $this->nonce = ...
0
votes
0answers
22 views

wp_footer problem

I have a problem with a newly installed theme called QA Engine. When I use that theme, I see my server providers webpage inserted after my page's footer. I don't know what happened, and why is that, ...
0
votes
1answer
55 views

CDATA removing new line in script tag in wordpress

I am getting this error in 4.1.6 suddenly. The code below when put in the editor <script>// <![CDATA[ alert('hello'); //]]> </script> gets converted to // <![CDATA[ ...
0
votes
0answers
16 views

Custom link menu including Javascript AND “if session”

I have menu links (such as this one below) which I need to implement in my WordPress menu and don't know how : <a href="javascript:void(0)" ...
2
votes
0answers
80 views

When does Wordpress wrap inline scripts in CDATA?

I'm debugging a problem with a third party script of ours that wordpress users use by copy / pasting a snippet of script and html into their post's bodies like (non-real world example of course): ...
1
vote
1answer
22 views

Get File Object from wp.Uploader

I would like to hook into the wp.Uploader and get the FileList object containing the file to be uploaded. So far I've been able to extend the uploader using the code below, but I can't quite seem to ...
0
votes
0answers
24 views

how to toggle tag around selection wordpress editor

js : (function() { tinymce.create("tinymce.plugins.afflpad", { init : function(ed, url) { ed.addCommand("afflpad_click", function(e) { ...
0
votes
0answers
32 views

Cannot Enqueue JS Script in Wordpress Admin

I'm running through a tutorial to add some ajax functionality to the admin area of WordPress and have hit a road block. I've been trying for a couple of hours now and as far as I'm aware, the below ...
4
votes
1answer
212 views

Move Wordpress native javascript to bottom of page?

Checking my page in google page speed insights, it complains that there are some javascript that is blocking the rest of the page from loading. The javascript in question is native Wordpress scripts ...
0
votes
0answers
83 views

Session variables lost during Ajax calls - Wordpress - Sage Starter Theme

I'm using the starter theme Sage to create a custom Wordpress Theme. I made a very simple infinite scroll system to display every posts. On that point, everything seems to work fine. Now, I have to ...
0
votes
3answers
61 views

Import HTML code that loads css and javascript into specific page

How can I add the following HTML code into one of my web pages? It's a web form that relies on css and a few java script. Below is the raw HTML code. <head> <link href="css/style.css" ...
0
votes
0answers
8 views

Hooking into action that fires in wp_head from widget on front end [duplicate]

I have a custom action hook for which the do_action() is executed in a function that hooks into the wp_head action. I would like to run add_action() for that custom action hook from the front-end ...
2
votes
0answers
25 views

Reset Undo on the tinymce editor

I have one editor where I switch between content in one editor, and what I want to do when I set the new content, I would like to reset the undo possibility. I have read on this site ...
0
votes
0answers
21 views

myCRED do_shortcode issue

i found a code to create a timer. I want to use it for delaying a do_shortcode commands but i don't work... the shortcode is execute when the timer is to 1:00 and i want to execut it when the timer is ...
0
votes
1answer
216 views

Ajax not firing properly using Firefox, but works in Chrome

I'm working on a plugin that seems to be fine in Chrome, but is not firing the PHP script via Ajax in Firefox. It is driving me to distraction. Here are the code blocks that relate to it. First, the ...
0
votes
0answers
29 views

After refresh settings field disappers

I'm working on a little plugin project to help gain a better understanding of wordpress development. So far i've been able to create dynamic text fields which a user can add themselves. Whatever the ...
0
votes
0answers
17 views

Creating a user 'add custom field' section

I'm trying to make this plugin where users can add a custom attribute for something i working on: So far what i've done is: which uses this code here: window.addEventListener("DOMContentLoaded", ...
0
votes
1answer
21 views

Including Styles and JS files to work ON my plugin interface

Hey WordPress community, I've been having a couple of issues with trying to add a stylesheet and a JavaScript file which run on my plugin interface. So far i have this: ...
0
votes
0answers
26 views

Conflicts with jQuery

I wrote a plugin that works fine, but in one site I get jQuery loaded twice even if I don't enqueue it myself (I guess the theme loads it also). I tried to deregister it and than again enqueue but ...
0
votes
0answers
52 views

Google PageSpeed Enable Compression isn't working?

I am trying to improve pagespeed of my website. When I test my site it tells "Compressing https://z-1-static.xx.fbcdn.net/rsrc.php/v2/yF/r/SQ7jeOqw5xW.js could save 188.3KiB (70% reduction)." I have ...
0
votes
1answer
115 views

Get html data with javascript to php array and store to wordpress database

What I wanted to do is get the items that are dropped to the droppable area and stored it a php array so that I can store into database so that I can access the stored array from other parts of my ...
0
votes
1answer
24 views

early enqueueing javascript file in page template, not in functions.php

Is it at all possible to enqueue javascript file early on page template file? I want to use this way of including scripts to keep my structure clean (so each page template has its own styling and ...