开发者

Why onclientclick do a postback?

开发者 https://www.devze.com 2022-12-23 21:19 出处:网络
I have an asp button with no onclick event but only onclientclick. Th开发者_运维知识库is call a javascript function in a iframe in which a video is playing;

I have an asp button with no onclick event but only onclientclick. Th开发者_运维知识库is call a javascript function in a iframe in which a video is playing;

each time I click the javascript function is called but also the video restart which means the page is reloaded.

How to prevent this ?


return false from your onclientclick.

OnClientClick="LoadVideo();return false;"


add

 return false;

to you function.

0

精彩评论

暂无评论...
验证码 换一张
取 消