jquery problems

JavaScript and client side scripting.

Moderator: General Moderators

User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: jquery problems

Post by John Cartwright »

At some point I'm going to just ask you to fix your own parse error :D.

As before, you do not wrap this code in a function. Please refer to jquery for some examples on attaching "events", otherwise javascript callbacks.
scifirocket
Forum Commoner
Posts: 31
Joined: Fri Aug 13, 2010 1:24 am

Re: jquery problems

Post by scifirocket »

i am comparing this from the jquery documentation:
[text]<script>
$("select").change(function () {
var str = "";
$("select option:selected").each(function () {
str += $(this).text() + " ";
});
$("div").text(str);
})
.change();
</script>
[/text]

to my code:
[text]<script>

$(document).ready() {
$("searchb").change(function () {
$.post("searchtest.php", {partialName: $(this).val()},function(data) {
$("#results").html(data);
});
});
});

</script>
[/text]

beside the face that i'm still getting the same error as before, it looks like I need to call the .change() method at the end. is this correct?
Post Reply