Tutorial: Jquery (by google API) with mybb (prototype)
#1
Quote:April 2011 - Developers @ Audentio.com managed this nonconflict code to a plugin to painless insert Jquery + plugins in mybb 1.6:

http://mods.mybb.com/view/jsnippets
http://community.mybb.com/thread-85031.html

No Need to edit any template after installing it Wink





Original post (2009)



http://dev.jquery.com/wiki/PrototypeAndJQuery

Generic example:
 <script src="http://jquery.com/src/latest/"></script>
 <script type="text/javascript">
    JQ = $;  //rename $ function
 </script>
 <script src="prototype.js"></script>



with Dynamic Drive Smooth Menu
Ungrouped Templates > headerinclude

  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
 <script type="text/javascript">
    JQ = $;  //rename $ function
 </script>

<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/prototype.js"></script>
.
.
<script type="text/javascript" src="ddsmoothmenu.js">

Link to this menu Code (javascript non-obtrusive):
http://www.dynamicdrive.com/dynamicindex...u.htm#ajax


This is an easy solution, but I don´t realize it´s related with mybb side (Prototype)...

if you don´t use this trick your popup (smilies) and Editor won´t work at all
Reply
#2
Uhm..What's the point of this?Confused
Reply
#3
What´s the point of "prototype" in mybb? Toungue
exactly the same I think...

but jquery from google is lightweight
Reply
#4
(2009-02-13, 04:47 AM)aglioeolio Wrote: What´s the point of "prototype" in mybb? Toungue
exactly the same I think...

but jquery from google is lightweight
The point is because it makes all of the requests - using quick reply, editing a post, etc. - easier. And Prototype is lightweight too, you just need to get the minified version of it.
Reply
#5
LOL, I don´t wanna start flamming or something like Windows x Linux, Manchester x Liverpool,etc - it´s just a quick tip nothing else

don´t bother if you don´t mind Wink
Reply
#6
Prototype is a heavyweight compared to jQuery - everyone with a well informed opinion knows that. When 1.4 was developed, jQuery was just starting as a library, and Prototype was the most popular back then. That is why it's developed with it (or at least, that's what I remember people saying!).

Why not just include the jQuery library after the Prototype library, and use

jQuery.noConflict();

You can then use jQuery as a command ( jQuery("#target").attr("title"); ). This is probably the preferred way, especially if you're using Prototype and developing something that is cross-platform.

http://docs.jquery.com/Using_jQuery_with..._Libraries
Reply
#7
(2009-02-14, 09:14 PM)Tom.M Wrote: Prototype is a heavyweight compared to jQuery - everyone with a well informed opinion knows that. When 1.4 was developed, jQuery was just starting as a library, and Prototype was the most popular back then. That is why it's developed with it (or at least, that's what I remember people saying!).

Why not just include the jQuery library after the Prototype library, and use

jQuery.noConflict();

You can then use jQuery as a command ( jQuery("#target").attr("title"); ). This is probably the preferred way, especially if you're using Prototype and developing something that is cross-platform.

http://docs.jquery.com/Using_jQuery_with..._Libraries

Precisely. You really don't need a long work around, just use the noconflict and it works fine with MyBB.
Reply
#8
Is there any thought to changing out to just using jQuery in future releases?
Reply
#9
how to do this? need clear tutorial Smile
<signature too big>
Reply
#10
How to do this? Kindly detail your tutorial OP?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)