From: rlb <bl...@wi...> - 2000-11-05 05:48:13
|
while working through the: Using the DynAPI2 part 4 : Widgets I've had a heck of a time trying to get my widget to be loaded. I used what the tutorial said to use: <Script language="Javascript" src="dynapi.js"></script> I actually used a local path : <Script language="Javascript" src="../../core/js/dynapi.js"></script> <Script language="Javascript" src="button.js"></script> <Script language="Javascript"> I got a bunch of errors and Netscape kept locking up. I read some where that the new way of calling routines was to use syntax like: CORE.<somefoldername>.<somewidgetname>.js I eventually got this to work by building my own folder alongside the other Core scripts like so: <Script language="Javascript" src="../../core/js/dynapi.js"></script> <Script language="Javascript"> DynAPI.setLibraryPath('../../core/js/lib2.0/') DynAPI.include('core.api.*') DynAPI.include('core.rlb.button.js') I don't remember where I saw the above reference. The question(s): Is this the preferred method of storing and loading scripts? How can I store my scripts separately from the CORE scripts, as in completely different spot, other than the "core" directory. Can there be more than one "setLibraryPath", for example: DynAPI.setLibraryPath('../../core/js/lib2.0/') DynAPI.setLibraryPath('../../rlb/js/lib2.0/') Learned a lot working this out. Still having fun by the way. Thanks bobb Henrik Våglin wrote: > Just a suggestion from a another novice, but how would > it work with inline layers instead? I haven't tried it > myself, but there might be a deifference. > > Otherwise I think this topic has been discussed here > recently (and elsewhere before) and the general idea > is that forms aren't covered when in a layer with a > lower z-Index value. You can hide the layers though > with the visability property, so one idea would be to > invoke an event that hides the other layer when > another is dragged over it (just mouseover/mouseout > should be OK I think) - a nasty workaround of course, > but it does what is expected: keeping the form > elements from happen in a virtual/visual mess. > > Henrik Våglin > http://hvaglin.freesqlhost.com > > --- rlb <bl...@wi...> skrev: > DynAPIers, > > > > Sorry to bother, but I have a question about a > > tutorial that I've been > > working through titled: > > > > Using the DynAPI2 > > part 3 : Dragging > > by Pascal Bestebroer > > July 16, 2000 > > > > Actually, it's about some unexpected results that > > I've come across. > > > > I was wondering if you might have any insights. > > Could you try this link: > > > > > > > http://64.33.167.222/work/DynAPI/dynapi20001024-full/Docs/layertut/mytut_p3.html > > > > Both LAYERs have FORMs in them. The left layer is > > draggable. The FORM > > elements seem to get messed up pretty good whenever > > I move the LAYER or > > overlap with another layer containing FORM elements. > > > > These are probably Javascript 101 questions, as in I > > should know the > > answers, but darned if I can find any info on > > placing FORM elements into > > LAYERS, or for that matter, draggable LAYERs, or the > > consequences. I > > suppose that I should mention that I know only > > slightly more about > > Javascript than I do about the DynAPI, although > > following this API stuff > > is a heck of a lot easier than trying to build from > > scratch. > > > > Question(s): > > > > Are these results a product of the Browser (it > > happens in NS > > and IE)? > > > > Is there a way of repainting things while > > dragging, or > > possibly displaying a graphic in the other > > window(s) that are > > not being dragged until the dragging event is > > over? > > > > Is this something that I shouldn't even be > > trying to do? Maybe > > I should use HTML Frames and targeted windows > > for example. > > > > Is there another Tutorial out there somewhere > > that explains > > what is happening > > > > I've been following this development process for > > quite a while. I first > > came across Dan's work last year. I now have a > > project to apply these > > types of capabilities to, if possible. > > > > Thanks for any help or pointers. > > > > > > Bob Basques > > > > > > I've included the source below, there's not much > > there, thanks to > > DynAPI. (by the way, I hope there's a better way of > > loading HTML in a > > later tutorial.) :) > > > > The source: (is this bad to send to the list???) > > > > <html> > > > > <head><title>DynAPI2 tutor - creating > > layers</title> > > > > <Script language="Javascript" > > src="../../core/js/dynapi.js"></script> > > > > <Script language="Javascript"> > > > > DynAPI.setLibraryPath('../../core/js/lib2.0/') > > > > DynAPI.include('core.api.*') > > > > DynAPI.onLoad=function() { > > > > addLay=new > > DynLayer(null,75,75,350,230,'#c0c0c0') > > > > addLay.setHTML('<center><p><font > > face="arial, > > geneva, helvetica"> </font></p><form > > method=POST > > > > action="http://gis.ci.stpaul.mn.us/cgi/xadd"><table > > width="350" border="0"><tr> <td colspan="3"> > > <div > > align="center"><font face="arial, geneva, > > helvetica" > > size="+2"><b><font > > size="4">Address</font></b></font> <font > > face="arial, geneva, helvetica" > > size="4"><b>Lookup</b> > > </font><font face="arial, geneva, helvetica" > > size="4"></font></div></td></tr><tr> <td > > colspan="2"> <div > > align="right"><b>Address:</b></div></td><td > > width="197"> > > <input type=text name="house_num22" maxlength=5 > > size=5></td></tr> <tr> <td colspan="2"> <p > > align="right"><b>Street</b> <b>Name:</b> > > </p></td><td > > width="197"><input type=text name="street122" > > size=19></td></tr><tr> <td colspan="2"> <p > > align="right"><b>Street </b><b>Type:</b> > > </p></td> <td > > width="197"> <select name="select4"><option > > value="">-Type- > > <option value="ALY">ALLEY <option > > value="AVE">AVENUE</select></td></tr><tr> <td > > colspan="2"> <p > > align="right"><b>Street </b><b>Direction:</b> > > </p></td><td > > width="197"> <select name="select4"><option > > value="">-Direction- <option value="N">NORTH > > <option > > value="NE">NORTHEAST </select></td></tr><tr> > > <td colspan="2"> > > <div align="right"> <b> </b> </div><div > > align="right"><b>City:</b> </div></td><td > > width="197"> <select > > name="select"><option value="">-City- <option > > value="ARDEN > > HILLS"> ARDEN HILLS</select> </td></tr><tr><td > > colspan="3" > > align="center"> <input type=submit > > name="action2" > > value="Search for > > Address"></td></tr></table></form></center>') > > > > > > > > DragEvent.setDragBoundary(addLay) > > > > DragEvent.enableDragEvents(addLay) > > > > interLay=new > > DynLayer(null,500,75,375,150,'#00c000') > > > > interLay.setHTML('<center><font > > face="arial, > > geneva, helvetica"><form method=POST > > > > > action="http://gis.ci.stpaul.mn.us/cgi/xintersection"> > > <table > > width="350"><tr><td align=center valign=top > > colspan="2"><font > > face="arial, geneva, helvetica"><font > > face="Arial" > > size="4"><b>Intersection Lookup</b></font> > > </font></td> > > </tr><tr> <td align=center valign=top> <b><font > > size="2">1st > > Street Name:</font></b></td><td align=center > > valign=top> > > <b><font size="2">Crossing Street > > Name:</font></b> </td> > > </tr><tr> <td align=center valign=top > <input > > type=text > > name="street1" size=19> <br> </td><td > > align=center valign=top > > > <input type=text name="street2" > > size=19><br></td></tr><tr> > > <td colspan=5 align=center valign=middle > > cellpadding="15"> > > <input type=submit name="action" value="Search > > for > > > > > Intersection"></td></tr></table></form></font></center>') > > > > DynAPI.document.addChild(addLay) > > DynAPI.document.addChild(interLay) > > > > } > > > > > > > > </script> > > > > </head> > > > > <body> > > <!-- > > --> > > </body> > > > > </html> > > > > -- > > -+-+-+-+-+- > > > > > > bobb > > > > http://64.33.167.222/ > > > > > > _______________________________________________ > > Dynapi-Help mailing list > > Dyn...@li... > > > http://lists.sourceforge.net/mailman/listinfo/dynapi-help > > ===== > // Henrik Vaglin > > ************************************************** > Visit my comics artpage at > http://photos.yahoo.com/bc/hvaglin?d&.flabel=fld5&.src=bc > ************************************************** > > __________________________________________________ > Do You Yahoo!? > Thousands of Stores. Millions of Products. All in one Place. > http://shopping.yahoo.com/ > _______________________________________________ > Dynapi-Help mailing list > Dyn...@li... > http://lists.sourceforge.net/mailman/listinfo/dynapi-help -- -+-+-+-+-+- bobb http://64.33.167.222/ |