Can Javascript Add Items To ASP/VBScript Dictionary Object?

Jul 23, 2005

I got two ASP pages. One is ASP email form (I'm using Persist ASP
Email component). Another one has all file links in it. For example,
when user click Outlook course hyperlink. It will pop up another
window with outlook course PDF file. (All PDF files are already in the
server).

What I am trying to do is: When user click the "Add Email" hyperlink,
it will add that course name and filepath into ASP/VBScript Dictioanry
Object. After the user finish and click "Attach to email" button. All
the files will be attached in the email as an attachment.

Because I am not familar with VBScript. So, can Javascript add items
to ASP Dictionary Object?

View 3 Replies


ADVERTISEMENT

JavaScript And VBScript

Jul 23, 2005

The user clicks on the delete icon, and gets a JavaScript client-side popup
to confirm that he wants to delete. I am passing this client-side function
a contactID.

Then, I want to send the result of this confirm (true|false) to a
server-side VBScript function, along with the contactID.
The VBScript function will then perform a delete in the database for the
specified contactID.

I have seen many examples about sending stuff back and forth between
JavaScript and VBScript, between server and client, but all the examples I
see are just popping up generic alerts and such. I need to execute some JS
on the client side, return a value, and send it to a VBScript function on
the server side.

View 3 Replies View Related

Javascript & VBScript!

Aug 25, 2003

Is it possible to exchange data between Javascript and VBScript! In other words can they communicate!

View 4 Replies View Related

Convert To VBScript To JavaScript ?

Oct 17, 2005

I have some pages with this VBScript code, which obviously does not
work in Firefox. How can I convert this to Javascript in order for my
web page to work in Firefox ? It basically fills a drop down with a
list of dates that a user can select. Code:

View 2 Replies View Related

Converting VBScript To JavaScript

Dec 3, 2007

I need some help converting this VBScript over to JavaScript so that the calculations will work properly in browsers other than IE.

You can take a look at Turn 2 Design Code: for a feel about what I'm trying to do, but basicly, I just need to calculate the cost of the selected items based on the selected quantity of that item.

The only thing I know about JavaScript is the small Pop-up scripts I've been able to litterally copy and paste to implement. So, please, dont just post code, post an explaination of whats going on and why so I can try to figure it out. Code:

View 8 Replies View Related

JavaScript Variable In VBScript

Mar 21, 2005

Not sure whether this should go in the JavaScript or VBScript/ASP section, but I'll try here anyway.

I have an ASP include file that contains both VBScript and JavaScript code. The VBScript processes some information and has an onChange event which calls a JavaScript function. Within this javascript function I want to access a recordset and retrieve a value using a variable from the javascript. Here's the code from the JavaScript section. Code:

View 1 Replies View Related

Speed! VBScript Vs JavaScript

Sep 30, 2000

Just wondering if anyone knew if there was a definite speed advantage to VBScipt as opposed to JavaScript?

View 7 Replies View Related

Javascript Equivalent For Vbscript Date()-1

Mar 28, 2007

I'm looking to return DATE ONLY for yesterday's date. No seconds,
milliseconds. Formatted either yyyy/mm/dd or mm/dd/yyyy. VB does it so
easily Date()-1 will return 03/27/2007 if today is 03/28/2007. Why so
many hoops for javascript? Any ideas?

View 21 Replies View Related

What's The Vbscript's Cint() Function In Javascript

Jul 20, 2005

I have the following function to get the total qty:

function calttl()
{
var ttlqty
ttlqty=0
for (i = 0; i <= document.qtymain.orderdetail.length-1; i++)
{
ttlqty = ttlqty + document.qtymain.qty.item(i).value
}

}

The problem I have is the document.qtymain.qty.item(i).value I get
look like a string, so the number I get for ttlqty is not add up the
number but concatenate.

How do I convert the value I get to a number in javascript?

View 8 Replies View Related

Recreated Vbscript Functions For Use In JavaScript

Sep 23, 2005

Here is a compilation/creation/collection of recreated vbscript functions for use in JavaScript. Additions and criticism are of course welcome.

Zip file contains:

vbs.js
ReadMe.html

<Edit>Surprisingly there haven't been many downloads for this. Here's a quick overview of the contents:</Edit>

==================================================
==================================================

CreateObject(x)
Translates into: new ActiveXObject(x)

dateDiff(p_Interval, p_Date1, p_Date2,p_firstdayofweek, p_firstweekofyear)
Returns the number of intervals between two dates

