0

I got this problem and I couldn't figure out why. I keep getting "ReferenceError: puremvc is not defined"

Can someone take a look? Attached are images of my folder structure, index.html, main.ts and DataProxy.ts and its error.

Here is what my folders structure looks like https://i.stack.imgur.com/xbkRt.jpg

Here is my index.html file https://i.stack.imgur.com/wksks.jpg

DT DT
  • 378
  • 2
  • 6
  • 16
  • Here is my main.ts file http://i.stack.imgur.com/FPSMT.jpg Here is my DataProxy.ts and it's error http://i.stack.imgur.com/FXm5X.jpg – DT DT Sep 30 '13 at 16:47
  • main.ts and index.html look like they are inside the js directory. Have you tried dropping `/js/` from your references or doing `../js/lib/` at the start of them. Also I am using the latest version of TypeScript and the Visual Studio Extension and latest version and I have included Knockout and JQuery .d.ts definitely typed reference files and I have no need to use RequireJS... oh wait your on a Mac nvm – Pricey Sep 30 '13 at 18:10

1 Answers1

0

Your paths don't look quite right - it looks from your images as if the paths should be:

<script src="/js/lib/puremvc/puremvc-typescript-standard-1.0-min.js"></script>

Note the leading / as it makes all the difference

This makes the URI relative to the root of your site, which means this path would work wherever you placed your index.html in your website.

Fenton
  • 241,084
  • 71
  • 387
  • 401
  • Not sure what file that I use /js/lib/, I think all the reference like this "../../lib DataProxy.ts: /// Here is the zip file: http://vnfx.com/TestPureMVC.zip – DT DT Oct 01 '13 at 02:53
  • In your `index.html` file you have the actual script tag. – Fenton Oct 01 '13 at 08:28
  • if I use /js/lib/ then I can't even load the js files because the index.html is not at the root – DT DT Oct 01 '13 at 17:45
  • When you start a URL with / it will be relative to the root of the site, not the document. This means it will work no matter where the document is. – Fenton Oct 01 '13 at 23:30
  • if you run this on the desktop then there is no root, isn't it? – DT DT Oct 03 '13 at 18:07
  • You only have a root if you run via a web server. – Fenton Oct 04 '13 at 11:45