I want to add a script
if(screensize>980){
add <script src="somejs">// functions should work without time delay
}
if(screensize<980){
remove <script src="somejs">
}
when screen size is less than 900, and I want to remove the same script when the user resize the screen to bigger size. and then back again removing and adding the script dynamically based on the screen size. script dependent functions should work without any problem (dynamically) and without delay and reloading. is it possible. I tried so many things but none worked.
$.ajax, document.createElement("script") - I tried these two but i want it dynamically remove and add.
For example: add and remove <script src="somescript">. Is there a possibility to comment and uncomment the loaded script dynamically?