cur*_*ets 8 xml ajax jquery jcarousel
我正在一个网站上工作,我们从XML文件中获取信息.它工作得很好,但现在我需要制作一个内容的滑块.为此,我将使用声称可以通过调用回调函数来动态加载内容的jCarousel.
但是,当我成功调用函数时,我无法进行初始的ajax加载.我究竟做错了什么?
$(document).ready(function() {
$.ajax({
type: "GET",
//Url to the XML-file
url: "data_flash_0303.xml",
dataType: "xml",
success: hulabula()
});
function hulabula(xml) {
$(xml).find('top').each(function() {
var headline = $(this).find('headline1').text();
var headlineTag = $(this).find('headline2').text();
$(".wunMobile h2 strong").text(headline + " ");
$(".wunMobile h2 span").text(headlineTag);
});
..............
Run Code Online (Sandbox Code Playgroud)
我做错了什么??? 或者这是一个我必须看的完全不同的地方?:-)
ist*_*men 15
使用hulabula代替hulabula()或将函数直接传递给ajax选项:
1.
$.ajax({
type: "GET",
//Url to the XML-file
url: "data_flash_0303.xml",
dataType: "xml",
success: hulabula
});
Run Code Online (Sandbox Code Playgroud)
2.
$.ajax({
type: "GET",
//Url to the XML-file
url: "data_flash_0303.xml",
dataType: "xml",
success: function(xml) { /* ... */ }
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
48118 次 |
| 最近记录: |