Hello
I am doing maintenance on a web server, and have several js files present which I need to categorize. However, I am faced with the dilemma of identifying between clientside js files and severside ones.
Is there a distinct way to identify between these files?

Re: how to identify between clientside and serverside js files? 80 80

Can you clarify what you mean by client vs server is files?

If you have a script element with a src attribute, the file is stored remotely but downloaded by the user agent then processed locally.

Re: how to identify between clientside and serverside js files? 80 80

But if you are talking about scripts that contact the server (i.e. AJAX), you will have to do text search for xmlhttp (or ActiveX for older version) string or ajax() in JQuery, which is usually used in Ajax call, inside your js file. The text search part is trivia by the way because you could implement a script to do that for you.

Re: how to identify between clientside and serverside js files? 80 80

can you open one of them or at least when you see this

<script runat="server">

you might also see something like this

var sys = require("sys"),http = require("http");

that is for the server side js e.g. node.js .

Re: how to identify between clientside and serverside js files? 80 80

In my case these are stored in Domino Designer (IBM Lotus Notes), and don't have the tags mentioned above in any of these js files

Re: how to identify between clientside and serverside js files? 80 80

As far as I know, you have to inspect the contents of the files and work out whether they do server-side or client-side stuff.

I expect that in some cases, the distinction will be manifest, in others less so.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.