[ 7 posts ]

yui-mac

  • Username: muncher
  • Joined: Sat Aug 14, 2010 3:29 pm
  • Posts: 73
  • Offline
  • Profile
Tags:

need be connected to internet to use YAHOO(Y.YUI2) ?

Post Posted: Mon Dec 06, 2010 10:22 am
+0-
My application works fine when I am connected to internet. But when not it gives error at the point where I use variable YAHOO.

something like -
var YAHOO = Y.YUI2
YAHOO.widget.....//this is where ff flags error.

Any idea ?

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: need be connected to internet to use YAHOO(Y.YUI2) ?

Post Posted: Mon Dec 06, 2010 10:32 am
+0-
Since you are locally hosting the 2in3 project, you need to setup the loader to load the files locally like you are with the 3.x source. The README in the project repository has the config you need:

https://github.com/yui/2in3/

yui-mac

  • Username: muncher
  • Joined: Sat Aug 14, 2010 3:29 pm
  • Posts: 73
  • Offline
  • Profile

Re: need be connected to internet to use YAHOO(Y.YUI2) ?

Post Posted: Mon Dec 06, 2010 11:24 am
+0-
so, does that mean, when it is connected to internet, it pulls those libs automagically ?

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile
Tags:

Re: need be connected to internet to use YAHOO(Y.YUI2) ?

Post Posted: Mon Dec 06, 2010 11:26 am
+0-
Well, it won't know the difference between being online versus being offline.. It's one or the other.. Either it loads the JS files from our CDN, or it loads them locally from your server.

yui-mac

  • Username: muncher
  • Joined: Sat Aug 14, 2010 3:29 pm
  • Posts: 73
  • Offline
  • Profile

Re: need be connected to internet to use YAHOO(Y.YUI2) ?

Post Posted: Mon Dec 06, 2010 2:17 pm
+0-
what do I put for base. I mean I have the js delivered from a server, even if not connected to internet.

below is my app structure
Code:
WebContent
|-css
|-js
  |-2in3/build/
  |-yui
  |-myApp
     |-init.js
     |-other javascripts.


YUI().use() is used in init.js.
using ../2in3/build/ for base doesnt work :(

yui-mac

  • Username: muncher
  • Joined: Sat Aug 14, 2010 3:29 pm
  • Posts: 73
  • Offline
  • Profile

Re: need be connected to internet to use YAHOO(Y.YUI2) ?

Post Posted: Thu Jan 13, 2011 5:24 am
+0-
Still not able to solve it. In firebug, when I put a breakpoint at x=0, scopeChain[1] has a YAHOO variable. Not sure what I am missing. but Y.YUI2 is undefined :(

Code:
YUI({configuration for offline use}
).use("...module list", function(Y){
    var x=0;//breakpoint here in firebug.
});

Alberto Santini

YUI Contributor

  • Offline
  • Profile

Re: need be connected to internet to use YAHOO(Y.YUI2) ?

Post Posted: Thu Jan 13, 2011 10:23 am
+0-
Hello yui-mac.

I am not sure but if "base" should be a relative or absolute path.

I second Dav's suggestion and add another config example:

http://developer.yahoo.com/yui/3/yui/#loader

Regards,
IceBox
  [ 7 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum