JQuery 和诺基亚:)

发布于 2024-08-27 06:38:56 字数 695 浏览 9 评论 0原文

您好,我正在尝试移动我的网站,但遇到了 Jquery 问题。当我尝试执行 jquery 调用 (.$ajax) 时,它没有被渲染。 代码部分

 var returnData = '';
                $.ajax({url: './indexSubmit.php',
                    async: false,
                    dataType: 'json',
                    data:{flag:'vehicleInfo',
                        vehicleId:xVehicleId},
                        success: function(data,textStatus){
                        if(textStatus != 'success'){
                            alert('Error: '+ textStatus);
                            return;
                        }
                        returnData = data;

这是我不确定的 ,但我想我需要在浏览器中安装jquery。如果是,我可以使用一些javascript在浏览器中自动下载并安装jquery吗?

Hi I was trying to mobilise my website and I ran into an issue with Jquery. When I was trying to perform a jquery call (.$ajax) it was not getting rendered. This is the part of the code

 var returnData = '';
                $.ajax({url: './indexSubmit.php',
                    async: false,
                    dataType: 'json',
                    data:{flag:'vehicleInfo',
                        vehicleId:xVehicleId},
                        success: function(data,textStatus){
                        if(textStatus != 'success'){
                            alert('Error: '+ textStatus);
                            return;
                        }
                        returnData = data;

I am not sure, but I guess I need to install jquery in the browser. If yes, can I automatically download and install jquery in the browser using some javascript?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

倒数 2024-09-03 06:38:56

您的对象格式错误,缺少右大括号、括号和分号:

         var returnData = '';
            $.ajax({url: './indexSubmit.php',
                async: false,
                dataType: 'json',
                data:{
                    flag:'vehicleInfo',
                    vehicleId:xVehicleId
                },
                success: function(data,textStatus){
                    if(textStatus != 'success'){
                        alert('Error: '+ textStatus);
                        return;
                    }
                    returnData = data;
                }); // <- this was missing

Your object is malformed, you are missing a closing brace, paren and semi-colon:

         var returnData = '';
            $.ajax({url: './indexSubmit.php',
                async: false,
                dataType: 'json',
                data:{
                    flag:'vehicleInfo',
                    vehicleId:xVehicleId
                },
                success: function(data,textStatus){
                    if(textStatus != 'success'){
                        alert('Error: '+ textStatus);
                        return;
                    }
                    returnData = data;
                }); // <- this was missing
蓝颜夕 2024-09-03 06:38:56

如果我没猜错的话,您需要的是包含 jquery 库,以便您可以在页面上使用它。然后你需要一个

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>

在里面... 阻止您的 html 页面。当然,在 src 属性内,您可以指定 jquery.js 文件所在的您自己的网络服务器内的路径。

If I get it right, what you need is to include the jquery library so you can use it on your page. Then you need a <script> tag on your html page. The most straightforward way:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>

Inside the <head> ... </head> block on your html page. Of course, inside the src attribute you can specify a path inside your own webserver where the jquery.js file is.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文