Problem using jQuery.load to include file contents.

30 views
Skip to first unread message

BTR Naidu

unread,
Nov 18, 2011, 6:29:36 AM11/18/11
to Google App Engine
Dear Friends,

I am facing some issues for which I could not find solution so far.
Did lot of search and tried many things. But no use.

I have a GAE app www.flexlmonline.com where I want to modularize the
entire website code. For this, I have copied the footer into a
separate file and trying to load it dynamically using the below code.

index.html has the code snippet:
<script type="text/javascript" src="js/jquery.form.js"></script>
<script type="text/javascript" src="js/gui.js"></script>
<div class="footerCont">
<span class="copy" id="crights"></span>
</div>

My gui.js has below code:
$(document).ready(function() {
$("#crights").load("footer.html");
}

The file footer.html is located in the same place where the index.html
file is. When I test this setup, I see the index.html getting
rendered and then at the end of loading the entire page goes blank.

The "Inspect element" in Developer Tools of chrome tells error like
'Uncaught TypeError: const 'request' has already been declared'.
Aparantly the jQuery.load is causing this error. If I disable that
line of code, the page loads normally.

Please help me if I am missing something causing this error? Of is
there a better way to modularize my website code?

Many thanks in advance.
BTR Naidu
www.btrnaidu.com
Reply all
Reply to author
Forward
0 new messages