I asked the other day about this problem but haven''t received a response. Trying again: I just downloaded 1.6 and can''t get a simple draggable to work, which is weird. I know it''s not my browser since the demos are working. Here is my simple code. I''ve also had the "new Draggable" between the select tags. Didn''t change anything. <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <script src="/javascripts/prototype.js" type="text/javascript"></script> <script src="/javascripts/scriptaculous.js" type="text/javascript"></script> <script src="/javascripts/dragdrop.js" type="text/javascript"></script> <script type="text/javascript">new Draggable(''ele123'')</script> ..................... <body> <div id="palette"> <select name="select1" size="5" id="ele123"> <option value="1">Blue</option> <option value="2">Red</option> <option value="3">Orange</option> <option value="4">Green</option> <option value="5">Aquamarine</option> </select> </div> </body> Stuart
You need to put the script that creates the draggable below the element you want to be draggable. Pages are parsed sequentially by browsers, so your javascript is being evaluated in the HEAD, long before the element you are trying to reference has been built by the browser. I''m surprised you aren''t seeing javascript errors galore. The alternative is to create the draggable in an onload event, but that is not evaluated until all images are loaded (this was a topic of discussion last week, and there is a complex workaround, so look at the archives for more info if you want). New to Javascript? Greg> -----Original Message----- > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org[mailto:rails-spinoffs-> bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Dark Ambient > Sent: Friday, June 23, 2006 2:12 PM > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: [Rails-spinoffs] Help please-draggable > > I asked the other day about this problem but haven''t received aresponse.> > Trying again: > > I just downloaded 1.6 and can''t get a simple draggable to work, which > is weird. I know it''s not my browser since the demos are working. > Here is my simple code. I''ve also had the "new Draggable" between > the select tags. Didn''t change anything. > > <head> > <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />> <script src="/javascripts/prototype.js"type="text/javascript"></script>> <script src="/javascripts/scriptaculous.js" > type="text/javascript"></script> > <script src="/javascripts/dragdrop.js"type="text/javascript"></script>> <script type="text/javascript">new Draggable(''ele123'')</script> > ..................... > > <body> > > <div id="palette"> > > <select name="select1" size="5" id="ele123"> > <option value="1">Blue</option> > <option value="2">Red</option> > <option value="3">Orange</option> > <option value="4">Green</option> > <option value="5">Aquamarine</option> > </select> > </div> > > </body> > > Stuart > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Very new to "coding" javascript. I''ve moved the script below the </select> on top of that, under the <select>, outside of the div , very odd. The only error I get from FF java console is "Draggable is not defined" IE also reports there are script errors in the page. This is script - I think it''s right, I''d like to move on to options. <script type="text/javascript">new Draggable(''ele123'', {revert:true})</script> Stuart On 6/23/06, Gregory Hill <Gregory_Hill-l9nu40+TWxQ@public.gmane.org> wrote:> You need to put the script that creates the draggable below the element > you want to be draggable. Pages are parsed sequentially by browsers, so > your javascript is being evaluated in the HEAD, long before the element > you are trying to reference has been built by the browser. I''m > surprised you aren''t seeing javascript errors galore. The alternative > is to create the draggable in an onload event, but that is not evaluated > until all images are loaded (this was a topic of discussion last week, > and there is a complex workaround, so look at the archives for more info > if you want). > > New to Javascript? > > Greg > > > -----Original Message----- > > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > [mailto:rails-spinoffs- > > bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Dark Ambient > > Sent: Friday, June 23, 2006 2:12 PM > > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > Subject: [Rails-spinoffs] Help please-draggable > > > > I asked the other day about this problem but haven''t received a > response. > > > > Trying again: > > > > I just downloaded 1.6 and can''t get a simple draggable to work, which > > is weird. I know it''s not my browser since the demos are working. > > Here is my simple code. I''ve also had the "new Draggable" between > > the select tags. Didn''t change anything. > > > > <head> > > <meta http-equiv="Content-Type" content="text/html; > charset=iso-8859-1" /> > > <script src="/javascripts/prototype.js" > type="text/javascript"></script> > > <script src="/javascripts/scriptaculous.js" > > type="text/javascript"></script> > > <script src="/javascripts/dragdrop.js" > type="text/javascript"></script> > > <script type="text/javascript">new Draggable(''ele123'')</script> > > ..................... > > > > <body> > > > > <div id="palette"> > > > > <select name="select1" size="5" id="ele123"> > > <option value="1">Blue</option> > > <option value="2">Red</option> > > <option value="3">Orange</option> > > <option value="4">Green</option> > > <option value="5">Aquamarine</option> > > </select> > > </div> > > > > </body> > > > > Stuart > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
This is driving me absolutely crazy :). The scripts are all in /javascripts. I''ve made sure that all the links are correct. Also moved the script for the draggable right below the </select> tag. <div id="palette"> <select name="select" size="5" id="ele123"> <option value="1">Blue</option> <option value="2">Red</option> <option value="3">Orange</option> <option value="4">Green</option> <option value="5">Aquamarine</option> </select> <script type="text/javascript" language="javascript"> new Draggable(''ele123'', {revert:true})</script> </div> I''ve run plenty of javascript off my host server so I know that can''t be the problem. The drag and drop run in neither FF or IE6. Neither of them are throwing any messages. Stuart On 6/23/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Very new to "coding" javascript. > > I''ve moved the script below the </select> on top of that, under the > <select>, outside of the div , very odd. The only error I get from FF > java console is "Draggable is not defined" IE also reports there are > script errors in the page. > > This is script - I think it''s right, I''d like to move on to options. > <script type="text/javascript">new Draggable(''ele123'', {revert:true})</script> > > Stuart > > > On 6/23/06, Gregory Hill <Gregory_Hill-l9nu40+TWxQ@public.gmane.org> wrote: > > You need to put the script that creates the draggable below the element > > you want to be draggable. Pages are parsed sequentially by browsers, so > > your javascript is being evaluated in the HEAD, long before the element > > you are trying to reference has been built by the browser. I''m > > surprised you aren''t seeing javascript errors galore. The alternative > > is to create the draggable in an onload event, but that is not evaluated > > until all images are loaded (this was a topic of discussion last week, > > and there is a complex workaround, so look at the archives for more info > > if you want). > > > > New to Javascript? > > > > Greg > > > > > -----Original Message----- > > > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > [mailto:rails-spinoffs- > > > bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Dark Ambient > > > Sent: Friday, June 23, 2006 2:12 PM > > > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > Subject: [Rails-spinoffs] Help please-draggable > > > > > > I asked the other day about this problem but haven''t received a > > response. > > > > > > Trying again: > > > > > > I just downloaded 1.6 and can''t get a simple draggable to work, which > > > is weird. I know it''s not my browser since the demos are working. > > > Here is my simple code. I''ve also had the "new Draggable" between > > > the select tags. Didn''t change anything. > > > > > > <head> > > > <meta http-equiv="Content-Type" content="text/html; > > charset=iso-8859-1" /> > > > <script src="/javascripts/prototype.js" > > type="text/javascript"></script> > > > <script src="/javascripts/scriptaculous.js" > > > type="text/javascript"></script> > > > <script src="/javascripts/dragdrop.js" > > type="text/javascript"></script> > > > <script type="text/javascript">new Draggable(''ele123'')</script> > > > ..................... > > > > > > <body> > > > > > > <div id="palette"> > > > > > > <select name="select1" size="5" id="ele123"> > > > <option value="1">Blue</option> > > > <option value="2">Red</option> > > > <option value="3">Orange</option> > > > <option value="4">Green</option> > > > <option value="5">Aquamarine</option> > > > </select> > > > </div> > > > > > > </body> > > > > > > Stuart > > > _______________________________________________ > > > Rails-spinoffs mailing list > > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >
If you are still seeing the "Draggable not defined" message, that most likely means it cant find the draggable javascript function that you are calling with the "new Draggable" call... are you able to reference any js functions defined in prototype using the paths you listed above? maybe try removing the leading "/" that you have in front of your path to the js files to make it read "javascript/..." instead of "/javascript/..." good luck! BD On 6/23/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > This is driving me absolutely crazy :). The scripts are all in > /javascripts. > I''ve made sure that all the links are correct. > Also moved the script for the draggable right below the </select> tag. > > <div id="palette"> > > > <select name="select" size="5" id="ele123"> > <option value="1">Blue</option> > <option value="2">Red</option> > <option value="3">Orange</option> > <option value="4">Green</option> > <option value="5">Aquamarine</option> > > </select> > <script type="text/javascript" language="javascript"> new > Draggable(''ele123'', {revert:true})</script> > </div> > > I''ve run plenty of javascript off my host server so I know that can''t > be the problem. The drag and drop run in neither FF or IE6. Neither > of them are throwing any messages. > > Stuart > > On 6/23/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Very new to "coding" javascript. > > > > I''ve moved the script below the </select> on top of that, under the > > <select>, outside of the div , very odd. The only error I get from FF > > java console is "Draggable is not defined" IE also reports there are > > script errors in the page. > > > > This is script - I think it''s right, I''d like to move on to options. > > <script type="text/javascript">new Draggable(''ele123'', > {revert:true})</script> > > > > Stuart > > > > > > On 6/23/06, Gregory Hill <Gregory_Hill-l9nu40+TWxQ@public.gmane.org> wrote: > > > You need to put the script that creates the draggable below the > element > > > you want to be draggable. Pages are parsed sequentially by browsers, > so > > > your javascript is being evaluated in the HEAD, long before the > element > > > you are trying to reference has been built by the browser. I''m > > > surprised you aren''t seeing javascript errors galore. The alternative > > > is to create the draggable in an onload event, but that is not > evaluated > > > until all images are loaded (this was a topic of discussion last week, > > > and there is a complex workaround, so look at the archives for more > info > > > if you want). > > > > > > New to Javascript? > > > > > > Greg > > > > > > > -----Original Message----- > > > > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > [mailto:rails-spinoffs- > > > > bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Dark Ambient > > > > Sent: Friday, June 23, 2006 2:12 PM > > > > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > Subject: [Rails-spinoffs] Help please-draggable > > > > > > > > I asked the other day about this problem but haven''t received a > > > response. > > > > > > > > Trying again: > > > > > > > > I just downloaded 1.6 and can''t get a simple draggable to work, > which > > > > is weird. I know it''s not my browser since the demos are working. > > > > Here is my simple code. I''ve also had the "new Draggable" between > > > > the select tags. Didn''t change anything. > > > > > > > > <head> > > > > <meta http-equiv="Content-Type" content="text/html; > > > charset=iso-8859-1" /> > > > > <script src="/javascripts/prototype.js" > > > type="text/javascript"></script> > > > > <script src="/javascripts/scriptaculous.js" > > > > type="text/javascript"></script> > > > > <script src="/javascripts/dragdrop.js" > > > type="text/javascript"></script> > > > > <script type="text/javascript">new Draggable(''ele123'')</script> > > > > ..................... > > > > > > > > <body> > > > > > > > > <div id="palette"> > > > > > > > > <select name="select1" size="5" id="ele123"> > > > > <option value="1">Blue</option> > > > > <option value="2">Red</option> > > > > <option value="3">Orange</option> > > > > <option value="4">Green</option> > > > > <option value="5">Aquamarine</option> > > > > </select> > > > > </div> > > > > > > > > </body> > > > > > > > > Stuart > > > > _______________________________________________ > > > > Rails-spinoffs mailing list > > > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > _______________________________________________ > > > Rails-spinoffs mailing list > > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
I''m no longer getting ANY error messages on the draggable. I also had thrown in a visual effect on a jpg and that gave me an error (can''t remember exactly, but something like "properties not defined" which is good in a way because (using FF) I can click the link in the javascript console and bring up the scriptaclus.js to show me the line where the conflict is happening. I''m assuming (maybe a mistake) that this means it''s finding the correct path. But,before I really get into effects and learning more options, I''d like to figure out why the draggable won''t work. I''m not even getting crosshairs. Another option I tried, thinking maybe there was something wonky with form elements is I created a label to act as a handle, that didn''t work either. I had the element in a div and thought maybe that was causing an issue. Again, no change in the draggable. I looked at the shopping cart demo and my code is very similar to the draggables there so ..... Stuart p.s btw , I know it''s got to be something I''m doing wrong. I just can''t figure out what it is. On 6/24/06, Brian Dinsmore <bdinsmor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> If you are still seeing the "Draggable not defined" message, that most > likely means it cant find the draggable javascript function that you are > calling with the "new Draggable" call... are you able to reference any js > functions defined in prototype using the paths you listed above? maybe try > removing the leading "/" that you have in front of your path to the js files > to make it read "javascript/..." instead of "/javascript/..." > > good luck! > > BD > > > On 6/23/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > This is driving me absolutely crazy :). The scripts are all in > /javascripts. > > I''ve made sure that all the links are correct. > > Also moved the script for the draggable right below the </select> tag. > > > > <div id="palette"> > > > > > > <select name="select" size="5" id="ele123"> > > <option value="1">Blue</option> > > <option value="2">Red</option> > > <option value="3">Orange</option> > > <option value="4">Green</option> > > <option value="5">Aquamarine</option> > > > > </select> > > <script type="text/javascript" language="javascript"> new > > Draggable(''ele123'', {revert:true})</script> > > </div> > > > > I''ve run plenty of javascript off my host server so I know that can''t > > be the problem. The drag and drop run in neither FF or IE6. Neither > > of them are throwing any messages. > > > > Stuart > > > > On 6/23/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Very new to "coding" javascript. > > > > > > I''ve moved the script below the </select> on top of that, under the > > > <select>, outside of the div , very odd. The only error I get from FF > > > java console is "Draggable is not defined" IE also reports there are > > > script errors in the page. > > > > > > This is script - I think it''s right, I''d like to move on to options. > > > <script type="text/javascript">new Draggable(''ele123'', > {revert:true})</script> > > > > > > Stuart > > > > > > > > > On 6/23/06, Gregory Hill < Gregory_Hill-l9nu40+TWxQ@public.gmane.org> wrote: > > > > You need to put the script that creates the draggable below the > element > > > > you want to be draggable. Pages are parsed sequentially by browsers, > so > > > > your javascript is being evaluated in the HEAD, long before the > element > > > > you are trying to reference has been built by the browser. I''m > > > > surprised you aren''t seeing javascript errors galore. The alternative > > > > is to create the draggable in an onload event, but that is not > evaluated > > > > until all images are loaded (this was a topic of discussion last week, > > > > and there is a complex workaround, so look at the archives for more > info > > > > if you want). > > > > > > > > New to Javascript? > > > > > > > > Greg > > > > > > > > > -----Original Message----- > > > > > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > [mailto:rails-spinoffs- > > > > > bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Dark Ambient > > > > > Sent: Friday, June 23, 2006 2:12 PM > > > > > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > > Subject: [Rails-spinoffs] Help please-draggable > > > > > > > > > > I asked the other day about this problem but haven''t received a > > > > response. > > > > > > > > > > Trying again: > > > > > > > > > > I just downloaded 1.6 and can''t get a simple draggable to work, > which > > > > > is weird. I know it''s not my browser since the demos are working. > > > > > Here is my simple code. I''ve also had the "new Draggable" between > > > > > the select tags. Didn''t change anything. > > > > > > > > > > <head> > > > > > <meta http-equiv="Content-Type" content="text/html; > > > > charset=iso-8859-1" /> > > > > > <script src="/javascripts/prototype.js" > > > > type="text/javascript"></script> > > > > > <script src="/javascripts/scriptaculous.js" > > > > > type="text/javascript"></script> > > > > > <script src="/javascripts/dragdrop.js" > > > > type="text/javascript"></script> > > > > > <script type="text/javascript">new Draggable(''ele123'')</script> > > > > > ..................... > > > > > > > > > > <body> > > > > > > > > > > <div id="palette"> > > > > > > > > > > <select name="select1" size="5" id="ele123"> > > > > > <option value="1">Blue</option> > > > > > <option value="2">Red</option> > > > > > <option value="3">Orange</option> > > > > > <option value="4">Green</option> > > > > > <option value="5">Aquamarine</option> > > > > > </select> > > > > > </div> > > > > > > > > > > </body> > > > > > > > > > > Stuart > > > > > _______________________________________________ > > > > > Rails-spinoffs mailing list > > > > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > _______________________________________________ > > > > Rails-spinoffs mailing list > > > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >
I should mention one more piece of information. Under my root folder (public_html) I have one folder called javascripts (where prototype and scriptaculus lives, plus all the individual js files) I also have another folder called includes, within the includes folder are sub folders that contain som js files. I don''t think this should be a conflict as they exist and are called to seperately but thought it was worth mentioning. Stuart On 6/24/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m no longer getting ANY error messages on the draggable. I also had > thrown in a visual effect on a jpg and that gave me an error (can''t > remember exactly, but something like "properties not defined" which > is good in a way because (using FF) I can click the link in the > javascript console and bring up the scriptaclus.js to show me the line > where the conflict is happening. I''m assuming (maybe a mistake) that > this means it''s finding the correct path. > > But,before I really get into effects and learning more options, I''d > like to figure out why the draggable won''t work. I''m not even getting > crosshairs. Another option I tried, thinking maybe there was > something wonky with form elements is I created a label to act as a > handle, that didn''t work either. > > I had the element in a div and thought maybe that was causing an > issue. Again, no change in the draggable. I looked at the shopping > cart demo and my code is very similar to the draggables there so ..... > > Stuart > > p.s btw , I know it''s got to be something I''m doing wrong. I just > can''t figure out what it is. > > On 6/24/06, Brian Dinsmore <bdinsmor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > If you are still seeing the "Draggable not defined" message, that most > > likely means it cant find the draggable javascript function that you are > > calling with the "new Draggable" call... are you able to reference any js > > functions defined in prototype using the paths you listed above? maybe try > > removing the leading "/" that you have in front of your path to the js files > > to make it read "javascript/..." instead of "/javascript/..." > > > > good luck! > > > > BD > > > > > > On 6/23/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > This is driving me absolutely crazy :). The scripts are all in > > /javascripts. > > > I''ve made sure that all the links are correct. > > > Also moved the script for the draggable right below the </select> tag. > > > > > > <div id="palette"> > > > > > > > > > <select name="select" size="5" id="ele123"> > > > <option value="1">Blue</option> > > > <option value="2">Red</option> > > > <option value="3">Orange</option> > > > <option value="4">Green</option> > > > <option value="5">Aquamarine</option> > > > > > > </select> > > > <script type="text/javascript" language="javascript"> new > > > Draggable(''ele123'', {revert:true})</script> > > > </div> > > > > > > I''ve run plenty of javascript off my host server so I know that can''t > > > be the problem. The drag and drop run in neither FF or IE6. Neither > > > of them are throwing any messages. > > > > > > Stuart > > > > > > On 6/23/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Very new to "coding" javascript. > > > > > > > > I''ve moved the script below the </select> on top of that, under the > > > > <select>, outside of the div , very odd. The only error I get from FF > > > > java console is "Draggable is not defined" IE also reports there are > > > > script errors in the page. > > > > > > > > This is script - I think it''s right, I''d like to move on to options. > > > > <script type="text/javascript">new Draggable(''ele123'', > > {revert:true})</script> > > > > > > > > Stuart > > > > > > > > > > > > On 6/23/06, Gregory Hill < Gregory_Hill-l9nu40+TWxQ@public.gmane.org> wrote: > > > > > You need to put the script that creates the draggable below the > > element > > > > > you want to be draggable. Pages are parsed sequentially by browsers, > > so > > > > > your javascript is being evaluated in the HEAD, long before the > > element > > > > > you are trying to reference has been built by the browser. I''m > > > > > surprised you aren''t seeing javascript errors galore. The alternative > > > > > is to create the draggable in an onload event, but that is not > > evaluated > > > > > until all images are loaded (this was a topic of discussion last week, > > > > > and there is a complex workaround, so look at the archives for more > > info > > > > > if you want). > > > > > > > > > > New to Javascript? > > > > > > > > > > Greg > > > > > > > > > > > -----Original Message----- > > > > > > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > > [mailto:rails-spinoffs- > > > > > > bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Dark Ambient > > > > > > Sent: Friday, June 23, 2006 2:12 PM > > > > > > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > > > Subject: [Rails-spinoffs] Help please-draggable > > > > > > > > > > > > I asked the other day about this problem but haven''t received a > > > > > response. > > > > > > > > > > > > Trying again: > > > > > > > > > > > > I just downloaded 1.6 and can''t get a simple draggable to work, > > which > > > > > > is weird. I know it''s not my browser since the demos are working. > > > > > > Here is my simple code. I''ve also had the "new Draggable" between > > > > > > the select tags. Didn''t change anything. > > > > > > > > > > > > <head> > > > > > > <meta http-equiv="Content-Type" content="text/html; > > > > > charset=iso-8859-1" /> > > > > > > <script src="/javascripts/prototype.js" > > > > > type="text/javascript"></script> > > > > > > <script src="/javascripts/scriptaculous.js" > > > > > > type="text/javascript"></script> > > > > > > <script src="/javascripts/dragdrop.js" > > > > > type="text/javascript"></script> > > > > > > <script type="text/javascript">new Draggable(''ele123'')</script> > > > > > > ..................... > > > > > > > > > > > > <body> > > > > > > > > > > > > <div id="palette"> > > > > > > > > > > > > <select name="select1" size="5" id="ele123"> > > > > > > <option value="1">Blue</option> > > > > > > <option value="2">Red</option> > > > > > > <option value="3">Orange</option> > > > > > > <option value="4">Green</option> > > > > > > <option value="5">Aquamarine</option> > > > > > > </select> > > > > > > </div> > > > > > > > > > > > > </body> > > > > > > > > > > > > Stuart > > > > > > _______________________________________________ > > > > > > Rails-spinoffs mailing list > > > > > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > _______________________________________________ > > > > > Rails-spinoffs mailing list > > > > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > > > > > > _______________________________________________ > > > Rails-spinoffs mailing list > > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > >
Well (and I know my multiple post are geting to be a pain..sorry) I''m back to getting "Draggable is not defined" . I moved the files, dropped the leading /, and made sure the server had the same paths. Stuart On 6/24/06, Brian Dinsmore <bdinsmor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> If you are still seeing the "Draggable not defined" message, that most > likely means it cant find the draggable javascript function that you are > calling with the "new Draggable" call... are you able to reference any js > functions defined in prototype using the paths you listed above? maybe try > removing the leading "/" that you have in front of your path to the js files > to make it read "javascript/..." instead of "/javascript/..." > > good luck! > > BD > > > On 6/23/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > This is driving me absolutely crazy :). The scripts are all in > /javascripts. > > I''ve made sure that all the links are correct. > > Also moved the script for the draggable right below the </select> tag. > > > > <div id="palette"> > > > > > > <select name="select" size="5" id="ele123"> > > <option value="1">Blue</option> > > <option value="2">Red</option> > > <option value="3">Orange</option> > > <option value="4">Green</option> > > <option value="5">Aquamarine</option> > > > > </select> > > <script type="text/javascript" language="javascript"> new > > Draggable(''ele123'', {revert:true})</script> > > </div> > > > > I''ve run plenty of javascript off my host server so I know that can''t > > be the problem. The drag and drop run in neither FF or IE6. Neither > > of them are throwing any messages. > > > > Stuart > > > > On 6/23/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Very new to "coding" javascript. > > > > > > I''ve moved the script below the </select> on top of that, under the > > > <select>, outside of the div , very odd. The only error I get from FF > > > java console is "Draggable is not defined" IE also reports there are > > > script errors in the page. > > > > > > This is script - I think it''s right, I''d like to move on to options. > > > <script type="text/javascript">new Draggable(''ele123'', > {revert:true})</script> > > > > > > Stuart > > > > > > > > > On 6/23/06, Gregory Hill < Gregory_Hill-l9nu40+TWxQ@public.gmane.org> wrote: > > > > You need to put the script that creates the draggable below the > element > > > > you want to be draggable. Pages are parsed sequentially by browsers, > so > > > > your javascript is being evaluated in the HEAD, long before the > element > > > > you are trying to reference has been built by the browser. I''m > > > > surprised you aren''t seeing javascript errors galore. The alternative > > > > is to create the draggable in an onload event, but that is not > evaluated > > > > until all images are loaded (this was a topic of discussion last week, > > > > and there is a complex workaround, so look at the archives for more > info > > > > if you want). > > > > > > > > New to Javascript? > > > > > > > > Greg > > > > > > > > > -----Original Message----- > > > > > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > [mailto:rails-spinoffs- > > > > > bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Dark Ambient > > > > > Sent: Friday, June 23, 2006 2:12 PM > > > > > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > > Subject: [Rails-spinoffs] Help please-draggable > > > > > > > > > > I asked the other day about this problem but haven''t received a > > > > response. > > > > > > > > > > Trying again: > > > > > > > > > > I just downloaded 1.6 and can''t get a simple draggable to work, > which > > > > > is weird. I know it''s not my browser since the demos are working. > > > > > Here is my simple code. I''ve also had the "new Draggable" between > > > > > the select tags. Didn''t change anything. > > > > > > > > > > <head> > > > > > <meta http-equiv="Content-Type" content="text/html; > > > > charset=iso-8859-1" /> > > > > > <script src="/javascripts/prototype.js" > > > > type="text/javascript"></script> > > > > > <script src="/javascripts/scriptaculous.js" > > > > > type="text/javascript"></script> > > > > > <script src="/javascripts/dragdrop.js" > > > > type="text/javascript"></script> > > > > > <script type="text/javascript">new Draggable(''ele123'')</script> > > > > > ..................... > > > > > > > > > > <body> > > > > > > > > > > <div id="palette"> > > > > > > > > > > <select name="select1" size="5" id="ele123"> > > > > > <option value="1">Blue</option> > > > > > <option value="2">Red</option> > > > > > <option value="3">Orange</option> > > > > > <option value="4">Green</option> > > > > > <option value="5">Aquamarine</option> > > > > > </select> > > > > > </div> > > > > > > > > > > </body> > > > > > > > > > > Stuart > > > > > _______________________________________________ > > > > > Rails-spinoffs mailing list > > > > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > _______________________________________________ > > > > Rails-spinoffs mailing list > > > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >
On 6/24/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Well (and I know my multiple post are geting to be a pain..sorry) I''m > back to getting "Draggable is not defined" . I moved the files, > dropped the leading /, and made sure the server had the same paths.Do you have this latest iteration online somewhere that we could look at? Todd
http://icanc.com/dnd/formelements.php That is the latest TIA Stuart On 6/24/06, Todd Ross <rails-spinoffs-25kFIyuv2iRiLUuM0BA3LQ@public.gmane.org> wrote:> On 6/24/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Well (and I know my multiple post are geting to be a pain..sorry) I''m > > back to getting "Draggable is not defined" . I moved the files, > > dropped the leading /, and made sure the server had the same paths. > > Do you have this latest iteration online somewhere that we could look at? > > Todd > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
On 6/24/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> http://icanc.com/dnd/formelements.php > > That is the latest>From formelements.php:<script src="/javascript/dragdrop.js" type="text/javascript"></script> By manually trying to retrieve that file from http://icanc.com/javascript/dragdrop.js: Not Found The requested URL /javascript/dragdrop.js was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Apache/1.3.36 Server at icanc.lurkingforwork.com Port 80 It can''t find the JavaScript files. If you check your webserver logs, you''ll probably see a ton of 404 errors from your testing. Todd
On 6/24/06, Todd Ross <rails-spinoffs-25kFIyuv2iRiLUuM0BA3LQ@public.gmane.org> wrote:> On 6/24/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > http://icanc.com/dnd/formelements.php > > > > That is the latest > > From formelements.php: > > <script src="/javascript/dragdrop.js" type="text/javascript"></script> > > By manually trying to retrieve that file from > http://icanc.com/javascript/dragdrop.js: > > Not Found > The requested URL /javascript/dragdrop.js was not found on this server. > > Additionally, a 404 Not Found error was encountered while trying to > use an ErrorDocument to handle the request. > Apache/1.3.36 Server at icanc.lurkingforwork.com Port 80 > > It can''t find the JavaScript files. If you check your webserver logs, > you''ll probably see a ton of 404 errors from your testing.http://icanc.com/dnd/javascript/dragdrop.js works fine. That means that the advice that Brian gave you about making the script elements relative instead of absolute (remove the / from the beginning) was spot on. Either move your scripts to the root of your webserver where you''re looking for them, or making them relative as Brian suggested. Todd
Hoochie mama! Error logs are filled to the brim :) Sorry...just never had this issue before so never thought about it. Stuart On 6/24/06, Todd Ross <rails-spinoffs-25kFIyuv2iRiLUuM0BA3LQ@public.gmane.org> wrote:> On 6/24/06, Todd Ross <rails-spinoffs-25kFIyuv2iRiLUuM0BA3LQ@public.gmane.org> wrote: > > On 6/24/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > http://icanc.com/dnd/formelements.php > > > > > > That is the latest > > > > From formelements.php: > > > > <script src="/javascript/dragdrop.js" type="text/javascript"></script> > > > > By manually trying to retrieve that file from > > http://icanc.com/javascript/dragdrop.js: > > > > Not Found > > The requested URL /javascript/dragdrop.js was not found on this server. > > > > Additionally, a 404 Not Found error was encountered while trying to > > use an ErrorDocument to handle the request. > > Apache/1.3.36 Server at icanc.lurkingforwork.com Port 80 > > > > It can''t find the JavaScript files. If you check your webserver logs, > > you''ll probably see a ton of 404 errors from your testing. > > http://icanc.com/dnd/javascript/dragdrop.js works fine. That means > that the advice that Brian gave you about making the script elements > relative instead of absolute (remove the / from the beginning) was > spot on. Either move your scripts to the root of your webserver where > you''re looking for them, or making them relative as Brian suggested. > > Todd > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
Sheesh, this is so puzzling I have all sorts of scripts in various folders and sub domains and never anything like this.>From my server log to show the path the server is looking for whichhonestly is a bit confusing to me, is it /includes or /javascript. I don''t have an includes under /dnd. The other thing is that it''s not showing any errors for prototype or scriptaculous. Only the 5 specific scripts. public_html/icanc/dnd/includes/http://icanc.com/dnd/javascript/builder.js Stuart On 6/24/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hoochie mama! Error logs are filled to the brim :) > Sorry...just never had this issue before so never thought about it. > > Stuart > > On 6/24/06, Todd Ross <rails-spinoffs-25kFIyuv2iRiLUuM0BA3LQ@public.gmane.org> wrote: > > On 6/24/06, Todd Ross <rails-spinoffs-25kFIyuv2iRiLUuM0BA3LQ@public.gmane.org> wrote: > > > On 6/24/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > http://icanc.com/dnd/formelements.php > > > > > > > > That is the latest > > > > > > From formelements.php: > > > > > > <script src="/javascript/dragdrop.js" type="text/javascript"></script> > > > > > > By manually trying to retrieve that file from > > > http://icanc.com/javascript/dragdrop.js: > > > > > > Not Found > > > The requested URL /javascript/dragdrop.js was not found on this server. > > > > > > Additionally, a 404 Not Found error was encountered while trying to > > > use an ErrorDocument to handle the request. > > > Apache/1.3.36 Server at icanc.lurkingforwork.com Port 80 > > > > > > It can''t find the JavaScript files. If you check your webserver logs, > > > you''ll probably see a ton of 404 errors from your testing. > > > > http://icanc.com/dnd/javascript/dragdrop.js works fine. That means > > that the advice that Brian gave you about making the script elements > > relative instead of absolute (remove the / from the beginning) was > > spot on. Either move your scripts to the root of your webserver where > > you''re looking for them, or making them relative as Brian suggested. > > > > Todd > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >
1. You don''t need to include dragdrop.js if you''re including scriptaculous.js* 2. You can''t call new Draggable in the head section, as the element you''re referring to is not defined at this time (you have to put the script calling new Draggable _after_ the element is defined in HTML) -Thomas * If you don''t need other script.aculo.us functionalities besides drag and drop you can also include effects.js (which is required for drag and drop to work) and dragdrop.js (in that order), without including scriptaculous.js Am 23.06.2006 um 22:11 schrieb Dark Ambient:> I asked the other day about this problem but haven''t received a > response. > > Trying again: > > I just downloaded 1.6 and can''t get a simple draggable to work, which > is weird. I know it''s not my browser since the demos are working. > Here is my simple code. I''ve also had the "new Draggable" between > the select tags. Didn''t change anything. > > <head> > <meta http-equiv="Content-Type" content="text/html; > charset=iso-8859-1" /> > <script src="/javascripts/prototype.js" type="text/javascript"></ > script> > <script src="/javascripts/scriptaculous.js" type="text/ > javascript"></script> > <script src="/javascripts/dragdrop.js" type="text/javascript"></ > script> > <script type="text/javascript">new Draggable(''ele123'')</script> > ..................... > > <body> > > <div id="palette"> > > <select name="select1" size="5" id="ele123"> > <option value="1">Blue</option> > <option value="2">Red</option> > <option value="3">Orange</option> > <option value="4">Green</option> > <option value="5">Aquamarine</option> > </select> > </div> > > </body> > > Stuart > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
So I linked dragdrop and effects in the order mentioned below (Thank you Thomas). The image is now dragging , but the select box is not. Is it possible selects need a handle ? Stuart On 6/24/06, Thomas Fuchs <t.fuchs-moWQItti3gBl57MIdRCFDg@public.gmane.org> wrote:> 1. You don''t need to include dragdrop.js if you''re including > scriptaculous.js* > 2. You can''t call new Draggable in the head section, as the element > you''re referring to is not defined at this time (you have to put the > script calling new Draggable _after_ the element is defined in HTML) > > -Thomas > > * If you don''t need other script.aculo.us functionalities besides > drag and drop you can also include effects.js (which is required for > drag and drop to work) and dragdrop.js (in that order), without > including scriptaculous.js > > Am 23.06.2006 um 22:11 schrieb Dark Ambient: > > > I asked the other day about this problem but haven''t received a > > response. > > > > Trying again: > > > > I just downloaded 1.6 and can''t get a simple draggable to work, which > > is weird. I know it''s not my browser since the demos are working. > > Here is my simple code. I''ve also had the "new Draggable" between > > the select tags. Didn''t change anything. > > > > <head> > > <meta http-equiv="Content-Type" content="text/html; > > charset=iso-8859-1" /> > > <script src="/javascripts/prototype.js" type="text/javascript"></ > > script> > > <script src="/javascripts/scriptaculous.js" type="text/ > > javascript"></script> > > <script src="/javascripts/dragdrop.js" type="text/javascript"></ > > script> > > <script type="text/javascript">new Draggable(''ele123'')</script> > > ..................... > > > > <body> > > > > <div id="palette"> > > > > <select name="select1" size="5" id="ele123"> > > <option value="1">Blue</option> > > <option value="2">Red</option> > > <option value="3">Orange</option> > > <option value="4">Green</option> > > <option value="5">Aquamarine</option> > > </select> > > </div> > > > > </body> > > > > Stuart > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
Alright, I seem to be in business. Not sure why the scripts weren''t linking and for now I''m just going to link the ones that I''m calling. i.e. effects, dragdrop Aside from that, the form elements don''t move. For now I''ve wrapped the elements in a label and can use the label to drag them. Now to try something more difficult. Thanks for all the help. Stuart On 6/24/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> So I linked dragdrop and effects in the order mentioned below (Thank > you Thomas). > The image is now dragging , but the select box is not. Is it possible > selects need a handle ? > > Stuart > > On 6/24/06, Thomas Fuchs <t.fuchs-moWQItti3gBl57MIdRCFDg@public.gmane.org> wrote: > > 1. You don''t need to include dragdrop.js if you''re including > > scriptaculous.js* > > 2. You can''t call new Draggable in the head section, as the element > > you''re referring to is not defined at this time (you have to put the > > script calling new Draggable _after_ the element is defined in HTML) > > > > -Thomas > > > > * If you don''t need other script.aculo.us functionalities besides > > drag and drop you can also include effects.js (which is required for > > drag and drop to work) and dragdrop.js (in that order), without > > including scriptaculous.js > > > > Am 23.06.2006 um 22:11 schrieb Dark Ambient: > > > > > I asked the other day about this problem but haven''t received a > > > response. > > > > > > Trying again: > > > > > > I just downloaded 1.6 and can''t get a simple draggable to work, which > > > is weird. I know it''s not my browser since the demos are working. > > > Here is my simple code. I''ve also had the "new Draggable" between > > > the select tags. Didn''t change anything. > > > > > > <head> > > > <meta http-equiv="Content-Type" content="text/html; > > > charset=iso-8859-1" /> > > > <script src="/javascripts/prototype.js" type="text/javascript"></ > > > script> > > > <script src="/javascripts/scriptaculous.js" type="text/ > > > javascript"></script> > > > <script src="/javascripts/dragdrop.js" type="text/javascript"></ > > > script> > > > <script type="text/javascript">new Draggable(''ele123'')</script> > > > ..................... > > > > > > <body> > > > > > > <div id="palette"> > > > > > > <select name="select1" size="5" id="ele123"> > > > <option value="1">Blue</option> > > > <option value="2">Red</option> > > > <option value="3">Orange</option> > > > <option value="4">Green</option> > > > <option value="5">Aquamarine</option> > > > </select> > > > </div> > > > > > > </body> > > > > > > Stuart > > > _______________________________________________ > > > Rails-spinoffs mailing list > > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >