examples/browser/transfer/script.js
function updateFee() {
		// Check for amount errors
		if(undefined === $("#amount").val() || !nem.utils.helpers.isTextAmountValid($("#amount").val())) return alert('Invalid amount !');

		// Set the cleaned amount into transfer transaction object
		transferTransaction.amount = nem.utils.helpers.cleanTextAmount($("#amount").val());

		// Set the message into transfer transaction object
		transferTransaction.message = $("#message").val();

		// Prepare the updated transfer transaction object
		var transactionEntity = nem.model.transactions.prepare("transferTransaction")(common, transferTransaction, nem.model.network.data.testnet.id);

		// Format fee returned in prepared object
		var feeString = nem.utils.format.nemValue(transactionEntity.fee)[0] + "." + nem.utils.format.nemValue(transactionEntity.fee)[1];

		//Set fee in view
		$("#fee").html(feeString);
	}
function updateFee() {
		// Check for amount errors
		if(undefined === $("#amount").val() || !nem.utils.helpers.isTextAmountValid($("#amount").val())) return alert('Invalid amount !');

		// Set the cleaned amount into transfer transaction object
		transferTransaction.amount = nem.utils.helpers.cleanTextAmount($("#amount").val());

		// Set the message into transfer transaction object
		transferTransaction.message = $("#message").val();

		// Prepare the updated transfer transaction object
		var transactionEntity = nem.model.transactions.prepare("transferTransaction")(common, transferTransaction, nem.model.network.data.testnet.id);

		// Format fee returned in prepared object
		var feeString = nem.utils.format.nemValue(transactionEntity.fee)[0] + "." + nem.utils.format.nemValue(transactionEntity.fee)[1];

		//Set fee in view
		$("#fee").html(feeString);
	}
function updateFee ( ) { // Check for amount errors if ( undefined === $ ( "#amount" ) . val ( ) || ! nem . utils . helpers . isTextAmountValid ( $ ( "#amount" ) . val ( ) ) ) return alert ( 'Invalid amount !' ) ; // Set the cleaned amount into transfer transaction object transferTransaction . amount = nem . utils . helpers . cleanTextAmount ( $ ( "#amount" ) . val ( ) ) ; // Set the message into transfer transaction object transferTransaction . message = $ ( "#message" ) . val ( ) ; // Prepare the updated transfer transaction object var transactionEntity = nem . model . transactions . prepare ( "transferTransaction" ) ( common , transferTransaction , nem . model . network . data . testnet . id ) ; // Format fee returned in prepared object var feeString = nem . utils . format . nemValue ( transactionEntity . fee ) [ 0 ] + "." + nem . utils . format . nemValue ( transactionEntity . fee ) [ 1 ] ; //Set fee in view $ ( "#fee" ) . html ( feeString ) ; }
Function to update our fee in the view
Function to update our fee in the view