ZafarAbid
asked on
JavaScript Onload Code
Hi,
I am using ASP for a page, where I load a list of videos from db... listing of videos and when you click them, they play properly but the first video does not load automatically... I want to load the first video from db when the page loads in the browser for the first time.
I have pasted the code below, I hope this helps you understand my question.
Regards,
Zafar
I am using ASP for a page, where I load a list of videos from db... listing of videos and when you click them, they play properly but the first video does not load automatically... I want to load the first video from db when the page loads in the browser for the first time.
I have pasted the code below, I hope this helps you understand my question.
Regards,
Zafar
Code Chunk 1:
////////////////////////
<li style="margin-right:0px; padding-right:0px; margin-bottom:0px; padding-bottom:0px; " >
<A id="vlist<%=cnt%>" HREF="#" STYLE="text-decoration:none; padding-right:0px; margin-right:0px; " onclick='javascript:new_video(s1,"<%=vid_url%>","<%=RS2("VIDEO_TITLE")%>","<%=RS2("VIDEO_DESCRIPTION")%>",<%=cnt%>)' onMouseOver="this.style.cursor='hand';vidOn(<%=cnt%>);" onmouseout="vidOff(<%=cnt%>);" ><%=RS2("VIDEO_TITLE")%>
</A>
</li>
///////////////////////////////////
The function: Code Chunk 2:
///////////////////////////////////
function new_video(s1,vid_name,vid_title,vid_des,vlist) {
s1.addVariable("FlashVars","&bgColor=0xFFFFFF&serverName=NAME_OF_THE_SERVER" + vid_name);
s1.write("player1");
if (crtList != 0) {
document.getElementById("vlist" + crtList).style.backgroundColor = "#E2E2E2";
}
crtList = vlist;
if (crtList != 0) {
document.getElementById("vlist" + crtList).style.backgroundColor = "#D4D4D4";
}
}
///////////////////////////////////
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you. :)
You can treat the sql and db code as being seperate to the body of the document. You shouldn't have to move it.
null
null
ASKER
Do you suggest moving all that code at the top? or how should I deal with this situation?
Regards,
Zafar