Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

235
Views
Se negó a ejecutar un script porque su hash, su nonce o un error 'inseguro en línea'

Estaba tratando de corregir este error que estaba enfrentando:

"Se negó a ejecutar un script porque su hash, su nonce o 'inseguro en línea' no aparece ni en la directiva script-src ni en la directiva default-src de la Política de seguridad de contenido".

Estoy tratando de crear una página de contacto y no puedo publicar.

 import React, {useState,setState} from 'react'; import "./Contactus.css"; import axios from 'axios'; class Contactus extends React.Component{ constructor(props) { super(props); this.state = { name: '', email: '', message: '' } } handleSubmit(e){ e.preventDefault(); axios({ method: "POST", url:"http://localhost:3002/send", data: this.state }).then((response)=>{ if (response.data.status === 'success') { alert("Message Sent."); this.resetForm() } else if (response.data.status === 'fail') { alert("Message failed to send.") } }) } resetForm(){ this.setState({name: null, email: null, message: null}) } render() { return ( <div className="contact-form-box"> <h1> Contact Us</h1> <form id="contact-form" onSubmit={this.handleSubmit.bind(this)} method="POST"> <div className="form-group"> <label htmlFor="name">Name</label> <input type="text" className="form-control" /> </div> <div className="form-group"> <label htmlFor="exampleInputEmail1">Email address</label> <input type="email" className="form-control" aria-describedby="emailHelp" /> </div> <div className="form-group"> <label htmlFor="message">Message</label> <textarea className="form-control" rows="5"></textarea> </div> <button type="submit" className="btn btn-primary">Submit</button> </form> </div> ); } onNameChange(event) { this.setState({name: event.target.value}) } onEmailChange(event) { this.setState({email: event.target.value}) } onMessageChange(event) { this.setState({message: event.target.value}) } handleSubmit(event) { } } export default Contactus;

Intenté agregar una etiqueta META que describe la política de seguridad de contenido en el archivo index.js, pero creó más errores junto con los originales.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!