Skip to content

Commit 5aa7912

Browse files
committed
jquery.org: Use buttons instead of anchors for forms.
1 parent bd6deaf commit 5aa7912

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

themes/jquery.org/style.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ a.icon-search::before {
251251
padding-right: 15px;
252252
}
253253

254-
.member-level a.button {
254+
.member-level .button {
255255
float: left;
256256
display: inline-block;
257257
clear: both;
@@ -262,7 +262,7 @@ a.icon-search::before {
262262

263263
}
264264

265-
.member-level form a.button {
265+
.member-level form .button {
266266
clear: none;
267267
}
268268

@@ -414,13 +414,13 @@ a.icon-search::before {
414414
margin-bottom: 40px;
415415
}
416416

417-
a.button,
418-
#content a.button, .button {
417+
.button,
418+
#content .button {
419419
background-color: #b71551;
420420
}
421421

422-
a.button:hover,
423-
#content a.button:hover {
422+
.button:hover,
423+
#content .button:hover {
424424
background-color: #7c0d36;
425425
}
426426

themes/jquery/js/main.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,18 @@ $(function() {
9090
gifts.not( gift ).slideUp();
9191
});
9292

93-
$(".member-level .pay").on( "click", function() {
94-
var a = $(this)
93+
$(".member-level .pay").on( "click", function( event ) {
94+
event.preventDefault();
95+
var button = $( this );
9596
StripeCheckout.open({
9697
key: 'pk_NjMf2QUPtR28Wg0xmyWtepIzUziVr',
97-
image: a.data("image"),
98-
name: a.data("name"),
99-
description: a.data("description"),
100-
panelLabel: a.data("panel-label"),
101-
amount: a.data("amount"),
102-
token: function(res) {
103-
alert(res.id);
98+
image: button.data("image"),
99+
name: button.data("name"),
100+
description: button.data("description"),
101+
panelLabel: button.data("panel-label"),
102+
amount: button.data("amount"),
103+
token: function( data ) {
104+
alert( "Stripe token: " + data.id );
104105
}
105106
});
106107
});

0 commit comments

Comments
 (0)