Results 1 to 2 of 2

Thread: Call JS from another JS ....

  1. #1
    Sencha User
    Join Date
    Mar 2011
    Vote Rating

    Default Call JS from another JS ....

    In my project, say on click on one button, I need to show a new page (like ahref) ..

    So I have written a below click event of the button in one JS file ...
    this.body.on('click', function(){window.location.href="overhaul_inshop.html"});

    But, I read that as per Sencha norms, one should have only main HTML file and other files should be only JS ...

    Even in my project, I have overhaul_inshop.js file which does all operations. But, how can I give the linking now to that JS ... If it is HTML, I can call like above code ... pls advice . Thanks.

  2. #2
    Touch Premium Member
    Join Date
    Sep 2008
    Orange County, CA, USA
    Vote Rating

    Lightbulb Call JS

    <!-- Application JS -->
    <script type="text/javascript" src="js/common.js"></script>
    <script type="text/javascript" src="js/Application.js"></script>
    In common.js you put something like...
    function include(file) {
        if (document.createElement && document.getElementsByTagName) {
            var head = document.getElementsByTagName('head')[0];
            var script = document.createElement('script');
            script.setAttribute('type', 'text/javascript');
            script.setAttribute('src', file);

Similar Threads

  1. How do I call?
    By Riaz in forum Sencha Touch 1.x: Q&A
    Replies: 2
    Last Post: 14 Sep 2011, 12:41 AM
  2. How can I call?
    By Riaz in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 24 Mar 2011, 4:43 AM
  3. Could I create "Call" button that will cause Iphone to make a call?
    By lexer in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 12 Nov 2010, 8:11 AM
  4. Ext.get call
    By febus in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 31 Aug 2009, 2:20 PM
  5. Call Ext.extend function from
    By adelphus in forum Ext 2.x: Help & Discussion
    Replies: 17
    Last Post: 3 Jun 2008, 1:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts