简体   繁体   中英

Why doesn't the $.post appear to be working on an iPad/iPhone on my site?

This is one of the pages.

When you click on the error icon at the bottom of the table more appear in the table. Then when you click on an icon in the table a qtip popup appears and grabs a code through the jquery function $.post. I've tested it in IE, Chrome, Opera and Firefox and it works fine. In safari on the ipod/ipad it doesn't though and then developer console on the device isn't really very helpful. The one thing that appears in it (twice) is:


JavaScript: Error
undefined
TypeError: 'undefined' is not a function

Anyone know what might be triggering this and if this relates to why the ajax isn't working? The script that's included relating to all this is here .

Thanks.


Edit: This is a part of the code that I've now changed to fix it. It's gone from

$.post("ajax_requests.php?action=get_error_code", {data:$(this.targetThis).attr('data-errorData')}, function(data) {

    $(this.qtipThis).find('.code').html(data);

    $(this.qtipThis).find('.email .link').attr('onclick', '');
    $(this.qtipThis).find('.email .link').attr('href', 'mailto:'+errorReportEmail+'?subject=Website Table Error (Error id: '+data+')');

}.bind(this));

to this (thanks to @raina77ow 's answer)

var self = this;
    $.post("ajax_requests.php?action=get_error_code", {data:$(this.targetThis).attr('data-errorData')}, function(data) {

    $(self.qtipThis).find('.code').html(data);

    $(self.qtipThis).find('.email .link').attr('onclick', '');
    $(self.qtipThis).find('.email .link').attr('href', 'mailto:'+errorReportEmail+'?subject=Website Table Error (Error id: '+data+')');
});

If the problem is related to the $.post , may be it's because of some variation of this issue ? It's not about batman , it's about Function.bind() method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM