Hi Mike, go Source-WEB_RESOURCES-files and delete mobilescreen1.js (it should be blue one, you can delete whole files folder as well).
Further on WEB_RESOURCES click options and choose Undo all source changes.
Hi Mike, go Source-WEB_RESOURCES-files and delete mobilescreen1.js (it should be blue one, you can delete whole files folder as well).
Further on WEB_RESOURCES click options and choose Undo all source changes.
Undo restored broken code and app still fails in the same way.
Can't I just delete file folder then exit app?
Would file folder be auto generated upon testing?
Hi Mike,
It would be better to restore files via Undo operation.
In file "mobilescreen1.js" line 326 there is a syntax error, please check.
Hi Katya,
We are going around in circles.
4 days ago I reported same error already checked.
Line 326 bits = o1 < 18 & 0x3f;
does not match
Line 21bits = o1<<< 18 & 0x3f;
throws
Uncaught SyntaxError: Unexpected number mobilescreen1.js:326
TwiiterSearchJS.js has correct code
line 21 bits = o1<<<8 | o3;
Further, I question how much QA and testing is done by Appery.io before publishing tutorials with bugs. This is not the first time.
Please advise.
Mike
Hi Katya,
I just confirmed this forum is corrupting my characters so I cannot post a reply.
I will email support directly.
Thanks,
Mike
Hi Mike,
There are a lot of mistakes in your code.
Why do you insert TwitSearchGlobal object definition as a handler for mobileslider2?
Next, you are greatly modified TwitterSearchJS and made a lot of very serious mistakes.
Here is the code which overcomes the problems of syntax with comments about them:
codeTwitSearchGlobal = {
Code: Select all
bearerToken : "",
encodeBase64 : function ( data ) { // Encodes data with MIME base64
// + original by: Tyler Akins (http://rumkin.com)
// + improved by: Bayron Guevara
Code: Select all
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
var o1, o2, o3, h1, h2, h3, h4, bits, i=0, enc='';
do { // pack three octets into four hexes
Code: Select all
o1 = data.charCodeAt(i++);
o2 = data.charCodeAt(i++);
o3 = data.charCodeAt(i++);
bits = o1<<16 | o2<<8 | o3;
h1 = bits>>18 & 0x3f;
h2 = bits>>12 & 0x3f;
h3 = bits>>6 & 0x3f;
h4 = bits & 0x3f; // use hexes to index into b64, and append result to encoded string
Code: Select all
enc += b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
} while (i < data.length);
switch( data.length % 3 ){
case 1:
enc = enc.slice(0, -2) + '==';
break;
case 2:
enc = enc.slice(0, -1) + '=';
break;
}
return enc;
},
beforeSearchTwit : function () {
// document.write("Invoking beforeSearchTwit function."); // This line completely rewriting content on the page!
if (this.bearerToken == ""){ // get bearer token and after that call searchTwit
Code: Select all
OAuth2DS.execute({});
} else {
SearchDS.execute({}); // why do you need to call this twice?
}
SearchDS.execute({}); // added by mf 07-23-13 in attempt to force execution of SearchDS
// document.write("Exiting beforeSearchTwit function."); // and again
}
// alert('TwitSearchGlobal.beforeSearchTwit run?.'); // This line causes syntax error }
alert('Exiting TwitSearchGlobal.beforeSearchTwit'); // fires always on start./code
Hi Katya,
Any reasonable person would understand that the customer is not responsible for debugging Appery code because failing line came directly from
Appery tutorial:
SearchDS.execute({}); // why do you need to call this twice?
Obviously, I DID copy and paste original corrected Appery file without any changes yet it still failed prompting me to add
A)
SearchDS.execute({}); // added by mf 07-23-13 in attempt to force execution of SearchDS
B)
// alert('TwitSearchGlobal.beforeSearchTwit run?.'); // This line causes syntax error
Commented out after I discovered it causes a syntax error so it is benign.
C)
alert('Exiting TwitSearchGlobal.beforeSearchTwit'); // fires always on start.
Adding this alert is another benign change to debug code execution.
Conclusion:
Cache must not have refreshed with corrected code until several days later
and my Mac has consumed 119 GB out of 120 GB capacity throwing swap space
warnings, etc.
I would like to know the best way to force clear cache
( assuming this was the root cause of failure ) other than clearing browser history?
I'm using Chrome Version 28.0.1500.95
Obliterate the following items from:
Clear browsing history
Clear download history
Delete cookies and other site and plug-in data
Empty the cache
Clear saved passwords
Clear saved Autofill form data
Clear data from hosted apps
Deauthorize content licenses
Regards,
Mike
I agree that code from our tutorial should work. But this is just sample code, not Appery.io generated code. Appery.io code is the UI or mapping, for example. You would be writing the same code to connect to Twitter using any other tool. Hope this clears things up.