[jQuery] How to display random content from external .html file?

[jQuery] How to display random content from external .html file?


Hello.
I'm relatively new to jQuery, never used JavaScript in my websites
before but with jQuery it seems so incredibly easy that I've decided
to learn it finally. I mostly use plugins, sometimes slightly modyfing
the code etc but getting better every day I think :)
Anyway, I have a problem with writing a function that will make this
effect possible: I want to display random content from external .html
file in my 'main' file.
Lets say I have an index.html file with <div id="quotes"> and a
texts.html file with <div id="texts"> inside which I have few <p
class="text"> elements. What I want to do is simply randomly display
one of these

elements inside the "quotes" div in my index file. I
*think* :) it's possible but being a newbie I can't really figure out
how to achieve this effect. Tried to find a plugin but only found
stuff to display random content that's inside my index file.
Any help would be appreciated, thanks in advance!
--
Justine


















    • Topic Participants

    • hello