Results 1 to 3 of 3

Thread: Load external script within Ext JS 4

  1. #1
    Sencha User
    Join Date
    Jul 2014

    Default Load external script within Ext JS 4

    Within Ext JS 4, I need to load D3 API. I am using the below code

    	loadScript: function(callback, scope) {		console.log('5) loadScript called');      
    		Ext.Loader.injectScriptElement('', onLoad, onError);
    	    console.log('D3 script loaded ');
        onError : function() {
    		console.log('On Error');
    	onLoad : function() {
    		console.log('On Load');'body').append('div').style('position', 'absolute').style('padding', '0 10px').style('background', 'red').style('opacity', 0);
    However, in browser console, I get the below error -

    Uncaught ReferenceError: onLoad is not defined

    Can someone please help me rectify the above code?

    Thank you.

  2. #2
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Central Ohio



    It's hard to tell from your code sample as it is incomplete and doesn't appear valid, but it appears you are trying to reference onLoad before it's defined just as the error message states. Can you post a workable example as a fiddle ( so I can work through this with you?


  3. #3
    Sencha User
    Join Date
    Jul 2014


    Thank you. This solved the problemExt.Loader.injectScriptElement('', this.onLoad, this.onError, this);

Similar Threads

  1. Loading and External script into a panel
    By damiansmith in forum Sencha Architect 2.x: Help & Discussions
    Replies: 0
    Last Post: 20 Feb 2013, 9:04 PM
  2. Load external java script files for an "item"
    By preyz in forum Sencha Touch 1.x: Discussion
    Replies: 4
    Last Post: 19 Apr 2011, 2:21 AM
  3. Include external script with javascript
    By marleone in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 8 Sep 2008, 9:42 AM
  4. Replies: 6
    Last Post: 7 May 2008, 10:31 PM
  5. How to get external script with extjs
    By psscommusic in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 6 May 2008, 5:34 PM

Tags for this Thread

Posting Permissions

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