Douglas Crockford
Frontend Masters - December 2015
- Programming Style and Your Brain
- And Then There Was JavaScript
// Source: http://www.highonphp.com/fixing-soap-exception-no-xml | |
class SoapClientNG extends \SoapClient{ | |
public function __doRequest($req, $location, $action, $version = SOAP_1_1){ | |
$xml = explode("\r\n", parent::__doRequest($req, $location, $action, $version)); | |
$response = preg_replace( '/^(\x00\x00\xFE\xFF|\xFF\xFE\x00\x00|\xFE\xFF|\xFF\xFE|\xEF\xBB\xBF)/', "", $xml[0] ); |
Coming from this post, the solution is very simple and doesn't need jQuery.
This is the function that will disable multiple submits to any form that has such attribute
function disableMultipleSubmits() { // by Andrea Giammarchi - WTFPL
Array.prototype.forEach.call(
document.querySelectorAll('form[disablemultiplesubmits]'),
function (form) {
form.addEventListener('submit', this, true);
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.