Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#4404 closed bug (invalid)

using $.ajax with dataType = json causes no action in opera

Reported by: madmike Owned by:
Priority: major Milestone: 1.4
Component: ajax Version: 1.3.2
Keywords: ajax json opera Cc:
Blocked by: Blocking:


Good day! i use $.ajax method to make a custom request to the php script. I need to interpret returned data as json, so i add dataType: 'json' to the options object when accessing this method. For example such function:

var request = $(this.form).serialize();

var method = $(this.form).attr('method') var action = $(this.form).attr('action')

$.ajax({type: method, url: action, data: request, dataType: 'json', success: function() {alert('success');}});

Php script on the requested page returns valid json string and all browsers except Opera understand it right and show alert message 'success', opera has no action in this case, but if i remove property dataType, opera works as good as others.

Change History (2)

comment:1 Changed 10 years ago by madmike

I've found out where is the error. I use input types in my form from web forms 2.0. draft recommendation. Opera currently supports such ones like 'email', 'date' and so on. So thus i had the problem with jquery serialize method, because in it's regexp currently there aren't any such types. However in other browsers i use special script from here http://code.google.com/p/webforms2/ to implement the functionality, and using serialize method works nice with such data types, maybe the script dynamically changes them to text.

So then i guess it can be an offer to add search for these new input types to the filter, or make it in different way without such strict rules about type, maybe test if just it is not checkbox, radio and file.

Sorry for wrong bug request. Regards, Mike.

comment:2 Changed 10 years ago by dmethvin

Resolution: invalid
Status: newclosed

I'll close this ticket, but feel free to add an enhancement ticket for the web 2.0 elements.

Note: See TracTickets for help on using tickets.