Closed Thread Icon

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

 
randy
Paranoid (IV) Inmate

From: Blackstone, Ma, USA
Insane since: Jan 2001

posted posted 09-22-2001 18:28

is there any servers besides the netscape ones that support server side javascript

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 09-22-2001 18:33

You can use JScript & VBScript in Microsoft ASP (Active Server Pages - similar to PHP)...

randy
Paranoid (IV) Inmate

From: Blackstone, Ma, USA
Insane since: Jan 2001

posted posted 09-23-2001 08:35

when u use jscript with asp does it have the same objects as if u were using vbscript....session etc...

randy
Paranoid (IV) Inmate

From: Blackstone, Ma, USA
Insane since: Jan 2001

posted posted 09-23-2001 08:38

btw i was wondering if it was possible to have static variables in a javascript

randy
Paranoid (IV) Inmate

From: Blackstone, Ma, USA
Insane since: Jan 2001

posted posted 09-23-2001 08:40

btw i was wondering if it was possible to have static variables in a javascript functions

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 09-23-2001 09:11

on the server side?



:[ Computers let you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila. ]:

randy
Paranoid (IV) Inmate

From: Blackstone, Ma, USA
Insane since: Jan 2001

posted posted 09-23-2001 09:14

either , i thought the core language was the same for both

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 09-23-2001 09:57

For all questions about ASP, visit Microsoft's web site...



WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 09-23-2001 18:28

Not many of us here support ASP...

It is just an ugly language (IMO)

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 09-23-2001 19:26

Just a small correction to WarMage's post above. ASP *is not* programming language. ASP is server-side technology used for creating dynamic web sites. ASP relies on other programming languages when generating pages. At the moment you can use VBScript and JScript (both of them are Microsoft creations) to program ASP pages. And it's a well known fact that Visual Basic is the worst programming language ever invented. VB is the thing that su&#120; here, big time!

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 09-24-2001 00:47

You can't really have static variables in JavaScript. You can certainly pretend a variable is static, by not changing it, but it's not *really* static.

randy
Paranoid (IV) Inmate

From: Blackstone, Ma, USA
Insane since: Jan 2001

posted posted 09-24-2001 10:02

i found a way to simulate a static variable

test.variable=0;
function test(){
variable++
}




jiblet
Paranoid (IV) Inmate

From: Minneapolis, MN, USA
Insane since: May 2000

posted posted 09-24-2001 17:53

A static variable is a variable that stays the same over all instances of an object class, correct?

How completely does javascript support OOP restrictions such as private & static variables?

-jiblet

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 09-24-2001 18:40

I'd have to think not very.

I've never used JS on the server side so I'm not aware of any differences.

In regards to scope. I (and most) don't use the "var" keyword. it's been my experiece that any variable set without the var keyword is global in scope. whether defined within a function or outside in the general scripting space.

randy.

I don't believe you need the "test." in this example. it should work fine
like so:

variable = 0;
function test(){
variable++;
}

I believe assigning the varaible within a function using "var" makes it local to the function.

I'm just writing this off the top of my head though



:[ Computers let you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila. ]:

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 09-24-2001 18:58

Oop! I was confusing "static" with "constant". Yeah, if you want a variable that remains the same the next time you call a function, you just want to define it *outside* the function, in a larger scope.

var myvar = 1; // myvar is defined outside the function, so it's remembered before and after the function is called.
function doSomething()
{
myvar = myvar + 1;
alert(myvar);
}
doSomething(); // alerts '2'
doSomething(); // alerts '3'

[This message has been edited by bitdamaged (edited 09-24-2001).]

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 09-24-2001 19:22

(sorry slime you had var = var+1 not trying to step on toes)



:[ Computers let you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila. ]:

jiblet
Paranoid (IV) Inmate

From: Minneapolis, MN, USA
Insane since: May 2000

posted posted 09-24-2001 22:29

Yeah, I think the concept of a static variable doesn't make much sense if you aren't defining classes. In a situation like this, a global variable would seem to be the appropriate method...

-jiblet

randy
Paranoid (IV) Inmate

From: Blackstone, Ma, USA
Insane since: Jan 2001

posted posted 09-26-2001 03:23

while on the subject of javascript i was wondering how to set a block of javascript to execute after a certain defined period of time.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 09-26-2001 05:51

setTimeout()

easist thing to do is wrap the block of code in a function and then use setTimeout()

setTimeout('function()','time in ms');
I like to name my timeouts

myvar = setTimeout('myfunc()',3000);

because then you can clear them like so
clearTimeout(myvar);



:[ Computers let you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila. ]:

randy
Paranoid (IV) Inmate

From: Blackstone, Ma, USA
Insane since: Jan 2001

posted posted 09-26-2001 09:31

yup thats what i was looking for

« BackwardsOnwards »

Show Forum Drop Down Menu