Smurfette
Smurfette

Reputation: 2005

How are JavaScript libraries saved by the browser?

I use a library on my main site www.domain.com as such

<script src = 'lib.js'>

However, when I link out to another tab that points to ( using target = '_blank' )

www.domain.com/path

the library is gone and I have to reload it.

Is this expected behavior?

I thought because resources like localStroage have limits based on domain that other aspects of the environment would be domain based.

That is resources I load at www.domain.com I thought would be available at www.domain.com/path.

But this seems to not be the case.

Upvotes: 2

Views: 113

Answers (1)

Raidri
Raidri

Reputation: 17560

Javascript files are only loaded for one page and need to be loaded again for every other page regardless of the domain or path.

Upvotes: 8

Related Questions