Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/443.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
Javascript 由ajax请求返回的dom元素_Javascript_Jquery_Html_Ajax_Lightbox - Fatal编程技术网

Javascript 由ajax请求返回的dom元素

Javascript 由ajax请求返回的dom元素,javascript,jquery,html,ajax,lightbox,Javascript,Jquery,Html,Ajax,Lightbox,我想使用lightbox插件(本例中为lightbox\u me)来lightbox一个由ajax请求返回的html-DOM元素 这是我的密码: <script src="script/jquery.lightbox_me.js"></script> <script> $("#about").click(function(e){ e.preventDefault(); $.ajax({ url : &qu

我想使用lightbox插件(本例中为lightbox\u me)来lightbox一个由ajax请求返回的html-DOM元素

这是我的密码:

<script src="script/jquery.lightbox_me.js"></script>

<script>

 $("#about").click(function(e){
  e.preventDefault();
 $.ajax({
  url : "about.html",
  success : function(html){
  (html).lightbox_me();
 });
});

</script>

$(“#关于”)。单击(函数(e){
e、 预防默认值();
$.ajax({
url:“about.html”,
成功:函数(html){
lightbox_me();
});
});
但是灯箱没有显示。我有一条控制台消息,上面说:

没有“lightbox\u me”方法

这条线应该是多少

 (html).lightbox_me();
大约:

 $(html).lightbox_me();
这条线应该是多少

 (html).lightbox_me();
大约:

 $(html).lightbox_me();

你错过了一个$sign

<script src="script/jquery.lightbox_me.js"></script>

<script>

 $("#about").click(function(e){
  e.preventDefault();
 $.ajax({
  url : "about.html",
  success : function(html){
  //A dollar sign must be before the (html)
  $(html).lightbox_me();
 });
});

</script>

$(“#关于”)。单击(函数(e){
e、 预防默认值();
$.ajax({
url:“about.html”,
成功:函数(html){
//美元符号必须在(html)前面
$(html).lightbox_me();
});
});

您的密码漏掉了一个$符号

<script src="script/jquery.lightbox_me.js"></script>

<script>

 $("#about").click(function(e){
  e.preventDefault();
 $.ajax({
  url : "about.html",
  success : function(html){
  //A dollar sign must be before the (html)
  $(html).lightbox_me();
 });
});

</script>

$(“#关于”)。单击(函数(e){
e、 预防默认值();
$.ajax({
url:“about.html”,
成功:函数(html){
//美元符号必须在(html)前面
$(html).lightbox_me();
});
});