-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNotes.txt
More file actions
90 lines (72 loc) · 2.3 KB
/
Copy pathNotes.txt
File metadata and controls
90 lines (72 loc) · 2.3 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
$('#checki').append("<p></p>").text("Rida");
$('#product_show').append("<%= escape_javascript (render: 'show', locals: { product: @product }) %>");
$('#product_content').val('')
$("#checking").hover(function(){
$("p").hide(1000);
});
*/
/*
alert("end!");
alert("asdfads");
$('#mydiv').append("<p></p>").text("Rida");
// $('#checki').append("<p>Rida</p>");
/*
$('#product_show').append("<%= escape_javascript (render: 'show', locals: { product: @product }) %>");
$('#product_content').val('')
$("#checking").hover(function(){
$("p").hide(1000);
});
$(document).ready(function(){$("body").append("<div id='run'>Rida</div>");});
/*
alert("end!");
alert("asdfads");
$('#mydiv').append("<p></p>").text("Rida");
// $('#checki').append("<p>Rida</p>");
/*
$('#product_show').append("<%= escape_javascript (render: 'show', locals: { product: @product }) %>");
$('#product_content').val('')
$("#checking").hover(function(){
$("p").hide(1000);
});
$("#run").on("click", function(){
alert("This div was clicked.");
});
*/
$(document).ready(function(){$("body").append("<p>Appended Paragraph</p>");});
$("#try").click(function(){
alert("This button was clicked from Click.");
});
$(document).ready(function(){$("#try").on("click", function(){
alert("This button was clicked from ON.");
});});
$(document).on("click", "#try", function(){
alert("This button was clicked from ON.");
});
$(document).ready(function(){$("#mydiv").append("<button id='try'>My Button</button>");});
$("#try").click(function(){
alert("This button was clicked from Click.");
});
$("#trying").on "click", ->
$.ajax
url: '/products'
data: product {}
dataType: "html"
error: (jqXHR, textStatus, errorThrown) ->
$('body').append "AJAX Error: #{textStatus}"
success: (data, textStatus, jqXHR) ->
$('body').append "Successful AJAX call: #{data}"
console.log("Before AJAX Call!")
$(document).ready ->
$("#trying").click ->
$.ajax
url: '/products'
type: 'POST'
data: { product: { name: $('#product_name').val() } }
dataType: "json"
error: (jqXHR, textStatus, errorThrown) ->
$('body').append "AJAX Error: #{textStatus}"
success: (data, textStatus, jqXHR) ->
console.log("Within AJAX Call!")
$('body').append "Successful AJAX call!"
console.log("After AJAX Call!")