Checking a value before assigning it to variable
Indentation

I'm not quite sure if this is correct, but from what I know, I believe it is.

Indentation in JavaScript does not matter as, before your code is run, it is completely minimized - meaning it removes all comments and unnecessary spaces.

That being said, trying to crush your JavaScript into three lines does not make it any faster.

Calling

In your first example, you call the same function three times with the same arguments each time. This is extremely inefficient.

It would be optimal to call it once and save it in a variable.

Therefore, these lines:

var filter = ""
if ( typeof getQuery("filter") != 'undefined' &amp;&amp; getQuery("filter") != "" ) filter = getQuery("filter")
if ( filter != "" ) createFilterView( filter ) 


Can become:

var filter = "";
var ret = getQuery("filter"); // for lack of a better variable name
if(typeof ret != 'undefined' &amp;&amp; ret != "") filter = ret;
if(filter != "") createFilterView(filter)


(Yes, you fixed this in the second example)

Conditionals 1

In your first example, you check to see that the return value of getQuery isn't "undefined" and that it isn't "". If that passed, you take the return value and place it in a variable. Then, you go through another conditional to make sure that that variable isn't empty.

Well, since in your first conditional you already check to make sure that the return value isn't empty, why don't you put the body of the second conditional into the first one.

This:

if ( typeof getQuery("filter") != 'undefined' &amp;&amp; getQuery("filter") != "" ) filter = getQuery("filter")
if ( filter != "" ) createFilterView( filter ) 


Becomes:

if(typeof getQuery("filter") != 'undefined' &amp;&amp; getQuery("filter") != "") {
    filter = getQuery("filter")
    createFilterView(filter)
}


Conditionals 2

In the conditional statements in both of your examples, you check that the return value of getQuery is not "". You don't have to specifically specify that.

You can just remove the != "" part and it would work the same way.

The further reduce the size of your conditional, you can have your getQuery function actually return the value undefined (null would be better, however) instead of it returning a string of the word "undefined".

Then, you could reduce your conditional to:

if(getQuery("filter"))


Semicolons

In JavaScript, it is a good practice to close statements with a semicolon.

Example:

createFilterView(filter)


Should be:

createFilterView(filter);
                        ^
                        |
                    semicolon


Quotes

This isn't really important, but I just thought I'd point it out.

You are consistent in your code with your quotes. For some strings, you use single quotes and for others, you use double quotes.

It is best to stick to one.