Monday, March 26, 2012

Fixing Twitter Bootstrap and Eclipse Javascript Errors

I've been meaning to play with Twitter Bootstrap and some of it's other associated projects like Font Awesome lately and decided to see if I could integrate into a sample application I'm building.  I'm using an SpringSource Tool Suite 2.9.1 which is based on Eclipse 3.7.2.  When using a Dynamic Web project type and bringing in the assets directory from the Bootstrap download into my WebContent directory, I kept getting JavaScript errors, lots of them.


I realized that it was simply complaining about a single prettify minimized js file that went away if I got the unminimized version.  But I'm stubborn so I refused to let Eclipse win with this work-around...

At first I thought it was related to the Validator or a Builder.  But then I noticed that there was a JavaScript reference to a runtime and I checked the Facets.  Sure enough there is a JavaScript facet that you can unlock and then uncheck.




Since I am not using that capability now, removing that Facet seemed to do the trick once I applied and executed a Project -> Clean, but at least on one occasion I actually had to rename/replace the javascript file that was causing problems to be marked as directed to in this Stack Overflow thread.  Once that was out of the way I now had a nice Bootstrap example ready to customize.  I simply copied one of the html files like starter-template.html or hero.html over from the Bootstrap examples directory and fixed the asset references with a replace-all.  If you have a better approach to get Bootstrap and Eclipse to play nicely, I'd love to hear about it.







10 comments:

InnomaxMediaLLP said...

Useful information shared..Iam very happy to read this article..thanks for giving us nice info.Fantastic walk-through. I appreciate this post.
Web development Company

akhil sharma said...

great work...very nice
valentine quote for whatsapp
valentine quote for boyfriend
valentine quote for girlfriend
valentine wishes for wife

Robert Richard said...

Furniture Removalists Sydney A renowned furniture removalists in Sydney, Bondi Removals is now offering furniture removal services at the most competitive prices. The furniture removal services they offer are carried out by their team of highly skilled and talented professionals employing cutting edge technological tools.

Devi.Angularjs said...

Wow. This really made my day. Thanks a lot!

Javascript Training in Chennai | HTML5 Online Training | JQuery Online Training

JavaScript Training Courses | Javascript Online Training | Angular 2 Training in Chennai

Devi.Angularjs said...

Interesting Article

Angularjs Training in Chennai | Backbone.JS Training in Chennai | Bootstrap Training in Chennai | Node.js Training in Chennai | Typescript Training in Chennai

Devi.Angularjs said...

JavaScript Training in Chennai JavaScript Training in Chennai Angular 2 Training in Chennai Angular 2 Training in Chennai | HTML5 Training in Chennai JQuery Training in Chennai JQuery Training in Chennai

Devi.Angularjs said...

HTML5 Training in Chennai HTML5 Training in Chennai | Angular 2 Training in Chennai Node.js Training in CHennai Node.js Training in chennai Ecmascript 6 Training in Chennai Ecmascript 6 Training in Chennai ES6 Training in Chennai ES6 Training in Chennai

Srinivas Ganta said...

very nice trick...thanks bro

Haxie 100 said...

HAPPY NEW YEAR 2017 Wishes
HAPPY NEW YEAR 2017 Profile Pics
HAPPY NEW YEAR 2017 Status Happy New Year Guys

riyaz shaik said...

Free Mp3 music download sites
Free MP3 download sites
Free music download sites
Free Mp3 music download sites 2017