I Want To Add Redirect Code In My Google Apps Script

This is my code
`

var sheetName = 'Sheet1'
var scriptProp = PropertiesService.getScriptProperties()

function intialSetup () {
  var activeSpreadsheet = SpreadsheetApp.getActiveSpreadsheet()
  scriptProp.setProperty('key', activeSpreadsheet.getId())
}

function doPost (e) {
  var lock = LockService.getScriptLock()
  lock.tryLock(10000)

  try {
    var doc = SpreadsheetApp.openById(scriptProp.getProperty('key'))
    var sheet = doc.getSheetByName(sheetName)

    var headers = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues()[0]
    var nextRow = sheet.getLastRow() + 1

    var newRow = headers.map(function(header) {
      return header === 'timestamp' ? new Date() : e.parameter[header]
    })

    sheet.getRange(nextRow, 1, 1, newRow.length).setValues([newRow])

    return ContentService
      .createTextOutput(JSON.stringify({ 'result': 'success', 'row': nextRow }))
      .setMimeType(ContentService.MimeType.JSON)
  }

  catch (e) {
    return ContentService
      .createTextOutput(JSON.stringify({ 'result': 'error', 'error': e }))
      .setMimeType(ContentService.MimeType.JSON)
  }

  finally {
    lock.releaseLock()
  }
}

`

After Success Response i want to redirect to another page or url how can i do this?

after success response i want to redirect to another page or url

Why do I get NaN value in react?

Whilst I am doing cart in react, I have no idea why I keep getting NaN value – only from a specific object data.

When I have the following data list:

export const ItemsList = [
  {
    id: 1,
    name: "VA-11 Hall-A: Cyberpunk Bartender Action",
    price: 110000,
    image: cover1,
    link: "https://store.steampowered.com/app/447530/VA11_HallA_Cyberpunk_Bartender_Action/?l=koreana",
  },
...
  {
    id: 6,
    name: "Limbus Company",
    price: 110000,
    image: cover6,
    link: "https://limbuscompany.com/",
  },
];

And the following code, please look at the comment line.

import React, { useContext } from "react";
import "./Goods.css";
import { DataContext } from "../../components/context/DataContext";

export const Goods = (props) => {
  const { id, name, price, image, link } = props.shopItemProps;
  const { cartItems, addItemToCart, removeItemFromCart } =
    useContext(DataContext);
  const cartItemStored = cartItems[id];

  return (
    <div className="goods">
      <div className="goods-id">{id}</div>
      <img src={image} alt="thumbnail_image" className="goods-image" />
      <div className="goods-name">{name}</div>
      <div className="goods-price">${price}</div>
      <button>
        <a href={link} className="goods-link">
          Official Store Page
        </a>
      </button>
      <div className="cart-button">
        <button onClick={() => removeItemFromCart(id)}>-</button>
// ★Maybe here? but why do I get NaN only for id:6? Others work well.
        {cartItemStored > -1 && <> ({cartItemStored}) </>}
        <button onClick={() => addItemToCart(id)}>+</button>
      </div>
    </div>
  );
};

What should I do to solve NaN? There seems to be no way to make that value as int in this case. Or do you see any problem from the above code block?

Thanks.

Exporting Object.defineProperty

I have this piece of code:

if (!String.prototype.startsWith) {
    Object.defineProperty(String.prototype, 'startsWith', {
        enumerable: false,
        configurable: false,
        writable: false,
        value: function(searchString, position) {
            position = position || 0;
            return this.lastIndexOf(searchString, position) === position;
        }
    });
}

How can I export startsWith from A.js to B.js usingA.startsWith()?

