
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