开发者

Ajax Database example from w3schools jquery driven [closed]

开发者 https://www.devze.com 2023-01-22 23:51 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered i开发者_如何学运维n its current for
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered i开发者_如何学运维n its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 12 years ago.

Hello i need the code from http://www.w3schools.com/ajax/ajax_database.asp rewritten in jquery(if possible) but more important for my project is on load the first customer to be already gathered from the db and eliminate the Please select option. Anybody could help me please .. I'm trying to do a kind of select sort/filter based on this example for my website,

Thank you


I made it myself .. but thanks for the votes :) I will add here maybe somebody will be interested

<script type="text/javascript">
$(document).ready(function() {
    $("select[name='customers']").attr("selectedIndex", 1);
    $("select[name='customers']").change(function() {
        var str = $(this).val();
        if( str == "" ) {
            $("#txtHint").html("");
        }
        else {
            $.get("getcustomer.asp", {"q": str}, function(data) { $("#txtHint").html(data) });
        }
    }).change();
});

0

精彩评论

暂无评论...
验证码 换一张
取 消