I'm trying to write a script using the Client Object Model that searches for information from a document library, but I'm having no luck. However, using the same script with a couple of variables changed, I've noticed that it works fine within a list.
I guess my question is: is it possible to manipulate library items (using the Client Object Model and ECMAScript) like you would list items?
Thanks in advance for any information you can provide!
Edit: Here is the code I'm working with (works fine within a list):
<script type = "text/javascript">
ExecuteOrDelayUntilScriptLoaded(initialize, "SP.js");
function initialize(){
var context = new SP.ClientContext.get_current();
var web = context.get_web();
var list = web.get_lists().getByTitle("LibraryName");
var query = new SP.CamlQuery();
var queryText = "<View Scope='RecursiveAll'><Query><Where><Eq><FieldRef Name='Title'/><Value Type='Text'>SomeTitle</Value></Eq></Where></Query></View>";
query.set_viewXml(queryText);
var items = list.getItems(query);
context.load(items);
context.executeQueryAsync(Function.createDelegate(this, querySuccess), Function.createDelegate(this, queryFailure));
function querySuccess(sender, args){
alert("Success");
}
function queryFailure(sender, args){
alert("Failure");
}
}
</script>