using php to check is a javascript file has been loaded?

前端 未结 2 691
悲&欢浪女
悲&欢浪女 2021-01-21 15:20

Can I use a script to check if a JS file is loaded?

I have a function, which places a form on a page with javascript controls. I don\'t know where the user will use th

2条回答
  •  逝去的感伤
    2021-01-21 16:04

    No. The page isn't seen until the PHP script has flushed all its output, by which time it's too late to do anything. But most browsers are smart enough to only load an external resource once per page anyway.

提交回复
热议问题