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

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -