Jquery easyui easyloader fails to load external js files

Source: Internet
Author: User

When easyloader loads an external js file, although the callback function is successfully called, The js file cannot be loaded. The solution is as follows: Find easyload. open the js file and change the script to this in red; var _ 8 = document. createElement ("script"); _ 8. type = "text/javascript"; _ 8. language = "javascript"; _ 8.src= _ 5; _ 8. onload = _ 8. onreadystatechange = function () {if (! _ 7 &&(! This. readyState | this. readyState = "loaded" | this. readyState = "complete") {_ 7 = true; this. onload = this. onreadystatechange = null; if (_ 6) {_ 6. call (_ 8) ;}}; note that the external js file to be loaded must start. js end, otherwise it will not be loaded. // Custom js module call Method 1: easyloader. modules = $. extend ({}, {"baseUI": {js: '<% = basePath %> struts/baseui. js', css: '<% = basePath %>/struts/themes/default/easyui.css'}, easyloader. modules); easyloader. locale = "zh_CN"; easyloader. load (['layout ', 'tabs', 'messager', 'portal ', 'baseuis'], function () {alert ("OK ");}); method 2: using ("<% = basePath %> struts/baseui. js ", function () {alert (" OK ");});

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.