A client side scripting language useful for making interactive web sites

learn more… | top users | synonyms

1
vote
1answer
351 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
116 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
870 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
736 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
674 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
540 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
541 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' ...
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 ...
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: ...
1
vote
1answer
401 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
221 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 ...
12
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
303 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, ...
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 ...
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 ...
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
702 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', ...
1
vote
2answers
9k views

How to use div -ids in url to jump to specific post…Is trailing slash the culprit?

Some links on my site take the user to a specific post in context on a category page. On non-WP sites, this is easily accomplished by including #example-div-id in the url like this: ...
0
votes
1answer
121 views

Load Javascript for a widget Worpress

I want to load a special Javascript File just when the widget is loaded in the sidebar. Where do I have to put my wp_enqueue_script(...) lines? class controller_widget extends WP_Widget { ...
1
vote
2answers
962 views

Google Maps and Yandex Maps doesn't work correctly

When I try to insert a map into my WordPress page, I get only a gray-colored field with some controls as shown on the picture: No matter, how I put in into the page: by using a special plugin or ...
0
votes
2answers
3k views

Properly embed javascript into WP (using function.php) - doesn't work?

It seems that my contact form's ajax javascript and the custom.js that I'm using for my drop-down navigation are interfering with each other. The contact form's ajax fuction will only work properly ...
0
votes
2answers
273 views

wordpress admin plugin menu custom css

I have a plugin that has a top level menu and subsequent submenus. Each one of these pages are going to need their own css and javascript. My code at the moment is: //main menu add_menu_page( "My ...
1
vote
1answer
1k views

Run JS after widget settings are saved?

I've written a small widget that uses JS for setting up some tabs in the settings panel. Is there a way to re-trigger the tab JS when the widget is done saving? Looking at the WP JS source it doesn't ...
0
votes
1answer
205 views

Using jquery and javascript in Wordpress

After trying for many many days without any improvement, I think I have no other choice but to ask for your help. I have to admit that I don't know much about coding, but I've tried various tutorials, ...
1
vote
1answer
139 views

wp_enqueue_script & constants?

I'm enqueuing a script: wp_enqueue_script('my-script', MY_SCRIPTS."/my-script.js"); How to get MY_SCRIPTS const working in this context? I know this works: $template_dir = ...
0
votes
1answer
975 views

Load images after page load

I just heard somewhere that by using some javascript it is possible to load of a page after the entire page load completes, When I googled, I found LazyLoad, but it seems that latest browsers are not ...
2
votes
1answer
499 views

Javascript Helpers

Are there any WordPress specific Javascript functions that could be used as helpers when writing custom code? I am thinking specifically of one that would pull back the base URL of your install, but ...
0
votes
1answer
424 views

How do I override all stylesheets and scripts without a plugin

I'm finding that plugins completely destroy my source formatting and generally suck at following standards. How can I absolutely block all style-sheets and move all .js to the footer of the site ...
0
votes
1answer
342 views

Hovercards and other hover over image functions don't work anymore!

This problem is driving me crazy. So, I've Jetpack installed and the Gravatar hovercards activated. I could live without them, but other "hover over image" functions (e.g. I'm using the Guan Image ...
0
votes
1answer
264 views

How can I duplicate “Add Custom Field” with just JavaScript?

I frequently need to add several Name-Value pairs to the Custom Fields of a post. At present I add these one by one, by entering the Name and Value and clicking Add Custom Field. I'd like to speed ...
0
votes
1answer
35 views

What's the default setting for including a <script> in a post

As we're evaluating whether we should build a Wordpress plugin and in that context I'm trying to figure out how Wordpress handles script tags in a post? What's the default setting? Thanks!
1
vote
2answers
2k views

Jquery conflict

I have been trying and trying to fix jquery issues. i have in my header lots of jquery. I use it for slider and other things that are built into this premade theme. I am unable to add anything that ...
0
votes
1answer
395 views

A carousel slideshow plugin in JavaScript

Am looking for carousel slideshow plugin that is similar to the one implemented here. Any JavaScript slideshow that closely resembles that one would do. It does not even have to be a WordPress ...
0
votes
2answers
66 views

W3TotalCache and Javascript — what should go where, when?

I'm just starting to use W3TotalCache and am a little perplexed by how I should load the gobs of javascript and CSS rendering on the site in the question. Adding some of the pre-minified jQuery ...
3
votes
1answer
218 views

Force core to use .dev JavaScript files

I was wondering if there's some constant telling WordPress not to use the minified versions of scripts but instead load .dev ones. Already tried define('SCRIPT_DEBUG', true); but it only turned off ...
1
vote
4answers
317 views

Script will not print in head if path to file is correct

I'm dealing with a rather hackish implementation, where header.php has this line: include_once "tracking.php";. Inside tracking.php, there are these lines: <script type="text/javascript" ...
4
votes
1answer
4k views

Hook the Keydown Event in the TinyMCE Post Editor

I would like to hook the keydown event in the TinyMCE Editor on the edit post admin page. I managed to hook the HTML content editor using the following code: jQuery('#content').keydown(function(){ ...
0
votes
1answer
1k views

Insert JavaScript in a blog post or a new page?

I want to insert some JavaScript into my post. Actually those are some small apps made in JavaScript. Please let me know how to insert the JavaScript into the post ?