简体   繁体   中英

JavaScript Ajax calls using YUI

Does anybody know if the order of linked external JavaScript files ever matters?. I've never known so but with YUI it seems to be the case when linking library files.

I am making HTTP get Ajax requests, using YUI and I have this HTML file and these 4 files linked (last is my Ajax file and the first 3 are library files from the framework downloaded from the build folder)...

<html>

  <head>

    <title>Ajax get page with YUI........</title>

    <script src="yahoo-min.js"></script>
    <script src="event-min.js"></script> 
    <script src="connection-min.js"></script>
    <script src="ajax.js"></script>  

  </head>

  <body>

  <h3>Mike's Wednesday Ajax get page........</h3>

      <div id="info">
    This text will be replaced by Ajax dynamically........
  </div>

   </body>
 </html>

If I link the library files in any other order, the call fails and I get errors. I'm just wondering as new to Ajax and YUI and as I've said, I've never experienced this before.

Thanks in advance.

If you stick with YUI 2, I would advice you to use the dependency configurator there: http://developer.yahoo.com/yui/articles/hosting/

It will tell you what files to include and in what order.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM