Question: I have a Query String (URL) filter on my SharePoint 2013 page that is currently passing a string parameter which I then use to filter a list. This list is displayed in a view on my web part page. I want to add a "Title" object above my list view to show the value of the filter parameter that I'm passing to filter the list.

Does anyone know how I can do this? I looked through the web part options that were available to add, and couldn't find one to simply display the result of the query string filter.

Answer: 
```
 var context = new SP.ClientContext.get_current();
    var list = context.get_web().get_lists().getByTitle("ListName");
    var cQuery = new SP.CamlQuery();
    var camlXML = "<View><Query><Where><Eq><FieldRef Name='Author' LookupId='True'/><Value Type='Lookup'>" + _spPageContextInfo.userId + "</Value></Eq></Where></Query></View>";
    cQuery.set_viewXml(camlXML);
    var listitems = list.getItems(cQuery);
    context.load(listitems);
    context.executeQueryAsync(function() {
            var enumerator = listitems.getEnumerator();
            while (enumerator.moveNext()) {
                var item = enumerator.get_current().get_fieldValues();
                console.log(item);
            }
        },
        function(s, a) {
            console.error(a.get_message());
        });

```

Though it works, I prefer the query provided by Yayati to use `<UserID/>` in caml Query instead of `_spPageContextInfo.userId` , as this userid is only available on SharePoint application pages in browser. however you can use this query to get items of a specific user, instead of current user by passing the userid.
To get current user Id

```
clientContext = new SP.ClientContext.get_current();
 var user=clientContext.get_web().get_currentUser();
 clientContext.load(user);
clientContext.executeQueryAsync(function(){
 var userId=user.get_id();

 var query="<Where><Eq>"+
    "<FieldRef Name="Author" LookupId="TRUE" />"+
     "<Value Type="Integer">" +userId + "</Value></Eq></Where>";

},failCallbackMethod);

```

This [link](http://www.ashokraja.me/tips/How-to-use-User-Name-User-Id-Logged-in-User-Id-in-SharePoint-CAML-Query) might help you