I have recently used modified a word count method in javascript for my website, so that it counts the intial amount words in the textarea, but it doesn't quite work
function wordCounter(field,countfield)
{
var maxlimit = 200;
var wordcounter = maxlimit - information.value.split(' ').length;
for (x = 0; x < field.value.lengt...
A friend asked me to update his shopping cart software. It's written in classical ASP using IE's JScript. I can't seem to format the variables correctly.
. <% if (oOrder['product'] == "camera")
{ %> <%= format_float(oOrder['cost'], 2, 3)/2 %> <% } %>
%>
When I do this I get a bunch of jibberish with regards to the output...
Background:
I have a JScript that runs when the computer starts up (from task scheduler). The script does some magic and determines if a user should be allowed to login at all. It starts by disabling all user accounts and then if a user is to be allowed in it enables the users account by firing the 'net user' command using wshShell.Exec(...
Hello all,
I'm developing a website with server-side JScript engine over ASP server.
I have several try-catch clauses in my code looking roughly like this:
try {
// do something
}
catch (err) {
// pass it to the frontend code
die("Exception caught: " + err.description);
}
I would very much like to display the line number in ...
Im trying to get my feet wet with some WSH. I thought it was going to be easy, but it's really a nightmare...
contents of registry.js >
Set shell = WScript.CreateObject('WScript.Shell');
strRegValue = 'HKLM/Software/Microsoft/Windows/CurrentVersion/ProductID';
strPID = shell.RegRead(strRegValue);
WScript.Echo strPID;
This is ...
I have a content page in my ASP.NET-page and want to set a JScript variable to it programatically, so I can use it within the JScript sections of the rendered page afterwards.
How can I start with this problem? I have a "head"-content that fills a ContentPlaceHolder in a master page, but have no idea how to write new content into it.
I...
So I'm having a crossbrowser javascript issue.
I've got a <select> dom element that has some descendent <option> element with selected=true.
In Firefox, I can just do select_elt.value to get the value of the selected option, but this seems not to work in IE6 (which I need to support).
I tried to iterate through the select_elt.getEleme...
I have a free MSDN account and now that I am proficient in C/C++/Java, and know some JavaScript, PHP and MySQL, I want to learn some proprietary languages from Microsoft. I am looking to experiment with everything within the next several months - C#, ASP, VB, things I haven't even heard of [insert suggestions here], what have you.
Howe...
Is there a way to capture the events triggered on HTML controls before they are forwarded for default (generic) handling by the control itself. In my case, I want to prevent a element dropdown to open when a user clicks on the control. e.g. On this user click, OnClick() event gets fired and is handled by the default control which open t...
I want to iterate over the environment keys and print a list of these items.
...
i am working on an already built program with a lot of classes and jscripts. the issue is the code has 3 dropdownlist's month, date, year. I need to remove the date one and passa static "01" value. here's the code for validating date in javascript -
function Validate_date(sender, args) {
var m = document.getElementBy...
I was reading about cookies and other related client-side storage options, and read about using window.name as a data cache of sorts:
http://en.wikipedia.org/wiki/HTTP_cookie#window.name
While it certainly has things that make it less desirable - and I won't sugar coat it, it is definitely a hack in the most true sense of that word - i...
Is it possible to have an overloaded function in classic asp JScript
...
I refer to Phil Haack's "Undoable" article found here: http://haacked.com/archive/2010/01/01/jquery-undoable-plugin.aspx
I've copied the exact mark-up for the table from the tables demo page, included JQuery 1.3.2 min, and copied the exact script block used on the demo page but when it gets to this bit:
$('a.delete').undoable({
inline...
I wrote the following two functions, and call the second ("callAndWait") from JavaScript running inside Windows Script Host. My overall intent is to call one command line program from another. That is, I'm running the initial scripting using cscript, and then trying to run something else (Ant) from that script.
function readAllFromAny...
I have an ActiveX component (which I did not write and have no control over). It has several methods I want to use, which return arrays. Every time I attempt to do something of the sort:
var arrayValue = axObj.methodWhichReturnsArray();
the arrayValue object is undefined. The component provider tells me that I should not be having any...
In MSDN, it is decleared as in http://msdn.microsoft.com/en-us/library/aa741364(VS.85).aspx :
Syntax
HRESULT execScript( BSTR code,
BSTR language,
VARIANT *pvarRet
);
Parameters
code
[in] BSTR that specifies the code to be executed.
language
[in] BSTR that specifies the language in which the code is executed. The la...
I have an array of dates that I am populating adding the dates creating the types and calling their constructor like this: new Date(2008, 1, 1)
I was wondering if there is a better way to do this? I am guessing that I can use the numeric representation of Date and put that into the array on the server side and send this array down to th...
I would need to create some webpages that are using jscript and different jscript libraries heavily and I will need to write a littlebit of code and debug it through to see if that works. I would like to know if there is an IDE exists on Windows jsut to do this or there is a combination of tools that can be used for this purpose?
...
I have JScript method that is :
function init() {
var userid = System.Environment.getEnvironmentVariable("USERNAME");
setUserName(userid);
}
When I debug it , at first line of the init fuction, I'll get "javascript Microsoft JScript runtime error: 'System' is undefined".
I'd be thankful if some one let me know how can I...