I am using ColdFusion 9 and the latest and greatest jQuery.
我正在使用ColdFusion 9和最新最好的jQuery。
At the top of my page, I use this:
在我的页面顶部,我用了这个:
I have a search field:
我有一个搜索域:
When a user types in the search field, the value is passed into a jQuery function:
当用户在搜索字段中输入时,将值传递给jQuery函数:
$(".Search").keyup(function() {
var Artist = $("#Artist").val();
var QString = "Artist=" + Artist;
$("#ArtistSearchResultsDiv").load("ArtistSearchResults.cfm?"+QString);
});
The search results div loads a page with these items in CFSCRIPT:
I have a CFC that runs the query and returns the correct records.
我有一个CFC,它运行查询并返回正确的记录。
The PROBLEM is that when I type in the search box, as soon as I hit a space, no further value is added to the QString variable, and so those values aren't passed to the query.
Here's how much search string looks in Firebug when searching for "The Beatles":
以下是在Firebug中搜索“披头士”时搜索字符串的效果:
GET http://127.0.0.1:8500/WebSites/AwesomeAlbums/GlobalAdmin/ArtistSearchResults.cfm?Artist=The
It's stops as soon as it sees a space.
它一看到空间就停下来。
So, if you were searching for "The Beatles", only the value "The" would be passed into the QString variable. If you were searching for "Celine Dion", only "Celine" would be passed.