[ 2 posts ]

Merlin

  • Username: Teonnyn
  • Joined: Wed Feb 24, 2010 6:53 pm
  • Posts: 5
  • Offline
  • Profile

Input/Output Issues - Transfering on Drop

Post Posted: Fri Feb 26, 2010 12:50 am
+0-
After a day's worth of work I finally have my system partially working. A test drop section has been set up and is active, it identifies hits and drops correctly. However, I am now trying to get IO working.

For the YUI Instance, I have this set up: YUI().use('dd', function(Y) {

Drag, and Drop / Hit Detection works.

I have set up a script that identifies a specific variable needed for the system in the name of the node, and turns it into a JS variable.

Snippet

Click here to see the revision history on this Gist.

Most of this is taken directly from the examples and modified slightly. However, the IO transfer fails to work. What needs to happen is this - when a user drops a dragged node on the drop target, it should trigger the IO to send the related variable to the page it's on through POST. The page will then read the variable in PHP and do something with it depending on what it actually says.

Checking in Firebug, the debugger reports "Y.io is not a function"

What am I doing wrong?

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: Input/Output Issues - Transfering on Drop

Post Posted: Sat Feb 27, 2010 9:37 am
+0-
You need to use IO:

Code:
YUI().use('io', 'dd', function(Y) {


This line will also fail:
Code:
data: "ID=dNum&first=yes",


It should be this:
Code:
data: "ID=" + dNum + "&first=yes",


Javascript is not like PHP, variables aren't parsed from strings.
  [ 2 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