![]() |
mensaje = Resource id #3 Nose ni entiendo por que me sale este mensaje => Resource id #3 Estoy aprendiendo AJAX de un libro. Este es el codigo: 1er archivo news.php <html> <head> <title>Documento sin título</title> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <script language="JavaScript"> function xmlhttpPost(strURL) { var xmlHttpReq=false; var self = this; if (window.XMLHttpRequest) { self.xmlHttpReq = new XMLHttpRequest(); } else if (window.ActiveXObject) { self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); } self.xmlHttpReq.open('POST', strURL, true); self.xmlHttpReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); self.xmlHttpReq.onreadystatechange = function() //aqui tenia unas mayusculas { if (self.xmlHttpReq.readyState == 4) { updatepage(self.xmlHttpReq.responseText); } } self.xmlHttpReq.send(getquerystring()); } function getquerystring() { var form = document.forms['editform']; var news = form.news.value; qstr = 'article=' + escape(news); return qstr; } function updatepage(str) { document.getElementById("resultado").innerHTML = str; document.getElementById("mensaje").innerHTML = "ACTUALIZADO"; } </script> <style> body, p, input, textarea, div {font: bold 8pt verdana, sans-serif;} a, span { font: bold 8pt verdana, sans-serif; text-decoration:none; color:red; } </style> </head> <body> <div id="resultado"> <? $news="news.txt"; $text= fopen ($news,'r'); $content=fread($text,filesize($news)); fclose($text); echo($content); ?> </div> <i>Actualizacion</i> <form name="editform" method=post> <textarea name="news" cols=50 rows=35 wrap=soft> <? echo($content); ?> </textarea> <input value="Actualizar" type="button" onClick='JavaScript:xmlhttpPost("writer.php")'> </form> <span id="mensaje"></span> </body> </html> 2do Archivo writer.php <? $bulletin="news.txt"; $text=fopen($bulletin, 'w') or die("falta archivo"); $article=utf8_encode($text); $article=utf8_decode($text); $article=stripslashes($text); $article=htmlentities($text); $article=str_replace('>','>',$text); $article=str_replace('<','<',$text); fwrite($text,$article); fclose($text); $news="news.txt"; $text=fopen($news,'r'); $content=fread($text,filesize($news)); fclose($text); echo($content); ?> El archivo news.txt puede tener cualquier informacion. Gracias de antemano y espero que me puedan ayudar. :'( |
| La zona horaria es GMT -6. Ahora son las 18:56. |
Desarrollado por vBulletin® Versión 3.8.7
Derechos de Autor ©2000 - 2026, Jelsoft Enterprises Ltd.