• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

static variables in JavaScript or equivalent ?

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


well I would like the variable value to alternate each time the function is called but it doesnt happen..flag always defaults to "sortAscending"...any Suggestions....Thanks
[ August 10, 2004: Message edited by: Eric Pascarello ]
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am taking a guess, Are you refreshing/reloading the page. If you are the variable is going to be reset each time the page loads.

Eric
 
Sarran Vidyakumar
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Eric/Guys:
I am not refreshing the page..I have a table whose values are sorted in ascending/descending order(using XSL)..So I need to pass the sortOrder variable as a parameter to the xslt function..So the sortOrder value passed has to alternate between 'ascending' & 'descending' each time...
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Aww I had to restart this post

This works for me, try this:
 
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It works for me in IE6 exactly as it is. I've just a added a link to execute the function.

Note that you should use <script language="JavaScript"> for HTML 3.2 and <script type="text/javascript"> in HTML 4 and XHTML. The language attribute is deprecated in HTML 4. The default scripting language in Internet Explorer is JScript, which is very similar to JavaScript, but not the same.

Jules
 
If a regular clown is funny, then a larger clown would be funnier. Math. Verified by this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic