<!-- HTML -->
<form id="urllink" action="/test">
<input type="hidden" name="mid" value="test">
</form>
<script>
var urllink = $("#urllink").attr("action");
var urllink = $("#urllink").serialize();
function test(){
$.ajax({
type:"POST",
url : urllink,
data : formData ,
dataType : "jsonp",
jsonpCallback : "myCallback",
success: function(data) {
alert(data[msg]);
},
error: function(xhr) {
console.log('실패 - ', xhr);
}
});
}
</script>
<button onClick="">테스트</button>
<!-- PHP -->
<?php
$callback = $_GET['callback'];
$arr = array("test" => "test");
$json_val = json_encode($arr);
echo $callback."(".$json_val.")";
?>
ParseError #0 "syntax error, unexpected ':', expecting ',' or ';'" in files/cache/opage/240.none.cache.php on line 2
정상적으로 출력 될려면 어떻게 해야할까요..