Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Numbers Working with Numbers Create a Program with Math

How to open math.js in the web browser.

I'm unable to open math.js in the web browser. Every time I try, it opens string-to-number.js in the browser inseatd and doesn't show math.js as a file under the js folder.

Hi Frank Din,

If you don't mind, post a link to your workspace so we can check it out.

When you click the preview button in your workspace, the browser should be opening the index.html file (not a javascript file). If you're being prompted to answer how many HTML and CSS badges you have, then my guess would be that string-to-number.js is the script file you're linking to in index.html.

If this is the case, you'll need to change the value of the src attribute in the script tag from "js/string-to-number.js" to "js/math.js".

That said, if you post a link I'm sure that I or someone else can tell you exactly what the problem is.

1 Answer

Not sure why you want to do this? <click preview> and add /js/math.js to the end.

The contents of math.js is displayed when I have this URL to my browser: http://port-80-5fwpycdv5a.treehouse-app.com/js/math.js