forked from mozi22/MemeGenerator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
64 lines (58 loc) · 1.45 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Meme generator</title>
</head>
<body>
<div style="width:40%;margin:30px auto;" >
<table>
<tr>
<td colspan="2">
<img src="testing.jpg" id="gag" />
</td>
</tr>
<tr>
<td>
<input type="text" placeholder="Upper Text" id="upperTextbox"/>
</td>
<td>
<input type="text" placeholder="Lower Text" id="lowerTextbox"/>
</td>
</tr>
<tr>
<td><p style="font-size:14px;color:#CCC;">Image updates on textbox focus out</p></td>
</tr>
</table>
</div>
<div id="error"></div>
</body>
</html>
<script src="jquery.js" type="text/javascript" ></script>
<script>
$('#lowerTextbox').focusout(function(){
if($.trim($(this).val()) != "")
{
SendAjaxRequest($('#upperTextbox').val(),$(this).val(),"lower");
}
});
$('#upperTextbox').focusout(function(){
if($.trim($(this).val()) != "")
{
SendAjaxRequest($(this).val(),$('#lowerTextbox').val(),"upper");
}
});
function SendAjaxRequest(umsg,dmsg,type)
{
$.ajax({
url: 'generator.php',
type: 'GET',
data: { upmsg : umsg, downmsg : dmsg, position: type },
success:function(e)
{
$('#error').html(e);
$('#gag').attr('src',e);
}
});
}
</script>