需要JQuery复古工程协助

时间:2012-10-03 13:43:36

标签: javascript jquery html ajax blackberry

我有以下代码

function dbFaultgo() {

        var f = element('faultForm');
        var headcode = f.elements['headcode'].value;
        var location = f.elements['location'].value;
        var detail = f.elements['detail'].value;
        var image = f.elements['image'].value;
        var fullname = f.elements['fullname'].value;
        var mobilenumber = f.elements['mobilenumber'].value;
        $('#loadingmessage').show();  // show the loading message.
        $.ajax({
            type: 'POST',
            url: 'http://(url removed)/save.php',
            data: { 
                headcode:headcode,
                location:location,
                injuryreport:detail,
                image:image,
                fullname:fullname,
                mobilenumber:mobilenumber
            },
            //change the url for your project
            success: function(data){
                $('#loadingmessage').hide();  // hide the loading message.
                alert('Your comment was successfully added');
                changePage ('page_05.html?v=1')

            },
            error: function(){
                $('#loadingmessage').hide();  // hide the loading message.
                alert('There was an error adding your comment');
            }
        });

        return false;

};

这几乎适用于所有智能手机......除了我需要它在Blackberry Bold运行的OS5上工作,它不允许Ajax,因为它不兼容。

是否有较旧的Javascript格式与上述功能的OS5 blackberryies(想想HTML4,IE8)兼容,还是需要使用某种第三方javascript插件?

1 个答案:

答案 0 :(得分:0)

不是使用Ajax,而是使用传统的HTML表单和POST,将用户带到“您的评论被添加”页面?根据您的应用程序,它会导致用户体验的轻微下降。