|
Back
Javascript Error: 'id' is undefined when using FreeTextBox
Problem I unzipped FreeTextBox 3.0.4 to a directory and created a virtual directory to it. I copied the client files to /aspnet_client/FreeTextBox/, created a virtual directory pointing to the unzip location, and tried to load http://.../sample01.aspx in IE 6. When I hover the mouse over any of the tool buttons, I get the following JavaScript error:
Line: 27 Char: 69 Error: 'id' is undefined Code: 0URL: http://.../sample01.aspx
Resolution
- Make the following change in the FTB-ToolbarItems.js file. You have to add this to the file FTB-ToolbarItems.js:
var id=this.td.button.id;
It will look like this:
FTB_Button.prototype.Initialize = function() { var id=this.td.button.id; FTB_AddEvent(this.td,"click",function() { if(FTB_Browser.isIE) document.getElementById(id).button.Click(); else this.button.Click(); } ); FTB_AddEvent(this.td,"mouseover",function() { if(FTB_Browser.isIE) document.getElementById(id).button.MouseOver(); else this.button.MouseOver(); } ); FTB_AddEvent(this.td,"mouseout",function() { if(FTB_Browser.isIE) document.getElementById(id).button.MouseOut(); else this.button.MouseOut(); } ); };
- Set the "SupportFolder" property in the FTB properties to whatever folder you want, i.e "/myproject/FreeTextBox"
- Change the "JavaScriptLocation" property to "ExternalFile"
- Drop all 5 .js files into the folder you set as your "SupportFolder"
This should let you still use all the rest of the FTB internal resources, only the java script files will be external. Later, when the bug is fixed, you can switch the .js files back to internal if you want pretty easily.
Back
|
|