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

125
Views
Publicaciones de noticias en tiempo real de Blogger que muestran un error de CORS en un sitio diferente

Con referencia a esta respuesta de Google , traté de usar la versión json de mis feeds usando la URL: https://[blog address].blogspot.com/feeds/posts/default?alt=json . Mi blog está configurado en modo público, pero también está lanzando la política CORS. Y este es el código que usé:

 <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> <script> var getJSON = function(url, callback) { var xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.responseType = 'json'; xhr.onload = function() { var status = xhr.status; if (status === 200) { callback(null, xhr.response); } else { callback(status, xhr.response); } }; xhr.send(); }; getJSON('https://[blog].blogspot.com/feeds/posts/default?alt=json', function(err, data) { if (err !== null) { alert('Something went wrong: ' + err); } else { alert('Your query count: ' + data.query.count); } }); </script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Pruebe alt=json-in-script en su lugar:

 <script type="text/javascript"> function myFunction({feed}) { alert('Your query count: ' + feed.entry.length); } </script> <script type="text/javascript" src="https://blog.blogspot.com/feeds/posts/default?alt=json-in-script&callback=myFunction"></script>

about 4 years ago · Juan Pablo Isaza Report
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!