A client side scripting language useful for making interactive web sites

learn more… | top users | synonyms

0
votes
1answer
4k views

Close modal window after form submit [closed]

I have this in a php file from Contact Form 7, which I load into a modal window (FancyBox) and I would like to close it after the user will press the Submit button. I was thinking of adding onSubmit=...
0
votes
1answer
1k views

wp_enqueue_script not loading my custom js file

I am using the following code below in my functions.php, However app.js is not found when I inspect it in the resources tab. It is looking for it in http://localhost:8888/goodMorningMoon/javascripts/...
0
votes
1answer
774 views

How do I get my nav menu to show sub pages?

http://webdesignsalemoregon.com/westernmennoniteschool/ is my website. I've got the top menu which is the one that was in the theme when I started to customize it. It's got a test drop down that ...
0
votes
3answers
270 views

Add jQuery function to media button

I have added a custom button to the media actions in a custom theme, function wp_myplugin_media_button($context) { $wp_myplugin_media_button_image = '../wp-content/themes/datamine/images/...
0
votes
1answer
120 views

Loading scripts on a single page plants the script in the footer

I'm using this code to plant a script on a spesific page, it works but inserts the script into the bottom of the page not the top - I'm at a loss to explain why! Is there a way to do this that results ...
0
votes
1answer
574 views

'ajaxurl' is undefined — wp-includes/js/wp-lists.js

My site displays the following script error in IE8: Webpage error details Message: 'ajaxurl' is undefined Line: 1 Char: 102 Code: 0 URI: http://www.superlogical.net/wp-includes/js/wp-lists.js?ver=...
0
votes
1answer
2k views

Theme has superfish - how to add supersubs?

I'm using a theme that is using Superfish for the navigation menu. The problem is, if the sub item is too long it will drop underneath, i want to keep the individual menu item's text on one line. Now ...
0
votes
1answer
811 views

Ajax page load in wordpress the right way?

I tried something like the following but if the page I'm loading has javascript it's not running because the elements are created after page load. When the javascript is something I wrote I simply ...
-1
votes
1answer
91 views

wp_enqueue has a resource but doesn't generate a script tag [duplicate]

Possible Duplicate: wp_enqueue_script isn't connecting my custom js file I am really confused as to how wp_enqueue_script works. I have the following code in my header, and when I inspect ...
1
vote
1answer
316 views

wp_enqueue_script isn't connecting my custom js file

I am using wp_enqeue_script to link to a custom.js file in my plugins folder. However I am expecting a link to show up on the page but it doesn't is there something else I am supposed to other than ...
0
votes
1answer
482 views

How can I put this JavaScript into WordPress? [closed]

I've got a client who is using WordPress and WooCommerce. I'm trying to add a button to a file. I can get the button to show up, both in the front end editor, and in the template files. But I can'...
7
votes
1answer
1k views

Wordpress Admin Bar pushed Sticky Footer off the bottom of the page

I've implemented Ryan Fait's oh-so-common sticky footer in a custom Wordpress theme. I've noticed now if I implement the Wordpress Admin Bar into my pages, which is 28px high (in current Wordpress ...
0
votes
1answer
672 views

Getting a 'slide down' js panel implemented within WP

I'm trying to implement a very simple vertical slide down panel in Wordpress, I've tried jbar (http://tympanus.net/codrops/2009/10/29/jbar-a-jquery-notification-plugin/) and an easy JS method I found ...
-1
votes
1answer
590 views

Javascript from Easy-Fancybox place into footer

the Easy FancyBox WP-Plugin works fine for me. Just the script will be placed in the header of my source, like other plugin, too. I´d like to push it down to the footer of my website (incl. the ...
0
votes
2answers
1k views

How to execute a plugin on a single page only?

A few basic questions to accelerate my wordpress plugin development start. I'd like to develop a wordpress plugin that adds some javascript and css to a specific page. What filters or actions should ...
7
votes
4answers
6k views

How to use Head JS with all enqueued scripts?

I want to load head js first and then all enqueued scripts into it's function. Like so... <script src=">/js/head.load.min.js" type="text/javascript" charset="UTF-8"></script> <...
0
votes
2answers
1k views

Script loaders vs wp_enqueue_script

My Wordpress theme has a lot of .js scripts running and it takes plenty of time to load them all one by one. I would love to use a script loader like HeadJS or yepnopejs to speed things up. But... ...
1
vote
1answer
533 views

Where is the WP auto-save draft JavaScript?

If you write a title, then move away from (blur) that input field, WordPress will auto-save a draft for you, likely in order to create a post slug placeholder for you. I'm looking to possibly extend ...
2
votes
1answer
1k views

jQuery Tree View and wp_list_pages

I'm looking to use the jQuery TreeView script on wp_list_pages to get a nice collapsable-tree effect going. The script requires that I add some classes to the list elements such as: <ul id="red" ...
1
vote
1answer
225 views

How do display simple page for printing product info? [closed]

I'm using WP 3.1.2 and latest e-commerce plugin. Now I'm stuck at creating simple page for printing product info. It has to be only product information with not WordPress header and footer. The pop up ...
0
votes
1answer
43 views

On one of my sites a file is shown as 404 but the file IS there

(Cross-posted from stack overflow) I am building a WordPress plugin. The plugin works beautifully on one site. But on every other site I've tried so far one of the resource files used it getting a ...
1
vote
1answer
353 views

What is the “proper” way to generate a javascript variable depending on a custom field value?

On my site I have some posts with a custom field "Name". Now, in case the post has "Name" set, I want to generate this code: <script type='text/javascript'> var FG_DONATE_BUTTON_PARAMS = { ...
0
votes
1answer
102 views

wp_enqueue_script causes page to vanish

The goal- include my-script.js (dependant on jquery) in my WP theme. The problem- When I use this code,(in the head element of the header template file) my entire page goes blank when loaded: <?...
0
votes
1answer
117 views

Wordpress getting css and script files from client machine rather than the server machine

I'm a noob Wordpress user and I'm having an odd problem. I managed to install Wordpress edit the wp-config file and everything. However when I browse my site from a remote machine no css or script ...
3
votes
1answer
1k views

How to disable hoverIntent in Wordpress 3.3 admin

I don't like hoverIntent in the new flyout menus or admin bar; to me, it makes my page feel slow. What would be the Wordpress-friendly way to disable hoverIntent (or change its options) in the new ...
3
votes
1answer
122 views

What happened to convertEntities?

I was using the javascript function convertEntities in a plugin that worked great until recently and now the function seems to have vanished under 3.3 - Is there a substitute function I should be ...
1
vote
1answer
5k views

Implementing lazy loading in homepage posts instead of pagination

I have lots of posts in my website. I have used default pagination function for paging the post list in homepage. But I wanted to implement lazy loading instead of pagination just like in twitter. I ...
1
vote
1answer
8k views

How can I run AJAX on a button click event?

Update: I managed to get the AJAX working, but not in the click event. I updated the question to match this. I'm trying some code I found on the page: 'AJAX in Plugins'. However I can't get it to ...
1
vote
2answers
878 views

Auto-detect javascript errors and warn theme user

This may sound simple, but it's not :) What I want, and most likely many theme developers do (themes that use javascript / jquery), is to warn the theme user that his site has javascript errors. In ...
8
votes
1answer
4k views

wp_enqueue_scripts, wp_register_scripts, wp_print_scripts: i'm confused

I've been reading up a bit on this subject, but the more I read - the more confused I get. Can someone explain to me in short what's the exact difference between wp_enqueue_scripts, ...
0
votes
1answer
744 views

PHP variables in a post?

I'm very new to PHP. On a Wordpress site, I want to use custom Google Maps with the Javascript API V3. Some posts will have maps in them, and I want to use PHP variables to determine the unique ...
3
votes
2answers
677 views

How to disable admin flyout menus?

Seriously, I hate flyout menus with a passion, and now they're popping up all over the place in the admin screen. (They are particularly heinous when you use the blue admin theme, because they add a ...
0
votes
1answer
545 views

how to insert a HTML form into a javascript popup?

I'm working on a plugin that generates a list of candidates as output. For each candidate there is a link (View Details) that once is clicked, a popup appears. I need to put a simple contact form into ...
0
votes
1answer
543 views

Remove Javascript generated by Comments

In a theme I am working on, the comments form (mostly sure they are both comments form) adds javascript to the header. <script type='text/javascript' src='http://[URL]wp-includes/js/l10n.js?ver=...
0
votes
1answer
1k views

TinyMCE in a div / textarea on frontend?

I have a post on my frontpage and I want to add the TinyMCE editor to it and could not make it work. I've tried these guides without any luck http://stackoverflow.com/questions/2855890/add-tinymce-...
4
votes
4answers
3k views

js error on post editing page

I'm getting a Javascript error on the wp-admin/post.php page which prevents me from adding tags/editing the post's link.. pretty much everything with JS... anyway, the error is: > Error: d....
1
vote
1answer
407 views

Mixing Regular Javascript With jQuery in a Plugin

Sorry for a simple question. I'm learning about plugins. I've got some javascript that I want to put in a jQuery file in my plugin. (I've got jQuery and the scripts enqueued, and working fine). ...
0
votes
1answer
222 views

how can i send this to wp_head - escape problem

how can escape this char ----> ; i ask becuse i want to use this to send some javascript to the head using wp_head this is want i want to attach to wp_head: add_action('wp_head', '...
0
votes
2answers
1k views

Store JSON in a custom field

I have a drawing canvas on some of my Wordpress' post pages, where users can draw on. Upon drawing, my JS code currently sends the user's drawing to a php file. This is where I store the array in JSON ...
13
votes
4answers
6k views

Solutions for generating dynamic javascript / CSS

Let's say you need to generate javascript or CSS code that depends on the current context. For example you have a form on the homepage that fires an ajax request on submit, and a different form on ...
8
votes
8answers
14k views

What does l10n.js do in WordPress 3.1? And how do I remove it?

I just installed WP 3.1 Beta 2 on my test server. I noticed that it ships with a new l10n.js file that gets automatically inserted into the header. I did a bit of digging and it has something to do ...
0
votes
1answer
309 views

How to make a Post Tag primary?

We are trying to rethink how a blog is laid out, by using Tags as primary headers for each post, instead of Categories. In order to do this, we have to set a Tag for the post as Primary. So, we are ...
2
votes
1answer
1k views

Insert shortcode in post editor from javascript (Visual / HTML)

I want to insert a shortcode in the Wordpress Post Editor from javascript (not a tinymce plugin). I currently use: tinyMCE.activeEditor.execCommand('mceInsertContent', false, "[SHORTCODE]test[/...
0
votes
3answers
326 views

Jquery not working

(function($) { $(document).ready(function(){ /*$('body').css('position','relative'); $('body').animate({'left':'-9999px'},3000);*/ alert('hello'); }); }(jQuery)); ...
1
vote
1answer
1k views

Open div inside a custom post-type with Fancybox

I did have a similar problem with this but never managed to find a solution... I have a custom post-type with a number of pages, but what I want to do is grab a particular div from the pages and ...
0
votes
1answer
1k views

How to Run a jQuery Script after a Javascript Script has Finished in WordPress

I've got javascript (a) and jQuery script (b). I need (b) to run after (a) has finished running. I need them to run sequentially. How do I do that? In wp_enqueue_script, I've made (b) dependent on (a)...
4
votes
3answers
4k views

trying to enqueue script in wordpress

I've read the codex section on wp-enqeue, but am still struggling. Basically, I would like to get the following to display properly in my theme's widget area (on every page): <link rel="...
0
votes
1answer
1k views

wp_enqueue_script() not working

I'm trying to add this social-network button: <a href="http://svejo.net/submit/?url=[your url]" data-url="[your url]" data-type="compact" id="svejo-button">Add in Svejo</a> ...
0
votes
1answer
704 views

jQuery UI Tools (Flowplayer) Issues

As great as the jQuery Tools might be they're giving me a headache. I want something like this for my website. I have the necessary script included (and Scrollable works just fine btw.): <script ...
0
votes
1answer
74 views

should i be checking for jquery before enqueing it in a plugin

At the start of a typical plugin which uses jquery I have something like the following wp_deregister_script('jquery'); wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/...