Problem getting JQuery running with mBed

01 Apr 2012

Hi all

I'm using the HTTP Server Example from: http://mbed.org/cookbook/HTTP-Server

This is running fine and serves pages properly to the browser (Google Chrome).

I saved the 'Complete Example' from: http://docs.jquery.com/How_jQuery_Works to the root of the mBed directory. This works OK, and uses the JQuery file: http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js

I then downloaded the jquery.min.js file to the mBed root directory (as I will not have internet connectivity in my final project), and modified the htm file accordingly: <script src="jquery.min.js"></script>

Now the Javascript window no longer pops up when I open the htm page - I just get redirected to jquery.com.

I tried copying the htm file and jquery.min.js to a directory on C: and opened the htm file in Chrome - it then worked properly.

I'm probably doing something stupid or missing something, but I don't see why jQuery isn't working on the mBed Web server.

Thanks for any help.

Gerry

29 Apr 2012

This is definitely a path lookup problem. I have not (yet) done anything with JQuery, but will do soon, and so your post caught my attention. I have some suggestions:

  • What if you leave only one, but not both, of the FSHandler's?
  • What if you instance the local filesystem as shown in: LocalFileSystem ? Then, you would point to: <script src="__/local/__jquery.min.js"></script>

Either if you have success or you don't, please post back!

29 Apr 2012

LocalFileSystem only supports 8.3 names so you will need to shorten the "jquery.min.js" filename to work in that file system. Some of the newer SD drivers available on this site support long filenames.