I am listing files from a directory and for each one there is a delete link, in firefox all works but with chrome when I want to display the list, I get this error, I dont know how to fix it
This page contains the following errors:
error on line 4 at column 44: Opening and ending tag mismatch: root line 0 and br Below is a rendering of the page up to the first error.
this is my script:
<script type="text/javascript">
window.addEvent('domready', function() {
$$('a.delete').addEvent('click', function(e) {
e.stop();
var id = this.get('id');
var DeleteFile = new Request({
// method: 'POST',
// data: 'archivo='+id,
url: 'deletefile.php?archivo='+id,
onRequest: function() {},
onSuccess: function(text, xmlanswer) {
//alert(text);
开发者_如何学编程 $('page_container').load('script2.php');
},
onFailure: function(){alert('Error!');}
}).send();
// DeleteFile.send({ data: { 'archivo': id } });
});
});
</script>
<?php
$ruta = "./uploadedfiles/";
$directorio = dir($ruta);
$types = array('jpg', 'jpeg', 'txt', 'gif', 'png', 'doc', 'docx', 'pdf', 'xlsx', 'pptx');
$identificador = "";
while ($archivo = $directorio->read()) {
$division = explode(".", $archivo);
$extension = end($division);
$identificador = $archivo;
if(in_array($extension, $types)){
echo $archivo . "<a id=\"". urlencode($identificador)."\" href=\"#\" class=\"delete\">Delete</a></br>";
//echo $archivo . " <a id=\"". $identificador."\" href=deletefile.php?archivo=" . urlencode($archivo) .">Delete</a><br>";
//echo $archivo. "<a id=refresh href=# >Delete</a><br> ";
}
}
$directorio->close();
?>
Your <br>
and </br>
tags are both wrong and mismatched.
The <br />
tag cannot have content; you should always make it a self-closing tag (<br />
)
精彩评论