函数如果启用了javascript,则返回 [英] function if javascript enabled, else postback

查看:65
本文介绍了函数如果启用了javascript,则返回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨;


当用户点击单选按钮时,我想要做的是,如果

javascript在他们的浏览器上启用,那么调用javascript函数和

不进行回发。如果javascript被禁用,那么它确实会进行回发。


有没有办法做到这一点?


-

谢谢 - 戴夫

david_at_windward_dot_net
http:// www.windwardreports.com

解决方案

David Thielen说:

嗨;

当用户点击一个单选按钮时,我想要做的是,如果在他们的浏览器上启用了javascript,它会调用一个javascript函数,而
不会做一个回发。如果javascript被禁用,那么它确实会进行回发。

有没有办法做到这一点?




嗯,你可以抓住表单的OnSubmit事件并处理它

有客户端代码...返回true或false允许或

禁止浏览器发布。
< br $>
FWIW,

Greg G.


使用Request.Browser.JavaScript检测是否启用了javascript在你之前

输出实际的页面,连同radiobutton并改变你的输出

如果不是这样就不能调用javascript函数。


-

问候


John Timney

Microsoft MVP


David Thielen <第***** @ nospam.nospam>在消息中写道

news:60 ********************************** @ microsof t.com ...

嗨;

当用户点击一个单选按钮时,我想要做的是,如果
javascript已启用浏览器,它调用javascript函数和
不做回发。如果javascript被禁用,那么它确实会进行回复。

有没有办法做到这一点?

-
谢谢 - 戴夫
david_at_windward_dot_net
http://www.windwardreports.com


嗨;


我可能遗漏了一些东西。如果javascript被禁用,那么onsubmit

函数不会被调用 - 对吗?


-

谢谢 - dave

david_at_windward_dot_net
http://www.windwardreports.com


" GregG"写道:

David Thielen说:

嗨;

当用户点击一个单选按钮时,我是什么我想做的是,如果在他们的浏览器上启用了javascript,它会调用javascript函数并且不会进行回发。如果javascript被禁用,那么它确实会进行回发。

有没有办法做到这一点?



那么,你可以捕获OnSubmit事件使用客户端代码表单和处理
...返回true或false以允许或不允许浏览器发布。

FWIW,
Greg G。



Hi;

When a user clicks a radio button, what I would like to do is that if
javascript is enabled on their browser, it calls a javascript function and
does not do a postback. If javascript is disabled, then it does do a postback.

Is there a way to do this?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

解决方案

David Thielen said:

Hi;

When a user clicks a radio button, what I would like to do is that if
javascript is enabled on their browser, it calls a javascript function and
does not do a postback. If javascript is disabled, then it does do a postback.

Is there a way to do this?



Well, you could capture the OnSubmit event for the form and handle it
there with client side code... return true or false to allow or
disallow the browser to post.

FWIW,

Greg G.


Detect if javascript is enabled using Request.Browser.JavaScript before you
output the actual page contianing the radiobutton and change your output
accordingly if its not so the javascript function cannot be called.

--
Regards

John Timney
Microsoft MVP

"David Thielen" <th*****@nospam.nospam> wrote in message
news:60**********************************@microsof t.com...

Hi;

When a user clicks a radio button, what I would like to do is that if
javascript is enabled on their browser, it calls a javascript function and
does not do a postback. If javascript is disabled, then it does do a
postback.

Is there a way to do this?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com



Hi;

I may be missing something. If javascript is disabled, then the onsubmit
function won''t be called - correct?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

"GregG" wrote:

David Thielen said:

Hi;

When a user clicks a radio button, what I would like to do is that if
javascript is enabled on their browser, it calls a javascript function and
does not do a postback. If javascript is disabled, then it does do a postback.

Is there a way to do this?



Well, you could capture the OnSubmit event for the form and handle it
there with client side code... return true or false to allow or
disallow the browser to post.

FWIW,

Greg G.



这篇关于函数如果启用了javascript,则返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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