What is wrong with this sample code? o_O
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
console.log("Testing");
$('#test').append("Test");
});
</script>
<title>Sin título 4</title>
</head>
<body>
<div id="test">Hello world.</div>
</body>
</html>
1 Answer 1
You have an illegal invisible character at the end of this line...
$('#test').append("Test");// <-- right before this comment
Delete the line entirely, and retype it, or make sure the cursor is after all characters on the line, and hit backspace until you see characters actually being removed.
This happens sometimes if you copy & paste code from jsFiddle.
The charCode of the offending character is 8203.
Sign up to request clarification or add additional context in comments.
2 Comments
Prusprus
How would one go about finding these illegal text characters themselves?
@Prusprus: Here's a SO question that may help. I don't have much better than that to offer. Good luck!
default
$('#test').append("Test");