Problema al descargar el archivo jquery con ResolveClientUrl asp.net

i think there is some bug in my ResolveClientUrl syntax. what would be the right syntax. please help. thanks

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js"></script>
    <script type="text/javascript">  window.jQuery || document.write("<script src="+<%=  this.ResolveClientUrl("~/Scripts/jquery-1.6.2.min.js") %>"+>\x3C/script>")</script>

preguntado el 08 de noviembre de 11 a las 13:11

3 Respuestas

there is a typo in your code. check out your concatenations and also, you need to escape some html characters like "/", ">", etc etc

the ff code should correct it.

<script type="text/javascript">
        window.jQuery ||
        document.write("<script type='text\/javascript' src='<%= this.ResolveClientUrl("~/Scripts/jquery-1.6.2.min.js") %>'><\/script>"); 
</script>

respondido 08 nov., 11:18

ResolveClientUrl returns relative to current page. You may try ResolveUrl which will return relative to raíz del sitio!

respondido 08 nov., 11:17

<script type="text/javascript">  window.jQuery || document.write("<script src="+<%=
      Page.ResolveUrl("~/Scripts/jquery-1.6.2.min.js") %>"+>\x3C/script>")</script>

respondido 08 nov., 11:18

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.