datePart(p_Interval, p_Date,p_firstdayofweek, p_firstweekofyear)
Returns the specified part of a given date.

FormatCurrency(Expression, NumDigitsAfterDecimal,IncludeLeadingDigit,UseParensForNegativeNumbers, GroupDigits)

FormatDateTime(datetime, FormatType)

FormatNumber(Expression, NumDigitsAfterDecimal,IncludeLeadingDigit,UseParensForNegativeNumbers, GroupDigits)

FormatPercent(Expression, NumDigitsAfterDecimal,IncludeLeadingDigit,UseParensForNegativeNumbers, GroupDigits)

InStr(strSearch,charSearchFor)
Returns the first location a substring SearchForStr that was found in the string str

isDate(p_Expression)

Left(string, length)
Returns a specified number of characters from the left side of a string.

Len(str)
Returns the number of characters in a string.

LTrim(str)
Returns a copy of a string without leading spaces.

Mid(str,start,len)
Returns a specified number of characters from a string.
monthName(p_Date, p_abbreviate)

Now()
Returns the current date and time.

Right(string, length)
Returns a specified number of characters from the right side of a string

RTrim(string)
Returns a copy of a string without trailing spaces.

Trim(strInput)
Removes leading and trailing spaces

weekdayName(p_Date, p_abbreviate)

================================================
================================================

View 1 Replies View Related

How To Get Vbscript And Javascript Variables To Work Together

Feb 4, 2005

I'm having a problem getting javascript and vbscript to place nicely together. Here is what I want to do:

I'm getting values from my database for different exam types. Here are some sample values:

Exam Type1
Exam Type2
Exam Type3

Here is how I get the values in vbscript: Code:

View 5 Replies View Related

Client-side Scripting: Javascript Or VBScript

Mar 17, 2002

Has anyone got any pros and cons for using Javascript over VBscript or vice-a-versa, Code:

View 7 Replies View Related

How To Implement HTTP PUT Method Using Apache, VBScript/JavaScript + AJAX

Nov 3, 2005

Can anyone redirect to any online tutorials, articles, code of how to upload a file using HTTP PUT method and JavaScript or VBScript to a server running Apache 2.0 that uses CGI + PERL.

How to create configuration entries in httpd.conf for supporting HTTP PUT method.

How to code with AJAX to post uploaded file content to the server using PUT method ?

View 1 Replies View Related

Can I Use Javascript To Create A VBScript "Menu"?

Mar 28, 2005

Can I use javascript to create a menu. then insert the value to it? I mean.. If i got 1 page, and 1 textbox. can I pass in the value in the textbox to a vbscript Msgbox or Menu, then i change the value in Menu, maybe use combo box or listbox. then i select it and click ok, the value in my page can get it and chage the default value? Thank!

ps: I want a pop up "menu", not a pop up "window"... or maybe in Vb6 we calll a form

View 2 Replies View Related

Add Items To A JSON Object?

Mar 3, 2009

Does anyone know the function for adding more items to an already declared JSON object?

Assuming you have something like code...

View 9 Replies View Related

Accessing And Changing Two Items In An Object?

Jul 7, 2011

I have an object that defines the default color, and then when the color is updated, the different css classes need to be updated as well. So here's what I was trying to do

var colorPicker = {
mainColor: "red",
backgroundColor: this.mainColor + "bkgd",
}

So problem 1 is I keep getting "undefined" returned for "this.mainColor". If I use colorPicker.mainColor, it hasn't been created yet so it throws an error.Problem two is if I update mainColor from another function, say to make mainColor = "green", then backgroundColor doesn't automatically update.

View 5 Replies View Related

Dictionary Class

Sep 18, 2002

here's something like an associative array implementation...

