Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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