Title: Execute javascript in table
Last modified: August 20, 2016

---

# Execute javascript in table

 *  Resolved [danseurs.visages](https://wordpress.org/support/users/danseursvisages/)
 * (@danseursvisages)
 * [15 years ago](https://wordpress.org/support/topic/execute-javascript-in-table/)
 * Hello,
    first sorry for my bad english 😉
 * I’m using a plugin (wowhead tooltips) which parse a post to replace [item]12345[/
   item] by an URL. To do that, i have insert javascript in the worpress header.
   php. But it doesn’t work for cells’ table. It seems that the plugins parse the
   post before wp_table insert the html code of a table.
 * One solution is to insert this javascript in wp_table. Is it possible ?
 * An other is to try to parse the post after wp_table insert his html => i will
   post to wowhead tooltips site to know if it is possible.
 * Last is to insert directly the URL in cell. It’s working but need some more work
   for me 🙂

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [15 years ago](https://wordpress.org/support/topic/execute-javascript-in-table/#post-2087283)
 * Hi,
 * thanks for your post.
 * Yes, you can execute JavaScript in table cells. You will however need to put 
   everything in one line, so there can not be any manual line breaks in the code(
   only those that automatically come from the browser, due to the width of the 
   textfields).
 * Regards,
    Tobias
 *  Thread Starter [danseurs.visages](https://wordpress.org/support/users/danseursvisages/)
 * (@danseursvisages)
 * [15 years ago](https://wordpress.org/support/topic/execute-javascript-in-table/#post-2087291)
 * Sorry, my question is not enough accurate ^^
 * Actually i insert this 3 lines in the header.php of my theme but they don’t parse
   cells’ table :
    <link href=”./wowhead/css/wowheadtooltips.css” rel=”stylesheet”
   type=”text/css” /> <script src=”[http://static.wowhead.com/widgets/power.js”></script&gt](http://static.wowhead.com/widgets/power.js”></script&gt);
   <script src=”./wowhead/js/armory.js.php” type=”text/javascript”></script>
 * I want to do the same thing so the javascript will be execute in the wp-table.
   Is there a wp-table header where i can insert this ?
 * In other words, how to parse data in wp_table using the javascript declare in
   my header.php ?
 * Hope you will understand what i mean 🙂
 * Tanks for your patience.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [15 years ago](https://wordpress.org/support/topic/execute-javascript-in-table/#post-2087305)
 * Hi,
 * the JavaScript parsing is done after the page is completely generated, so it 
   does not really matter where the content comes from.
 * The actual problem might be that the bbCodes are interpreted as Shortcodes by
   WordPress and therefore removed.
 * Can you please post a link to the page with your table?
 * Regards,
    Tobias
 *  Thread Starter [danseurs.visages](https://wordpress.org/support/users/danseursvisages/)
 * (@danseursvisages)
 * [15 years ago](https://wordpress.org/support/topic/execute-javascript-in-table/#post-2087351)
 * Hello,
    if the parsing it done after, i think it’s the other plugin which fail.
   I will investigate this evening.
 * here en example : [http://www.slc.fistandantilus.com/vvcc/wp/66](http://www.slc.fistandantilus.com/vvcc/wp/66)
 * The page code is :
    [item]62406[/item] [table id=16 /]
 * in table 16, i have [item]62406[/item]
 * Outside of the table, [item]62406[/item] is convert to [Gants de fièvre des os]
   
   Inside the table [item]62406[/item] is not convert.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [15 years ago](https://wordpress.org/support/topic/execute-javascript-in-table/#post-2087377)
 * Hi,
 * ok, thanks for the link. As it seems, the replacing is indeed already done in
   PHP (then the JavaScript is only used to render the tooltip).
 * I checked the source code of the plugin and the plugin does not use the default
   WordPress Shortcode API, but a custom implementation. This can however be fixed,
   so that the replacing also works in tables.
 * Please add this code to the “functions.php” file in your theme folder:
 *     ```
       add_filter("wp_table_reloaded_cell_content", "whp_parse");
       ```
   
 * Regards,
    Tobias
 *  Thread Starter [danseurs.visages](https://wordpress.org/support/users/danseursvisages/)
 * (@danseursvisages)
 * [15 years ago](https://wordpress.org/support/topic/execute-javascript-in-table/#post-2087384)
 * Hello,
    it work nice. Tanks a lot 🙂
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [15 years ago](https://wordpress.org/support/topic/execute-javascript-in-table/#post-2087409)
 * Hi,
 * no problem, you are very welcome!
 * Best wishes,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Execute javascript in table’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-table-reloaded_f7dcd3.svg)
 * [WP-Table Reloaded](https://wordpress.org/plugins/wp-table-reloaded/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-table-reloaded/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-table-reloaded/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-table-reloaded/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-table-reloaded/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-table-reloaded/reviews/)

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * 7 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/execute-javascript-in-table/#post-2087409)
 * Status: resolved