/*
File: Dictionary.js
Version: 1.0
Last modified: 09.17.2002
Author: Alexandar Minkovsky (a_minkovsky@hotmail.com ; URL: http://www24.brinkster.com/alekz)
Copyright: Left
Type: Class
Exports: Dictionary class.
Dependencies: None.
Description:
Similar to ASP "Scripting.Dictionary" Object, or an associative array
with somewhat limited functionality. There's a few differences:
- "item" property is replaced by two methods getVal and setVal.
- "key" property is replaced by the setKey method.
As the value of an item can be virtually anything, even another Dictionary object,
the Dictionary Class might be usefull.
If someone have a suggestion or wants the Dictionary class to be extended some way,
feel free to drop me an e-mail.
Tested with: IE4; IE5; IE5.5; IE6; NS4.78; NS6.0; NS6.1; NS6.2; NS7.0; Mozilla 1.0; Mozilla 1.1; Opera 6.0
*/
/*
================
Dictionary Class
================
- Instanciating
oDict = new Dictionary();

- Properties
~ Public
(int) count - Number of keys in the Dictionary. Default: 0. Read only, do never manually set this property!
~ Private
(Object) Obj - the object actually containing the data. Do never use it directly.

- Methods - look at the function descriptions for detailed explanation.
~ Public
(BOOL) exists(sKey)
(BOOL) add (sKey,aVal)
(BOOL) remove(sKey)
(void) removeAll()
(Array) values()
(Array) keys()
(Array) items()
(Any) getVal(sKey)
(void) setVal(sKey,aVal)
(void) setKey(sKey,sNewKey)
*/
//****************************************
//Dictionary Object
//****************************************
/*
function: Dictionary
Parameters: None
Returns: A new Dictionary object.
Actions: Constructor.
*/
function Dictionary(){
//Properties
//~Public
this.count = 0;
//~Private
this.Obj = new Object();
//Methods
//~Public
this.exists = Dictionary_exists;
this.add = Dictionary_add;
this.remove = Dictionary_remove;
this.removeAll = Dictionary_removeAll;
this.values = Dictionary_values;
this.keys = Dictionary_keys;
this.items = Dictionary_items;
this.getVal = Dictionary_getVal;
this.setVal = Dictionary_setVal;
this.setKey = Dictionary_setKey;
}
//****************************************
//Method implementations
//****************************************
/*
function: Dictionary_exists
implements: Dictionary.exists
Parameters:
(String) sKey - Key name being looked for.
Returns: (BOOL) - true if sKey is found ; false if it is not.
Actions: Iterates through all Dictionary keys and checks for sKey.
*/
function Dictionary_exists(sKey){
return (this.Obj[sKey])?true:false;
}
//****************************************
/*
function: Dictionary_add
implements: Dictionary.add
Parameters:
(String) sKey - Key name to be added.
(Any) aVal - Value to be associated with sKey.
Returns: (BOOL) - true if sKey is created ; false if it is not (because of a duplicate Key name).
Actions: Adds a new Key=Value pair to the Dictionary.
*/
function Dictionary_add(sKey,aVal){
var K = String(sKey);
if(this.exists(K)) return false;
this.Obj[K] = aVal;
this.count++;
return true;
}
//****************************************
/*
function Dictionary_remove
implements: Dictionary.remove
Parameters:
(String) sKey - Key to be removed.
Returns: (BOOL) - true if sKey has been removed ; false if it has not (did not exist).
Actions: Removes a specified key from the Dictionary.
*/
function Dictionary_remove(sKey){
var K = String(sKey);
if(!this.exists(K)) return false;
delete this.Obj[K];
this.count--;
return true;
}
//****************************************
/*
function: Dictionary_removeAll
implements: Dictionary.removeAll
Parameters: None
Returns: Nothing
Actions: Removes all key=value pairs from a Dictionary object.
*/
function Dictionary_removeAll(){
for(var key in this.Obj) delete this.Obj[key];
this.count = 0;
}
//****************************************
/*
function: Dictionary_values
implements: Dictionary.values
Parameters: None
Returns: Returns an Array containing all the item values in a Dictionary object.
Actions: Iterates through the Dictionary name=value pairs and builds an Array of all values.
*/
function Dictionary_values(){
var Arr = new Array();
for(var key in this.Obj) Arr[Arr.length] = this.Obj[key];
return Arr;
}
//****************************************
/*
function: Dictionary_keys
implements: Dictionary.keys
Parameters: None
Returns: Returns an Array containing all existing keys in a Dictionary object.
Actions: Iterates through the Dictionary name=value pairs and builds an Array of all keys.
*/
function Dictionary_keys(){
var Arr = new Array();
for(var key in this.Obj) Arr[Arr.length] = key;
return Arr;
}
//****************************************
/*
function: Dictionary_items
implements: Dictionary.items
Parameters: None
Returns: Returns a bidimensional Array containing all existing keys=value pairs in a Dictionary object.
Actions:
- Iterates through the Dictionary key=value pairs and builds a bidimensional Array.
- First index contains the key name ; second index contains the value:
ex. Arr[0][0] is the key name of the first Dictionary item
Arr[0][1] is the value of the first Dictionary item
*/
function Dictionary_items(){
var Arr = new Array();
for(var key in this.Obj){
var A = new Array(key,this.Obj[key]);
Arr[Arr.length] = A;
}
return Arr;
}
//****************************************
/*
function: Dictionary_getVal
implements: Dictionary.getVal
Parameters:
(String) sKey
Returns: Item value for the passed sKey.
Actions: Retrieves the Dictionary item value corresponding to sKey.
*/
function Dictionary_getVal(sKey){
var K = String(sKey);
return this.Obj[K];
}
//****************************************
/*
function: Dictionary_setVal
implements: Dictionary.setVal
Parameters:
(String) sKey
(Any) aVal
Returns: Nothing.
Actions:
- Sets the Dictionary item value corresponding to sKey to aVal.
- If The key is not found in the dictionary it is created.
*/
function Dictionary_setVal(sKey,aVal){
var K = String(sKey);
if(this.exists(K))
this.Obj[K] = aVal;
else
this.add(K,aVal);
}
//****************************************
/*
function: Dictionary_setKey
implements: Dictionary.setKey
Parameters:
(String) sKey
(String) sNewKey
Returns: Nothing.
Actions:
- Changes sKey to sNewKey
- if sKey is not found, creates a new item with key=sNewKey and value=null
- if sKey is not found, but sNewKey is found - does nothing.
- if sKey and sNewKey both exist - does nothing.
*/
function Dictionary_setKey(sKey,sNewKey){
var K = String(sKey);
var Nk = String(sNewKey);
if(this.exists(K)){
if(!this.exists(Nk)){
this.add(Nk,this.getVal(K));
this.remove(K);
}
}
else if(!this.exists(Nk)) this.add(Nk,null);
}
//****************************************