I tried to use exports Object.defineProperty(String.prototype, 'startsWith', { but I’m getting errors

In file B.js, I’m using import * as A from './A.js', but I’m unable to use A.startsWith().

How can I solve it?

Thank you.

Screen share to the connected peer with webRTC

I am exploring webRTC and trying to build a zoom alike web application. I have successfully sharing screen and showing it my device but I could show the shared screen to the peer networks. I want to share my screen with everyone who are connected to the same room. I don’t know how to do that. Can anyone help me with the issue?

Below is the JavaScript code:

Script.js

const socket = io('/')
const videoGrid = document.getElementById('video-grid')

const myPeer = new Peer(undefined, {
    host: '/',
    port: '8000'
})
const myVideo = document.createElement('video')
myVideo.muted = true
const peers = {}

let videoStream
navigator.mediaDevices.getUserMedia({
    video: true,
    audio: true
}).then(stream => {
    videoStream = stream
    addVideoStream(myVideo, stream)

    myPeer.on('call', call => {
        call.answer(stream)
        const video = document.createElement('video')
        call.on('stream', userVideoStream => {
            addVideoStream(video, userVideoStream)
        })
    })

    socket.on('user-connected', userId => {
        connectToNewUser(userId, stream)
    })

    socket.on('user-disconnected', userId => {
        if (peers[userId]) peers[userId].close()
    })

})

myPeer.on('open', id => {
    socket.emit('join-room', ROOM_ID, id)
})

function connectToNewUser(userId, stream) {
    const call = myPeer.call(userId, stream)
    const video = document.createElement('video')
    call.on('stream', userVideoStream => {
        addVideoStream(video, userVideoStream)
    })
    call.on('close', () => {
        video.remove()
    })

    peers[userId] = call
}

function addVideoStream(video, stream) {
    video.srcObject = stream
    video.addEventListener('loadedmetadata', () => {
        video.play()
    })
    videoGrid.append(video)
}

//====================================== Front-end styling logics =================================

const audio = document.getElementById('audio')
const audio_mute = document.getElementById('audio-mute')
const video = document.getElementById('video')
const video_mute = document.getElementById('video-mute')
const screen_share = document.getElementById('screen-share')
const record = document.getElementById('record')
const record_stop = document.getElementById('record-stop')
const leave_btn = document.getElementById('leave-btn')
const message_view_box = document.getElementById('message-view-box')

audio.addEventListener('click', function () {
    const track = videoStream.getAudioTracks()[0].enabled
    console.log(videoStream.getAudioTracks());
    if (track) {
        videoStream.getAudioTracks()[0].enabled = false
    }
    else {
        videoStream.getAudioTracks()[0].enabled = true
    }
    audio.style.display = 'none';
    audio_mute.style.display = 'inline-block';
})
audio_mute.addEventListener('click', function () {
    const track = videoStream.getAudioTracks()[0].enabled
    console.log(videoStream.getAudioTracks());
    if (track) {
        videoStream.getAudioTracks()[0].enabled = false
    }
    else {
        videoStream.getAudioTracks()[0].enabled = true
    }
    audio_mute.style.display = 'none';
    audio.style.display = 'inline-block';
})
video.addEventListener('click', function () {
    const track = videoStream.getVideoTracks()[0].enabled
    console.log(videoStream.getVideoTracks()[0].enabled);
    if (track) {
        videoStream.getVideoTracks()[0].enabled = false
    }
    else {
        videoStream.getVideoTracks()[0].enabled = true
    }
    video.style.display = 'none';
    video_mute.style.display = 'inline-block';
})
video_mute.addEventListener('click', function () {
    const track = videoStream.getVideoTracks()[0].enabled
    console.log(videoStream.getVideoTracks()[0].enabled);
    if (track) {
        videoStream.getVideoTracks()[0].enabled = false
    }
    else {
        videoStream.getVideoTracks()[0].enabled = true
    }
    video_mute.style.display = 'none';
    video.style.display = 'inline-block';
})



// ============================= Chat box logics ===============================

let chat_box = document.getElementById('chat_box');
let chat_box_input = document.getElementById('chat_box_input');
let send_icon = document.getElementById('send-icon');

chat_box.addEventListener('submit', function (e) {
    e.preventDefault()
    // console.log(e.target.chat_box_input.value);
    if (chat_box_input.value) {
        socket.emit('chat message', chat_box_input.value);
        chat_box_input.value = '';
    }
    // e.target.chat_box_input.value = ''
})
socket.on('chat message', function (msg) {
    const item = document.createElement('li');
    item.textContent = msg;
    message_view_box.appendChild(item);
    message_view_box.scrollTop = message_view_box.scrollHeight - message_view_box.clientHeight;
});

// =============================================================================

//================================== Screen share logics =======================
const videoElem = document.getElementById('screen')
screen_share.addEventListener('click',async function () {
    startCapture();
})

// Options for getDisplayMedia()
const displayMediaOptions = {
    video: {
      cursor: "always"
    },
    audio: true
  };

  async function startCapture() {  
    try {
      videoElem.srcObject = await navigator.mediaDevices.getDisplayMedia(displayMediaOptions);
    //   const videoStreamTrack = await navigator.mediaDevices.getDisplayMedia(displayMediaOptions);
    //   call.peerConnection.getSenders()[1].replaceTrack(videoStreamTrack)
      dumpOptionsInfo();
    } catch (err) {
      console.error(`Error: ${err}`);
    }
  }

  function dumpOptionsInfo() {
    const videoTrack = videoElem.srcObject.getVideoTracks()[0];
  }
  
  
//==============================================================================
//==============================================================================
record.addEventListener('click', async function () {
    record.style.display = 'none';
    record_stop.style.display = 'inline-block';
    let stream = await navigator.mediaDevices.getDisplayMedia({
        video: true,
        audio: true
      })
    
      //needed for better browser support
      const mime = MediaRecorder.isTypeSupported("video/webm; codecs=vp9") 
                 ? "video/webm; codecs=vp9" 
                 : "video/webm"
        let mediaRecorder = new MediaRecorder(stream, {
            mimeType: mime
        })
        let chunks = []
        mediaRecorder.addEventListener('dataavailable', function(e) {
            chunks.push(e.data)
        })
        mediaRecorder.addEventListener('stop', function(){
            let blob = new Blob(chunks, {
                type: chunks[0].type
            })
            let url = URL.createObjectURL(blob)
      
            // let video = document.querySelector("video")
            // video.src = url
      
            let a = document.createElement('a')
            a.href = url
            a.download = 'video.webm'
            a.click()
        })
    
        //we have to start the recorder manually
        mediaRecorder.start()
})




record_stop.addEventListener('click', function () {
    record_stop.style.display = 'none';
    record.style.display = 'inline-block';
    mediaRecorder.stop();
})
//==============================================================================


screen sharing functionality below

//================================== Screen share logics =======================
const videoElem = document.getElementById('screen')
screen_share.addEventListener('click',async function () {
    startCapture();
})

// Options for getDisplayMedia()
const displayMediaOptions = {
    video: {
      cursor: "always"
    },
    audio: true
  };

  async function startCapture() {  
    try {
      videoElem.srcObject = await navigator.mediaDevices.getDisplayMedia(displayMediaOptions);
    //   const videoStreamTrack = await navigator.mediaDevices.getDisplayMedia(displayMediaOptions);
    //   call.peerConnection.getSenders()[1].replaceTrack(videoStreamTrack)
      dumpOptionsInfo();
    } catch (err) {
      console.error(`Error: ${err}`);
    }
  }

  function dumpOptionsInfo() {
    const videoTrack = videoElem.srcObject.getVideoTracks()[0];
  }
  
  
//==============================================================================

Button not triggering .ics file download

I believe the ‘saveAs’ function is being called correctly.

The consoles not reporting any errors. Im at a loss.

here is a link to the site SDC

The Repository Repo

I expected the .ics file to generate. I don’t blatantly see anything wrong with the code unless I’m missing something.

Data is showing in console but not displaying in page Reactjs

I am working on Reactjs and using nextjs framework,Right now i am tyring to get
data using axios but data is not showing,But in console.log its showing in getStaticProps section(in blogs),Where i am wrong ?

const Post = ({ post, blogs }) => {
 const blogs2 = Array.isArray(blogs) ? blogs : [];
  {blogs2.map((blog) => {
   return <>
                {blog.slug}`}
  </>
  })}
};
export default Post;

export const getStaticProps = async ({ params }) => {
    const { data: data } = await Axios.get(`xxxxxxxxxxxxxxxxxxxxxxxxxxxx/${params.slug}`);
    const post = data;
    const { data: data2 } = await Axios.get(`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/${params.slug}`);
    const blogs = data2;
    console.log('data is' +blogs);   //showing data 
    return {
        props: {
            post: post, blogs: blogs
        },
    };
};

export const getStaticPaths = async () => {
    const { data } = await Axios.get("xxxxxxxxxxxxxxxxxxxxxxxxxxx/blogs");
    const posts = data.slice(0, 10);
   const paths = posts.map((post) => ({ params: { slug: post.slug.toString() } }));

    return {
        paths,
        fallback: true,
    };
};

When to use Mounted,Created and beforeMounted component lifecycle Vue js

So i have a component to render while using v-for loop to loop question from an array to be answer, at first the component successfully render with no issue, but i notice one things, its only render the title but never updated the component lifecycle when i clicked next button to render the next array, here is my code:

<template>
    <v-form v-if="dataShow.length > 0" ref="form">
        <v-row v-if="answerError">
            <v-col md="8" offset-md="2" sm="10" offset-sm="1" class="pb-0">
                <v-alert
                    dark
                    class="mb-0"
                    dismissible
                    color="red"
                    elevation="2"
                    icon="mdi-alert-circle"
                >
                    {{ $t('ANSWER_ERROR') }}
                </v-alert>
            </v-col>
        </v-row>

        <v-row v-for="(question, index) in dataShow" :key="index">
            <v-col md="8" offset-md="2" sm="10" offset-sm="1">
                <v-card>
                    <v-card-text class="pb-0 mb-0 mt-0">
                        <v-row>
                            <v-col cols="12" sm="8" class="pb-0 mb-0 mt-0">
                                <label class="label-question pt-0 pb-0 mb-0">{{
                                    question.question
                                }}</label>
                            </v-col>

                            <v-col cols="5" class="pb-0 mb-0 pt-0 mt-0">
                                <p class="label-description pt-0 mb-0">
                                    {{ question.description }}
                                </p>
                            </v-col>
                        </v-row>

                        <v-row>
                            <v-col cols="12">
                                {{ question.required ? '*' : '' }}
                                {{ question.numeric ? '#' : '' }}
                                <AnswerTypeText
                                    class="mb-4 pt-0 mt-0 pb-0"
                                    v-if="question.type == 'Text'"
                                    :question="question"
                                />
                                <AnswerTypeEmail
                                    class="mb-4 pt-0 mt-0 pb-0"
                                    v-if="question.type == 'Email'"
                                    :question="question"
                                />
                                <AnswerTypeDropdown
                                    class="mb-4 pt-0 mt-0 pb-0"
                                    v-if="question.type == 'Dropdown'"
                                    :question="question"
                                />
                                <AnswerTypeCheckbox
                                    class="mb-4 pt-0 mt-0 pb-0"
                                    v-if="question.type == 'Checkbox'"
                                    :question="question"
                                />
                                <AnswerTypeRadio
                                    class="mb-4 pt-0 mt-0 pb-0"
                                    v-if="question.type == 'Radio'"
                                    :question="question"
                                />
                                <AnswerTypeDatepicker
                                    class="mb-4 pt-0 mt-0 pb-0"
                                    v-if="question.type == 'Date'"
                                    :question="question"
                                />
                                <AnswerTypeTimepicker
                                    class="mb-4 pt-0 mt-0 pb-0"
                                    v-if="question.type == 'Time'"
                                    :question="question"
                                />
                                <AnswerTypeTabletype
                                    class="mb-4 pt-0 mt-0 pb-0"
                                    v-if="question.type == 'Multiple'"
                                    :question="question"
                                />
                            </v-col>
                        </v-row>
                    </v-card-text>
                </v-card>
            </v-col>
        </v-row>

        <v-row>
            <!-- <v-col cols="12" md="12" sm="12" class="d-flex"> -->
            <!-- <v-col cols="6" md="6" sm="6">
                <v-btn
                    :disabled="isDisabledB"
                    ref="back"
                    medium
                    elevation=""
                    color="primary"
                    @click="onBack"
                    >Back</v-btn
                >
            </v-col> -->
            <v-col
                md="8"
                offset-md="2"
                sm="10"
                offset-sm="1"
                class="d-flex mb-3"
                v-if="!hideNext"
            >
                <v-btn
                    :disabled="isDisabledN"
                    ref="next"
                    medium
                    elevation=""
                    color="secondary"
                    @click="onNext"
                    >Next</v-btn
                >
            </v-col>
            <v-col
                v-if="showSubmit"
                md="8"
                offset-md="2"
                sm="10"
                offset-sm="1"
                class="d-flex mb-3"
            >
                <v-btn dark color="primary" @click="onSubmit">Submit</v-btn>
            </v-col>
            <!-- </v-col> -->
        </v-row>
    </v-form>
</template>

<script>
import { mapState } from 'vuex'
export default {
    middleware: ['authenticated'],
    props: ['formId'],
    data() {
        return {
            isDisabledN: false,
            isDisabledB: false,
            showCounted: 10,
            currentPage: 1,
            options: [],
            hideNext: false,
            showSubmit: false,
            answerError: false,
            dataShow: '',
        }
    },
    methods: {
        defaultData() {
            this.dataShow = this.questions.slice(0, this.showCounted)
        },
        checkPage() {
            if (this.showCounted * this.currentPage >= this.questions.length) {
                this.hideNext = true
                this.showSubmit = true
                this.isDisabledN = true
                this.isDisabledB = false
                document.body.scrollTop = 0 // For Safari
                document.documentElement.scrollTop = 0 // For Chrome, Firefox, IE and Opera
            } else if (this.currentPage <= 1) {
                this.isDisabledN = false
                this.showSubmit = false
                this.isDisabledB = true
                document.body.scrollTop = 0 // For Safari
                document.documentElement.scrollTop = 0 // For Chrome, Firefox, IE and Opera
            } else {
                this.showSubmit = false
                this.isDisabledN = false
                this.isDisabledB = false
                document.body.scrollTop = 0 // For Safari
                document.documentElement.scrollTop = 0 // For Chrome, Firefox, IE and Opera
            }
        },
        onNext() {
            if (this.$refs.form.validate()) {
                this.dataShow = this.questions.slice(
                    this.showCounted * this.currentPage,
                    this.showCounted * this.currentPage + this.showCounted
                )
                setTimeout(() => {
                    this.$refs.form.resetValidation()
                }, 5000)
                setTimeout(() => {
                    this.$refs.form.reset()
                }, 500)

                this.currentPage++
                this.checkPage()
                console.log('data', this.dataShow)
            } else {
                this.answerError = true
                setTimeout(() => {
                    this.answerError = false
                }, 3000)
                this.checkPage()
                setTimeout(() => {
                    this.$refs.form.resetValidation()
                }, 5000)
            }
        },
        async onSubmit() {
            try {
                if (this.$refs.form.validate()) {
                    await this.$store.dispatch('answers/store', this.formId)

                    //redirect to completed
                    this.$router.push('/answers/completed')
                } else {
                    this.answerError = true
                    setTimeout(() => {
                        this.answerError = false
                    }, 3000)
                    document.body.scrollTop = 0 // For Safari
                    document.documentElement.scrollTop = 0 // For Chrome, Firefox, IE and Opera
                }
            } catch (err) {
                console.log(err)
                this.$store.commit('alerts/show', {
                    type: 'error',
                    message: err.response
                        ? this.$t(err.response.data.message)
                        : this.$t('SERVER_ERROR'),
                })
            }
        },
    },
    computed: {
        ...mapState('questions', ['questions']),
    },
    mounted() {
        setTimeout(() => {
            this.defaultData()
            this.checkPage()
        }, 500)
    },
}
</script>

and here is an example on how i use the created lifecylce to keep update the component when it renders… but it never update it… only the title of the component and not the answerrules of the component….

<template>
    <v-text-field
        name="answer"
        v-model="answer"
        :rules="answerRule"
        placeholder="[email protected]"
        @keyup="typing"
    />
</template>

<script>
export default {
    props: ['question'],
    data() {
        return {
            timer: null,
            answer: null,
            answerRule: [],
        }
    },
    methods: {
        async typing() {
            try {
                clearTimeout(this.timer)
                this.timer = setTimeout(async () => {
                    let payload = {
                        questionId: this.question.id,
                        value: this.answer,
                        questionName: this.question.question,
                    }

                    //update question
                    await this.$store.commit('answers/update', payload)
                }, 1000)
            } catch (err) {
                this.$store.commit('alerts/show', {
                    type: 'error',
                    message: err.response
                        ? this.$t(err.response.data.message)
                        : this.$t('SERVER_ERROR'),
                })
            }
        },
    },
    created() {
        if (this.question.required) {
            this.answerRule.push((v) => !!v || this.$t('QUESTION_REQUIRED'))
            this.answerRule.push(
                (v) =>
                    /^(([^<>()[]\.,;:s@"]+(.[^<>()[]\.,;:s@"]+)*)|(".+"))@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA-Z-0-9]+.)+[a-zA-Z]{2,}))$/.test(
                        v
                    ) || this.$t('EMAIL_INVALID')
            )
        }
        this.answerRule.push(
            (v) =>
                /^(([^<>()[]\.,;:s@"]+(.[^<>()[]\.,;:s@"]+)*)|(".+"))@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA-Z-0-9]+.)+[a-zA-Z]{2,}))$/.test(
                    v
                ) || this.$t('EMAIL_INVALID')
        )
    },
}
</script>

is there a way to override it? or there is and best practice on how to keep the components updated…

code: 50035, errors: { application_id: [Object] }, message: ‘Invalid Form Body’

it worked but the slash commands are now showing on discord

here’s my log

`

code: 50035,
    errors: { application_id: [Object] },
    message: 'Invalid Form Body'
    code: 50035,
    code: 50035,
    errors: { application_id: [Object] },
    message: 'Invalid Form Body'
  },
  code: 50035,
  status: 400,
  method: 'PUT',
  url: 'https://discord.com/api/v9/applications/undefined/guilds/1040994481085874186/commands'
}

`

how should i fix this?

Promise in React doesn’t set the state of a variable and the parent component can not reach it

I have the next code:

 const handleClick =  async (e) => {
        e.preventDefault();

        
        
        rezultat1 = fetchPretraga()

        .then(setRez)
        .then(() => {
            navigate('/lista');
        });

    }

I also have this


const handleClick =  async (e) => {
        e.preventDefault();

    
        svojstva1 = fetchSvojstva()
        
        .then(setSv)
        .then(() => {
            navigate('/proizvod');
        });
   
    }

The upper code does not work when I have the navigate in it (when i remove it, it works, but i need it to replace the route). The lower code is the same, but this one works, it sets the state and the parent component can use the variable.

How is this possible?

What is the best way to combine two arrays using javascript?

I’m going to write a function that creates an array like this

[“0-AA”, “0-BB”, “1-AA”, “1-BB”, “2-AA”, “2-BB”, “3-AA”, “3-BB”]

This function, to be exact, is a combination of the following two arrays with a separator ‘-‘.
ex) arr1 = [0,1,2,3] (number) arr2 = [“AA”, “BB] (produce code)

The result is always equal to the product of the length of the two arrays
The size of both arrays is subject to change
The first array is always an integer

So I first created an integer array of the length that I wanted, as shown below

const arrArray.from({ length: 17 }, (_, i) => i + 1)

I want to know a good way to combine the arrays according to the rules. Is it possible to write with an array-only function such as map, concat, etc. without repetitive statements such as for statements?

how to use google speech API to convert audio files to string?

I am trying to use Google Speech API to convert audio files to strings but I can’t make it work when I try to transcribe an audio file that is uploaded by my form element.

<Form onSubmit={handleSubmit}>
        <input type="file" ref={audioFileRef} />
        <Button>Import</Button>
</Form>

This is my fetch:

fetch(path, {
      method: "POST",
      headers: {
        "Content-Type": "audio/wave",
      },
      body: formData,
    })

This is the server:

async function main(content) {
  const client = new speech.SpeechClient();

  const config = {
    encoding: "LINEAR16",
    sampleRateHertz: 16000,
    languageCode: "en-US",
  };

  const audio = {
    uri: content,
  };

  const request = {
    audio: audio,
    config: config,
  };

  const [response] = await client.recognize(request);

  return await response.results
    .map((result) => result.alternatives[0].transcript)
    .join("n");
}

app.post("/import-audio", async (req, res) => {
  const transcription = main(req.body);
  transcription.then(console.log).catch(console.error);
});

I am trying to transcribe the audio file from the form element

Javascript – document.write with HTML tags throws “ILLEGAL” status [duplicate]

JS Code

    document.write('
          <b>Version:</b> 2.11<br>
          <b>Author:</b> Alex Toucan<br><br>
          <p>® <script src="/static/year.js"></script> AT Products LLC</p>
');

Console

Uncaught SyntaxError: Unexpected token ILLEGAL 

I’m quite new to the web side of JavaScript, and I have been attempting to get this to work, which was unsuccessful. What can I do to improve my code?