Closed Thread Icon

Topic awaiting preservation: server-side javascript - eh? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8641" title="Pages that link to Topic awaiting preservation: server-side javascript - eh? (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: server-side javascript - eh? <span class="small">(Page 1 of 1)</span>\

 
smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 05-08-2003 18:51

I'm intrigued by the notion of server-side javascript, I have done a little reading from some very confusing sources and it seems it should be easy to implement - it appears to be the same as client-side javascript but without the document or browser window specific bits, and it is encased in <server></server> tags.

So is it really that simple? what is support for this like? how will I have to change my document.write statements to be compatible?

I use js files to control a lot of the unchanging sitewide content on my website (I haven't learnt php yet - starting soon tho), it would be great if I could get my js files to write their contents into my webpages on the server instead of on the client machine. Presumably if it does it on the server the content which gets written will be picked up by google and other bots, no?

visit my CryoKinesis Online Gallery

quisja
Paranoid (IV) Inmate

From: everywhere
Insane since: Jun 2002

posted posted 05-09-2003 15:40

I googled it, and couldn't find much of use. What I could gather is that it's an interpreter that someone not related to the W3C/browser manufacturer has written for use on a server, meaning you can use JS syntax and maybe methods for server side stuff, as you described. This doesn't seem particuarly useful or relevant:
+ So you don't have to learn a new language, but that's not such a problem if you already know one or two.
+ PHP/ASP are way more comprehensive than JS for the sort of stuff you might wanna do. I.e. string manipulation, database connectivity...
+ One of JS' big advantages is that it is client side and dynamic. This means you can click stuff and things happens immediately. It means that you can interact with page elements, move them around etc.
+ The developers of this compiler might not even support all the things that JS would be able to do, so some of your knowledge would be defunct server side.
The only advantage that I can see is that JS understands HTML, which PHP does not. Therefore you could add attributes to tags etc.

About the hiding code thing:
1. There probably wouldn't be much you were doing that people would be interested in stealing (if it was all document.write's and simple maths).
2. Hiding code is generally seen as a bad thing.


home

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 05-09-2003 16:56

Thanks for the answer, but I didn't want to hide any code, I don't mind sharing my code because it isn't that good or useful anyway. I am a 'view source' person and so I believe if I use others code for my own pursposes whether it be learning or directly putting it on a page (normally don't do this) then I should 'give something back' so to speak and not try and obfuscate or hide my own code. I do remove all comments from my code (except other people's copyright notices), as I like small file sizes, but I don't purpsoefully try to hide code whatsoever.

My point with it being picked up with google was that because a lot of links are written in my pages with javascript these links don't get spidered by google because it never actually opens the page in a browser type interface in order for the javascript to write them.

cyberspy
Obsessive-Compulsive (I) Inmate

From:
Insane since: May 2003

posted posted 05-19-2003 10:52

Netscape used to support server side Javascript on their Netscape Enterprise web server. It could be used to access databases etc to build dynamic content, much in the same way as CGI/PHP/ASP et-al. However, Netscape's Javascript pages ( http://devedge.netscape.com/central/javascript/ ) don't appear to have any info on this anymore.

You can use Javascript with ASP for server-side scripting. Remember, ASP is not a language, but a framework that can be used with any language that has been implemented with ActiveX. VBScript and Javascript are supplied 'out of the box'.

Regards

CyberSpy



[This message has been edited by cyberspy (edited 05-19-2003).]

jive
Paranoid (IV) Inmate

From: Greenville, SC, USA
Insane since: Jan 2002

posted posted 05-24-2003 23:51

I've done some reading on this as well. It used to be called "live script". . .

I guess it just never caught on.



amikael
Bipolar (III) Inmate

From: övik
Insane since: Dec 2002

posted posted 05-25-2003 02:43

In ASP you can use javascript.
It's only a matter of changing the default from VBscript to Jscript, and stay away from anything not strictly javascript, since it works anyway.
- I'm not exactly sure I understand this question though, since this is wellknown, and I have never used anything BUT javascript working serverside..??
Most people I know, do.

(^-^)b

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 05-25-2003 09:33

so does the javascript actually run serverside or is it written into the document and then runs clientside?

amikael
Bipolar (III) Inmate

From: övik
Insane since: Dec 2002

posted posted 05-25-2003 20:22

It runs serverside, of course.
What's the point if it does'nt??

It's very comfortable for me, since it means that I can use the same language/frame of mind when writing asp-applications, instead of switching between languages.
Also, in Asp.NET, you can compile javascript-applications on the server.
That is more adjusted to Jscript though, which is more like C#, but it still works for javascript too.

(^-^)b

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 05-25-2003 21:01

Actually Amikael, you?re not really using JavaScript at all. Your just using the core flow control methods of a JavaScript like language (also know as ECMA script) to access ASP objects. You could do the same thing with VB script but you wouldn't be programming in VB, it'd still be ASP.

Anyways, JavaScript in the true sense is client side only. Other companies (like Microsoft) kinda stole the name as it was a huge buzz word at the time they launched ASP -- Just like Java was all the rage when Netscape released JavaScript. Java and JavaScript have piss all in common in the same way that Netscape's JavaScript and MS's ASP scripted with JavaScript have bugger all in common.

At least, that's how I currently see it. Feel free to correct me if I'm wrong though.

amikael
Bipolar (III) Inmate

From: övik
Insane since: Dec 2002

posted posted 05-26-2003 00:35

You can access date(), etc - all you can in javascript, except stuff relating to the DOM, since there is no document.. - and ECMAscript is essentially javascript, according to Netscape, and they should know.
Jscript is - as you say - not javascript, but I dont have to use that.
- That's optional.
Microsoft may very well be 'the evil empire', but I dont care.
It's up to everyone else if they do.
I only care if the tool I need is available, and even though I agree there are other, perhaps more powerful server-technologies, the question was about javascript..so I'm only relating to that.


(^-^)b

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 05-26-2003 01:24

so asp contains ecma script which is just the standard script that both javascript and actionscript were based on, right?

now being serverside the document object doesn't exist, so what would be the method to convert document.write statements into compatible code? I seen javascripts where write is used with a different prefix than document, so to get the same functionality as document.write what would be the easiest way?

I know some people are just gonna say "why don't you just use php", but consider that option ruled out for the moment.

[This message has been edited by smonkey (edited 05-26-2003).]

amikael
Bipolar (III) Inmate

From: övik
Insane since: Dec 2002

posted posted 05-26-2003 02:35

response.write("some stuff");

It's the response-object you use here, which is replacing the document.
There is no document yet, but there's the *response* serving up what will be appearing in the document when it's served to the browser.


(^-^)b

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 05-26-2003 02:49

The DOM isn't JavaScript, it's err.. the DOM. Completely different thing altogether really. But what makes JavaScript is its events which don't apply when you?re using it sever side, which is why I don't see this as being true JavaScript in the Netscape sense of the language, regardless of the similarities. I see it as more of a general scripting language, i.e. ECMA Script, but that?s just my view of things.

ECMA script came after JavaScript. JavaScript was created by Netscape and later it was adopted as a formal standard for certain types of scripting languages, thus ECMA script was born. Macromedia?s Flash ActionScript is also an ECMA script based language.

Slime has a handy article about this kinda stuff here: http://www.slimeland.com/content/articles/jsenhance/

Smonkey: You do realise that to use Script like this on the server side you'll need access to an NT web server with ASP installed? If you have access to one of them then you'd be best seeking advice in the server-side coding forum. (Actually, you could run ASP on a *nix server but, err, why would you bother??) But if you only have access to a Unix server then there's about a 90% chance that PHP will be installed and available for general use.

I say this because I assume you?re interested in this because you already know some JavaScript and don't really want to invest your time in PHP yes? If that is the case then you'll still need to learn how to use the ASP objects in order actually do anything worthwhile, just as you would PHP, but believe me when I say PHP is dead easy and has an extremely similar syntax to JavaScript.

In any event, this conversation belongs in the server side forum and before you start asking questions about server side technologies you'd best find out which ones you actually have access to.

Or If I've just completely miss-read where your at with things then just ignore my ramblings... =)



[This message has been edited by Dracusis (edited 05-26-2003).]

amikael
Bipolar (III) Inmate

From: övik
Insane since: Dec 2002

posted posted 05-26-2003 12:00

It's infernally simple to create applications in ASP if you use javascript, since Microsoft is supporting that over VBscript in .Net.
It has more power and more features than for VBscript..
Basically, if you know javascript, you can learn ASP and create applications like the auction found at http://www.naltabyte.se in about a half an hour, never done any apps before, 'cause that's what I did.

(^-^)b

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 05-26-2003 14:36

As many of the forums regulars would know, yes I do use a *nix server with php, mysql, etc. but from reading the cobalt-raq user config page on my virtual account it also says I have asp too, double whammy! I'm not knowledgable with any form of code, only markup, but I want to learn as much as possible, including the evil corporate asp. I think this thread has met it's end now, the original question has been answered and now as dracusis points out, we are heading into a discussion best suited for the server-side forum.

This summer I will be spending my time reading books on php and mysql and a little asp too so I may take a glance at ms-sql for the sake of well roundedness. I will also gen up on javascript which will no doubt please some members of the forums.

Thanks all.

« BackwardsOnwards »

Show Forum Drop Down Menu