Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jquery加载URL语法错误,无法识别的表达式_Jquery_Syntax_Load - Fatal编程技术网

jquery加载URL语法错误,无法识别的表达式

jquery加载URL语法错误,无法识别的表达式,jquery,syntax,load,Jquery,Syntax,Load,无法找出此代码的错误,这是URL的代码,但它引发了sytax错误:无法识别的表达式 $(document).ready(function(){ $("a.qshop-btn").on('click', function () { var $target = $(this).data('target'); var q = $(this).data('name'); var url = $('http://localhost/html/quickShop.php?q='+encodeURIC

无法找出此代码的错误,这是URL的代码,但它引发了sytax错误:无法识别的表达式

$(document).ready(function(){

$("a.qshop-btn").on('click', function () {

var $target = $(this).data('target');

var q = $(this).data('name');

var url = $('http://localhost/html/quickShop.php?q='+encodeURIComponent(q));

$("#qs-content").load(url, function (response,status,data) {

    $(".preloader").css('display','none');

    $($target).modal({ show:true });

        });
    });
});

您试图将url变成一个JQuery对象,而它是一个简单的字符串。只需这样写:
var-url=http://localhost/html/quickShop.php?q=“+组分(q)

您试图将url设置为JQuery对象,而它是一个简单的字符串。只需这样写:
var-url=http://localhost/html/quickShop.php?q=“+组分(q)