开发者

PHP coding, How to handle javascript & within javascript in the same piece of source code?

开发者 https://www.devze.com 2023-03-31 12:06 出处:网络
Typically, I inject so many javascript in the website. But suddenly, the client told me that he can\'t render the website correctly, so I check it. I realize that he didn\'t enable javascript on his s

Typically, I inject so many javascript in the website. But suddenly, the client told me that he can't render the website correctly, so I check it. I realize that he didn't enable javascript on his side.

So, my question is, should I need two places of source code? one is: index_with_js.php, and one is index.php, all files separate with js and non js version?

It is not a difficult job, but just make people insane to doing this. An开发者_运维百科y better suggestions?


Really, you should make your website degrade gracefully. Its not too difficult just involves changing the way you work a little bit.

I always build a website as if the user doesn't have JavaScript enabled to ensure its usable without it and I add my JavaScript afterwards. This way you don't have to worry about any complicated redevelopments.

I think you're likely to have to do a lot of work on this particular clients site as it sounds like its JavaScript heavy and since you can't detect whether JavaScript is enabled very easily (or at all?) You're going to have to make sure the website renders in a managable way then add your JS.

0

精彩评论

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