| Portada | Monotemáticos | Secciones | Desarrolladores | Comunidad | Servicios | Servicios profesionales | RSS | ||||
| ARTICULO: Comprobar la validez de una URL con Ajax |
Se muestra un comentario sin revisar
| Pepote | 17/10/07 |
| Creo que es complicarse un poco la vida. Se puede hacer sin Ajax. El problema es que como Ajax está de moda, se utiliza para todo aún siendo innecesario. La alternativa sin Ajax: <html> <head> <script language='Javascript'> function checkURL(){ var msURL=document.fichero.txturl.value; var ifrURL=document.getElementById("ichkURL"); var dvURL=document.getElementById("divURL"); if (msURL.indexOf("http://") < 0) document.fichero.txturl.value="http://"+msURL; dvURL.innerHTML="<b>URL comprobada: "+document.fichero.txturl.value+"</b>"; ifrURL.style.display="inline"; ifrURL.width="100%"; ifrURL.height="50%"; ifrURL.src=document.fichero.txturl.value; } </script> </head> <body> <table border="0" align="center"> <form name="fichero"> <tr> <td align="right">URL:</td> <td><input type="texto" name="txturl"> <input type="button" value="Comprobar URL" onclick="checkURL()"> </td> </tr> </form> </table> <br> <div id="divURL" align="center"></div> <iframe align="center" id="ichkURL" src="" width="0" height="0"></iframe> </body> </html> |
|
| Ver el articulo y todos sus comentarios | |
| Añadir un comentario del artículo |
|
Comentarios no revisados de: |