Hello,

I have two pages in coldfusion but basically I am dealing with JavaScript and jQuery. So, here's my question:

FYI: I am using TinyMCE 4.0.8 version

Please consider the following scenario:

Page 1:

I have the following piece of code on page 1:

Code:
<div id="templatesWrap">
    <div class="template" data-templatelocation="templateone" data-templatename="Template ONE" data-templateid="" >
     <div class="templateContainer">
     <span>
      <a href="Here I have specified URL to Page 2" title="Use Template" class = "button secondary" id = "temp1">
<img class="thumbnail" src="templatefiles/thumbnail_010.jpg" alt="templateone">
    </a>
    </span>
        <div class="templateName">Template ONE</div>
                <p>
        <a href="https://app.abc.com/pqr/core/compose/message/create?token=c1564e8e3cd11bc4t546b587jan31&amp;sMessageTemplateId=templateone&amp;sHubId=&amp;goalComplete=200" title="Use Template" class="button secondary">Use Template</a>
                </p>
        </div>
    </div>




  <div class="template" data-templatelocation="templatetwo" data-templatename="Template TWO" data-templateid="" >
    <div class="templateContainer">
    <span>
     <a href="https://app.abc.com/pqr/core/compose/message/create?token=c1564e8e3cd11bc4t546b587jan31&amp;sMessageTemplateId=templatetwo&amp;sHubId=&amp;goalComplete=200" title="Use Template">
    <img class="thumbnail" src="templatefiles/thumbnail_011.jpg" alt="templatetwo">
    </a>
    </span>
    <div class="templateName">Template TWO</div>
    <p>
    <a href="https://app.abc.com/pqr/core/compose/message/create?token=c1564e8e3cd11bc4t546b587jan31&amp;sMessageTemplateId=templatetwo&amp;sHubId=&amp;goalComplete=200" title="Use Template" class="button secondary">Use Template</a>
    </p>
    </div>
</div>

So, basically when a user clicks on "Use Template" button, it should not only take the user onto next page (Page 2) where the editor is defined but also load the template into the editor.
Here is what I am doing on Page 2:

Page 2

I have specified the first two script tags here as follows:

Code:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
Code:
<script>
$("#temp1").click(function() {
    $("#sTextBody").load("FolderURL/template.html");
});
</script>

When I click on "User Template" button on Page 1, it's just letting me to next page and not loading the template into the editor.

Am I doing something wrong here? Please advise.

P.S. The problem I feel is somehow the click function on Page 2 is not getting activated with the temp1 id button mentioned on Page 1.

Thanks