A client side scripting language useful for making interactive web sites

learn more… | top users | synonyms

1
vote
0answers
12 views

esc_js() breaks unicode sequences by removing the slash '\' character

I've noticed that esc_js() is breaking unicode encoded characters by removing the '\' (slash) character. For example: esc_js('\u041f') returns: 'u041f' I can potentially use REGEX to identify ...
1
vote
1answer
34 views

Adding javascript actions to words in post content

I would like to have my blog run some JavaScript code when certain particular words are clicked on. One approach would be to include "onClick" handlers in HTML elements within the posts and disable ...
0
votes
0answers
16 views

Uncaught SyntaxError: Unexpected Token Illegal wordpress [on hold]

I have a local install of Wordpress running & I am suddenly getting these errors in my console when I open a modal window (such as file upload): {Uncaught SyntaxError: Unexpected token ILLEGAL ...
-1
votes
0answers
11 views

I am editing a plugin to sort list items alphabetically but can't seem to get it working. What am I doing wrong?

I know modifying a plugin is a big no-no. But I'm sure most of you have done a few in a few cases. This happens to be the case. So I bought a plugin for a client to use on their website but turns out ...
0
votes
0answers
22 views
+50

Combine enqueue js without effecting dependencies

I want to combine little javascript files while keeping other script's dependencies for them. Is there any way? Details: New version of BuddyPress enqueue 6-7 little javascripts: // Legacy ...
-1
votes
0answers
21 views

Why wordpress plugin shortcode doesn't work properly with IE

I recently working on a wordpress, plugin, it already reached a final stage, and all it left is cross browser compatibility, the problem is why shortcode doesnt work properly With IE. Below are My ...
-1
votes
0answers
9 views

window.onhashchange event [on hold]

In mobile view the menu becomes a Select Box and if I select some menu item I really get their but the display inside the select box returns to “Menu” and dosen’t reflect the actual selection. URL: ...
0
votes
0answers
7 views

Using Javascript from Github in Wordpress theme (popup footer wanted) [migrated]

My ultimate goal: a footer that pops up after scrolling down the page X amount. I'm trying to use a script from Github, scrollr, which apparently is "easy to use" for beginners. ...
0
votes
1answer
8 views

How to get DEFER or ASYNC attribute to appear when I add a stylesheet with wp_enqueue_style from a plugin? [duplicate]

Almost all of my CSS and JS resources can be postponed with an ASYNC or DEFER tag added to the resource. This may improve performance of my page load times considerably. However, I don't know how to ...
0
votes
1answer
22 views

How to deregister scripts all at once

How can I deregister all wordpress scripts all at once except for the admin? I have looked at the discussion How can I de-register ALL styles all at once? And same with Javascript?, but i do not want ...
0
votes
0answers
15 views

add bootstrap modal after login in wordpress

I'm trying to add a boostrap modal just after login in my website. I have my javascript: jQuery(document).ready(function($){ $('#after_login_modal').modal(); }); I have my div: <div ...
0
votes
0answers
30 views

Front-end ajax login form broken after WP4.0 upgrade

A site I manage has a a simple form a user can click on to login using ajax. It worked great until I upgraded to wordpress 4.0 Here is the relevant code: Function.php: function ...
-3
votes
1answer
43 views

How to Javascript/jQuery

I am trying to turn an HTML 5 template into a Wordpress theme. The jQuery/Javascript combo seems not to be working, what should I do? (I just used <?php echo get_template_directory_uri(); ...
1
vote
1answer
26 views

How to get my plug-in, wrote in php, to refresh on its own every 5 minutes?

I wrote a plugin with custom widgets for the Dashboard. It retrieves information from an XML file, and display the information into the widget. The XML file will be modified a bit every few minutes or ...
0
votes
0answers
9 views

How to modify a class in load-scripts.js ?

I need to semplify the image edit interface and I need to override a couple of function defined in load-scripts.js in the class imageEdit. There is a way to override it? And there is an unminified ...
0
votes
1answer
38 views

Heartbeat API: How to access data already enqueued?

I'm having problems when trying to access data that I've queued using the Heartbeat API. I'm queuing data using wp.heartbeat.enqueue(). For example: var data = { my_key: 'value' }; ...
0
votes
2answers
39 views

Filter custom post types by custom field using AJAX

I have a few custom post types (books, films etc) created with WP-Types. I then have a custom field called Genre, created with ACF. If a user selects "Books" from the dropdown on the frontpage, he ...
0
votes
1answer
17 views

Need to hide an element depending on date and post category

I've been racking my brains for a few days trying to figure this out. I'm using WP Voting on my site. I need to create a script in single.php that will remove the div that contains the voting widget ...
0
votes
1answer
26 views

Show Post Content with AJAX

I want to do a very basic AJAX call where, on click of a list item, a container div fills with associated content pulled from a Wordpress page. I'm a newb with AJAX; I've tried a few different routes ...
0
votes
1answer
43 views

WordPress opens js files as a catalog. Path is right [on hold]

When I import external js file everything is okay.. no matter if I import it by <script> tag or by wp_register_script function but when i try to import local file everything crashes. Firstly I ...
-3
votes
1answer
24 views

dropdown does not work [closed]

I have the page http://www.supersprox.eu/invoicewithtabs/. When I click "Show filter" button an area with several dropdowns appear. The problem is I can not select values of the first row of ...
0
votes
0answers
11 views

Is server side Javascript possible with wordpress

Is it possible to run JavaScript server side on wordpress. I have about 5,000 lines of Javascript that I would like to run on the server, rather than the client (browser). 5,000 lines is a lot of ...
0
votes
1answer
51 views

Accessing an API with jQuery and AJAX

As a proof of concept I'm trying to access an API using jQuery and AJAX and posting the results to a page. After following some online tutorials and doing my best to put it all together, I have the ...
3
votes
1answer
90 views

How to add a “data-” attribute to the image tag of native gallery output

While trying to make WordPress and Galleria to become friends I already have a good result. Galleria can easily be used to display native WordPress Galleries. I'm using a plugin but that's not ...
0
votes
1answer
41 views

admin-ajax.php (aborted) error when using jQuery.get

One thing that really confuse me is the following: When I load a javascript file via Ajax and I watch the http requests thats being made, then I see the following error in Firebug: admin-ajax.php ...
1
vote
4answers
84 views

jquery won't load in footer

I wanted to move jquery to the site's footer, but that doesn't work. I've tried it with the following code. As you can see, I have a couple of another scripts and they load correctly on the footer. ...
0
votes
0answers
11 views

Enqueue script in Widget

I am trying to use wp_enqueue_script inside function widget of the Widget class. But it seems like when I print html it doesn't handle the javascript functions which I enqueue before. This enqueue ...
0
votes
0answers
15 views

Can You Require the Use of JavaScript in a WordPress Plugin?

I commonly use Mozilla Firefox for testing changes I make for a plugin that I'm developing. I also have the NoScript addon installed because it is also my main browser. I noticed that the ...
0
votes
1answer
38 views

JS news ticker is not working on home page but working on other pages. How to solve this?

I created this news ticker: http://jsfiddle.net/riffaz/92s92k1d/ and it's working fine in fiddle. I am trying to add this ticker to the site. For that I put this code on a PHP widget <?php ...
1
vote
3answers
42 views

Javascript not included

I have tried to include my javascript file in the following way: function theme_scripts() { wp_enqueue_scripts( 'custom-script', get_template_directory_uri() . '/js/menu-fix.js',array('jQuery'), ...
0
votes
1answer
36 views

'Dehighlighting' navigation once clicked

I'm using the Twenty Fourteen theme and I'm loading the pages using Ajax. What I want to happen - the menu bar to unfocus the previous page on the navigation bar and highlight the current page. What ...
0
votes
1answer
18 views

Executing Javascript in Plugin

I am trying to display a google map using short code for a plugin I am building, but I can not get it to work. Does anyone have some advice on this? Here is my code: add_shortcode( 'show_map', ...
0
votes
0answers
16 views

Iris color picker

i try to implement Iris color picker in my wordpress theme and it works fine, but when i include the Iris color picker's files i can't call a custom function via a tag. this is the Iris color picker ...
3
votes
0answers
52 views

Is it Possible to Extend WP Customize JS Methods?

I’m wondering if it’s possible to extend the methods of the anonymous api object in wp-admin/js/customize-control.js. I need to overwrite one of these methods with my own custom logic but I suspect ...
0
votes
0answers
26 views

how to transfer the post content from index / category/Archive page to another page with a form?

I have a wordpress site ! I want to insert a link below each article/post on the index/category/archive page which on click , i want to open a page which has a FORM with title and a message text ...
0
votes
1answer
33 views

Notification when left menu bar is closed?

How to get a notification via Javascript when the left menu bar has been collapsed ? I was looking everywhere in the net but there is zero out there... thanks! update: somebody asked what the left ...
0
votes
2answers
29 views

Create special WordPress slideshow with “jquery.cycle.all.js”

i want to create my own slideshow without using any slider plugins hear is my code -- in the footer --- <script type="text/javascript" src="<?php bloginfo( 'template_url' ...
0
votes
0answers
27 views

wordpress - ajax communication

This is the first time I do the ajax and I must confess that I am confused. What I want to do is to take the value of 3 Select html to make a request to my database that'll get me a score according to ...
0
votes
0answers
34 views

How to slidedown and slideup child pages clicking on parent pages in jquery or javascript?

I have created a sidebar in wordpress in which all parent pages with subpages are listed. I have used following code in sidebar-left.php file and call this in template file. <div id="primary" ...
2
votes
1answer
62 views

javascript onload calling a function of a plugin

A friend created a plugin for me which allows the users to mark posts as read or unread. The code of this plugin is the following : edit of the code ! <?php /** * @package Read-Unread * ...
0
votes
1answer
87 views

Adding an onchange event to a custom dropdown menu in Wordpress

I would like to add an onchange event to a dropdown menu I've created via my Wordpress plugin. As this is my first foray into Wordpress development, and the company I work for has a tall order for ...
0
votes
2answers
80 views

Problems with plugin that fetches data from database with ajax

After some answers I have edited my code. This is my plugin structure stpl1 stpl1.php getuser.php In stpl1.php I have the following code: <?php /* Plugin Name: Wordpress Plugin Stijn 1 ...
0
votes
1answer
117 views

Populating content dynamically via AJAX and Advanced Custom Fields [closed]

I am using a repeater field from Advanced Custom Fields to create multiple photo galleries. There are 4 pages and each page has multiple image galleries. Because of this, I want to reduce load by ...
0
votes
1answer
14 views

Showing a link with Javascript based on log-in status

<?php if ( is_user_logged_in() ) { echo ''; } else { echo '<a onclick="ppOpen('#login_panel', '800',1)" href=\"javascript:\">Entrar</a>'; } ?> Hello, I'm trying to make this work ...
0
votes
0answers
47 views

Using Ajax to autocomplete a form with data from db

I'm struggling to get the following: User fills out personal number Other input gets autocompleted with data from database As I have never made a plugin, help is greatly appreciated, my database ...
0
votes
0answers
156 views

AJAX filter posts on click based on category

This is my first foray into AJAX, I've been splicing bits of code from various tutorials which probably hasn't helped. I have a list of categories on my homepage (index.php) and a list of the most ...
0
votes
1answer
60 views

How to load JS for specific screen size using wp_enqueue_script?

I need a option so that when I am adding some script using wp_enqueue_script it should load for specific screen size. Like when the screen size will be below 768px the script will not load. I am ...
0
votes
1answer
59 views

How to get values from wordpress listings and use them in javascript array?

I'm trying to get values (latitude, longitude and an image) from the WordPress database and put it into a javascript array. Unfortunately I'm a newbie at Javascript and PHP! Here is the code I have ...
0
votes
1answer
35 views

prevent HTML output if custom field is empty [closed]

I am using the ACF plugin for custom fields. I am using this to add a second content area to my website. I have a peice of JS that says if this div is present then add a class to the page-content ...
0
votes
2answers
53 views

How to set up php,javascript and css to allow for our finished product to be displayed within a page?

hey wordpress experts, We have coded a table using php, javascript and css which pulls up information from a text file and displays it in the browser. We have everything working as desired when we ...