I added a setTimeout function to the following jQuery script to give page elements time to load before I ultimately change them.
setTimeout(function () {
//♪dolla sign dolla sign dolla dolla dolla sign♪
$('span.profile_text:eq(1)').text('Who Knows?');
$('span.profile_text:eq(3)').text('Probably a dude...');
//this last one is different because Chatango formatting is stupid formatting
$('span.profile_text:eq(5)').html('Somewhere in the universe... <br> <br>');
}, 2500);
(this replaces my age, gender, and location usertext on Chatango in case you were wondering)
Now anyways, my problem is that the website alters the JavaScript so that the setTimeout function is replaced with three dots followed by it's parameters.
(just imagine ...(function () {
and then the rest of the JavaScript under it)
I need to find some way to work around it so that I can get the script to run on a delay, either by using a different function to accomplish the same task, or possibly by adding more functions or characters to just sort of jam it in there even though Chatango clearly does not want it..
Sorta like an XSS job, but with a website where you're actually supposed to be allowed to put in whatever you want and have it run as verbatim HTML.
If anyone has any suggestions, I would really appreciate them. I really want to go somewhere with this, but I'm going to have to get it to walk on its own before I can start putting on bells and whistles.
setTimeout() is an evaluated statement and can cause insecurity as it can inject code at runtime:
See this for more details(same issue with eval): When is JavaScript's eval() not evil?
Where you cannot use setTimeout, use promises or callbacks - it doesn't look like you actually need the event to be time based.