What is wrong with this sample code? o_O
<html>
<head>
<script type="text/javascript" src=".7.2/jquery.min.js"></script>
<script type="text/javascript" src=".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>
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>
Share
Improve this question
edited Jul 12, 2012 at 7:46
Daedalus
7,7225 gold badges38 silver badges63 bronze badges
asked Jul 12, 2012 at 2:56
testtest
18.2k67 gold badges172 silver badges245 bronze badges
7
|
Show 2 more comments
1 Answer
Reset to default 22You 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.
$('#test').append("Test");
– test Commented Jul 12, 2012 at 2:57