Fixed bug when index.html is not at root url

E.g., on iOS emulator
Added Phonegap library
a