javascript - How can I set an if the query string is does come up as something other than -


how can make javascript if function if query string show other undefined. here code:

    var getquerystring = window.location.href.split("?")[1]; alert(getquerystring);   

basically wanted if function in javascript. here code:

    if (getquerystring = 1){           //add code     } 

how can set javascript function?

the bellow code should work you

var getquerystring = window.location.href.split("?")[1];  if (typeof getquerystring !== 'undefined') {     //your code goes here } else [   alert("query string not set"); } 

Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -