[dba-Tech] .js help?

Jim Lawrence accessd at shaw.ca
Sun Sep 26 21:12:56 CDT 2010


Hi Kathryn:

JQuery is a series of imbedded functions...look up "how to use and create
JQuery functions" lots of tutorials out there...and you should learn all
this stuff. ;-)

I am not sure there is not enough code there to automate the process of
adding and updating twitts on the fly. But, within code all it would take is
to have the contents of line 194 (the page body html code) replaced. (If you
are using an editor to view the code make sure 'wrap' is turned on.) The
page Body is just being used as a data storage area and the code just cycles
through the contents and displays it on the marquee. (I would have probably
used JSON (A small JavaScript database) for that purpose as now how are you
going to be able to be able to display the rest of page?

Obviously, this code was taken from some operational location. If I could
take a look at that then it might be easier to figure out and to add the
appropriate pieces.

Any very rough example of replacing the Body contents via AJAX code would
be; Given: (note: this is just air code off the top...)

...
<body>
   content
</body>

<script>
   var success_callback = function(data) {
      $('body').load( url,[data],[callback] ); //Get and replace with "data"
   }
   ajax(url, params, success_callback);
</script>
...

Or check out this example: http://api.jquery.com/replaceWith/

HTH
Jim




More information about the dba-Tech mailing list