View 2 Replies View Related

Portable Dictionary Class

Aug 23, 2007

Can you show me an example of a working dictionary object that is
portable? I would like to have something like:

d = new PortableDict()

d.setValue('a',12)
d.setValue('b',-3)

subd = new PortableDict()
d.setValue(subd,51)

d.hasKey('a') // true
d.hasKey('c') // false
d.hasKey(subd) // true
d.getValue('a') // 12

etc.

Alternatively, is there a programming scheme that allows me to assign
custom properties/attributes to DOM elements? I can do it with
FireFox, but not with IE - it throws an error telling that the given
attribute is not supported. Which is strange because AFAIK in
JavaScript you can freely modify objects, add attributes and methods
on the fly. But it looks like that in IE, HTML DOM elements are not
real JavaScript objects.

View 8 Replies View Related

Dictionary Bookmarklet To Open In New Window

Aug 6, 2010

How could I make this useful dictionary bookmarklet open in a new window?

javascript:var%20t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection&&document.selection.createRange&&document.selection.createRange().text));var%20e=(document.charset||document.characterSet);if(t!=''){ location.href='http://translate.google.com/translate_t?text='+t+'&hl=en&langpair=auto|en&tbb=1&ie='+e;}else{location.href='http://translate.google.com/translate?u='+escape(location.href)+'&hl=en&langpair=auto|en&tbb=1&ie='+e;};

