他の Jquery のロードに追加した Jquery がいくつかありますが (すべて正常に動作します)、コードの残りの部分が壊れています。どこかにエラーがありますが、どこにあるのかわかりません!
//Retrieve the customization summary area:
var summary = $('#customise-area-3 p');
//Use jQuery to select all the checkboxes with the name hardware that are checked.
$('input[type=checkbox][name=hardware\[\]]:checked').each(function(k,v) {
//Retrieve the value of the checkbox.
var checkboxValue = v.val();
//Add the checkbox value to the summary area:
summary.innerHTML += checkboxValue + '<br />';
});
これはWordpress内にあるため、残りのすべてのJqueryは次のスタイルになっています。
jQuery(document).ready(function( $ )
{
$("#customise").click(function()
{
$(".entire_product").hide();
$(".customise").show();
});
});
Wordpress 環境内でコードを機能させるために、次のことを行いました。
jQuery(document).ready(function( $ )
{
var summary = $('#customise-area-3 p').get(0);
$('input[type=checkbox][name="hardware[]"]:checked').each(function(k,v) {
//Retrieve the value of the checkbox.
var checkboxValue = v.val();
//Add the checkbox value to the summary area:
summary[0].innerHTML += checkboxValue + '<br />';
});
});
これにより、コードの残りの部分が壊れるのを防ぎますが、実際には何もしません。つまり、選択したチェックボックスの値を概要に追加します。