Chrome does not support localhost for CORS requests (a bug opened in 2010, marked WontFix in 2014).
To get around this you can use a domain like localho.st
(which points at 127.0.0.1 just like localhost) or start chrome with the --disable-web-security
flag (assuming you’re just testing).
Related Posts:
- Get HTML code using JavaScript with a URL
- Origin null is not allowed by Access-Control-Allow-Origin
- How to enable CORS in AngularJs
- How do I link a JavaScript file to a HTML file?
- Edit webpage with javascript trick – how to “unedit”?
- Cannot set property InnerHTML of null [duplicate]
- jQuery document.createElement equivalent?
- Pure JavaScript equivalent of jQuery’s $.ready() – how to call a function when the page/DOM is ready for it [duplicate]
- Remove CSS class from element with JavaScript (no jQuery) [duplicate]
- How to make JavaScript execute after page load?
- What is the meaning of == $0 that is shown in inspect element of google chrome for the selected element [duplicate]
- How can I get the values of data attributes in JavaScript code?
- Javascript: getElementById vs getElementsById (both works on different pages)
- Export html table data to Excel using JavaScript / JQuery is not working properly in chrome browser
- Send POST data using XMLHttpRequest
- javascript close current window
- TypeError: Cannot Set property ‘onclick’ of null
- Bootstrap Dropdown menu is not working
- Bootstrap Dropdown menu is not working
- What do curly braces in JavaScript mean?
- Create table with jQuery – append
- How to call a JavaScript function within an HTML body
- How would I call a javascript function in html?
- “.addEventListener is not a function” why does this error occur?
- XMLHttpRequest status 0 (responseText is empty)
- Coin toss with JavaScript and HTML
- Resize image with javascript canvas (smoothly)
- Play an audio file using jQuery when a button is clicked
- getBoundingClientRect is not a function
- Jquery button click() function is not working
- Make iframe automatically adjust height according to the contents without using scrollbar?
- Textarea Auto height
- How to reset a form using jQuery with .reset() method
- Access to Image from origin ‘null’ has been blocked by CORS policy
- ReferenceError: “alert” is not defined
- How do I check whether a checkbox is checked in jQuery?
- How to create a HTML Cancel button that redirects to a URL
- JavaScript: Get image dimensions
- Scroll to bottom of div?
- document.getElementById().value doesn’t set the value
- How to run a function when the page is loaded?
- Clearing my form inputs after submission
- How to parse Excel (XLS) file in Javascript/HTML5
- Reload an iframe with jQuery
- Video auto play is not working in Safari and Chrome desktop browser
- How to change the buttons text using javascript
- how to display a div triggered by onclick event
- How to change the text of a label?
- JavaScript – Count Number of Visitor for Website
- Using “×” word in html changes to ×
- How do I store an array in localStorage?
- What’s the effect of adding ‘return false’ to a click event listener?
- Fully responsive HTML5 video
- How to fix the error; ‘Error: Bootstrap tooltips require Tether (http://github.hubspot.com/tether/)’
- HTML anchor link – href and onclick both?
- “Uncaught TypeError: Illegal invocation” in Chrome
- How can I capture the right-click event in JavaScript?
- How do I clear the content of a div using JavaScript?
- How can I embed a YouTube video in a WordPress template page?
- HTML / Javascript in custom field textarea?
- The value of attribute [ data-type ] must be in double quotes – custom html widget error
- Javascript code inside “” in core WordPress files .php
- Add scripts on custom post add/edit pages Not Working
- Slide in Panel WordPress Post
- Adding JavaScript to a WordPress website
- Convert HTML Script to Shortcode [closed]
- Insert “javascript:void(0);” into URL
- Populate dropdown with Child Pages based on Parent Page chosen
- Can I change an external script’s HTML?
- How to integrate my HTML and javascript into my child theme
- How to change redirection route to a php page for making it only accessible by logged-in members?
- Ajaxify This Code
- parts of url disappear when using # inside href=”” [closed]
- How to insert HTML/JavaScript form into WordPress page? [closed]
- Noscript not working as it should in wordpress site
- Add Codepen animation as Preloader to WordPress
- Cannot set property ‘className’ of null at setThemeFromCookie
- HTML escaping data with ajax requests
- Adding a Calculator to a WordPress Page
- Link to page with posts of specific type
- Creating multiple category drop down
- how to let users upload their custom cover image
- WordPress User Meta value variable into Google Gauge Chart
- Overriding inline !important CSS with Javscript code snippet with media query
- Using Google Analytics in an enqueued JS file
- separate list of programs in html/javascript coming from php
- How do I disable cache for a certain page?
- Unable to use Datepicker in a table when inserting a row
- Getting click on item to open closest relevant element (popup) with jQuery
- Hide CSS class only in single post pages
- Target a specific container to style on WordPress storefront theme
- Some code is added automatically to my site’s header – what is it?
- How to delay display of page elements until enqueued script has injected html
- I need help implement a Javascript code into the PHP file
- Possible jquery / library conflict in plugin usage
- Adding Custom HTML/CSS/JS code in specific page
- Why the images on mi javascript are not found?
- dropdown does not work [closed]
- How do I cycle a JS function in WordPress? [closed]
- Modal pop-up HTML code works on other sites or HTML viewers but not in the custom HTML block within a wordpress page?