A client side scripting language useful for making interactive web sites

learn more… | top users | synonyms

0
votes
0answers
4 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
29 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): ...
0
votes
1answer
1k views

Replace link with form to pass variables to javascript / ajax

I'm sending a single variable to javascript/ajax via a link, but want to send via a form so I can pass user input as well. (It's for a plugin that interfaces with an Echonest Remix python script to ...
1
vote
1answer
13 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 ...
-1
votes
0answers
19 views

need a good code for open and close tag wordpress editor [on hold]

hi i need a good code for open and close tag wordpress editor 1.The button on first click shoud open and on second click have to close </b> tag 2.Add active class ! 3.How to ...
0
votes
0answers
17 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) { ...
1
vote
5answers
94 views

Running JS after theme customizer finished initialization

I have a piece of JS code that I use show/hide customizer control groups depending on a select item value. The code was working fine until recent wp update (not sure which version first broke this). ...
0
votes
1answer
4k views

Howto use WP built in Thickbox for images?

I've been searching for a better way to utilize the built in Thickbox function for images. I've been using my method for a few months, but I don't think it's the best way to do it. Here is the code ...
0
votes
1answer
581 views

How to make Isotope and Wordpress work together?

I am trying to make my Wordpress theme using Isotope plugin. http://isotope.metafizzy.co/ So far, I have such a result after doing that was suggested: I believe that Isotope Masonry should not ...
0
votes
0answers
19 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 ...
1
vote
1answer
470 views

How to add a onclick attribute to a list of checkboxes?

I have this array for checkbox: array( 'name' => __('Latest Product',''), 'desc' => __('Select if you want to display latest product',''), 'id' => $prefix . ...
0
votes
1answer
2k views

Ajax page load without reload

I am working on a script to load my page without refreshing. It is working as I want it except for one thing. The test site I have up is http://dev.dog-company.com . Only home About us and FAQ will ...
0
votes
0answers
17 views

jquery is loading js scripts with 1 script for a few sec a good aproach?

so..... I want to make a dynamic table from a mysql query and i've done it successfuly but... I dont like the idea off people being able to look at my script files. Is there anyway to avoid this? My ...
4
votes
1answer
137 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
16 views

iPad Popping Back to Page Top on Scroll

I am using WordPress, Bootstrap, and Skrollr. I have Skrollr disabled on mobile using the following code: var mySkrollrFunction = function () { var windowWidth = $(window).width(); // ...
0
votes
0answers
24 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
36 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" ...
3
votes
1answer
357 views

WP3.5 Media Uploader - how to make it accept multiple images?

I'm wondering how to make WP3.5 media uploader return 2 or more items in attachement? It always runs once even if 2 items are selected. The code: $('.button').on('click', function(){ var ...
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
2answers
1k views

Placing Ads after every 10th Post with Infinite Scroll

I have to load a couple of ads, some normal html and two are java script. I've tried the PHP method of this: <?php $postnum++; if($postnum%10 == 0) { ?> <div id="topset"> <ul ...
3
votes
1answer
3k views

How to replace regular jquery calls with CDN calls from Google?

I will like to implement a few of the boilerplate template features in one of my instance WordPress. I am trying to figure out how to exchange the regular jquery calls below <script ...
0
votes
1answer
47 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
94 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
1answer
2k views

Parse wordpress blog data using json api and ajax

I have seen lots of responses to how to extract data from wordpress blog posts using the json api plugin. Many uses $.getJSON, $.ajax, .responseData.feed.entries, success function() etc. What is the ...
1
vote
0answers
14 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 ...
5
votes
1answer
425 views

Custom “Uploads” Dir: “Edit Image” in Media Library broken

Directory Structure I have customized my (local) install (dev box). The current directory structure is: ./root |- wp (WordPress Core root) \ |- wp-config.php |- wp-content (Content and ...
0
votes
2answers
591 views

Unable to load “wpColorPicker” on theme customize page

Whether I'm using a Wordpress default theme or a custom one, I see the JS error: Uncaught TypeError: Object [object Object] has no method 'wpColorPicker' when I click "Customize" on the theme. I've ...
0
votes
0answers
14 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
808 views

Replacing &#038; in JS code on pages

I am needing to remove the &#038; that seems to be replacing my & on my page code. My original code looked like this: ...
0
votes
0answers
24 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
2answers
1k views

Load plugin JS in footer

I am trying to load JS files in my theme's to footer.All my custom JS files are being added to WordPress using wp_enqueue_script, but i am unable to find any way which will help me to load them in ...
0
votes
1answer
25 views

Using google graph api with wordpress

I am trying to implement a single graph on a single wordpress page. I am using this page from google guide - https://google-developers.appspot.com/chart/interactive/docs/basic_load_libs To implement ...
0
votes
3answers
1k views

How do I add some javascript validation to the admin interface form's onsubmit?

I have a plugin that adds meta boxes to the admin interface and I need to do some validation when the user presses the "update" button before the form is submitted. Is there a WordPress action or ...
0
votes
0answers
12 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
17 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
4answers
2k views

Wordpress Ajax always returns a 404 error

I just got this code from a tutorial. I can't seem to get it to work. HTML (home.php) <form name="myform" id="myform" action="" method="POST"> <!-- The Name form field --> ...
0
votes
0answers
23 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
24 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
2answers
424 views

How to make featured image thumbnails on index page load smoother?

I'm using a theme called Hatch Pro, which is a gallery based theme and the index page displays the posts using the featured image. You can see it here. On slower browser environments, the images ...
0
votes
1answer
17 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 ...
-1
votes
0answers
30 views

Meta Slider / Flex Slider Carousel variable image width

i tried working with Meta Slider making a Carousel that allows me to show images with the same height but different width. Thats not working somehow with flex slider. i have a sliding area of 960x270 ...
0
votes
1answer
817 views

wp_enqueue_script() not working at all

I'm trying to enqueue JavaScript files using wp_enqueue_script(), but it isn't working at all. Here is my code: function load_css_js() { wp_enqueue_style('gdgt-base', get_template_directory_uri() ...
3
votes
1answer
58 views

Display message once per session to users with a specific role

I need to display a message to only users with a specific role. The message should appear either as soon as the user logs in or if they re-open their browser after having closed it when logged in to ...
0
votes
1answer
60 views

Add Item to Custom TinyMCE Menu

I've created a custom menu which appears on my TinyMCE toolbar but would like to add another item to that menu in a separate function elsewhere in my plugin (depending on whether some other ...
1
vote
2answers
828 views

Defer all js except certain ones in functions.php file

I read How to add defer="defer" tag in plugin javascripts? and the code @toscho posted works good to defer certain js files or deferring ALL js files by commenting out the contact-form-7 ...
0
votes
4answers
57 views

Add JavaScript to single post

I want to add small javascript program in wordpress post, please let me know how to add / execute in WP Post ? EDIT Yes I tried, but no luck. First I added HTML Code & JavaScript in Post Text ...
0
votes
1answer
24 views

Javascript not working

Here is my js code var geoSearch = new google.maps.Geocoder; jQuery(document).ready(function() { var address = FYN_search.postcode; if(jQuery.type( address ) === "string"){ var region ...
1
vote
1answer
535 views

Javascript WP Object Documentation?

I was working on implementing the media library within one of my plugins/themes. I found a nice tutorial (http://mikejolley.com/2012/12/using-the-new-wordpress-3-5-media-uploader-in-plugins/) that ...
0
votes
1answer
438 views

Load php function with AJAX on modal window

On a movie information wordpress theme i am developing, i have an href with text "watch trailer" on each cover of all movies. This brings a modal window, and that is working already, but i want to ...
0
votes
1answer
168 views

How to solve 'Eliminate render-blocking JavaScript and CSS in above-the-fold' content for multiple files?

I get this when I check my site in google insight: Pretty ok right? But I still consider to fix Eliminate render-blocking JavaScript and CSS in above-the-fold content to get a good results on ...