javascript - Subfunction Not Working -


itemprop = "text">

My function formatMoney works when recalculateReservationFee () But my javaScript console gives me an error "undefined function" when I try to call formatMoney recalculateGrandTotal () from a sub function named recalculateReservationFee () . I do not understand why this is happening, how can I define methods for recalculation from formatMoney , GrandTalk () ?

Here's my code:

  // Money Formatter (decPlaces, thouSeparator, decSeparator) {Var n = this, decPlaces = isNaN (decPlaces = Math.abs (DeedPlace))? 2: decPlaces, decSeparator = decseparator == undefined? "." : DecSeparator, youSeparator = youSeparator == undefined? ",": Separator, sign = N & lt; 0? "-": "", I = parseint (n = Math.base (+ n || 0) .tifix (deplaces) + "", j = = (j = i.length)> 3? H% 3: 0; Return sign ++ (js? Iusubstr (0, j) + thou separator: "") + i.substr (j) .replace (/ (\ d {3}) (? = \ D) / g, "$ 1" + thou sipator) + (DeedPlace accusator + Math. Abus (N - I) .tiffix (dipsplace). Slice (2): ""); }; Function Recalculation Reservation () {var vacationRentalPrice = parseFloat (& lt; RentLentalPrice; & Gt;) for touching dollars per PHP;); Var taxite = parseflot (document.getAlmentBiID ("price displaycrite"). Text content); Var cleaner = parseflow (document. GetElementById ("priceDisplayCleaningFee"). Text content); Var Pool Hitting = Perfalto (document.getElementById ("priceDisplayPoolHeating"). Text Content); Var PetFee = parsefloat (document.getElementById ("priceDisplayPetFee". Text content); Var Property Dame Protection = Parseflot (document. GetElementById ("priceDisplayPropertyDamageProtection"). TextContent); Var ReservationFit-targeted = VacantNational Prius + Tax-Rights + Cleanliness + PoolHighting + Patio + Property Protection; Var theNewReservationFee = parseFloat ((& lt;? Php echo $ reserve percentage;? & Gt; * Reservation FeeTarget) / 100); Var FormatNewReferenceFli = The New ReservationFormmani (2, ',', '.'); // Example "$ 3,543.76" document. GetElementById ("priceDisplayReservationFee") InnerHTML = formatted new reservation; //document.write('<br/>The Vars: 
'vacationRentalPrice +'
'CleaningFee +'




< '+ TaxRate +'
'+ PoolHeating +'
'+ PetFee +'
'PropertyDamageProtection +' & lt; br / & gt; Gt; -
'+ आरक्षणFeeTarget +' & lt; br / & gt; '+ Formatted New Reservation); Function Recalculate GrandTable () {var GrandText = VacationlinePrint + & lt;? PHP resonance $ theRefundableDamageDepositRounded; ? & Gt; + Tax rate + cleaner + pool heaving + pacifer + property damage protection + formatted new reservation; Variable Grand Tactical = The Grand Tattle. FormatMani (2, ',', '.'); // Example "$ 3,543.76" document. GetElementById ("priceDisplayVacationPackageTotal"). InnerHTML = Formatted GrandTable; Document.getElementById ("priceDisplayVacationPackageGrandTotal"). InnerHTML = Formatted Grantlock; } Recalculate Grandetle (); } Function Emptied (The Namedu, The Named Class) {document.getElementById (theNamedFee) .innerHTML = '0.00'; Var elems = document.getElementsByClassName (theNamedClass); For (var i = 0; i & lt; elems.length; i ++) {ames [i] .disabled = true; } Recalculation reserve (); } ShowFee (theNamedFee, someFee, theNamedClass) {document.getElementById (theNamedFee) .innerHTML = someFee; Var elems = document.getElementsByClassName (theNamedClass); (Var i = 0; i & lt; elems.length; i ++) {ames [i] .disabled = false; } Recalculation reserve ();

line

  var theGrandTotal = vacationRentalPrice + .... + formatted new reservation; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ string  Number + "string" = "number string"  


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -