0
我只想在IE中加載這些腳本。條件註釋不起作用,因爲在IE 10或更高版本上使用they aren't supported,而我正在使用IE11。僅在IE上加載腳本
¿有什麼想法?我試過answer of this question,但它給我一個錯誤。
Active Server Pages error 'ASP 0138'
Nested Script Block
/solicitudviajes/desplazamientos.asp, line 31
A script block cannot be placed inside another script block.
<script type="text/javascript">
if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)){
document.write('<script src="../jquery-ui/jquery-1.10.2.js"><\/script>');
document.write('<script src="../jquery-ui/ui/jquery.ui.core.js"><\/script>');
document.write('<script src="../jquery-ui/ui/jquery.ui.widget.js"><\/script>');
document.write('<script src="../jquery-ui/ui/jquery.ui.dialog.js"><\/script>');
document.write('<script src="../jquery-ui/ui/jquery.ui.button.js"><\/script>');
document.write('<script src="../jquery-ui/ui/jquery.ui.position.js"><\/script>');
document.write('<script src="../jquery-ui/js/jquery-ui-1.10.4.custom.min.js');
}
</script>
你有一個服務器端語言?它通常可以選擇你正在使用的瀏覽器,否則你可以使用js來檢測和包含腳本 – Pete
https://stackoverflow.com/questions/29987969/how-to-load-a-script-only-in-ie –
我試着從複製的問題的答案之前,但它給我一個錯誤,這就是爲什麼我沒有這個問題再次的Active Server Pages錯誤「ASP 0138」 嵌套的Script塊 /solicitudviajes/desplazamientos.asp 31行 腳本塊不能放在另一個腳本塊中。 –