GithubHelp home page GithubHelp logo

Comments (2)

mlaffargue avatar mlaffargue commented on July 25, 2024

As my framework won't allow me to put specific page script in header. To load script in header I use :
var fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript")
fileref.setAttribute("src", filename)
document.getElementsByTagName("head")[0].appendChild(fileref);

Usually I put this in top of my specific page :
loadjscssfile("/jquery-ui-1.8.4.custom.min.js", "js");
loadjscssfile("/jquery-ui-timepicker-addon.js", "js");

Well I just found out that if I don't put too close the jquery-ui and datetimepicker js using :

  • setTimeout('loadjscssfile("/jquery-ui-timepicker-addon.js", "js");',10);
  • Or putting the load later in the code, the error disappear ....
    Not sure what's going on, since the timeout method seems to me kind of random (need it to be loaded not immediately but at least before I use it ...). I'll just put the load later in the code.

Is there some kind of asynchronous loading of scripts ?

from jquery-timepicker-addon.

mlaffargue avatar mlaffargue commented on July 25, 2024

Finally found out :
Using this crashes with $.datepicker being null [Using Ctrl+F5 and randomly using F5]
loadjscssfile("/jquery-ui-1.8.4.custom.min.js", "js");
loadjscssfile("/jquery-ui-timepicker-addon.js", "js");

However using this works...
<script language="javascript" src="/jquery-ui-1.8.6.custom.min.js"></script>
loadjscssfile("/jquery-ui-timepicker-addon.js", "js");

from jquery-timepicker-addon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.