1

How would I use jquery BBQ to check if a parameter exists and if it does not then run a function?

I'm assuming that $.deparam.fragment().srhTerm; is what I would use, however if srhTerm doesn't exist in the url, does it return false or null?

thanks

James Allardice
  • 164,175
  • 21
  • 332
  • 312
Jason
  • 7,612
  • 14
  • 77
  • 127

1 Answers1

1

It will return undefined.

This is what the test could look like:

if( typeof($.deparam.fragment().srhTerm) == 'undefined' ) {
    // do stuff
}
Jonas G. Drange
  • 8,749
  • 2
  • 27
  • 38