Code:
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript">
(function($){
$.fn.awnlapi = function(apikey, type, image, xhtml = false, alt) {
if(xhtml == false){
var endtag = '>';
}
else
{
var endtag = '/>';
}
$(fn).html('<img src="http://api.mywebsite.com/api.php?apikey='+ apikey +'&type='+ type +'&image='+ image +'" alt="'+ alt +'"'+ endtag);
}
}).jQuery;
$().ready(function() {
$('#image').awnlapi('893c5f6119f901f94b3ce67816f77f88127aff353b1a48d2f0f5c9c70a0f571589b84d04', 'gif', '1', false, 'This is alt!');
}
</head>
<body>
<div id="image"></div>
</body>
</html>
What is wrong?
Greetings
Comment