简体   繁体   中英

How to check if an element exist in query string using javascript?

In Dynamics CRM 2016, I am able to pass some parameters to the other form using query string but I am unable to check if a particular element is exist in query. I tried using indexOf for check index, includes to varify if element is exist but I cannot made a way through. I would like to hear from experts to get the length or if an element is exist in query string parameter.

function getQueryStringLength()
{
    var param = Xrm.Page.context.getQueryStringParameters();
    var chkElem = param.includes("new_orderid");
    alert(chkElem);
}

If indexOf returns -1 if substring is not found. Otherwise it will return array index where substring started. Not sure why you did not succeed.

if(str.indexOf(substr) > -1)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM