Syntax 在函数上传递路径(未捕获错误:语法错误,无法识别的表达式)

Syntax 在函数上传递路径(未捕获错误:语法错误,无法识别的表达式),syntax,parameters,path,expression,Syntax,Parameters,Path,Expression,今天我遇到了一个未捕获的错误:语法错误,无法识别的表达式:。 我会传递一个路径到一个预加载图像的函数,但当我要调用它时,我会得到错误: preLoader('img/realizzazione-impianti-fotovoltaici-header.png'); 这就是功能: var preLoader = function (arrayOfImages){ $(arrayOfImages).each(function(){ //$('<img/>')[0

今天我遇到了一个未捕获的错误:语法错误,无法识别的表达式:。 我会传递一个路径到一个预加载图像的函数,但当我要调用它时,我会得到错误:

preLoader('img/realizzazione-impianti-fotovoltaici-header.png');
这就是功能:

var preLoader = function (arrayOfImages){
    $(arrayOfImages).each(function(){
        //$('<img/>')[0].src = this;
        var cacheImage = document.createElement('img');
        cacheImage.src = this;
        cacheImg.push(cacheImage);
        });//each

    }//preLoader