Wednesday, July 2, 2014

jQuery not working after the content is loaded through AJAX



$(document) refers to the whole document.
$(document).on('click', "#click", function () {
    $('#click').css({
        "background-color": "#fff",
        "color": "#000",
        "cursor": "inherit"
    }).text("Open this window again and this message will still be here.");
    return false;
});


jquery with page loaded by ajax

 
  $(document).on('click', "#checkall", function () {
    $(".tours_table tr").not(".tours_table tr:eq(0)").click(function(){
       $(this).toggleClass("selecting");
    });
   
    $("#checkall").change(function () {
    $(".tours_table table input:checkbox").prop('checked', $(this).prop("checked"));
    });
   
    $(".tours_table table input:checkbox").not("#checkall").change(function(){
       if($("#checkall:checkbox").attr("checked","checked")){
        $("#checkall:checkbox").removeAttr("checked");}
    });
  
  
  });

ajax with codeigniter

function delete1(){
        var  num_record1 = new Array();
    $('.checkname1:checked').each(function () {
        var e = $(this);
        num_record1.push(e.val());
    });
            var showarray=new Array();
        $.ajax({
            type:'post',
            url:'deletetours',
            data:{showarray:num_record1},
            success: function(data) {
                $("#showtype").html(data);
                }
                ,
            error: function() {
                alert('error');
            }
        });
    //});
}

Tuesday, June 10, 2014

Monday, May 26, 2014

alias configuration

C:\wamp\bin\apache\Apache2.4.4\conf\extra

configure in file(httpd-vhosts.conf):


ServerAdmin webmaster@myadminv2
DocumentRoot "D:\Dropbox\IT KHMER SHARE\myadmin_v2.00"
ServerName myadminv2
 
AllowOverride all
Allow From All


-------------------------------------------------------------------

C:\Windows\System32\Drivers\etc

configure in other file(hosts):

127.0.0.1       localhost
127.0.0.1       myadminv2
127.0.0.1       myadminv3

-------------------------------------------------------------------
C:\wamp\bin\apache\Apache2.4.4\conf

uncomment infront of the sentence below

Include conf/extra/httpd-vhosts.conf

-------------------------------------------------------------------
check before sentence below

rewrite module









Saturday, May 24, 2014

redirect to any page

Window.open("url",true); (can not)
Window.location.href="url",true; (can)
Alert("msg",window.location.href="url",true);