javascript - validation

They have: 330 posts

Joined: Apr 2000

If I were to create a game using javascript, but I wanted to validate the app each time it is used to make sure it's being used on my site only how would I do that?

They have: 5,633 posts

Joined: Jan 1970

hummmmm..... you cant. Javascript can be downloaded rewritten by any one. The best bet is put comments tags threatening to kill anyone who steals it.

They have: 330 posts

Joined: Apr 2000

The killing thing is a good idea... I didn't think of that.

My thoughts are to build some kind of random daily code that is linked directly from my site. When the page loads I would like it to validate against that code which I am hosting on my server. During that validation I would require the code and referal site to match the criteria I specify.

The problem is, using ASP I can do all of the fun stuff I mentioned above, but I am not that familiar with javascript. If I do this in ASP the code is already validated when the page loads so stealing the source code bypasses everything I have completed. Can this be done? ... or should I just buy a gun?

They have: 330 posts

Joined: Apr 2000

btw - in your signature you have "comeing" instead of "coming".

Busy's picture

He has: 6,151 posts

Joined: May 2001

There are a few programs out there that will scramble your code (any type I believe) but is very expensive.
As bja888 mentioned, Javascript os a text based language (just like HTML) so can be seen and downloaded by anyone. The no right scripts etc dont work, besides someone can just go 'file/save page as' and they have it

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

I think what your trying to do with Javascript is useless for reasons already mentioned. Your best bet would be to do it with ASP or PHP. That way, no one would have access to your code.

nicora's picture

He has: 267 posts

Joined: Nov 2001

Server side script is the answer. Javascript is a client side script which in turn, allows the client to access it.

They have: 5,633 posts

Joined: Jan 1970

I'm all for just buying the gun.... Or a lazer guiede missle.... or a javascript guided missle

dk01's picture

He has: 516 posts

Joined: Mar 2002

You could try building in a domain checking function into your code....if you were to do this and could hide it then everyone but someone who really understands the code couldn't copy it. Of course this would require that your js is complex enough to nest the function in without anyone noticing.

-dk

CptAwesome's picture

He has: 370 posts

Joined: Dec 2004

Well, the best idea, is to havre some sort of a backend scoring system, so stealing the javascript woul dbe pointless unless they have the backend scoreboard. They could always duplicate that as well, but at least it would be more work for them.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.