Accessing VB code within Javascript 
Author Message
 Accessing VB code within Javascript

Good afternoon,

I'm looking for some help on how to access VBScript in Javascript. Or more
specifically I'm trying to stuff information from Javascript into the
VBScript Request variable and go to another page that will process that
Request variable.

Here's the code.
This is a function within my Javascript that is called

        function getRecord(arrRecord)
                {
                var arrRecord = obj1.SelectedRecord;
                Function(arrRecord[1],'return VBRedirect(recordID)');
                }

I'm using WebGridEXP (if anyone's interested), and I use the getRecord
function to get all the information in the select row from a table. It's
returned in an array and I'm getting the information from the first column
of that array. I'm trying call a VBScript function called VBRedirect.

Here's VBRedirect

        function PeopleList(recordID)
                Request("ID") = recordID
        end function

What I want VBRedirect to do is to, put the recordID into a Request variable
ID and then redirect the user to another page that will process that Request
ID.
The above doesn't work. In fact if I just want to pop up a msgbox in
VBRedirect, I can't seem to access the function within JavaScript. Can
anybody tell me how I can initated VBScript functions using JavaScript, or
tell me a way of setting Request information directly from JavaScript?

Thanks ahead of time!

Jeff



Tue, 22 Nov 2005 15:13:20 GMT  
 Accessing VB code within Javascript
How is vb supposed to be in JS?

Have vb and js separate.

Use the documented command to address conversion issues.


Quote:
> Good afternoon,

> I'm looking for some help on how to access VBScript in Javascript. Or more
> specifically I'm trying to stuff information from Javascript into the
> VBScript Request variable and go to another page that will process that
> Request variable.

> Here's the code.
> This is a function within my Javascript that is called

> function getRecord(arrRecord)
> {
> var arrRecord = obj1.SelectedRecord;
> Function(arrRecord[1],'return VBRedirect(recordID)');
> }

> I'm using WebGridEXP (if anyone's interested), and I use the getRecord
> function to get all the information in the select row from a table. It's
> returned in an array and I'm getting the information from the first column
> of that array. I'm trying call a VBScript function called VBRedirect.

> Here's VBRedirect

> function PeopleList(recordID)
> Request("ID") = recordID
> end function

> What I want VBRedirect to do is to, put the recordID into a Request
variable
> ID and then redirect the user to another page that will process that
Request
> ID.
> The above doesn't work. In fact if I just want to pop up a msgbox in
> VBRedirect, I can't seem to access the function within JavaScript. Can
> anybody tell me how I can initated VBScript functions using JavaScript, or
> tell me a way of setting Request information directly from JavaScript?

> Thanks ahead of time!

> Jeff



Tue, 22 Nov 2005 16:12:48 GMT  
 Accessing VB code within Javascript

says...

Quote:

>How is vb supposed to be in JS?

>Have vb and js separate.

>Use the documented command to address conversion issues.

I don't understand this part. Which documented command?
Quote:



>> Good afternoon,

>> I'm looking for some help on how to access VBScript in Javascript. Or more
>> specifically I'm trying to stuff information from Javascript into the
>> VBScript Request variable and go to another page that will process that
>> Request variable.

>> Here's the code.
>> This is a function within my Javascript that is called

>> function getRecord(arrRecord)
>> {
>> var arrRecord = obj1.SelectedRecord;
>> Function(arrRecord[1],'return VBRedirect(recordID)');
>> }

>> I'm using WebGridEXP (if anyone's interested), and I use the getRecord
>> function to get all the information in the select row from a table. It's
>> returned in an array and I'm getting the information from the first column
>> of that array. I'm trying call a VBScript function called VBRedirect.

>> Here's VBRedirect

>> function PeopleList(recordID)
>> Request("ID") = recordID
>> end function

>> What I want VBRedirect to do is to, put the recordID into a Request
>variable
>> ID and then redirect the user to another page that will process that
>Request
>> ID.
>> The above doesn't work. In fact if I just want to pop up a msgbox in
>> VBRedirect, I can't seem to access the function within JavaScript. Can
>> anybody tell me how I can initated VBScript functions using JavaScript, or
>> tell me a way of setting Request information directly from JavaScript?

>> Thanks ahead of time!

>> Jeff



