Categories
WordPress

How to fix invalid JSON response error in WordPress

Updating failed. The response is not a valid JSON response.

This error appears when edit and update your posts or pages on your WordPress website. You will see message saying “The response is not a valid JSON response” and updating that page would fail. In this article, I will show you how to fix the invalid JSON error in WordPress.

WordPress needs to communicate with the server while you are editing a post or page form WordPress admin and it getting responses from the web hosting server in the background. This response is in JSON format which is used to quickly transport data using JavaScript.

I getting this error when I move my wordpress website to another server.

Solution:

First please confirm your home and siteurl is ok on database wp_options table.

Please go to Settings => Permalinks page. From here, you need to review the WordPress permalink options. Please select “Post name” option form Permalink Settings and click on the Save Changes button to store your settings.

Permalink Settings

Also please confirm those code are available on the .htaccess file.

Now site is ready to edit post or page from WordPress admin.

Thank you for carefully read my article If you have any query please Leave your query on following comment section or contact with us. Hope it will help you.

Categories
React Native

React Native: Download or Save View Content as Image in gallery

In this article, I will show you how we can download or save loop view content as image in React Native. For download or save view inner content, you want to ensure that you have react-native-view-shot and @react-native-community/cameraroll its dependencies.

Install npm package for view-shot and cameraroll

Make sure view-shot and cameraroll linked with Xcode

Configure Download View Inner Content

Now we write a const variable viewRefs to set each view ref for each loop view item. Also I have used userDataList loop data object.
Now we write a const method const downloadImage = async (index) => {} to download and save loop view, each item.
Now we write a const method const getPermissionAndroid = async () => {} for Permissions storage, to save and download image. On my previous article I have explain how to Share View Content in loop each item.
Permission is required to read and write to the external storage. Open android/app/src/main/AndroidManifest.xml file and add those permissions to save or download image.
React Native Download and Save View Content full Example code:

Here is full code for Download and Save view content loop items using React Native. You can move the code on your own created screen.

Done, now run your app using following command:

Thank you for carefully read my article If you have any query please Leave your query on following comment section or contact with us. Hope it will help you.

Categories
React Native

React Native: Share view content in loop or Share list each item

In this article, I will show you how we can share view content with other apps in React Native. To use this share view inner content, you want to ensure that you have react-native-view-shot and react-native-share its dependencies.

Share view content in loop

Installation Sharing View Inner Content

Now we write a const variable viewRefs to set each view ref for each loop view item. Also I have used userDataList loop data object.

Now we write a const method const shareImage = async (index) => {} to share loop view, eache item.

React Native Sharing View Content full Example code:

Here is full code for sharing view content with other apps using React Native. You can move the code on your own created screen.

Done, now run your app using following command:

Thank you for carefully read my article If you have any query please Leave your query on following comment section or contact with us. Hope it will help you.

Categories
React Native

React Native: Form Validation Multiple Input Fields

In this article, I will show you how we can validate multiple input fields. On my previous article I have discus how to implement Multiple Input Fields with add more rows with React Native. In this article I will make first row inputs are require of multiple rows.

Validate Multiple Input Fields

If you don’t know how to validate React Native multiple input fields before submit form data. I hope this article can help you to validate multiple input fields.

Validate Multiple Input Fields

Now we write a function function validateFormMultipleFields() to validate multiple input fields.

Now we write another form submit handle method const handlePressSubmitButton = () => {} to validate multiple input fields when a user submit form data to API end point.

Validate Multiple Input full Example code:

Here is full code for validate multiple input fields with React Native. You can move the code on your own created screen.

Done, now run your app using following command:

Categories
React Native

React Native: Dynamic multiple input fields and add more field

In this article, I will show you how we can implement multiple input fields dynamically with add more rows on click on Add More button with React Native.

Dynamic Multiple Input Multiple Row

If you don’t know how to create this React Native dynamic multiple input fields, then hope this article can help you. In this example initially screen came with two row with 6 input fileds such as (UserId, StartAmount and EndAmount). We can added multiple row by click on add more rows. I have write another article to validate multiple inputs.

Here we defined first two rows with 6 input fileds with (userId, startAmount and endAmount) and each fields error key.

Here we added method for Add More form inputs lines.

Dynamic Multiple Input full Example code:

Here is full code with dynamic multiple input field example. You can move the code on your own created screen.

Done, now run your app using following command:

Thank you for carefully read my article If you have any query please Leave your query on following comment section or contact with us. Hope it will help you.