Wordpress plugin to insert javascript

Status
Not open for further replies.
I'm looking for a Wordpress plugin that will allow me to insert javascript into the HTML editor. Here's the problem though: I need to be able to insert PHP within the script I'm inserting.

Here's the particular bit of javascript I'm trying to embed:

Code:
<!--this function enables autocompletion for a text input box using jQuery.js-->
$(function() { 
    var availableTags = [
      
      <?php list_webcode('http://www.link.to.a.file.com'); ?>  
     
    ];
    $( "#tags" ).autocomplete({
      source: availableTags
    });
  });

I'm using another Wordpress plugin that allows me to use [insert_php] instead of <?php in the HTML editor, so I would like a javascript plugin that will let me use the PHP plugin I'm currently using.

Any suggestions?
 

smervy

Seniorius Lurkius
11
I would suggest just writing your own shortcode function. It gets really dangerous running php inside of the entry and writing a shortcode is very simple http://www.webdesignerdepot.com/2013/06 ... hortcodes/. You can then create params that could include the class to select or any other useful parameters and significantly simplify making changes to the functionality later.
 
Status
Not open for further replies.