Skip to content

Instantly share code, notes, and snippets.

fetch("https://api.apispreadsheets.com/data/568/").then(res=>{
if (res.status === 200){
// SUCCESS
res.json().then(data => {
const yourData = data.data
this.setState(
{
filmInfo: yourData,
fetching: false
}
import React, { Component } from 'react';
class FilmCard extends Component {
constructor(props) {
super(props);
}
render() {
return (
<div>
render() {
let body;
if(this.state.filmInfo.length===0 && !this.state.fetching && !this.state.error){
body = <h1> ... </h1>
} else {
if(this.state.fetching){
body = <h1> ... </h1>
}
else{
if(this.state.error){
import React, { Component } from 'react';
import './App.css';
import FilmCard from './FilmCard';
class App extends Component {
constructor(props) {
super(props);
this.state = {
filmInfo: [],
<!DOCTYPE html>
<html>
<head>
<title>Save Web Form Data to Spreadsheets - Contact Form</title>
<script
src="https://code.jquery.com/jquery-3.4.1.js"
integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU="
crossorigin="anonymous"></script>
<script>
function SubForm (){
<!DOCTYPE html>
<html>
<head>
<title>Save Web Form Data to Spreadsheets - Contact Form</title>
<script
src="https://code.jquery.com/jquery-3.4.1.js"
integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU="
crossorigin="anonymous"></script>
<script>
function SubForm (){
<script>
function SubForm (){
$.ajax({
url:'https://api.apispreadsheets.com/data/410/',
type:'post',
data:$("#myForm").serializeArray(),
success: function(){
alert("Form Data Submitted :)")
},
error: function(){
<!DOCTYPE html>
<html>
<head>
<title>Save Web Form Data to Spreadsheets - Contact Form</title>
<script
src="https://code.jquery.com/jquery-3.4.1.js"
integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU="
crossorigin="anonymous"></script>
<script>
function SubForm (){
<!DOCTYPE html>
<html>
<head>
<title>Save Web Form Data to Spreadsheets - Contact Form</title>
<script
src="https://code.jquery.com/jquery-3.4.1.js"
integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU="
crossorigin="anonymous"></script>
<script>
function SubForm (){
<script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous">
</script>