How can I execute Javascript function before Page load?

前端 未结 4 524
清歌不尽
清歌不尽 2020-12-18 00:48

I am using a hidden field \'Isjsenabled\' to detect whether Client\'s Javascript is enabled or disabled. If Javascript is enabled, Javascript function will be fired and it w

4条回答
  •  萌比男神i
    2020-12-18 01:02

    Unobtrusive JavaScript may be of interest. Allowing your pages to degrade gracefully will simplify development. Design for no JavaScript initially and enhance the experience. This may not be an option if your application is extremely JavaScript intensive and absolutely requires it to function. In that case using the noscript tag to inform your users that they need JavaScript enabled would be a good idea.

    Also, look at x0n's comments. Here a reference to help understand the HTTP request life cycle.

提交回复
热议问题