Web Development Blog

[FIXED] ib is null – ibrowser Plugin for TinyMCE

I, like you, have run into the problem of ibrowser not working for Firefox (FF3). This is a pain as it seems like a great free image uploaded/manager for TinyMCE. The problem I kept running it is that after installing ibrowser and then testing it out, is that the icon to open up the popup for this plugin does nothing. Under further investigation I discovered I was getting a JavaScript error “ib is null“.

Well, so I search Google and found some people saying to add “var ib = null;” (no quotes) to the beginning of the editor_plugin.js. I opened my editor_plugin.js file and see that for my version this bug fix is already in there (aka ib = null; as already pasted into the beginning of this file). So back to square one, problem still not solved.

Then I looked through the code and found that the issue seems to be that on line 14 (of my version) which reads tinymce.ScriptLoader.load(url + ‘/interface/common.js’); this is not actually loading the script. So I just commented that line out and copied and pasted that whole script under that line.

That seemed to work and I got the ibrowser to open and upload images. But it would now not insert the image into the editor when you click the insert button. And I saw that I was getting the JavaScript error “opner.ibrowser_callback is not a function” now.

So this copy and paste method was not really working. I realized then that if the problem is that its just not loading the script then I should add in some code that will load the script for me.

[SOLUTION]

I’m luckly already using jQuery so I just did the following:

  1. In the file editor_plugin.js (located in ibrowser root plugin folder) commented out the line:
    tinymce.ScriptLoader.load(url + '/interface/common.js');
  2. Added the following line after that:
    $.getScript(url+'/interface/common.js'); // BUG FIX by Sean Gallagher www.GallagherWebsiteDesign.com
  3. Do the same as the above 2 steps for editor_plugin_src.js file as well
  4. That’s it! Upload editor_plugin.js and editor_plugin_src.js to your server and your done.

For non-iQuery users try the following solution – I’ve not tried this but others said it worked.

  1. In the file editor_plugin.js (located in ibrowser root plugin folder) commented out the line:
    tinymce.ScriptLoader.load(url + '/interface/common.js');
  2. Added the following line after that:
    tinymce.ScriptLoader.add(url + '/interface/common.js'); tinymce.ScriptLoader.loadQueue();
  3. Do the same as the above 2 steps for editor_plugin_src.js file as well
  4. That’s it… for more on this solution check out the TinyMCE forum thread for this (this solution is on the last page of that thread).

For more on jQUery script loading check out the getScript function.

To download ibrowser visit visions4net.com’s download page.

To download TinyMCE check out the TinyMCE home page.

10 Comments

  1. Horst

    You know what? YOU SAVED MY A$$! Thank you so very much for giving the world this bugfix :-) :-) :-)

    Reply
  2. miro

    works for me :) thanks!!!

    Reply
  3. patryk

    Hi! I’ve got still problem: after click on ibrowser icon, the popup will open, but for a moment will close and i see only that i can download ibrowser.php. Where’s the problem? Maybe my server configuration? Please, help me!

    Reply
  4. Gallagher Website Design

    @patryk, yes sounds like you don’t have PHP installed on your server. Is your server running PHP? Check into that but also you could add/create a .htaccess file (use a text editor to make the file and name it .htaccess) and place it into the folder where ibrowser.php resides. Of course that file won’t work unless you have PHP and are running Apache as your web server. Let me know how it goes.

    Add the following text (in the blue box below) to the .htaccess file:

    AddType x-httpd-php .php
    Reply
  5. patryk

    @gallagher: i’ve got installed: on windows xampp, on ubuntu LAMP. And on the both is the same problem. I did you wrote and no changes:( I’ve got no problems with other php files

    Reply
    • Gallagher Website Design

      @patryk, Sounds like something is wrong on your server or PHP settings. Did you try what I said regarding adding a .htaccess file and the code I posted in my other comment? Also let me make sure I have this right… your problem is when you click the ibrowser icon you get a dialog box to download the file ibrowser.php, right? If so then it has to be your server or PHP settings. Could also be another .htaccess file that is causing the problem.

      Reply
  6. Harald

    Thank you verry much

    Reply
  7. aayushi

    Thanks a lot. it works :)

    Reply
  8. solaandrews

    You are a life saver!!! thank you a million

    Reply
  9. Francis

    I got 3 + hours to install iBrowser…
    iBrowser is a very complex project; so developers must fix these minor bugs that destroy this program!!!!!

    However THANK YOU VERY MUCH gallagher!!!!

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Request A Free Quote

GET OUR PRICING GUIDE

Enter your email address below, and we'll send you our current pricing guide immediately.