Skip to main content

jQuery error Uncaught RangeError: Maximum call sta

More
10 years 6 months ago - 10 years 6 months ago #231621 by sandervankasteel
-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.4.16
-- Error-message(debug-mod must be tuned on) -- : jQuery error : Uncaught RangeError: Maximum call stack size exceeded

Hello,

For a client I've developed a custom pricing plugin which is working great, the pricing is based on 2 custom fields (made in HikaShop). Now the client wants that once the those fields have a certain value, the text value of the price is set. So I've written a small component which returns that price as JSON and now I'm trying to use AJAX to fetch that price but jQuery is returning this error

Uncaught RangeError: Maximum call stack size exceeded


The code that does the AJAX call:
Code:
jQuery(document).ready(function() { // if(typeof(hkjQuery) == "undefined") window.hkjQuery = window.jQuery; // window.hikashop.ready(function() { jQuery('#breedte').on('keyup', function(event) { if(parseInt(jQuery(this).val()) > 30 && parseInt(jQuery("#hoogte").val()) > 30) { getPrices(); } }); jQuery('#hoogte').on('keyup', function(event) { if(parseInt(jQuery(this).val()) > 30 && parseInt(jQuery("#breedte").val()) > 30) { getPrices(); } }); }); function getPrices() { jQuery.ajax({ url: '<?php echo JRoute::_("index.php?option=com_name&task=prices.getprices"); ?>', data : { 'width': jQuery('#hoogte').val(), 'height' : jQuery('#hoogte'), 'product_id' : jQuery('#product_id').val() }, dataType : 'json', type : 'POST' }).done(function(returnData) { console.log(returnData); // jQuery('.hikashop_product_price').text( "€ " + returnData.price +""); }).fail(function(returnData) { console.log(returnData); }); } </script>

Any suggestions?
Last edit: 10 years 6 months ago by sandervankasteel. Reason: Typo + addition

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #231627 by nicolas
Hi,

On which line of that code do you get that error ?

The only issue I see is that you have:
'height' : jQuery('#hoogte')
instead of:
'height' : jQuery('#breedte').val()

Please Log in or Create an account to join the conversation.

Time to create page: 0.181 seconds
Powered by Kunena Forum