I have just solved the problem. There was something causing problems with a standard Request call, so this is the code I used instead:
vote.each(function(element){ element.addEvent('submit', function(e){ e.stop(); new Request.JSON({ url : e.target.action, onRequest : function(){ spinner.show(); }, onComplete : function(){ spinner.hide(); }, onSuccess : function(resp){ var j = resp; if (!j) return false; var restaurant = element.getParent('.restaurant'); restaurant.getElements('.votes')[0].set('html', j.votes + " vote(s)"); $$('#restaurants .restaurant').pop().set('html', "Total Votes: " + j.totalvotes); buildRestaurantGraphs(); } }).send(this); }); });
If anyone knows why the standard Request object was giving me problems I would love to know.
Related Posts:
- Error OPTIONS net::ERR_CONNECTION_REFUSED
- Chrome sendrequest error: TypeError: Converting circular structure to JSON
- require is not defined? Node.js
- Cannot open local file – Chrome: Not allowed to load local resource
- How to disable JavaScript in Chrome Developer Tools?
- Cannot open local file – Chrome: Not allowed to load local resource
- Getting Error “Form submission canceled because the form is not connected”
- Getting Error “Form submission canceled because the form is not connected”
- What is the meaning of == $0 that is shown in inspect element of google chrome for the selected element [duplicate]
- Export html table data to Excel using JavaScript / JQuery is not working properly in chrome browser
- What’s the difference between console.dir and console.log?
- How can I quickly retrieve a value from a MapIterator returned from Object.keys function?
- Disable same origin policy in Chrome
- Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH
- blocked a frame of origin “null” from accessing a cross-origin frame – chrome
- How to use jQuery in chrome extension?
- Disable Chrome strict MIME type checking
- getElementsByAttribute() is not a function
- Chrome/jQuery Uncaught RangeError: Maximum call stack size exceeded
- Uncaught Reference Error: stLight is not defined (in Chrome only)
- How do I load an HTML page in a div using JavaScript?
- Video auto play is not working in Safari and Chrome desktop browser
- “Uncaught TypeError: a.indexOf is not a function” error when opening new foundation project
- Resource interpreted as Document but transferred with MIME type application/zip
- How to force JavaScript to deep copy a string?
- “Uncaught TypeError: Illegal invocation” in Chrome
- Tinymce.js editor in Chrome?
- map function for objects (instead of arrays)
- Check if a string has a certain piece of text [duplicate]
- How to convert a string to an integer in JavaScript?
- “document.getElementByClass is not a function”
- How to create an associative array in JavaScript literal notation
- Include another HTML file in a HTML file
- After $npm install, Getting Error: Cannot find module ‘../lib/utils/unsupported.js’
- What’s the best way to convert a number to a string in JavaScript?
- React Native: this.setState is not a function
- How to perform string interpolation in TypeScript?
- forEach is not a function error with JavaScript array
- Short circuit Array.forEach like calling break
- How can I upload files asynchronously with jQuery?
- How do I format date in jQuery datetimepicker?
- Express Render not working return error: No default engine was specified and no extension was provided
- Remove Object from Array using JavaScript
- Angular4 – No value accessor for form control
- What is the difference between ( for… in ) and ( for… of ) statements?
- Cannot read property ‘bind’ of undefined. React.js
- Why is my asynchronous function returning Promise {
} instead of a value? - NodeJs : TypeError: require(…) is not a function
- Sort array by firstname (alphabetically) in Javascript
- What is the difference between null and undefined in JavaScript?
- Pass react component as props
- How to fix Cannot find module ‘typescript’ in Angular 4?
- Origin null is not allowed by Access-Control-Allow-Origin
- using jQuery $(this).addClass not working, simple code not working
- document.getElementById(id).focus() is not working for firefox or chrome
- How to get height of div in px dimension
- jQuery: Uncaught Error: Syntax error, unrecognized expression
- What is the difference between String.slice and String.substring?
- How to use in jQuery :not and hasClass() to get a specific element without a class
- Crop the image using JavaScript
- What is the best way to remove a table row with jQuery?
- Only on Firefox “Loading failed for the script with source”
- How do you use a variable in a regular expression?
- How to embed a youtube playlist with a sidebar
- How to add a button dynamically using jquery
- External JavaScript Not Running, does not write to document
- Create a simple 10 second countdown
- Generate a Hash from string in Javascript
- Find a value in an array of objects in Javascript [duplicate]
- What does `node –harmony` do?
- Preventing YouTube embeds loading multiple instances of player JS?
- How to handle malformed response from WP REST API?
- Use useSelect/useDispatch instead of withSelect/withDispatch
- Trouble adding JavaScript in visual editor (Sharpspring embed code)
- Modals using loops and ACF [closed]
- Changes to JS not reflected on site
- How to set translations in javascripts for my plugin?
- Pass data from wordpress to javascript in JSON
- How to make wordpress URLS google friendly for ajax driven sites?
- js addclass function not working as expected, intereaction or special WP somethign needed?
- WP TinyMCE (Full + media ) – 4.8 JS Init Dynamicly
- Get a default value of the Customizer setting using wp.customize API (JS)
- Google PageSpeed Enable Compression isn’t working?
- How can I add Javascript in the header of all post pages and only post pages
- wp_enqueue_script not loading my custom js file
- Load external javascript files
- Javascript alert appears before tag
- Add captcha validation to my custom form for Frontend posting
- AddThis Sharing Bar Not Displaying on Custom Page Template – JS conflict?
- Bootstrap bundle present in page source but not working
- Web cover page open when button clicked
- Add JavaScript-Library “Fitty” to WordPress
- Replace script attr or link
- Access checks with custom REST endpoints and backbone
- How to pass data to javascript in custom widget class
- jQuery + more won’t load in header
- How to add additional JavaScript code [duplicate]
- JavaScript errors
- Javascript not working on index.php but it is working on single post’s page
- Unable to change the location of a file