Author | Topic: Running a WAA function within an HTML to dynamically load HTML code | |
---|---|---|
Michael | Running a WAA function within an HTML to dynamically load HTML code on Sun, 20 Sep 2009 02:24:18 -0400 I have an HTML page, which is static, except for one portion of the code, where I want to call my WAA function to add an ordered list, but I cannot figure out how to do this. For example: --------------------------------------------------------------------------------------------- <html> <body> Some text........... Some text........... Some text........... Some text........... Some text........... Call my function here to build an ordered list, right now I have it like this. And the BuildList() is a Javascript code that runs the WAA function. <script language="JavaScript"> BuildList(); <script> Some text........... Some text........... Some text........... Some text........... Some text........... Some text........... </body> </html> --------------------------------------------------------------------------------------------- Does this make sense? | |
Michael | Re: Running a WAA function within an HTML to dynamically load HTML code on Sun, 20 Sep 2009 02:27:04 -0400 I forgot to show you the BuildList() Javascript, which is like this: <script language="JavaScript"> function BuildList() { document.location.href = "/waa1gate.exe?WAA_PACKAGE=SOI&WAA_FORM=VIDEO_ARCHIVE"; } </script> But, when me using the "document.location.href" to call the function, it replaces the whole HTML page instead of embedding the ordered list into the web page. Is this possible? "Michael" <mjgregg69@hotmail.com> wrote in message news:2e1b064d$1efd18c5$33e10@news.alaska-software.com... >I have an HTML page, which is static, except for one portion of the code, >where I want to call my WAA function to add an ordered list, but I cannot >figure out how to do this. > > For example: > --------------------------------------------------------------------------------------------- > <html> > <body> > Some text........... > Some text........... > Some text........... > Some text........... > Some text........... > > Call my function here to build an ordered list, right now I have it like > this. And the BuildList() is a Javascript code that runs the WAA function. > > <script language="JavaScript"> > BuildList(); > <script> > > Some text........... > Some text........... > Some text........... > Some text........... > Some text........... > Some text........... > > </body> > </html> > --------------------------------------------------------------------------------------------- > > Does this make sense? > | |
Allen Lee | Re: Running a WAA function within an HTML to dynamically load HTML code on Sun, 20 Sep 2009 21:51:56 -0700 Hi Michael; If you don't find an elegant javascript solution then why don't you: 1. Split your static html page into 2 parts - before and after the ordered list. 2. cBuffer1:=memoread('static1.html') 3. cOrdList:= (create the ordered list tags and call the WAA function to to generate the list items for the html code) 2. cBuffer2:=memoread('static2.html') 4. oHTML:put(cBuffer1+cOrdList+cBuffer2) Michael wrote: > I forgot to show you the BuildList() Javascript, which is like this: > > <script language="JavaScript"> > function BuildList() { > document.location.href = > "/waa1gate.exe?WAA_PACKAGE=SOI&WAA_FORM=VIDEO_ARCHIVE"; > } > </script> > > But, when me using the "document.location.href" to call the function, it > replaces the whole HTML page instead of embedding the ordered list into the > web page. > > Is this possible? > > > "Michael" <mjgregg69@hotmail.com> wrote in message > news:2e1b064d$1efd18c5$33e10@news.alaska-software.com... >> I have an HTML page, which is static, except for one portion of the code, >> where I want to call my WAA function to add an ordered list, but I cannot >> figure out how to do this. >> >> For example: >> --------------------------------------------------------------------------------------------- >> <html> >> <body> >> Some text........... >> Some text........... >> Some text........... >> Some text........... >> Some text........... >> >> Call my function here to build an ordered list, right now I have it like >> this. And the BuildList() is a Javascript code that runs the WAA function. >> >> <script language="JavaScript"> >> BuildList(); >> <script> >> >> Some text........... >> Some text........... >> Some text........... >> Some text........... >> Some text........... >> Some text........... >> >> </body> >> </html> >> --------------------------------------------------------------------------------------------- >> >> Does this make sense? >> > > | |
Jeremy Suiter | Re: Running a WAA function within an HTML to dynamically load HTML code on Mon, 21 Sep 2009 09:45:37 +0200 Hello Michael, To do what you want to do I can suggest two approcahes. Either generate the whole page via WAA or use AJAX to dynmacially add content. AJAX is a bit tricky to get going with, but once you have you'll never look back Jeremy > I forgot to show you the BuildList() Javascript, which is like this: > > <script language="JavaScript"> > function BuildList() { > document.location.href = > "/waa1gate.exe?WAA_PACKAGE=SOI&WAA_FORM=VIDEO_ARCHIVE"; > } > </script> > But, when me using the "document.location.href" to call the function, > it replaces the whole HTML page instead of embedding the ordered list > into the web page. > > Is this possible? > > "Michael" <mjgregg69@hotmail.com> wrote in message > news:2e1b064d$1efd18c5$33e10@news.alaska-software.com... > >> I have an HTML page, which is static, except for one portion of the >> code, where I want to call my WAA function to add an ordered list, >> but I cannot figure out how to do this. >> >> For example: >> --------------------------------------------------------------------- >> ------------------------ >> <html> >> <body> >> Some text........... >> Some text........... >> Some text........... >> Some text........... >> Some text........... >> Call my function here to build an ordered list, right now I have it >> like this. And the BuildList() is a Javascript code that runs the WAA >> function. >> >> <script language="JavaScript"> >> BuildList(); >> <script> >> Some text........... >> Some text........... >> Some text........... >> Some text........... >> Some text........... >> Some text........... >> </body> >> </html> >> --------------------------------------------------------------------- >> ------------------------ >> Does this make sense? >> | |
Bruce Anderson | Re: Running a WAA function within an HTML to dynamically load HTML code on Mon, 21 Sep 2009 11:56:10 -0500 Build your whole page in WAA if the contents of the list will not change while the user is viewing it. Build your page and use AJAX if the contents of the list will be changing while the user is viewing it. If you go AJAX, look at prototype.js with its ajax.updater() function. I think it is magic available via free download. With this approach, AJAX is not so complicated as it once was. And, learn the <div> tag. Everything revolves around the <div> tag. Bruce Anderson Houston | |
Brian L. Wolfsohn | Re: Running a WAA function within an HTML to dynamically load HTML code on Tue, 22 Sep 2009 20:17:30 +0200 >>I have an HTML page, which is static, except for one portion of the >>code, where I want to call my WAA function to add an ordered list, but >>I cannot figure out how to do this. Michael, Insert a searchable tag inside your static html page i.e. <<~~domyfunction()~~}} or <<~~{||domyfunction()}~~}} read the entire page into your WAA, search and replace the tag with an eval'd codeblock of your function and return the entire page including your content via WAA. HTH Brian Wolfsohn |