+ Start a Discussion
Ganesh BabuGanesh Babu 

Using Component in Javascript/Jquery

Hello All,

When i try to append a div tag which contains a component, Javascript is not working.
I am trying to display components as header and footer over a div.

I have pasted my code and please check it and tell me what is the issue.

 
mydiv = $('<div id="somediv" class="somediv"></div>');
             mydiv1 = $('<br/>');
             alert('1');
             footerdiv = $('<div id="somediv2" class="header1"><c:Template_Header /></div>');
            alert('3');
            headerdiv = $('<div id="header_next" class="footer1"><c:Template_Header /></div>');     
            alert('2');
             
            alert('4');
            mydiv1.appendTo('body');
            headerdiv.droppable().appendTo('body');
            mydiv.droppable().appendTo('body');
            footerdiv.droppable().appendTo('body');
Sometimes, footerdiv is working and it is not executing after headerdiv.

Thanks in Advance,

Regards,
Ganesh.B
srilakshmi1.387861669756762E12srilakshmi1.387861669756762E12
i think div is html tab ,it may not work on java script
Ganesh BabuGanesh Babu
No It is working if i remove component from div tag.
srilakshmi1.387861669756762E12srilakshmi1.387861669756762E12
it is for adding header and footer for every visual force page ,if it is useful gothrough onces otherwise leave it
<apex:page renderAs="pdf" controller="accmulpdf">

<head>

<style type="text/css">
@page {
    size: 18.0cm 29.7cm;
    margin-top: 2.0cm;
    margin-left: 1.5cm;
    margin-right: 1.5cm;
    margin-bottom: 2cm;
}
div.header {position: running(header)}
div.footer {position: running(footer)}
@page{
         @top-center {content: element(header)}
         @bottom-center {content: element(footer)}
     }   
</style>
</head>
<div class="header">
    <apex:image value="{!$Resource.tvarana_logo}" width="120" height="50"/>
</div>
<div class="footer" align="right">
    Date:<apex:outputText value="{!NOW()}"/>
</div>
<h1>
    <table border="1">
   
    <apex:repeat value="{!acc}" var="a">
    <tr>
        <td>{!a.id}</td>
        <td>{!a.name}</td>
    </tr>
    </apex:repeat>
   
   
    </table>

</h1>

</apex:page> 
srilakshmi1.387861669756762E12srilakshmi1.387861669756762E12
to work this chance vf page version to 26.0