I have two pages one is the main page and the another one is the inner page:
Page names: main.jsp , sidebar.jsp
I want to call the onload function on both of these pages. Is that possible. If yes How?
Below is the code for main.jsp:
<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
<%@ include file=/pages/common/init.jsp%>
<%@ taglib prefix=sx uri=/struts-dojo-tags%>
<html xmlns=http://www.w3.org/1999/xhtml lang=en xml:lang=en>
<head>
<title>J.C. Taylor - Broker Website</title>
<meta http-equiv=content-type content=text/html;charset=utf-8 />
<link rel=stylesheet href=/css/default.css media=screen type=text/css />
</head>
<body onload=prepopulateFields();load(17);>
<s:form name=continue id=continue_id action=continue method=POST validate=true enctype=multipart/form-data>
<div id=wrapper>
<div id=main>
<div id=sidebar>
<%@ include file=/pages/common/sidebar.jsp%>
<span class=clearIt></span>
</div>
The sidebar.jsp is:
<body onload=setSelected();>
//Some static content here
</body>
So Basically I want is to call prepopulateFields() Javascript method which belongs to onload() event of the main .jsp page and setSelected() which belongs to onload() method of the sidebar.jsp symulatneously and separately.
I know I can call the setSelected(); method inside the prepopulateFields() method but that I dont want to do. All I want is when the page is loaded both the onload functions should be called separately.
If you have some suggestions please do let me know!
I know I am being little bit ridiculous here but if I could do that My job will be very easy.