How to load jqtouch on-demand
Posted
by Jayson P.
on Stack Overflow
See other posts from Stack Overflow
or by Jayson P.
Published on 2010-03-30T07:07:21Z
Indexed on
2010/03/30
7:13 UTC
Read the original article
Hit count: 729
I'm trying to load jqtouch on-demand like so:
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
$(function() {
$.getScript("js/jqtouch.min.js", function() {
$.jQTouch();
});
});
</script>
Firebug outputs: $(_3c.selector).tap is not a function
If I include jqtouch.min.js in a script, like I did for jquery.js and call $.jQtouch, everything will work correctly. However, I'd like to load jqtouch only when I need to, however I can't seem to get it to work. I also tried doing an ajax post to jqtouch.min.js and received the same error.
© Stack Overflow or respective owner