I've only just started playing around with Javascript, so don't mind what I say if I misuse a term or ask to do something that's impossible. I'm having a problem opening a program through Javascript. I want the script to start a game that people can play. I'm using the code "document.location="Game Folder/demo.exe";". When I run the document, the popup window appears asking if I want to download or run the file. When I click to run it, the program opens, but then immediately crashes. This application I'm trying to execute is in a folder with other files that it presumably needs, so I'm thinking that it needs to be somehow linked to everything else or have the entire folder loaded. Or, maybe I'm just using the wrong command...

I'm afraid you can't do that. That is why many people use flash for embedded games and applications. What you need to do is re-write that application/game for a web platform. Some notable web platforms are:


If you are not the author of this game, then your only solution would be to zip the contents of the game folder and then offer it to download.

I didn't write the game, so I guess that kills it. Thanks for quickly sorting this out for me, though.

i ve written a javascript program and have saved it with.js file too.. what is the next step to run a javascript program?

This question has already been answered. Start a new discussion instead.