Uncaught TypeError: Cannot read property 'split' of undefined on image src
0
this is my code var product_features_images = ""; var product_features_count = $(".productInfo.toolTipLink").length; for (i = 0; i < product_features_count; i++){ var feature_cached_URL = $(".productInfo.toolTipLink:eq(" + product_features_count + ") img").attr("src").split("/"); var feature_element = "<img src='/img/produkty/liebherr/icons/" + feature_cached_URL[feature_cached_URL.length - 1]; + "'>" product_features_images = product_features_images + feature_element; } All parts work. only split("/") doesn't work. feature_cached_URL = "/external/products/product-related-entity-assets/246797/IMG_40x40/liebherr-button-bluperformance.jpg", and all I want is to slice do