[Javascript] echo value padded with spaces?

Skip Evans skip at bigskypenguin.com
Mon May 5 21:12:02 CDT 2008


Hey Peter & all,

No changes to the server, and it's right here 15 
feet from me, so I can be sure of that.

What I ended up doing to solve it is echo back 
'false' or 'true' and then use ret.indexOf('true') 
to look for the whole word anywhere in the 
returned value.

While this fix works, I am still very curious as 
to why it is returning this value.

I'll check out the analyzer.

Thanks,
Skip

Peter Brunone wrote:
> Just shooting in the dark here... were there any changes to the server, PHP upgrades, etc?
> 
> If you want to be sure that's a real, honest-to-goodness space (i.e. character 13), you can use my string analyzer:
> 
> http://authors.aspalliance.com/peterbrunone/analyzethis/analyzethis.asp
> 
> Paste your value and see what you get.
> 
> Cheers,
> 
> Peter
> 
> ----------------------------------------
> 
> From: Skip Evans skip at bigskypenguin.com
> 
> Hey all,
> 
> I have a login function that has been working fine 
> for a very long time. All of a sudden (or at least 
> for a reason I could not nail down) it began to 
> fail to validate properly.
> 
> I had this on the PHP side when a user name 
> password combination failed:
> 
> echo 'false';
> 
> And in the JS I simply did this:
> 
> if (ret=='false')
> alert('Invalid login')
> 
> But when I did an alert on the return I got this:
> 
> ' false'
> 
> The echoed value 'false' is now coming through 
> with space padded on the left side.
> 
> Can anyone explain this to me???
> 
> Thanks globules!
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Javascript mailing list
> Javascript at lists.evolt.org
> http://lists.evolt.org/mailman/listinfo/javascript

-- 
Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison, WI 53703
608-250-2720
http://bigskypenguin.com
=-=-=-=-=-=-=-=-=-=
Check out PHPenguin, a lightweight and versatile
PHP/MySQL, AJAX & DHTML development framework.
http://phpenguin.bigskypenguin.com/



More information about the Javascript mailing list