Its the "To English" bookmarklet as featured on lifehacker (http://lifehacker.com/5168984/to-english-bookmarklet-quickly-easily-translates-any-text-with-one-click).

View 1 Replies View Related

Double-click Online Dictionary Definition Script?

Sep 3, 2009

I've always wanted to help second-language English speakers access my site better, by offering a 'double-click on a word' definition in other languages. I had a useful script for some years which was rather dated, and ceased to work if there was an iframe on the page for some reason. Anyway, I found a very good solution at [URL]However, this opens the definition in a new tab/window.

Having experimented with it opening in a popup, I found problems in getting the popup to regain focus if someone had not closed it before looking for another definition. And anyway, popups can get blocked. So I found a nice layer/iframe solution at [URL] though their positioning of the layer is poor, at least in FF because it slides too far down below the bottom of the page. Their script is: [URL]I have modified that to work with dictionarist and stripped out their own floating part of the script, so that it works with position fixed for everything except IE6. But for IE6, I need to still change this from position fixed to position absolute, and then use a script to float the box.I have been trying the script I use successfully elsewhere in a vaguely similar context:

Code:

/* Script by: www.jtricks.com
* Version: 20060303
* Latest version:

[code]....

which has a call to startFloat(); near the end, which is based on their own floating script nearer the top of [URL] which I have removed. (Doubtless the references to Netscape (RIP) can be removed.)

View 4 Replies View Related

Dictionary Page - Display Definition Of Word OnClick

Oct 9, 2009

I am doing a distionary page with javascript and I am trying to get it so that the definitions come up when the word they are for is clicked on.

Here is my javascript
Javascript Document
var filename = "dictionary.js";
function loaded(which){
alert(which + " loaded");
}/**/
function showInfo(which){
var placeholder = document.getElementById("definition");
var source = whichInfo.getAttribute("href");
placeholder.setAttribute(source);
alert("showInfo called");
return false;
}function prepareList(){
if (!document.getElementsByTagName || !document.getElementById)
return false;
var words = document.getElementById("words");
if (!words) return false;
var links = words.getElementsByTagName("a");
for(var i = 0; i < links.length; i++) {
links[i].onclick = function(){
showInfo(this);
return false;
}}
alert("prepare list done");
}function init(){
prepareList();
}loaded(filename);
window.onload = init;

Here is my html
<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 StrictEN" "[URL]">
<html xmlns="[URL]">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Dictionary DOM Scripting</title>
<link href="../styles/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="dictionaryScripts/dictionary.js"> </script>
</head><body>
<div class="page">
<div class="nav"><ul>
<li><a href="../home.html">Home</a></li>
<li><a href="../form/form.html">Form</a></li>
<li><a href="dictionaryCSS.html">Dictionary with CSS</a></li>
<li><a href="dictionaryDOM.html">Dictionary with DOM scripting</a></li>
<li><a href="discussionPage.html">Discussion</a></li>
</ul></div><div class="header">
<h1>Dictionary with DOM Scripting</h1></div>
<div class="mainContent">
<div id="words"><h2>L</h2>
<p>Click on the word to get a definition</p>
<dt><a href="lecturer.html">LECTURER, n.</a></dt>
<dt><a href="learning.html">LEARNING, n</a></dt>
<dt><a href="liar.html">LIAR, n.</a></dt>
<dt><a href="love.html">LOVE, n.</a></dt></div>
<div id="definition">Choose a definition</div>
</div></div></body></html>

View 5 Replies View Related

JQuery :: [apycom Menu] Submenu Items Showing As Top Level Items In IE?

Jan 10, 2010

version of Apycom's jQuery menu; you can find itat http://apycom.com/ and it is looking really good.I have uploaded files, and published it on a test site - www.flexin.beUnfortunately, some of the submenus starting from the second that haschildren elements, it adds the item on the top level in InternetExplorer.Does anyone on this list has any experience with this library?

View 2 Replies View Related

How To Convert Below Vbscript

Jan 20, 2011

how to convert below vbscript to javascript.

[Code]...

View 3 Replies View Related

<OBJECT>, Javascript And IE

Aug 8, 2006

The IE developer toolbar's DOM inspector shows the OBJECT tag and the PARAM
tags inside it, and if I don't have the Javascript in an external file, I'll
get the "click here to activate" tooltip and the border around what is
supposed to be the Flash movie. If I right-click inside the border, I get the
Flash context menu. The movie just doesn't load.

<html><head><title>foo</title>
<script>
function foo() {

AXObject = document.createElement("object");

AXObject.type="application/x-shockwave-flash";
AXObject.data="flashtest.swf";
AXObject.width="200";
AXObject.height="50";
AXObject.style.visibility="visible";

var p=document.createElement("param");
p.name="movie";
p.value="flashtest.swf";
AXObject.appendChild(p);
var p=document.createElement("param");
p.name="quality";
p.value="high";
AXObject.appendChild(p);

document.body.appendChild(AXObject);

}
</script>
</head>
<body id="foo" onload="foo()">
</body>
</html>

View 1 Replies View Related

Call A Value From The Database To Vbscript?

Apr 4, 2009

Can I call a value from the database to javascript/vbscript. Let's say the database is called SQL="SELECT * from checkout".Can I validate that the SQL and the javascript/vbscript equals to each other and inside the javascript uses the response.redirect function to another asp page?

View 3 Replies View Related

Execute A Vbscript Sub Routine?

May 8, 2010

From inside a javascript function i need to execute a vbscript sub routine.
You might be thinking why i can't do it in javascript. well i probably can but i am better at VBscript and it would be a lot easier.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved