A client side scripting language useful for making interactive web sites

learn more… | top users | synonyms

8
votes
4answers
19k views

How can you check if you are in a particular page in the WP Admin section? For example how can I check if I am in the Users > Your Profile page?

I'm building a plugin and I want to add bits of javascript in the admin head but only for certain admin pages. I don't mean pages as in a WordPress page that you create yourself but rather existing ...
1
vote
2answers
2k views

How to trap “Publish” button to check for meta box validation?

I'm trying to do some form validation on my custom meta box, and I remember somewhere reading about some javascript function to disable/enable the Publish button - except I can't find it. How do I ...
0
votes
1answer
148 views

JS behavior differs depending on page tree

I'm a developer for a very large real estate plugin and I'm having a lot of trouble with one of our agent sites: The init methods used to initialize ajax functionality are called using a jQuery(...
0
votes
1answer
1k views

Add text to Text Widget using Javascript

Wordpress has a Text Widget (at least the theme I'm using does, and I think they all do?) In this widget I can add text or HTML. If I add HTML I can include JavaScript. This works fine (I'm hosting ...
1
vote
1answer
586 views

Help display image in single post using javascript zoom image..?

Can someone helping me implement single post image with Javascript features with image zoom such i found here : http://www.housetohome.co.uk/galleries/bedroom/adult/Relaxed_country_bedroom_31391.html ...
-1
votes
3answers
2k views

Admin panel: Javascript not loading properly. Cannot edit pages/posts [closed]

I am using the latest Wordpress.org install. None of my back-end javascript is working, none of my navigation drop downs, admin panel areas are not loading as well. I have not edited any core files. ...
3
votes
1answer
772 views

Loading Javascript Only When Specific Content Existing in a Post?

I'm trying to add Javascript for my "PrettyPhoto" plugin to pages only when their content contains rel='prettyPhoto'. This looks very simple to me but all solutions I've found on the internet doesn't ...
1
vote
1answer
269 views

Inserting code to HTML view from a pop up initiated from visual view

I am trying to insert html into the HTML view.What i have done is to have tinymce advanced(a wordpress plugin) button that throws a popup and in it is all the necessary things to insert the html.The ...
1
vote
3answers
627 views

How to Add Javascript Only When a Function Exists?

I have a few function. For both of them need javascript code. I need to add javascript code in header only when function is active. At this time I have all my javascript code in header for all my ...
1
vote
1answer
255 views

add JS to multiple plugin admin pages

For a WP Theme with multiple admin screen (got its own main menu and some submenus), I want to add a common Js script to load on (only) all these pages. I know how to acheive this using the pagehooks ...
0
votes
1answer
1k views

Script to Automatically Advance to the Next Page of a Paginated Post

I have a custom post type that is just a paginated post and acts as a slideshow. How can I make it so that the reader can choose an option to have the slideshow advance automatically to the next page ...
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 ...
2
votes
3answers
1k views

Changing Font-Size based on specific Font thru javascript

I am using an 'rtl' font (named as JNN) in horizontal menu bar, which is normal & readable at 18px where as the alternate available 'rtl' fonts (like Tahoma & Arial Unicode MS) on Windows are ...
2
votes
1answer
319 views

Want to have the Post editor remembering the last editing position

As you probably know the WordPress theme editor remembers its last editing position, but I want my post editor to do the same (it jumps to the top if you save a post/page).... Any tips/hacks how to ...
1
vote
1answer
363 views

combining js scripts from a js newb [closed]

I've got a small .js file on my wp site where I have been adding in all of my small js scripts. It works perfectly, but I am stuck trying to figure out how to add in another script. So far jslint does ...
8
votes
2answers
3k views

How to configure Wordpress to be able to use <script> tag inside posts?

I'm looking for a solution that would allow me to write tags inside posts and be sure that the visual editor or wordpress will not alter them. The same problem can apply for other specific HTML code ...
3
votes
1answer
353 views

Does javascript have an equivalent to PHP's preg_replace_callback?

I have a php function that executes inside an add_meta_box() in the WP content editor (see below) that I would like to convert to javascript so that it executes on a button click (on demand vs ...
1
vote
2answers
619 views

Combining multiple javascript and css files

Is there any plugin which can automatically combine all the javascript and css files that are used on a page? While I can combine them manually I would like to avoid them as some plugins add their ...
3
votes
1answer
8k views

Comment form validation

How can I set the validation rules for the comment field? I change the value of commenter name/e-mail/homepage onmouseover and onblur (I use this instead of labels - so if the field is empty it ...
13
votes
3answers
12k views

Loading scripts only if a particular shortcode or widget is present

I needed a way to filter a page/posts content before it was loaded so I could add scripts to the header if a specific shortcode was present. After much searching I came across this on http://...
0
votes
1answer
5k views

Which plugin can do horizontal scrolling of RSS feeds in WordPress [closed]

I need a plugin which can do horizontal scrolling of RSS feeds in wordpress, I have got a vertical scrolling RSS feeds but cannot find a horizontal one
1
vote
2answers
276 views

Widget code is not working on WordPress.com Hosted Blogs

I have developed a JavaScript widget which works fine when I embed it in any of my html pages. The code is something like this <script type="text/javascript" charset="utf-8"> var asset_host = ...
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: http://www....
14
votes
5answers
11k views

Validating Custom Meta Box Values & Required Fields

Something which I have never seen covered is the best way to validate that specific form fields are filled out correctly for custom post type meta boxes. I am looking to get expert opinions on how ...
1
vote
1answer
542 views

Widget Javascript code (ajax)

I have a widget like this: class test_widget extends WP_Widget{ function test_widget(){ $widget_ops = array('description' => 'test widget'); $this->WP_Widget(false, 'Test', $...
6
votes
2answers
6k views

How to dequeue a script?

Wordpress has wp_enqueue_script() but not a wp_dequeue_script() function, so what would be the best way to dequeue a script? I'm using LAB.js to load all of my scripts rather than enqueueing them ...
0
votes
1answer
98 views

window resizing problem

I have been working on a plugin of wordpress, in which i save the last reading position, the width and height of the browser at the time of closing the browser, I save the width and height with jquery ...
2
votes
1answer
97 views

Wordpress problem with htmlentities

I make some changes over the post before storing it in the database. I use content_save_pre to do this. Some characters like " get done into &#8220; in the JavaSript code which I insert (part of ...
3
votes
5answers
8k views

Adding onload to body

I'm currently trying to develop a plugin that will embed a Google Earth Tour into a WP post / page via a shortcode. The issue I am running into is that for the tour to load, I have to add an onload="...
1
vote
2answers
206 views

JavaScript Files Registered in Parent Theme Won't Load When Calling wp_enqueue_script() in Child Theme?

I'm making a framework parent theme and in the parent functions.php, I want to register all the possible js files I use frequently and if I want it to load it, in the child functions.php I just have ...
1
vote
3answers
543 views

Why doesn't wp_enqueue_script() work when including a JavaScript file with TEMPLATEPATH?

I am trying to use tips from here to add my JS file. I put the following in the functions.php of atahualpa theme I've got installed function lektor_init() { if (true) { wp_enqueue_script('...
54
votes
2answers
28k views

What is the preferred way to add custom javascript files to the site?

I've already added my scripts, but I wanted to know the preferred way. I just put a <script> tag directly in the header.php of my template. Is there a preferred method of inserting external or ...
8
votes
2answers
651 views

Modifying a JS file with data from plugin settings

I have a plugin that, among other things, has a javascript file that requires a few user specific settings. What would be the best way to get those settings into javascript from the plugin's settings ...
5
votes
2answers
1k views

Test to see if jQuery or Prototype is queued by another plugin?

In my plugin, I want to test to see if jQuery or Prototype (or both) are going to be loaded by another plugin. So, have wp_enqueue_script('jquery') or wp_enqueue_script('prototype') has already been ...