Dear Scriptmakers,
I have a PHP based page. I want to onload a javascript in a page but I do not know how can I do that. Let me explain:
My page has an index.php with a slidebar ofc. I always change the content part only. The page what should contain the script is the mainpage.php. I've saved the script in a separated file and I cannot onload it. Is that any way to do that?
This is my script:
And I want to onload here, in the "facts" div. This area is a text contained and image bordered part of the page.Code:<!-- var textarray = [ "hi", "hello", "how r u", "where r u" // No comma after last entry ]; function RndText() { var rannum= Math.floor(Math.random()*textarray.length); document.getElementById('ShowText').innerHTML=textarray[rannum]; } onload = function() { RndText(); } var inter = setInterval(function() { RndText(); }, 2000); //-->
Any help is appreciated!Code:<div id="facts"> <div class="top"> <div class="bottom"> <div class="left"> <div class="right"> </div> </div> </div> </div> </div>
P.s.: I do not know so much about javascript. And sorry for my English.![]()


Reply With Quote
Bookmarks