Navigation überspringen

[Gelöst] What the best way to insert javascript to the post

This support ticket is created vor 5 Jahren, 4 Monaten. There's a good chance that you are reading advice that it now obsolete.
Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 0 Antwort, hat 1 Stimme.

Zuletzt aktualisiert von Rostislav Avtodiychuk vor 5 Jahren, 4 Monaten.

Assistiert von: Minesh.

Author
Artikel
#1476663

Tell us what you are trying to do? I have many simple javascript codes from codepen and others. I want use them in different posts for child tests. I don't need any connection to the database.
Can you show/assist/help what the best or any way to use them? I try to use the content template, blocks, layout but they are not working as I need on the preview.

here is code from codepen
[code]
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title>undefined</title>
<meta name="generator" content="Google Web Designer 7.1.1.1210">
<link href = "versteckter Link"
rel = "stylesheet">
<script src = "versteckter Link"></script>
<script src="versteckter Link"></script>

<style>
#sortable{ list-style-type: none; margin: 0;
padding: 0; width: 25%; float:left;}
#sortable li{ margin: 0 3px 3px 3px; padding: 0.4em;
padding-left: 1.5em; font-size: 17px; height: 16px; }
.default {
background: #cedc98;
border: 1px solid #DDDDDD;
color: #333333;
}
</style>

<script>
$(function() {
$('#sortable').sortable({
update: function(event, ui) {
var productOrder = $(this).sortable('toArray').toString();
if(productOrder == "4,3,2,1"){ $("#sortable-9").text ("true");} else {$("#sortable-9").text ("false");}

}
});
});
</script>
</head>

<body>

<ul id = "sortable">
<li id = "1" class = "default">Product 1
<li id = "2" class = "default">Product 2
<li id = "3" class = "default">Product 3
<li id = "4" class = "default">Product 4

<br>

<h3><span id = "sortable-9"></span></h3>
</body>
</html>
[/code]
Thanks for any help