javascript - incorrect web service method URL -



javascript - incorrect web service method URL -

i've built simple web method in webservice1.asmx checks strength of password. i'm trying method work javascript on string in html input field.

[webmethod] [scriptmethod(usehttpget = true, responseformat = responseformat.xml)] public string passwordcheck(string str) { bool flag1 = false; bool flag2 = false; int k = 0; while ((flag1 == false || flag2 == false) && k < str.length) { if ((str[k] <= 'z' && str[k] >= 'a') || (str[k] <= 'z' && str[k] >= 'a')) flag1 = true; else if (char.getnumericvalue(str[k]) <= 9 && char.getnumericvalue(str[k]) >= 0) flag2 = true; k++; } if (flag1 && flag2) homecoming "strong"; else homecoming "weak"; }

and here's javascript section:

< script type = "text/javascript" > var httpreq = new xmlhttprequest(); function testfunc(str) { httpreq.onreadystatechange = function() { if (httpreq.status = 200 && httpreq.readystate == 4) document.getelementbyid("span1").innerhtml = httpreq.responsetext; } httpreq.open("get", "webservice1.asmx/passwordcheck?str=" + str, true); httpreq.send(); } </script>

i'm getting next error when activating testfunc keystroke: "request format unrecognized url unexpectedly ending in '/passwordcheck'". seems problem here? perhaps typing url in httpreq.open() incorrectly?

javascript c# ajax

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -