Author Topic: WB2.8 & jquery  (Read 3328 times)

Offline Argos

  • Posts: 2542
  • Gender: Male
    • Argos Media
WB2.8 & jquery
« on: August 17, 2009, 01:50:47 AM »
I searched everywhere but can't find any info on how to use the jQuery framework that comes with WB2.8. What if I see some nice jQuery thingy somewhere, and want to use it. How do I go from there? Before, you just had to put the commands in the head of the template, but now what?
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!

Offline Luisehahne

  • WebsiteBaker Org e.V.
  • **
  • Posts: 4379
  • Gender: Male
    • Webdesign und Entwicklung WebsiteBaker
Re: WB2.8 & jquery
« Reply #1 on: August 17, 2009, 01:53:19 AM »
I upload 3 files from my template to look how to bind.

1) index.php see head with css
2) javascript before body end

Dietmar

[gelöscht durch Administrator]
Immer nur von der Zukunft reden, die Gegenwart vergessen und auf die Vergangenheit schimpfen
Neues Unwort: Schnappatmung

Offline Argos

  • Posts: 2542
  • Gender: Male
    • Argos Media
Re: WB2.8 & jquery
« Reply #2 on: August 17, 2009, 02:04:56 AM »
Thanks Dietmar. Do I understand it right that you still have to add the lines to the template? So no jQuery stuff is already loaded automatically?

What do these lines do? Are they needed when jQuery is used?
Code: [Select]
<?php
// load jquery API
require_once("jquery_api.js");
?>

<script src="<?php echo TEMPLATE_DIR?>/javascript.functions.js" type="text/javascript"></script>

Sorry, still confused...  :roll:
What exactly is the differerence between pre-2.8 and 2.8 regarding jQuery?
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!

Offline Luisehahne

  • WebsiteBaker Org e.V.
  • **
  • Posts: 4379
  • Gender: Male
    • Webdesign und Entwicklung WebsiteBaker
Re: WB2.8 & jquery
« Reply #3 on: August 17, 2009, 02:10:13 AM »
in my template i bind all js external

in the jquery_api.js are the default loads with jquery scripts
in the javascript.function s.js are the jquery functions

It's my way to included the scripts and function, And my modules use frontend.css, frontend.js to load in the head
and the frondend_body.js in the body

And some css are loaded with jquery-insert.js on the fly when they are needed.

And now i will be going sleeping

Trusted Dietmar

Immer nur von der Zukunft reden, die Gegenwart vergessen und auf die Vergangenheit schimpfen
Neues Unwort: Schnappatmung

Offline BerndJM

  • Posts: 1764
  • Gender: Male
Re: WB2.8 & jquery
« Reply #4 on: August 17, 2009, 02:45:18 AM »
Mmmh,
try to give a short resume:

the jQuery-stuff was shipped with 2.8 because it was used a little bit in the backend and a few never modules use it. One of the next steps will be, to replace the YUI stuff in the backend with equivalent jQuery.

The decision to use jquery was the easier handling and to give (module)developers an easy to handle framework, without the need to bind the necessary scripts into the modules and give a common base for the jquery framework to avoid trouble with different modules loading their "own" jquery.js

There is per default no jquery functionality for the front end. But you can use all the nice jquery features in your template by calling the main scripts from the include-folder, if necessary add your own jquery-plugins, and so on.
You can do this the conventional way like described on the jquery pages or in a more "expert" way like in the examples from Dietmar.

If I wrote some bullshit, please correct me.

Regards Bernd
In theory, there is no difference between theory and practice. But, in practice, there is.

Offline Argos

  • Posts: 2542
  • Gender: Male
    • Argos Media
Re: WB2.8 & jquery
« Reply #5 on: August 17, 2009, 03:09:30 AM »
Aaah! Now I understand better, thanks a lot. I can now try to understand Dietmars advanced stuff as well, it was too technical for me to comprehend at first.
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!