A client side scripting language useful for making interactive web sites

learn more… | top users | synonyms

-1
votes
3answers
581 views

Pass a PHP variable (loop-audio.php) to jQuery function (js/script.js)

I've searched a lot for this and I seem to get different answers. In my situation, my jQuery function has to use a PHP variable from a different file. How can I accomplish this? Clear and simple ...
0
votes
0answers
139 views

Responsive theme 'undefined' on woocommerce single product pages in mobile nav bar

I am using the responsive theme for my mobile site and am using 'any mobile theme' plugin to implement that them whenever someone is on a mobile device. when I am on a woocommerce single product page ...
0
votes
1answer
1k views

Get content from WordPress posts in Boostrap modal window - Javascript side?

I have a WordPress page with a grid that pull posts. Each post is in a box showing the title + thumbnail and upon clicking on it the content of the post should also appear in the modal (namely, ...
0
votes
1answer
40 views

javascripts files not linking to my category slugs?

I have a wordpress custom theme set-up and what i want is to create separate category templates, now seeing the template hierarchy i created the category-{slug} file and now when i am linking my ...
1
vote
2answers
147 views

Putting PHP variables into javascript [duplicate]

I've created a simple theme options page for my site. The options page contains three input fields. I can output the the fields by using get_option. The three fields are called using the following: ...
-1
votes
1answer
305 views

how woocommerce swatch color name when hovered or selected

I have the woocommerce plugin and the woocommerce swatches and photos extension that shows swatches instead of variations as a drop down. When hovering over the swatches and when a swatch is ...
1
vote
1answer
65 views

Proper way to enqueue a generated script that isn't in a .js file?

What's the proper way for loading a script via WordPress that isn't in a .js file? I'm generating some javascript on the fly based on some field options in a plugin. I want to load it into the page, ...
0
votes
1answer
464 views

Problem passing id-specific objects to javascript via wp_localize_script

I'm using wp_localize_script to pass multiple arrays of data into a javascript file. To differentiate between the different arrays (and prevent overwriting), they are labelled relative to the post id ...
0
votes
1answer
28 views

Will this js code work in a page template?

I have been given this code that I want to adapt and use to change a link in a template.php file, I have not been able to adapt it to work so would love any help that can be given. <script ...
0
votes
0answers
37 views

Page template dynamic links based on browser size

I have a page template that links though to another php file to define what is displayed. The code for the page is - <?php /* Template Name: Portfolio */ ?> <?php get_header(); ?> ...
0
votes
0answers
123 views

javascript errors on mobile browser, not on desktop

I'm building an application based on the wordpress backend. The app is working correctly on desktop, but on my ipad I noticed the javascript broke. I made some investigations and I discovered that ...
0
votes
1answer
280 views

Resolving Javascript errors likely related to Gantry framework

I'm trying to resolve some Javascript errors on a site I'm working on (built using the Gantry framework), as I have a sneaking suspicion they're keeping some plugins from working properly. For ...
0
votes
2answers
3k views

Load page HTML content through AJAX

I'm currently building a single page style site that loads all content through AJAX, but will degrade back to a standard page load if javascript isn't present. I have done AJAX loading in the past ...
2
votes
1answer
473 views

Ajax template: how to handle head section

I know it's easy stuff, but I'm new to this and I can't understand which is the best approach. Background The template I'm working on is a dual theme Desktop/Mobile, UA Sniffing based. Now I just ...
0
votes
1answer
418 views

Load content dynamically & resize event

On complex layouts, heavy use of Media Queries affect performances since the mobile browser still loads all elements that has been hidden. For what I understand now, to load the right layout/content ...
2
votes
3answers
3k views

How to prevent wordpress from loading old versions of jquery in wp_head();?

I noticed my twenty twelve theme is including outdated versions of jquery and js so I want to replace the scripts with the newer versions, however the scripts are in the file included by wp_head() ...
0
votes
1answer
233 views

Why won't the Comprehensive Google Map Plugin load?

all. I could use some help troubleshooting a plugin, since the plugin's author hasn't responding to support threads on the plugin page. I'm using the Comprehensive Google Map Plugin to display a map ...
-1
votes
2answers
710 views

Why isn't wp_enqueue_script('jquery-masonry') working?

I'm trying to add masonry sript to my site, but wp_enqueue_script('jquery-masonry'); is not adding the script. Instead I have to use: wp_register_script('jquery_masonry', includes_url(). ...
0
votes
0answers
228 views

Plugin - including external javascript calling google maps

I have developed a javascript plugin retrieving data for my website (no wordpress here). The user can simply add it to its website with a div (the container of the plugin) and a script tag (the ...
0
votes
2answers
1k views

wp_enqueue_script not working?

Excuse me, I'm very new to PHP and WordPress, but I'm trying to link to an exterenal js file called trans.js, that relies on jQuery. Here is the code at the beginning of the header.php: <script ...
0
votes
1answer
36 views

Can't attach Javascript to theme

I'm currently learning theme development, and tweaking the twentytwelve theme. I've got an external javascript file I'm trying to link, but it won't seem to register. The codex tells me: <script ...
0
votes
3answers
1k 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
1answer
31 views

How to add Wordpress JS Script Links

Hi I do have a code here from my HTML. I just dont know/forgot on how to link scripts in wordpress... <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> ...
1
vote
1answer
574 views

retrieve custom image sizes from media uploader javascript object

I am attempting to get the custom image sizes that I've created using add_image_size to return in the javascript object. I know how to include them in the dropdown, but I don't want / need that. The ...
0
votes
2answers
66 views

how to make my website secured

i have a php code inside my website to a quotation form that has java script for making name , telephone number and email rquired fields before submiting the form and its working fine but a few ...
0
votes
1answer
55 views

Dealing with a library that depends on jQuery

I am about to use the pikachoose.com library with wordpress. However, this library references jQuery, and uses the short form (using $). In WordPress documentation, it states that the short form ...
0
votes
1answer
58 views

JavaScript Libraries in WordPress

I understand that in order to use a JavaScript library in WordPress, such as jQuery, we have to use the following code to prevent conflicts: function my_scripts_method() { wp_enqueue_script( ...
0
votes
1answer
318 views

in jquery read a multidimensional array via wp_localize_script()

From PHP I am pushing a basic array to jQuery via wp_localize_script() and then using the array data in my script file. Now I have extended the array into a multidimensional array and can not figure ...
0
votes
1answer
220 views

loading a javascript on a WP PAGE

so im trying to do this http://jsfiddle.net/2XV7w/5/ on my custom_page on wordpress. this is a conditional html form. It will display a specific <div> when i choose a specific drop-down value. ...
0
votes
2answers
212 views

creating a static HTML/JS/PHP page

i need to create a static page that allows me to code HTML/JS/PHP that connects to a separate MYSQL backend. how can i achieve such in wordpress page?
1
vote
2answers
713 views

Run shortcode at certain resolution

I've gone a roundabout way of trying to ask a question about this here: Loading shortcode with ajax but figured it might be worth asking the fundamental question of what I am trying to do without ...
1
vote
0answers
159 views

Fancybox type popup window that's not an iframe

I'm a bit stuck and need some help to get me going in the right direction. I'm trying to do something similar to the lightbox style popup on this website: http://cargocollective.com/montessori I ...
0
votes
1answer
292 views

Javascript/jquery loads super slow (around 6 seconds) which affects only homepage

I got a custom wordpress theme from a developer but he isn't responding to me anymore. Basically my homepage takes ages to load which causes all the elements on the homepage not function until the ...
3
votes
1answer
142 views

How to intercept already localized scripts

If a plugin uses some script (prominent example: jQuery UI Datepicker), but you're not happy with how the script renders the output, then there're two possibilities: 1. Unregister the script > Add ...
-2
votes
1answer
125 views

Use Wordpress Built In Jquery

I see that on every page Wordpress is loading in jquery, how do I go about using that jquery as it keeps telling me that it doesn't recognize $ or $noConflict(); - I'm trying to add some jquery under ...
1
vote
2answers
487 views

How to load javascript file on homepage in Wordpress in order?

I am using a quicktags plugin, which was not loading on the home page, now it does, but it does it on the wrong place. How can I solve this? I want the quicktags.min.js file to load first, rather ...
1
vote
1answer
48 views

a child theme not de-registering a patent javascript file

We're currently rolling out a number (>100) of wordpress sites where we're using a custom child theme and a holding page plugin. Most of our clients use IE8 as their browser (corporate policy) and ...
1
vote
3answers
458 views

How do I sanitize a javascript text?

I have a textarea that will receive a js snippet(Google Analytics). Is there a way to sanitize that? Since I cannot use functions like wp_filter_nohtml_kse(), what should I use?
0
votes
1answer
58 views

Showing Different Code on Pages With Different Layouts

I have pages and posts on a WordPress site. The pages have various layouts. Parent pages are following a 2-column (maincontent + right sidebar) layout while child pages have a one-column layout (no ...
2
votes
1answer
304 views

Trigger Customizer saving process with Javascript only

I'm working on a custom theme that uses WordPress Customization API to let the user play with parts of the content of his website, basically the front-page which he can modify by adding/removing ...
0
votes
0answers
44 views

3.5.x Theme Customize: Handling Custom Control Requests

I am extending the WP_Customize_Image_Control as a means to include an upload-able word mark for a site. The control works just fine, but I need to do some post process handling on the image (i.e. ...
0
votes
2answers
411 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
1answer
352 views

Creating a custom wordpress widget and stopping js from running twice(once in active widget once in widget selector)?

Ok so here's the question how do i stop js from running twice on the widget.php page? I am creating a ajax loaded custom image selector from a domain on the same server as the current site. I want ...
6
votes
1answer
827 views

How to load wp_editor via AJAX

Does anyone know how o load wp_editor via AJAX in WordPress? My markup and editor is getting loaded properly but editor controls are not getting loaded properly, it may be because Javascript is not ...
0
votes
1answer
161 views

Localizing methods for jQuery append prepend wrap parent

So I am serializing some options in WordPress and then localizing them to be used in my jQuery script, however what I am trying to do next isn't working. jQuery('.advert')+ lu_ban_object.method ...
4
votes
1answer
433 views

Unable to get Preview of Uploaded image within a Custom Meta box

I first followed the steps in this tutorial. Added the Image Uploader, tried it out but I realized it's an older version of the WP Uploader... So I then found this post, and now my uploader is ...
1
vote
2answers
60 views

How do I add JavaScript that will execute on all my sites in Multisite?

We are creating an internal network of sites using MU and there are some small things we would like to have globally on all the sites without having to add them individually for each site. I would ...
1
vote
1answer
158 views

Best approach to fetch data from wp options to js file or php file

I am creating my first ever plugin, as I am not a programmer, I have been following tutorials and reading the codex, etc. My plugin consist in showing a notice to users when certain conditions are ...
0
votes
2answers
72 views

Trigger a function during onload

I recently added Javascript and CSS files into the wordpress. All the files are being registered through functions.php. One of the files is my_worldmap.js as shown below $(function() { ...
0
votes
1answer
44 views

Load custom script on a single template

So I placed two scripts in the plugin folder, but I can´t figure out why they wont load. I created a custom template where I have placed the following code: <?php function my_enqueue_scripts() { ...