Display PHP data in Jquery AJAX

前端 未结 3 1008
萌比男神i
萌比男神i 2021-01-23 16:37

I have a php page where I display few images with radio buttons. On start two images are pre selected and I merge those and show the combinations. But user can choose a differen

3条回答
  •  萌比男神i
    2021-01-23 17:24

    You'll want to send with the ajax call the "dataType: 'image'," so the ajax call knows what to do with the returning data -- other options that I've used are dataType:'json' or 'text' or 'html', etc. http://docs.jquery.com/Specifying_the_Data_Type_for_AJAX_Requests

    actually it won't take anything but a string, so send back the image src to display. (I was thinking you wanted to return the actual image itself).

提交回复
热议问题