Title: Xbel javascripts do not work.
Last modified: August 18, 2016

---

# Xbel javascripts do not work.

 *  Resolved [mrmac](https://wordpress.org/support/users/mrmac/)
 * (@mrmac)
 * [20 years, 12 months ago](https://wordpress.org/support/topic/xbel-javascripts-do-not-work/)
 * Hi, I installed Xbel on my website but I didnâ€™t manage to make it work.
 * As you can see ([http://lxp.it/index.php/my-bookmarks/](http://lxp.it/index.php/my-bookmarks/))
   the folders do not uncollapse.
 * I tried to disactivate any other plugin (but Ezstatic, needed by xbel). I tried
   to use the xbel file downloaded from another xbel-hacked site, I tried to surf
   the site with IE (instead of Firefox), I tried to put the tag in a post rather
   than in a static page, I tried to use other plugins than EZ to run xbelâ€¦
 * Nothing! The js for uncollapse the folders seems really not to workâ€¦
 * Any suggestion on what can cause this failure?
 * Thanks!!

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

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 12 months ago](https://wordpress.org/support/topic/xbel-javascripts-do-not-work/#post-222536)
 * Always look for the error (when it comes to javascript):
 * `Error: toggleFolderView is not defined
    Source File: javascript:toggleFolderView('
   nbMi72') Line: 1
 * I see this (in Firefox) when clicking on your javascript links. Check your js
   code; the quotemarks in it are being converted to numeric character references(
   for “pretty” single-quotes: ‘ and ’), and this is playing havoc with it’s functionality.
 * Question: Can you move your javascript function into your `<head>`? That’s really
   where it belongs.
 *  Thread Starter [mrmac](https://wordpress.org/support/users/mrmac/)
 * (@mrmac)
 * [20 years, 12 months ago](https://wordpress.org/support/topic/xbel-javascripts-do-not-work/#post-222575)
 * Hi Kafkaesqui and thank you for the support.
 * Thanks to your suggestions I began to better understand what’s up with the script
   and – above all – I understood how to make a deeper diagnosys in the future on
   similar problems.
 * Yet, my programming skills are a bit rusty (does it says anything “turbopascal
   v.3.0”?) 😉
 * I managed to locate the text of the script (here below) but I have no clue on
   how to fix the problem. I’m even unaware if having the text of the scripts itself
   can allow you (or anybody else) to support me (however I try!).
 * Concerning your question, for the little knowledge I developed of WP in these
   past two weeks, I believe that it’s impossible to move the JS to the head part
   of the page: the script is inserted via a php call in the actual text of the 
   post/page (XBEL plugin)… if you have suggestions – however – I will be glad to
   try them out.
 * >  <script language=”JavaScript”>
   >  function toggleFolderView(szDivID) { var obj
   > = document.layers ? document.layers[szDivID] : document.getElementById ? document.
   > getElementById(szDivID).style : document.all[szDivID].style; obj.display = (
   > obj.display == ‘none’ ? ‘block’ : ‘none’); var obj_title = document.layers ?
   > document.layers[szDivID+’_title’] : document.getElementById ? document.getElementById(
   > szDivID+’_title’).style : document.all[szDivID+’_title’].style; obj_title.backgroundImage
   > = (obj_title.backgroundImage == ‘url(<?=$folder_open?>)’ ? ‘url(<?=$folder_closed?
   > >)’ : ‘url(<?=$folder_open?>)’); }</script>
 * Many thanks!
    Mac.
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 12 months ago](https://wordpress.org/support/topic/xbel-javascripts-do-not-work/#post-222593)
 * “the script is inserted via a php call in the actual text of the post/page”
 * Yes, it would be inserted with the help of the `wp_head` hook, which should be
   in the `<head>` of your template (usually header.php). However, your Page source
   shows the javascript (above) is appearing in the `<body>` of your document, just
   before your bookmark links actually begin. So the question is, how is the plugin
   able to add the javascript in this portion of your Page?
 * Another question is how the quotes are being converted, but I suspect if we can
   answer the first, the second will be dealt with.
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 12 months ago](https://wordpress.org/support/topic/xbel-javascripts-do-not-work/#post-222594)
 * Actually, I took a closer look at this plugin, and the only element being inserted*
   automatically* is the stylesheet link. The js is added as part of the `xbel()`
   function. Are you calling this function within a Page template, or rather somehow
   from its content (i.e. Write/Manage > Pages)?
 *  Thread Starter [mrmac](https://wordpress.org/support/users/mrmac/)
 * (@mrmac)
 * [20 years, 12 months ago](https://wordpress.org/support/topic/xbel-javascripts-do-not-work/#post-222598)
 * The procedure I followed is the one described by the author of the plugin: I 
   inserted the following snippet of code
 * >  <?php xbel(); ?>
 * in the editor window of Write/Manage. In order to process it I installed EZstatic
   plugin, but I also tried (and got the same problems) with “the execution of all
   things” and some other plugin who is supposed to execute pieces of code…
 * Does this help to help? 🙂
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 12 months ago](https://wordpress.org/support/topic/xbel-javascripts-do-not-work/#post-222599)
 * Either WordPress or a text formatting plugin is converting the quotes when handling
   the Page content. Without doing some digging I can’t say what to change to fix
   this, but I can suggest another method to incorporate it into your Page:
 * 1. Make a copy of your theme’s page.php template, and call it bookmarks.php.
 * 2. Edit bookmark.php in a text editor (or your WordPress Theme Editor). First,
   add this to the very top of it:
 * `<?php
    /* Template Name: Bookmarks */ ?>
 * Then right after [The Loop](http://codex.wordpress.org/The_Loop) portion of your
   template (or within it but after `the_content()`), add:
 * `<?php xbel(); ?>`
 * 3. Go to Manage > Pages, edit My Bookmarks, and select “Bookmarks” from the Page
   Template dropdown list (then click Edit Page).
 * More information on Page templates:
 * [http://codex.wordpress.org/Pages#Page_Templates](http://codex.wordpress.org/Pages#Page_Templates)
 *  Thread Starter [mrmac](https://wordpress.org/support/users/mrmac/)
 * (@mrmac)
 * [20 years, 12 months ago](https://wordpress.org/support/topic/xbel-javascripts-do-not-work/#post-222601)
 * Kudos to you, Kafkaesqui, for having found a perfect solution for what I needed
   to do. Now the page works exactly as I wanted… Moreover I learnt different useful
   things along the way… hope I will be able to support others in the future!
 * [http://lxp.it/index.php/my-bookmarks/](http://lxp.it/index.php/my-bookmarks/)

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

The topic ‘Xbel javascripts do not work.’ is closed to new replies.

## Tags

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

 * 7 replies
 * 2 participants
 * Last reply from: [mrmac](https://wordpress.org/support/users/mrmac/)
 * Last activity: [20 years, 12 months ago](https://wordpress.org/support/topic/xbel-javascripts-do-not-work/#post-222601)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
