most of the time we include script tag in html head tag. like
<Head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
</head>
I want that I don’t want to include js file path rather I need to download js programmatically by jquery. like i will download js file programmatically from http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js and check if the file can not be download or does not exist then i will download the same file from my site like http://www.my-site.com/js/1.5.2/jquery.min.js.
please help me to do it using jquery.
I think you want to add script programmetically.
This following mechanism allows the rendering engine to immediately render and display the initial view defined in HTML while the JavaScript resources are still being loaded and executed which leads to better user experience
When tags are found in the HTML document the referenced script resources are downloaded and executed before the rendering engine can continue to download other resources which effectively blocks the rendering of the page below the tag. To avoid this blocking behaviour a script tag can be created via a mechanism known as a dynamic script tag injection Reference(http://www.nczonline.net/blog/2009/07/28/the-best-way-to-load-external-javascript/)