JSON within Module - Joomla! Forum - community, help and support
hi
i have module 3 dropdowns, in 1 class, depending on each other. have first dropdown loads data sql.
i second 1 loads data depending on first selected value. have code:
this goes in default.php , if height isset executes , sql statment class works fine , encodes json. firebug giving me error json.parse: unexpected character , i'm looking in data returning whole html code.
any appreciated !
thank
i have module 3 dropdowns, in 1 class, depending on each other. have first dropdown loads data sql.
i second 1 loads data depending on first selected value. have code:
code: select all
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
function curpageurl() {
var pathname = window.location.pathname;
return pathname;
}
$(document).ready(function(){
$('#art1').change(function(){
var $height = $('#art2') ;
$height.find('option:not([value=default])').remove();
$.getjson(curpageurl(), {height:$(this).val()}, function(heights){
$.each(heights, function(index, height){
$height.append('<option value="'+height[0]+'">'+height[1]+'</option>');
});
});
});
});
</script>
this goes in default.php , if height isset executes , sql statment class works fine , encodes json. firebug giving me error json.parse: unexpected character , i'm looking in data returning whole html code.
any appreciated !
thank
gentle bump 
Comments
Post a Comment