my guess is i'll have to get all the strings by doing a split at each new line (\n) then they will be array'd so they are separated, then some how do a string replace. i suppose the first string: quotes to be like this:
"rotateQuotes.quotes = [ " quotes ","
the middle would be like this:
"" quotes ","
and the last like this:
"" quotes "];"
idk why im here :P RAGE! can't figure it out...
want it from the Quotes.txt because our bot saves quotes from our mIRC chat rooms to that file.
couple of people say i just have to do my random quotes differently where it splits the string and randoms the array id number.
in your case, you wouldn't just be placing the entire contexts of the text file into your page using "innerHTML". you'd have to be a bit (a lot) more precise. so, what you'd do is take the responseText and place each quote within the responseText into an instance in some array. that could be done using the "split" function against the responseText string, splitting at any instance of
so if your text file said:
quote 1 here
quote 2 here
quote 3 here
quote 4 here
quote 5 here
quote 6 here
and you split it based on "\n", you'd get an array that looked like:
Last edited by Angry Black Man; 03-03-2012 at 11:37 AM.
1. If you reply to my post, and your reply would then appear directly beneath my post, DON'T QUOTE MY ENTIRE POST!!! IT'S REDUNTANT!!! IT'S ASININE!!!! IT'S REDUNDANTLY ASININE!!!!! DON'T DO IT!!!!
3. Use the [code][/code] tags. Otherwise, you may be left wondering why no one responded to your eyesore of a thread.
thx the PHP method will work great i do believe...
at first was tring to avoid PHP scripts because there not allowed on the site being used... however i just made this on my own host and added it to the theme in the location desired with an iframe, my host allows php so i dont have to avoid using it anymore... lol didnt think about it, was stuck on making it work with js, and everything i tried failed :P
ok yea the PHP method failed for some reason not sure why.... maybe i did it wrong idk...
well think he desided just to update the file with the list, with the bot instead of making a Quotes.txt file... think ima try the AJAX method later. idk nothing in AJAX lol only what it is and what its made to do... do believe i need to learn