Tue, 22 Nov 2005 22:10:33 GMT  
 Accessing VB code within Javascript


Quote:
> Good afternoon,

> I'm looking for some help on how to access VBScript in Javascript. Or more
> specifically I'm trying to stuff information from Javascript into the
> VBScript Request variable and go to another page that will process that
> Request variable.

VB Request is server-side only, even in IE which can handle client-side
VB. IE is the only browser that can handle client side VBScript. But the
request object is defined on the server only.
JS is generally client-side, unless using runat=server and only in web
servers that can handle it (not many).

The server is already done with it and has passed the page to the
client. You can't do that that way.

So, if you want to pass a parameter to a new page...use javascript only.
The request variable in VBScript is merely a reference to form or URL
params. Make a form (all hidden if you like), set the values with JS,
then submit it (also with JS). Or, use the querystring - build the url
from javascript and set location to it (this one may cause problems with
cookies in header data).

HTH
----------------------------------------
~kaeli~
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdeign.net/kaelisSpace
Contrary to popular opinion, the plural
of 'anecdote' is not 'fact'.
----------------------------------------



Tue, 22 Nov 2005 22:13:01 GMT  
 Accessing VB code within Javascript

Quote:


>says...

>>How is vb supposed to be in JS?

>>Have vb and js separate.

>>Use the documented command to address conversion issues.

>I don't understand this part. Which documented command?



>>> Good afternoon,

>>> I'm looking for some help on how to access VBScript in Javascript. Or more
>>> specifically I'm trying to stuff information from Javascript into the
>>> VBScript Request variable and go to another page that will process that
>>> Request variable.

>>> Here's the code.
>>> This is a function within my Javascript that is called

>>> function getRecord(arrRecord)
>>> {
>>> var arrRecord = obj1.SelectedRecord;
>>> Function(arrRecord[1],'return VBRedirect(recordID)');
>>> }

>>> I'm using WebGridEXP (if anyone's interested), and I use the getRecord
>>> function to get all the information in the select row from a table. It's
>>> returned in an array and I'm getting the information from the first column
>>> of that array. I'm trying call a VBScript function called VBRedirect.

>>> Here's VBRedirect

>>> function PeopleList(recordID)
>>> Request("ID") = recordID
>>> end function

>>> What I want VBRedirect to do is to, put the recordID into a Request
>>variable
>>> ID and then redirect the user to another page that will process that
>>Request
>>> ID.
>>> The above doesn't work. In fact if I just want to pop up a msgbox in
>>> VBRedirect, I can't seem to access the function within JavaScript. Can
>>> anybody tell me how I can initated VBScript functions using JavaScript, or
>>> tell me a way of setting Request information directly from JavaScript?

>>> Thanks ahead of time!

Ignore "name".  I killfiled him a long time ago because in my
experience, he's never said anything remotely useful.

Obviously you're writing ASP using VBScript, so that runs on the
server, but is your JScript running on the server also?  In other
words, are you writing ASP using both VBScript and JScript or is your
JScript being executed on the client-side?

If your JScript is running on the server then there's no reason I know
of why your JScript cannot use the Request object directly.  What
error do you get when you do Request("ID") = recordID in JScript?

Quote:
>>> The above doesn't work. In fact if I just want to pop up a msgbox in
>>> VBRedirect, ...

You can't display a msgbox in server-side code.  Well, maybe you can,
but it wouldn't make any sense -- where would the msgbox appear?
However, if your ASP was generating HTML, you could generate
*client-side* script to display a msgbox.

Regards,
Steve
--
Please post questions to the newsgroup; everyone benefits.
This posting is provided "AS IS" with no warranties, and confers no rights.
Sample code subject to http://www.microsoft.com/info/cpyright.htm



Wed, 23 Nov 2005 04:58:56 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Accessing VB code within Javascript

2. Compressing Access files from within VB code

3. Opening a db within Access VB code

4. Executing Access Query within VB Code

5. Calling Excel code within Access code?

6. Include JavaScript code within external CSS files

7. Access to url parameters from within script code

8. Accessing an EPS file from within PS code

9. Access to url parameters from within script code

10. How to access a pdf file from within javascript

11. change printer from within a VB module within Access 2000

12. html code within vb code

 

 
Powered by phpBB® Forum Software