VB类中的Javascript [英] Javascript in VB class

查看:73
本文介绍了VB类中的Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法从VB代码中启动javascript命令?对于

实例,如果满足某个条件,则发出window.open(某个url)。我知道你可以在运行时将javacript添加到控件事件中,但我需要

启动它,而不是等待用户点击某些内容。


谢谢

Is there a way to launch a javascript command from within VB code? For
instance, to issue a window.open(some url) if a certain condition is met. I
know you can add the javacript to a control event at runtime, but i need to
just launch it, not wait for the user to click something.

Thanks

推荐答案

只需将您的javascript绑定到相应的客户端事件(例如

body标签的onload属性)。无论如何它总是会执行客户




Patrice


-


" Brian Henry" <峰; br ********** @ newsgroups.nospam>一个écritdansle message de

新闻:%2 ****************** @ TK2MSFTNGP10.phx.gbl ...
Just bind your javascript to the appropriate client side event (such as the
the onload attribute of the body tag). It will be always performed client
side anyway.

Patrice

--

"Brian Henry" <br**********@newsgroups.nospam> a écrit dans le message de
news:%2******************@TK2MSFTNGP10.phx.gbl...
有没有办法从VB代码中启动javascript命令?对于
实例,如果满足某个条件,则发出window.open(某个url)。
我知道你可以在运行时将javacript添加到控件事件中,但我需要
来启动它,而不是等待用户点击某些内容。

谢谢你/>
Is there a way to launch a javascript command from within VB code? For
instance, to issue a window.open(some url) if a certain condition is met. I know you can add the javacript to a control event at runtime, but i need to just launch it, not wait for the user to click something.

Thanks



没有。 VB代码服务器端。 JavaScript是客户端的。从来没有twain

会见。


-

HTH,

Kevin Spencer

..Net开发人员

微软MVP

大件物品组成

很多小东西。 />

" Brian Henry" <峰; br ********** @ newsgroups.nospam>在留言中写道

新闻:#W ************** @ TK2MSFTNGP10.phx.gbl ...
No. "VB Code" is server-side. JavaScript is client-side. And never the twain
shall meet.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Brian Henry" <br**********@newsgroups.nospam> wrote in message
news:#W**************@TK2MSFTNGP10.phx.gbl...
有没有办法从VB代码中启动javascript命令?对于
实例,如果满足某个条件,则发出window.open(某个url)。
我知道你可以在运行时将javacript添加到控件事件中,但我需要
来启动它,而不是等待用户点击某些内容。

谢谢你/>
Is there a way to launch a javascript command from within VB code? For
instance, to issue a window.open(some url) if a certain condition is met. I know you can add the javacript to a control event at runtime, but i need to just launch it, not wait for the user to click something.

Thanks



" Brian Henry" <峰; br ********** @ newsgroups.nospam>在消息中写道

news:%2 ****************** @ TK2MSFTNGP10.phx.gbl ...
"Brian Henry" <br**********@newsgroups.nospam> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
有没有办法从VB代码中启动javascript命令?对于
实例,如果满足某个条件,则发出window.open(某个url)。
我知道你可以在运行时将javacript添加到控件事件中,但我需要
来启动它,而不是等待用户点击某些内容。
Is there a way to launch a javascript command from within VB code? For
instance, to issue a window.open(some url) if a certain condition is met. I know you can add the javacript to a control event at runtime, but i need to just launch it, not wait for the user to click something.



JavaScript只是服务器发送给客户端的响应中的文本。除非您向客户发送文本,否则将无法使用JavaScript。您可以向客户端发送文本的唯一

时间是在请求结束时。


此外,您似乎有一些代码,并且您想要该代码启动了一些

JavaScript。但是,如果用户没有点击

,那么该代码是如何被调用的?

-

John Saunders

johnwsaundersiii at hotmail



JavaScript is just text in a response the server sends to the client. Unless
you are sending text to the client, there will be no JavaScript. The only
time you can send text to the client is at the end of the request.

Also, you seem to have some code, and you want that code to launch some
JavaScript. But how did that code get called if the user didn''t click
anything?
--
John Saunders
johnwsaundersiii at hotmail


这篇关于VB类中的Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