08-04-2005 02:06 AM - edited 03-13-2019 10:02 AM
I would like to say that my service runs fine in the emulator but not on the IPPhone (7960).
I've got a input page and would like to use these inputs in another page.
After all inputs a "*" must be placed.
All works fine, but when I enter nothing the IPPhone comes up with "undefined*" as a Var.
I've tried to work around it but with no succes.
Please advice.
Thanks,
Robin
--------------------Code-----------------
<%@ Language=JavaScript %>
<%
var fStr=Request.QueryString("fStr")+"*";
var lStr=Request.QueryString("lStr")+"*";
Response.ContentType = "text/xml";
try
{
var s = new ActiveXObject("LDAPSEARCH.LDAPSearchList");
s.server = "XXXXXXXXXXX";
s.AuthName = "cn=Administrator,CN=Users,DC=VOIPTest, DC=com";
s.AuthPasswd = "XXXXX";
s.searchbase = "dc=VOIPTest,dc=com"; //ou=Holland
s.SetOutputTitle("Phone List", 45);
//s.SetOutputPrompt("Records %s to %e of total %c", 45);
s.SetOutputPrompt(lStr + " " + fStr , 45);
//s.SetSearchOption(10,0);
s.AddReturnAttr("givenName,sn","Name","%1,%2", 30);
s.AddReturnAttr("telephonenumber","Telephone","%1", 30);
s.AddSortingAttr("telephonenumber", 1);
Response.Write(s.XMLOutput(1, 32));
}
catch(err)
{
Response.Write("Error: " + err.description);
}
Response.End();
Session.Abandon();
%>
Solved! Go to Solution.
08-04-2005 11:05 PM
Actually, it's not a workaround, it's the proper thing to do. JavaScript returns undefined if a variable has not been defined, Java returns null. My own Java LDAP searcher thus sets the search string to * if the query string I'm looking for has not been defined.
What is your problem with s?
08-04-2005 04:26 AM
Found a work around:
-----------code---------------
if(fStr == "undefined")
{
fStr="*";
}
else
{
fStr= fStr+"*";
}
-----------code---------------
Still strange :s
08-04-2005 11:05 PM
Actually, it's not a workaround, it's the proper thing to do. JavaScript returns undefined if a variable has not been defined, Java returns null. My own Java LDAP searcher thus sets the search string to * if the query string I'm looking for has not been defined.
What is your problem with s?
08-05-2005 12:50 AM
Ok this is the first time i work with JavaScript.
I've worked with quite a few languages but never encounterd this before. (Never to old to learn :) )
the "s" is a smily thingy
I use it when i think something is strange.
just like :P or ;).
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide