javascript – get onchange event on ajax load html

i am using Jquery for ajax load html file

$.post(url_here, {param:value}, function(d){ $('#container').html(d); }, 'html');

andĀ  in that html we have select html dropdown like

one two

in most condition we want get event dropdown change selected value, and we will using .change event (from jquery)

$('#slc_input').change( function(){ alert( $(this).val() ); } );

but this method, will not get value from #slc_input.

solution

add attribute onchange on select component and fireup the function

one two

and declare the function ‘show_value_at_change’

function show_value_at_change(){
  var _v = $('#slc_input').val();
  alert(_v);
}

 

Advertisements

vpn – checkpoint linux web based crash

my firefox crash when load checkpoint vpn client web based, the solution disable check outdated java version check in firefox to be false

crash with extension.blocklist.enable true
run with extension.blocklist.enable false

 

how turn off java version check in firefox

debian – change home to new partition space

have bigger partition 200GB to replace /home 32GB folder

1. create new partition using gparted

sudo gparted


get the file /dev/sda4

2. mount to folder /mnt/newhome

sudo mkdir /mnt/newhome
sudo mount /dev/sda4 /mnt/newhome

3. copy all in home folder

cd /home
sudo rsync -a ./ /mnt/newhome

4. unmount partition

sudo umount /mnt/newhome

5. change old home folder to home_old

sudo mv /home /home_old

6. create new /home folder

sudo mkdir /home

7. auto mount /dev/sda4 to /home

sudo echo "/dev/sda4 /home ext4 nodev,nosuid 0 2" >> /etc/fstab

8. restart

sudo reboot

9. and login with your user, check with df command

sudo df -h


10. if anything ok, delete /home_old

sudo rm -rf /home_old

node.js – express_generator from jade to pug

when using express generator default will using jade as template generator, the problem is jade is renamed with pug. when it running will out warn deprecated message

npm WARN deprecated jade@1.11.0: Jade has been renamed to pug, ...

this how I set up express, express_generator and using it to generate folder for project

# install express and express_generator
$ npm install -g express
$ npm install -g express_generator

# set using express to generate our project
$ mkdir -p ~/projects && cd ~/projects
$ express web_rest && cd web_rest

# open package.json file
$ nano package.json
# change jade to pug (line 14)
# "jade": "1.11.0",
# to
# "pug": "^2.0.0-rc.2",

# open app.js
$ nano app.js
# change view engine to pug (line 15)
# app.set('view engine', 'jade');
# to 
# app.set('view engine', 'pug');

# rename all jade extention to pug in views folder
$ cd views
$ mv error.jade error.pug
$ mv index.jade index.pug
$ mv layput.jade layout.pug

# back to main dir
$ cd ..

# install node_module
$ npm install
# install start, start will using to for running the server
# check file package.json for script
$ npm install -g start

# start the project
$ npm start

# test with curl
$ curl http://localhost:3000

 

debian linux – using two browser firefox version

in firefox version 52, this version limit NPAPI support, this technology required for Java applets, which my vpn client using java applet šŸ˜¦

and how to solve ? using older version firefox just for open vpn applet

i am using debian 8, from crunchbang++ distro

# i am using firefox 50 version, the reason it not to old,
wget -cv https://ftp.mozilla.org/pub/firefox/releases/50.0/linux-x86_64/en-US/firefox-50.0.tar.bz2 

# extract file, move to bin folder, rename folder to firefox50
tar xvjf firefox-50.0.tar.bz2
mv firefox ~/bin/firefox-50

# set another profile user
~/bin/firefox-50/firefox -ProfileManager

# create new profile
# and lauch the firefox

# you can create with link for launcher

codeigniter – shared error hosting debug

problem implement in shared hosting, you cannot doing “tail -f error_log”, the error_log from cpanel being silent.Ā  no clue why the page gave you blank page.

and you start shout “its works in my machine” .

this page i dedicated to write, what i m doing to trace the error in development to production

0 – backup all code from hosting

it must, countless debug and modify runing code, and forget what have you done. backup it to local or else where,.

1 – try running the production codeĀ  in development environtment, see the log

2 – using meld or same function software to equal code or file