From: Pascal B. <pa...@dy...> - 2000-11-17 18:38:23
|
Haven't looked at your code yet, but just a fast note that I recently (last weekend) uploaded a new set of widgets to work with the latest DynAPI (atleast tested with Dynacore) so if you have older widgets you'll probably need to update. sorry, but that's all for now (haven't got much time :) Pascal Bestebroer pa...@dy... http://www.dynamic-core.net > -----Oorspronkelijk bericht----- > Van: dyn...@li... > [mailto:dyn...@li...]Namens Peter Curran > Verzonden: vrijdag 17 november 2000 17:09 > Aan: dyn...@li... > Onderwerp: [Dynapi-Help] Problems with DynAPI2 and Dynacore > > > I am having some problems trying to use some of the features of the > Dynacore widget package. I'm hoping someone can give me a few tips to get > going. I am using the 2000.11.7 release of DynAPI2, and (AFAIK) the most > recent versions of the Dynacore widgets. I'm relatively now to > Javascript, > and while I have spent some time attempting to fix these problems, I've > probably missed something obvious to someone with more experience.... > > I have created three HTML files, forming a page with two frames, named > "menubar" and "coolpage" (working from the DynAPI Tutorial, Part 6). > > First, when I try to using my page in Netscape 4.73, I get the following > Javascript error: > > JavaScript Error: > file://C:/Tools/DynApi2/dynapi/js/dynapi.js, line 52: > DynDocument is not defined. > > This refers to a line in the loadHandler function. I have tried various > things to work around this, but no luck. It appears to be a problem with > the order in which things are loaded, but I haven't found the way around > it. The stuff works in IE5.5, with the exception of the next problem. > > The second problem is that I cannot get the "label" widget to > work. Nothing > appears on the screen, no matter what I try. Most of the other > widgets seem > to do roughly what I expect, but this one, presumably the simplest of the > bunch, has me stuck. I can work around this in various ways, but > I'm hoping > that getting an understanding of what is wrong here will help me > understand > more of JS and DynAPI2 in general. In the code below, I also include a > button widget that seems to work fine. > > Anyhow, here are the three pages I am using. I have stripped them down as > much as I can to demonstrate the problems. To avoid problems to anyone > whose mail client displays HTML, I have changed all less-than > characters to > '[[' and greater-than characters to ']]' - to try the pages > you'll have to > substitute them back. Also, the two path names at the top of menubar.htm > will have to be changed to match your setup. > > Thanks very much for any help. I'm quite impressed with DynAPI and the > Dynacore package, but they could sure use some documentation!!! > Maybe I'll > get some time to contribute something... > > ======== Demo.htm ======================= > [[html]] > [[head]][[title]]DynDocument framesets[[/title]][[/head]] > > [[frameset cols="158,681" rows="*"]] > [[frame src="menubar.htm" name="menu"]] > [[frame src="coolpage.htm" name="page"]] > [[/frameset]] > > ======== coolpage.htm =================== > [[html]] > [[head]][[title]]Cool page[[/title]][[/head]] > > [[body]]Sample GUI page...[[/body]] > [[/html]] > > ======== menubar.htm ==================== > [[html]] > [[head]][[title]]Our menu[[/title]] > [[script language="Javascript" > src="file://C:/Tools/DynApi2/dynapi/js/dynapi.js"]][[/script]] > > [[Script language="Javascript"]] > > myDynAPIPath = "C:/Tools/DynApi2/dynapi/" > > DynAPI.setLibraryPath(myDynAPIPath + "js/lib/") > DynAPI.include('dynapi.api.*') > DynAPI.include('dynacore.gui.style') > DynAPI.include('dynacore.gui.label') > DynAPI.include('dynacore.gui.button') > > DynAPI.onLoad=function() { > coolpage=new DynDocument(parent.page) > > testlabel = new CoreLabel(20, 40, "Label") > coolpage.addChild(testlabel) > > testbutton = new CoreButton(20, 80, null, null, "Button", null) > coolpage.addChild(testbutton) > > testbutton.onClick = function () { > testbutton.style.font.color = > (testbutton.style.font.color == "Red") ? > "Blue" : > "Red" > testbutton.repaint() > } > } > [[/script]] > [[/head]] > > [[body]]Menu Page[[/body]] > [[/html]] > > -- > Peter Curran Software Developer Casebank Technologies Inc. > > _______________________________________________ > Dynapi-Help mailing list > Dyn...@li... > http://lists.sourceforge.net/mailman/listinfo/dynapi-help > |
From: Peter C. <pc...@ca...> - 2000-11-21 14:45:32
|
At 12:32 PM 18/11/00 -0800, you wrote: >From: "SReindl" <SR...@la...> >To: <dyn...@li...> >Subject: AW: [Dynapi-Help] Problems with DynAPI2 and Dynacore >Date: Sat, 18 Nov 2000 10:20:41 +0100 > >Peter, >you probably solved the problem in the meantime. >Mostly, the error you mentioned (DynDocument not defined) refers to some >unclosed braces somwewhere in the code. It is a little bit tricky to find >the position, since there is almost no relation between the line (52) of the >error and the actual position. >Unclosed braces can be missing ", ', ), ], or } ... > >Stephan Stephan - thanks very much for your response. Unfortunately, it hasn't helped. I have managed to reduce the problem to a much smaller file - just one this time. And, in the process, caused it to also appear in IE5.5, as well as NS4.73 as before. Here is my new source file: [[html]] [[head]] [[title]]Demo[[/title]] [[script src="file:///C:/Tools/DynApi2/dynapi/js/dynapi.js"]][[/script]] [[/head]] [[body]]Demo[[/body]] [[/html]] (As before, I replaced angle brackets with [[ and ]], to avoid e-mail problems). I have run this through "tidy" (the W3 Consortium's HTML validator) and it reports only one warning, that the language type is not specified on the SCRIPT tag (a deliberate omission, in this case). It also adds a DTD line, but that is not a problem here. Both IE and NS report the same error - DynDocument not defined on line 52 of dynapi.js. In the original file, which has this code plus a whole lot more, only NS has a problem - IE handles it correctly. I can't see any mismatched braces, or anything else that could be wrong in this code. If there are any, they would have to be in dynapi.js - in which case, presumably everyone would be having problems. Peter Curran Software Developer Casebank Technologies Inc. |
From: SReindl <SR...@la...> - 2000-11-21 17:50:23
|
It seems that u have to include at least the api package to initialize the DynDocument. When I insert the lines <script> DynAPI.setLibraryPath('js/lib/') DynAPI.include('dynapi.api.*') </script> the error disappears ( my path is shorter, I use local, relative path and did not check any further). So, maybe you have to look for TWO errors. One from the missing init of the api package an another one from within your code ... Stephan Stephan - thanks very much for your response. Unfortunately, it hasn't helped. I have managed to reduce the problem to a much smaller file - just one this time. And, in the process, caused it to also appear in IE5.5, as well as NS4.73 as before. Here is my new source file: [[html]] [[head]] [[title]]Demo[[/title]] [[script src="file:///C:/Tools/DynApi2/dynapi/js/dynapi.js"]][[/script]] [[/head]] [[body]]Demo[[/body]] [[/html]] (As before, I replaced angle brackets with [[ and ]], to avoid e-mail problems). I have run this through "tidy" (the W3 Consortium's HTML validator) and it reports only one warning, that the language type is not specified on the SCRIPT tag (a deliberate omission, in this case). It also adds a DTD line, but that is not a problem here. Both IE and NS report the same error - DynDocument not defined on line 52 of dynapi.js. In the original file, which has this code plus a whole lot more, only NS has a problem - IE handles it correctly. I can't see any mismatched braces, or anything else that could be wrong in this code. If there are any, they would have to be in dynapi.js - in which case, presumably everyone would be having problems. Peter Curran Software Developer Casebank Technologies Inc. _______________________________________________ Dynapi-Help mailing list Dyn...@li... http://lists.sourceforge.net/mailman/listinfo/dynapi-help |
From: Pascal B. <pa...@dy...> - 2000-11-21 18:11:44
|
are you sure you'r using the latest dynapi.js file? also make sure to add these lines: DynAPI.include('dynacore.api.dynlayer.js') DynAPI.include('dynacore.api.browser.js') DynAPI.include('dynacore.api.dyndocument.js') which should make sure the DynAPI.document is always available. Pascal Bestebroer pa...@dy... http://www.dynamic-core.net > -----Oorspronkelijk bericht----- > Van: dyn...@li... > [mailto:dyn...@li...]Namens Peter Curran > Verzonden: dinsdag 21 november 2000 15:44 > Aan: dyn...@li... > Onderwerp: [Dynapi-Help] Re: Problems with DynAPI2 and Dynacore > > > At 12:32 PM 18/11/00 -0800, you wrote: > > >From: "SReindl" <SR...@la...> > >To: <dyn...@li...> > >Subject: AW: [Dynapi-Help] Problems with DynAPI2 and Dynacore > >Date: Sat, 18 Nov 2000 10:20:41 +0100 > > > >Peter, > >you probably solved the problem in the meantime. > >Mostly, the error you mentioned (DynDocument not defined) refers to some > >unclosed braces somwewhere in the code. It is a little bit tricky to find > >the position, since there is almost no relation between the line > (52) of the > >error and the actual position. > >Unclosed braces can be missing ", ', ), ], or } ... > > > >Stephan > > > Stephan - thanks very much for your response. Unfortunately, it hasn't > helped. I have managed to reduce the problem to a much smaller > file - just > one this time. And, in the process, caused it to also appear in IE5.5, as > well as NS4.73 as before. > > Here is my new source file: > > [[html]] > [[head]] > [[title]]Demo[[/title]] > [[script > src="file:///C:/Tools/DynApi2/dynapi/js/dynapi.js"]][[/script]] > [[/head]] > [[body]]Demo[[/body]] > [[/html]] > > (As before, I replaced angle brackets with [[ and ]], to avoid e-mail > problems). > > I have run this through "tidy" (the W3 Consortium's HTML > validator) and it > reports only one warning, that the language type is not specified on the > SCRIPT tag (a deliberate omission, in this case). It also adds a > DTD line, > but that is not a problem here. > > Both IE and NS report the same error - DynDocument not defined on line 52 > of dynapi.js. > > In the original file, which has this code plus a whole lot more, only NS > has a problem - IE handles it correctly. I can't see any > mismatched braces, > or anything else that could be wrong in this code. If there are any, they > would have to be in dynapi.js - in which case, presumably > everyone would be > having problems. > > Peter Curran Software Developer Casebank Technologies Inc. > > _______________________________________________ > Dynapi-Help mailing list > Dyn...@li... > http://lists.sourceforge.net/mailman/listinfo/dynapi-help > |
From: Peter C. <pc...@ca...> - 2000-11-21 19:30:07
|
At 10:17 AM 21/11/00 -0800, "SReindl" <SR...@la...> wrote: >From: "SReindl" <SR...@la...> >To: <dyn...@li...> >Subject: AW: [Dynapi-Help] Re: Problems with DynAPI2 and Dynacore > >It seems that u have to include at least the api package to initialize the >DynDocument. <snip> and "Pascal Bestebroer" <pa...@dy...> wrote: >From: "Pascal Bestebroer" <pa...@dy...> >Subject: RE: [Dynapi-Help] Re: Problems with DynAPI2 and Dynacore > >are you sure you'r using the latest dynapi.js file? > >also make sure to add these lines: > >DynAPI.include('dynacore.api.dynlayer.js') >DynAPI.include('dynacore.api.browser.js') >DynAPI.include('dynacore.api.dyndocument.js') > >which should make sure the DynAPI.document is always available. Stephan and Pascal - thanks again for your response. My last message was silly. I tried to strip the problem down to the smallest possible file, and in the process almost certainly converted it into a different problem with the same symptoms. I'm now going back to a simple version of the original problem. As before, this code work properly in IE5.5, but fails in NS4.73. I am using the 2000.11.07 version of dynapi.js. I assuming in the above includes "dynacore" should not be there - I use "DynAPI.include('dynapi.api.*') " (I tried naming each file explicitly - no difference.) Here is the new code: Demo.htm: ========= [[html]] [[head]] [[title]]Framesets[[/title]] [[/head]] [[frameset rows="100,*" cols="*"]] [[frame src="menubar.htm" name="menu"]] [[frame src="coolpage.htm" name="page"]] [[/frameset]] [[/html]] Coolpage.htm: ============ [[html]] [[head]] [[title]]Cool page[[/title]] [[/head]] [[body]]Cool page[[/body]] [[/html]] Menubar.htm: =========== [[html]] [[head]] [[title]]Demo[[/title]] [[script src="file:///C:/Tools/DynApi2/dynapi/js/dynapi.js"]][[/script]] [[script]] DynAPI.setLibraryPath("C:/Tools/DynApi2/dynapi/js/lib/") DynAPI.include('dynapi.api.*') DynAPI.onLoad=function() { coolpage = new DynDocument(parent.page) } [[/script]] [[/head]] [[body]]Demo[[/body]] [[/html]] In this code, when Demo.htm is loaded into IE, everything works - in NS, an error shows up in the javascript: window. Actually, the same problem occurs even if the onLoad function is completely commented out - the problem appears to be solely in the loading of the dynapi.js stuff into NS. However, I have no idea where things are going wrong at this point. -- Peter Curran Software Developer Casebank Technologies Inc. |
From: Peter C. <pc...@ca...> - 2000-11-22 15:02:51
|
Further to my problem with Netscape - I have found that, as might be expected, the problem goes away if I delete the line "DynAPI.include('dynapi.api.*')" and instead insert explicit "<script src=file:...>" tags for each of the DynAPI/api/*.js files. OTOH, just replacing the "include *" method with five separate includes, naming each of the api/*.js files explicitly, does not help. Seems to be some problem with the include method when run under NS. I haven't pursued it any further yet. -- Peter Curran Software Developer Casebank Technologies Inc. pc...@ca... 905 792-0618 X535 |
From: Richard :o\) <ma...@ri...> - 2000-11-22 23:14:33
|
Hi, I wasn't really following what the problem was, but judging from your post the problem is in your directory structure, because this has changed a lot recently. - NS will give problems if it doesn't find a file, IE will pass it over. If you use this version: http://www.dynamic-core.net/core/index.htm there are example pages included, with all the correct includes, you can build further on one of these. Richard:o) ----- Original Message ----- From: "Peter Curran" <pc...@ca...> To: <dyn...@li...> Sent: Wednesday, November 22, 2000 3:49 PM Subject: [Dynapi-Help] Re: Problems with DynAPI2 and Dynacore > Further to my problem with Netscape - I have found that, as might be > expected, the problem goes away if I delete the line > "DynAPI.include('dynapi.api.*')" and instead insert explicit "<script > src=file:...>" tags for each of the DynAPI/api/*.js files. OTOH, just > replacing the "include *" method with five separate includes, naming each > of the api/*.js files explicitly, does not help. Seems to be some problem > with the include method when run under NS. I haven't pursued it any further > yet. > > -- > Peter Curran Software Developer Casebank Technologies Inc. > pc...@ca... 905 792-0618 X535 > > _______________________________________________ > Dynapi-Help mailing list > Dyn...@li... > http://lists.sourceforge.net/mailman/listinfo/dynapi-help > ____________________________________________________________ > Get your FREE personal .com domain name and > NAMEzero Personal Portal at: http://www.namezero.com. > For customer service, mailto:cus...@na.... > > |