Sometimes I do not define "FB" problem while getting the problem
I realized that the problem is because sometimes my website does not load that file then it is nothing, and the object FB really does not exist.
My solution is to stop my users if this happens, so I tried the following codes in javascript but none works: / P>
if (FB ) If you run the alert * (* FB! == wrong) * / / ap * /} run the user / warner, if (FB! = 'Undefined')) / / to run the app * /} and {/ * alert user * /} thanks! Assuming FB, there is a variable containing a Facebook object, I will try something like this:
P>
If (typef (FB)! = 'Undefined' and FB! = Null) {// run the app} Other {// Warning to the user} < P> To check that some plain old javascript is not undefined, you should use the "typef" operator. The samples that you show that you compare it with the string 'undefined', unless your string actually 'undefines' in your FB object, its evaluation will be wrong! On the one hand, you may want to use different tools like Firefox (in Firefox) to see if you are not loading facebook files, so you can work.
Comments
Post a Comment