A client side scripting language useful for making interactive web sites

learn more… | top users | synonyms

5
votes
1answer
2k views

Display attachments by ID in a wp.media frame

I'm trying to use the new wp.media uploader frame for an app I'm building. I've read up a lot on other questions, blog posts, etc etc. The code I pasted below is working already quite fine and even ...
2
votes
1answer
278 views

Using get_option() in JavaScript

Previously, I used the get_option() function to get an option in PHP, like this: $width = get_option('my_width'); This is inside a shortcode function. Now, I want to have an option in JavaScript. ...
-1
votes
2answers
579 views

Are you sure popup on Contact Form 7 [closed]

I have a contact form built with Contact Form 7. What I want to do is when the user hits the submit button to throw up a pop up window with a notice asking if their sure they want to submit the form ...
2
votes
2answers
217 views

javaScript in <head> section of WP API

How do I place the following javaScript in the <head> section of the Wordpress Widgets API menu screen? <script type="text/javascript"> jQuery(window).load(function() { ...
0
votes
1answer
176 views

WordPress Theme - jQuery JavaScript Library Issue

I am having some issues with a couple of plugins which use jQuery/JS i.e. cookie control and a picasa photo gallery. The theme I am using is quite basic and comes with no sliders etc with moving ...
3
votes
2answers
1k views

Pass custom fields values to Google Maps

I am using this script on display google maps on my wordpress site: <head> <script> function initialize() { var mapProp = { center:new ...
0
votes
1answer
1k views

Execute PHP code in Javascript onclick

When a user clicks on the table row, I want to: save a value in the user profile go to a page I am within this loop: <?php $query = new WP_Query(array('post_type' => 'aanvraag', ...
0
votes
1answer
135 views

Expanding / Collapsing Modules in Wordpress Panel

I'm using WordPress 3.3.2. version. I can't able to expand / collapse modules in wordpress panel. I have deactivated all plugins and checked. But no result. If i disable Java Script, it is working ...
1
vote
1answer
70 views

How to implement a JavaScript and CSS file for my WordPress homepage?

I saw this Javascript feature tour file today, and was curious how I would go about implementing it on the homepage of a WordPress site. Ideally, I'd like to add it so it only shows up if and only ...
0
votes
1answer
201 views

Javascript alert appears before <!DOCTYPE> tag

I have wordpress 3.5.1 on Debian Squeeze. Every time before the page loads javascript alert appears with message 2819371938193817109948281937271937 and have to click OK to see the page. I get this ...
0
votes
1answer
119 views

go to home page when i select default in select-box

I'm new for WordPress. I'm using following code, <div id="cat_list"> <?php wp_dropdown_categories(array('show_option_all' => 'Categories') ); ?> </div> And my JavaScript ...
0
votes
2answers
549 views

Failing to load my script files in wordpress! i can't figure out what i'm doing wrong

i have customized my .html as a custom wp theme. i have these scripts in my header.php: <script type='text/javascript' src="scripts/jquery-1.8.2.js"></script> <script ...
0
votes
1answer
290 views

How to setup a popup registeration page in wordpress with function.php

everyone: I wonder if there is existing tutorial on how to create a popup registration page in wordpress by utilizing function.php? or is there another way that can do with it? Thank you!
0
votes
1answer
569 views

Cloudflare's Rocket Loader + Wordpress -> Ignore scripts?

I'm trying to make Cloudflare's Rocket Loader work on my WP site. Everything works fine except for the WP Visual Editor. I followed the advice here but it doesn't work: How do I add custom attributes ...
0
votes
1answer
151 views

Is there some jQuery conflict here?

I'm customizing a wordpress theme called Accordium, and I have decided to add infinite scroll to it using a wordpress plugin called pbd-ajax-load-posts. In the theme, when you click on a post in ...
0
votes
1answer
68 views

What can cause JavaScript and CSS files to be minified?

On one of my client's site, I see that my plugin's JS and CSS files are minified. Trying to identify what causes the files to minify, I tried to deactivate all plugins (except mine), and changing the ...
0
votes
1answer
791 views

Load JavaScript from a post that's loading into Fancybox via ajax

I'm hoping this makes sense. When a user clicks on a post title I'm launching a modal overlay via fancybox, and feeding the associated post content via ajax. However I have a javascript call function ...
0
votes
1answer
1k views

Dynamically changing navigation links (next and previous) via AJAX

In my wordpress site, I have inside the loop of single.php , a select tag in which the options are the posts of the current category returned via a custom query. On changing selected option, I have ...
1
vote
3answers
2k views

theme path in javascript file

I need to include the path to my theme file within a javascript file. How would I go about this? I have already tried: var templateUrl = "<?php get_stylesheet_directory_uri(); ?>"; function ...
0
votes
1answer
101 views

I keep getting Javascript error messages

I think something in my code must be utterly wrong because as soon as I manage to fix one error that I found, the next one pops up. I just managed to solve this problem. Now this error message keeps ...
-1
votes
1answer
70 views

new to javascript - using in <head> instead of functions.php, not loading correctly

Live site. I've decided to incorporate javascript in my new theme; this is my first time doing so and have pieced together what I've down with help of blog posts and forums. I have the javascript ...
0
votes
2answers
260 views

jQuery UI inside widget on admin page

I have created a widget that has quite a few settings, and so I am trying to create a tabbed menu (using jQuery UI) inside the widget settings of the admin page. The problem is basically that tabs ...
0
votes
1answer
144 views

Javascript in wordpress

I have featured images shown for different posts of same category in a page in a specific div. I need to show the whole post related to this image in the same page in another div. I know i must use ...
1
vote
1answer
1k views

What is the Javascript event for an item being added to the cart in Woocommerce?

I can't seem to find this in the docs or through google. So basically I'm just looking for the Javascript event that fires when an item is added to the cart. For some reason my default added to cart ...
3
votes
1answer
604 views

How to combine multiple CSS files and concatenate JavaScripts if WordPress recommends enqueuing them?

How would I go about combining multiple CSS files and concatenating my scripts if they're being enqueued as WordPress recommends? My site is pretty slow and would like to optimize for performance.
0
votes
2answers
45 views

Including Javascript options

For a Wordpress Theme I know javascript files (ending in .js) must be included using wp_enqueue_script in functions.php but how do I include additional javascript code, for example say I need to add ...
0
votes
1answer
146 views

Paginated WP_Query doesn't return 404's, even when posts don't exist

I'm currently building a theme for a client, and one of their requirements is endless scrolling on a "Charts" page. They want this to be paginated, and the endless scroll to load the next page below ...
1
vote
1answer
381 views

How do I get my page to load the jQuery UI Effects library?

I'm using javascript for the first time to do some simple animations on the home page of my website. So far I have added the following to my header.php file (which is only used for my home page), ...
0
votes
2answers
243 views

My jQuery is enqueued properly. So why isn't it working?

I'm just trying to add a simple bit of Show/Hide jQuery to a child theme. $(document).ready(function(){ $("#openbtn").click(function(){ $("#openingtimes").toggle(300); }); }); I've saved the ...
19
votes
1answer
3k views

Is it possible to reuse wp.media.editor Modal for dialogs other than media

To expand: I'd like to utilize the same Modal code/appearance ( as used in wp.media.Modal, wp.media.FocusManager ) to open a modal of my own custom dialog, not the Media Editor. In the past, I've ...
0
votes
1answer
204 views

How to add additional JavaScript code [duplicate]

I'm developing a mobile site and the template I'm using is based off of Jquery Mobile. In the header.php file, the template I am using is making calls to CDN javascript files: <link ...
0
votes
1answer
1k views

Add multiple JavaScript files to template header [duplicate]

I have multiple JavaScript files that I want to load. Some of them in my header.php and the rest in the footer.php. These are the files: <?php <script type="text/javascript ...
1
vote
1answer
595 views

prettyPhoto media loading very slowly in Chrome

I'm having a problem with prettyPhoto media WordPress plugin (lightbox type) script in Chrome. It works beautifully in other browsers, but it takes forever to load in Chrome. When using this script ...
0
votes
1answer
70 views

Can't insert files in other inputs

I'm trying to allow multiple images to be uploaded to the media library where I can then take the URL of the image and insert it into a custom page on the website but for some reason, when I click on ...
0
votes
2answers
171 views

Is the wp_enqueue method efficient?

I had a quick question regarding how you are supposed to load in scripts with Wordpress. I am developing a theme and I know that the best way to do this is to use the ...
0
votes
2answers
184 views

custom page url slug needs illegal ?id=1 for javascript

I have created portfolio page which contains a image-slid-menu for navigation. For an menu item to appear as open, javascript gets instruction like ?id=0 appended to the url. for instance ...
0
votes
2answers
4k views

Add captcha validation to my custom form for Frontend posting

i have implemented the frontend form, which enables UNREGISTERED users to post on my site. Everything in working perfectly, the only problem I have is with the implementation of the captcha. All of ...
0
votes
2answers
931 views

How to modify the paths of js from twentytwelve theme?

<?php wp_head(); ?> from my default wp theme generates <script type='text/javascript' src='http://example.com/wp-includes/js/comment-reply.min.js?ver=3.5.1'></script> <script ...
2
votes
0answers
107 views

Continue javascript execution when errors occurs [duplicate]

I use the WP native function wp_enqueue_script() for all my JavaScripts loading both in WP front and back-end so it can handle duplicated calls to the same script and so on. One of the issues is that ...
0
votes
1answer
285 views

How to enqueue script based on post category?

I have scripts for various little tools I have made using some js and html. I want the js to load only on specific single posts in side a specific category. I have tried the following code and it does ...
2
votes
1answer
73 views

Handling URLs in WordPress application

We have a web application that we run inside of WordPress in order take advantage of WordPress's authentication. To make this work, we created a template type for our application that simply includes ...
2
votes
1answer
184 views

Archive dropdown styling not applied

I am trying to add a custom dropdown for archives but struggling with couple of mistakes that might be the reason why it doesn’t work. The CSS only gives my dropdown the width, not the other styles ...
2
votes
1answer
129 views

javascript is not working on Event Submission?

I am using Events Manager Plugin Javascript is not working on Submit Events Page . I found the reason behind this , that was, I have written a line of code in functions.php to call jquery file. ...
0
votes
1answer
89 views

Wordpress video end function [duplicate]

Possible Duplicate: $ not defined using jQuery in Wordpress I need to trigger a alert box when video ends THis is the code i got from google <script> ...
2
votes
1answer
132 views

Does WordPress Development Mode Exist (with not minified JS)?

A lot of WP JS is minified and therefore it's hard to be analyzed in the Console. Is there any way to have all scripts uncompressed?
2
votes
1answer
241 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 ...
2
votes
1answer
135 views

How to include admin-ajax when loading external javascript

I'm creating a plugin that has some external Javascript and some AJAX calls ... but I don't know the best way to make reference to the admin-ajax.php file since the path requires some input from PHP ...
2
votes
1answer
570 views

How do I enqueue(or delay loading of) <script> tags in individual page posts?

My customer has many pages with <script> elements including javascript. <script src="myscriptforthispageonly.js"></script> I'm trying to get all scripts to load in the footer ...
0
votes
2answers
465 views

Including javascript for a shortcode

I'm creating a plugin that allows a user to use a shortcode. This shortcode depends on a bunch of javascript that needs to be present once the shortcode loads. I'm having issues trying to decide when ...
1
vote
1answer
155 views

Get post meta in enqueued js file

I am writing a plugin in which I have a js file. I enqueue it with wp_enqueue_script. In this file I have some functions. The functions are triggered by an onclick event of a button. The button is ...