Where is the .JS file in this code? And why are they calling it this way?

后端 未结 5 606
我在风中等你
我在风中等你 2021-01-07 16:00

Where is the JS file and is this Async the fastest way to call JS?

I guess they then have PHP calls in the .JS for updating the Ad stats??

The code:

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-07 16:32

    There are a couple of ways to include js code into html, one is put the code directly into the tag, just like what you wondered about the code you posted, the other method is to use the following syntax:

    
    

    As a side note, the code you posted uses a technique that prevents js name spacing conflicts by putting the code in the (function() ...)(); block, which I find to be a very good practice.

    Regarding the question about using async in tag, you might want to take a look at this: http://davidwalsh.name/html5-async

提交回复
热议问题