NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: linas@debetas.lt on November 29, 2011, 04:27:44 PM
-
Hi,
I successfuly add extra script myscriptfile.js to the site properties in head section of the page, then it exist in all pages. The problem is that takes time to download because each page will request it.
Is it possible to add scrip for if I load specified netwebforms? I use nettalk5 latest
Example
<html>
<head>
<title>My First chart using FusionCharts - Using JavaScript</title>
<script type="text/javascript" src="FusionCharts/FusionCharts.js"></script>
</head>
<body>
....
....
</body>
</html>
this line <script type="text/javascript" src="FusionCharts/FusionCharts.js"></script> must be in the head.
Linas
-
Check out the XHTML Tab on your netwebform. You can add it there or as a p_web.script() (I'm not sure if that is the right syntax) in your handcode.
You also need to add your script to the webserver, settings, Scripts Tab which I guess if it is working, you probably have already done.
-
Hi Linus,
>> The problem is that takes time to download because each page will request it.
If you look in your server log, you'll notice this assumption is wrong.
Since the browser caches js and css files, the user only gets them once.
Thus adding them "globally" makes life a lot easier for you and ultimately results in more reliability.
Cheers
Bruce
-
Hi Bruce,
Yes global use is very handy.
Tested, caching depends on the browser settings, so not allways caches, and also the JS I have on top includes more JS files.. so you download a bunch of flowers.
Found a way how to use script in different way.
Linas