Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getCategory(pincode){
- var URL = 'http://www.popcracker.com/pincode-api/pincode.php?';
- $.ajax({
- url:URL,
- data:{'id':id},
- dataType:'json',
- type:'POST',
- beforeSend:function(){ $('#'+divId+'_loader').html('<img src="loading.gif">');},
- success:function(data){
- var pincode=getParameterByName('pincode');
- function getParameterByName(name) { name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); }
- complete:function(){
- setTimeout(function(){
- $('#'+divId+'_loader').html('');
- },1000)
- },
- error: function(xhr,status,error) { alert('Error: ' + status) ; }
- });
- }
- getCategory(0,'main_cat_div','maincat');
- $('#maincatId').live('change',function(){
- $('#sub_cat2_div').html();
- var id = $(this).val();
- getCategory(id,'sub_cat_div','subcat1');
- });
- $('#subcat1Id').live('change',function(){
- var id = $(this).val();
- getCategory(id,'sub_cat2_div','subcat2');
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment