• 22-09-2013, 14:04:42
    #1
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Merhaba arkadaşlar, bir projede autocomplete, datetime picker birde input select ekledim js ile ama autocomplete ekleyince şu aşağıda kırmızı ile işaretlediğim kod çakıştı, şöyle oldu bunu ekleyince autocomplete çalışmıyor silince ise input select in çubuğundaki resim efekti gidiyor hangisini ellesem diğeri dökülüyor bunu nasıl çözebilirim?


        <link href="style.css" rel="stylesheet" />
        <link href="css/custom-theme/jquery-ui-1.8.20.custom.css" rel="stylesheet" />
        <%--bu js zopim chatin--%>
        <!--[if lte IE 8]><link rel="stylesheet" type="text/css" href="/st.css?_=1379076475" /><![endif]-->
        <script src="js/libs/jquery.min.js"></script>
        <script src="js/jquery-ui-1.8.20.custom.min.js"></script>
        <script type="text/javascript">
            jQuery(document).ready(function ($) {
                $("#date_in").datepicker({
                    dateFormat: 'MM dd, yy',
                    minDate: 0,
                    showOtherMonths: true
                });
            });
        </script>
        <script type="text/javascript">
            /* <![CDATA[ */
            $(function () {
                var input = document.createElement("input");
                if (('placeholder' in input) == false) {
                    $('[placeholder]').focus(function () {
                        var i = $(this);
                        if (i.val() == i.attr('placeholder')) {
                            i.val('').removeClass('placeholder');
                            if (i.hasClass('password')) {
                                i.removeClass('password');
                                this.type = 'password';
                            }
                        }
                    }).blur(function () {
                        var i = $(this);
                        if (i.val() == '' || i.val() == i.attr('placeholder')) {
                            if (this.type == 'password') {
                                i.addClass('password');
                                this.type = 'text';
                            }
                            i.addClass('placeholder').val(i.attr('placeholder'));
                        }
                    }).blur().parents('form').submit(function () {
                        $(this).find('[placeholder]').each(function () {
                            var i = $(this);
                            if (i.val() == i.attr('placeholder'))
                                i.val('');
                        })
                    });
                }
            });
            /* ]]> */
        </script>
    
    
        <%-- autoc  --%>
        <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
        <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                var myArr = [];
    
                $.ajax({
                    type: "GET",
                    url: "states.xml", // change to full path of file on server
                    dataType: "xml",
                    success: parseXml,
                    complete: setupAC,
                    failure: function (data) {
                        alert("XML File could not be found");
                    }
                });
    
                function parseXml(xml) {
                    //find every query value
                    $(xml).find("state").each(function () {
                        myArr.push($(this).attr("label"));
                    });
                }
    
                function setupAC() {
                    $("input#txtAlis").autocomplete({
                        source: myArr,
                        minLength: 1,
                        select: function (event, ui) {
                            $("input#txtAlis").val(ui.item.value);
                            $("#searchForm").submit();
                        }
                    });
    
                    $("input#txtVaris").autocomplete({
                        source: myArr,
                        minLength: 1,
                        select: function (event, ui) {
                            $("input#txtVaris").val(ui.item.value);
                            $("#searchForm").submit();
                        }
                    });
                }
    
            });
        </script>
        <%-- autoc  --%>
        <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
        <script src="js/jquery.customSelect.js"></script>
        <script src="js/jquery.customSelect.min.js"></script>
        <link href="css/custom-theme/jquery-ui-1.8.20.custom.css" rel="stylesheet" />
        <%-- drpopdown  --%>
        <script type="text/javascript">
            $(function () {
                $('select.styled').customSelect();
            });
        </script>
        <%-- drpopdown  --%>
        <%-- date  --%>
        <script type="text/javascript">
            jQuery(document).ready(function ($) {
                $("#<%=date_in.ClientID%>").datepicker({
                    dateFormat: 'MM dd, yy',
                    minDate: 0,
                    showOtherMonths: true
                });
            });
        </script>
        <%-- date  --%>
  • 22-09-2013, 19:50:46
    #2
    daha eski bir sürüm kullanmayı denemelisin, şuan jquery vs1.10 yayınlamış durumda ve 1.9 da bazı fonksiyonlar kaldırıldı. Bu yüzden çakışma yaşıyor olabilirsin.
  • 23-09-2013, 03:46:43
    #3
    berkorn adlı üyeden alıntı: mesajı görüntüle
    Merhaba arkadaşlar, bir projede autocomplete, datetime picker birde input select ekledim js ile ama autocomplete ekleyince şu aşağıda kırmızı ile işaretlediğim kod çakıştı, şöyle oldu bunu ekleyince autocomplete çalışmıyor silince ise input select in çubuğundaki resim efekti gidiyor hangisini ellesem diğeri dökülüyor bunu nasıl çözebilirim?


        <link href="style.css" rel="stylesheet" />
        <link href="css/custom-theme/jquery-ui-1.8.20.custom.css" rel="stylesheet" />
        <%--bu js zopim chatin--%>
        <!--[if lte IE 8]><link rel="stylesheet" type="text/css" href="/st.css?_=1379076475" /><![endif]-->
        <script src="js/libs/jquery.min.js"></script>
        <script src="js/jquery-ui-1.8.20.custom.min.js"></script>
        <script type="text/javascript">
            jQuery(document).ready(function ($) {
                $("#date_in").datepicker({
                    dateFormat: 'MM dd, yy',
                    minDate: 0,
                    showOtherMonths: true
                });
            });
        </script>
        <script type="text/javascript">
            /* <![CDATA[ */
            $(function () {
                var input = document.createElement("input");
                if (('placeholder' in input) == false) {
                    $('[placeholder]').focus(function () {
                        var i = $(this);
                        if (i.val() == i.attr('placeholder')) {
                            i.val('').removeClass('placeholder');
                            if (i.hasClass('password')) {
                                i.removeClass('password');
                                this.type = 'password';
                            }
                        }
                    }).blur(function () {
                        var i = $(this);
                        if (i.val() == '' || i.val() == i.attr('placeholder')) {
                            if (this.type == 'password') {
                                i.addClass('password');
                                this.type = 'text';
                            }
                            i.addClass('placeholder').val(i.attr('placeholder'));
                        }
                    }).blur().parents('form').submit(function () {
                        $(this).find('[placeholder]').each(function () {
                            var i = $(this);
                            if (i.val() == i.attr('placeholder'))
                                i.val('');
                        })
                    });
                }
            });
            /* ]]> */
        </script>
    
    
        <%-- autoc  --%>
        <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
        <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                var myArr = [];
    
                $.ajax({
                    type: "GET",
                    url: "states.xml", // change to full path of file on server
                    dataType: "xml",
                    success: parseXml,
                    complete: setupAC,
                    failure: function (data) {
                        alert("XML File could not be found");
                    }
                });
    
                function parseXml(xml) {
                    //find every query value
                    $(xml).find("state").each(function () {
                        myArr.push($(this).attr("label"));
                    });
                }
    
                function setupAC() {
                    $("input#txtAlis").autocomplete({
                        source: myArr,
                        minLength: 1,
                        select: function (event, ui) {
                            $("input#txtAlis").val(ui.item.value);
                            $("#searchForm").submit();
                        }
                    });
    
                    $("input#txtVaris").autocomplete({
                        source: myArr,
                        minLength: 1,
                        select: function (event, ui) {
                            $("input#txtVaris").val(ui.item.value);
                            $("#searchForm").submit();
                        }
                    });
                }
    
            });
        </script>
        <%-- autoc  --%>
        <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
        <script src="js/jquery.customSelect.js"></script>
        <script src="js/jquery.customSelect.min.js"></script>
        <link href="css/custom-theme/jquery-ui-1.8.20.custom.css" rel="stylesheet" />
        <%-- drpopdown  --%>
        <script type="text/javascript">
            $(function () {
                $('select.styled').customSelect();
            });
        </script>
        <%-- drpopdown  --%>
        <%-- date  --%>
        <script type="text/javascript">
            jQuery(document).ready(function ($) {
                $("#<%=date_in.ClientID%>").datepicker({
                    dateFormat: 'MM dd, yy',
                    minDate: 0,
                    showOtherMonths: true
                });
            });
        </script>
        <%-- date  --%>

    Bir projede biden fazla jquery kütüphanesinin kullanılması doğru değil. Projenize göre her zaman son güncel versiyonu kullanmalısınız.

    Aşağıdaki aşağıda açıklamaya çalıştım.

    <script src="js/libs/jquery.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
    Üçü de birbirinin aynısı sadece versiyon farklı olabilir.
    
    <script src="js/jquery-ui-1.8.20.custom.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.js"></script>
    İkisi birbirinin aynısı
    
    <script src="js/jquery.customSelect.js"></script>
    <script src="js/jquery.customSelect.min.js"></script>
    Bu ikisi zaten birbirinin aynısı

    Aşağıdaki versiyonlar işini görecektir zira hem 1.9 itibariyle kaldırılmış olan metotlar bunda mevcut hemde yeni gelen metotlar vardır.

    jQuery 1.8.2
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>

    jQuery UI 1.9.2
    <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>



    -
  • 25-09-2013, 03:53:14
    #4
    aynen hocam onları commentledim ekleyince çakışmadı cevap için teşekkürler