Problem with Jquery?

Download and support for PhpBB3 Top Stats Mod
User avatar
doktornotor
BBCoder IV
BBCoder IV
Posts: 167
Joined: 14 Sep 2011, 23:20
BBCodes: 30
Favourite MOD: Thanks for Posts
Contact:

Problem with Jquery?

Post by doktornotor »

smallbreeds wrote:Perfect! I removed the line jQuery.noConflict(); and is working well!
Good. You really should report this to the blinky PM mod author and point him to the API docs, he is doing something weird there.
Support requests via PM go straight to /dev/null!
smallbreeds
BBCoder II
BBCoder II
Posts: 22
Joined: 17 Nov 2011, 19:55
BBCodes: 0

Problem with Jquery?

Post by smallbreeds »

Will do so, thanks again!
User avatar
all4phone
BBCoder IV
BBCoder IV
Posts: 150
Joined: 11 Feb 2011, 13:50
BBCodes: 28
Favourite BBCode: Random text signature
Favourite MOD: BBCode Strikethrough MOD
Location: Poland
Contact:

Problem with Jquery?

Post by all4phone »

First of all thank you to Stoker, per Top Stats MOD :thumb:

In view of the problem which had smallbreeds (thanks for letting me know), I decided to check interoperability modifications Top Stats and Red Blinking PM and additionally mChat, which uses the jQuery library also.
    I installed all on a clean phpbb in the order:
  1. Top Stats
  2. mChat
  3. Red Blinking PM
    Then I checked operation:
  • TopStats - no scrolling Recent Active Topics
  • mChat - no sound, no slide BBCodes, smilies
  • rbpm - correct operation (maybe because of install as a last)
I opened styles/prosilver/template/overall_header.html and
I removed the phrase noConflict - nothing happened, it does not improve

I brought back noConflict and remove from Red Blinking PM script:

Code: Select all

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
    Then I checked operation:
  • TopStats - works correctly
  • mChat - works correctly
  • rbpm - works correctly
Conclusion: all three modifications using the jQuery library, from My experience shows that you must remove references to jQuery scripts of modifications that were installed later, as the next after the first mod wich uses jQuery.
After your conversation in this topic, I wonder about the use of noConflict and it probably would resign in the next version. I thank everyone for their voice heard in this discussion, it was very helpful for me.
User avatar
doktornotor
BBCoder IV
BBCoder IV
Posts: 167
Joined: 14 Sep 2011, 23:20
BBCodes: 30
Favourite MOD: Thanks for Posts
Contact:

Problem with Jquery?

Post by doktornotor »

all4phone wrote:After your conversation in this topic, I wonder about the use of noConflict and it probably would resign in the next version. I thank everyone for their voice heard in this discussion, it was very helpful for me.
Well, looking at your code, you seem to use it the other way round. In my jQuery Replace Broken Images mod, I am doing this in overall_footer.html:

Code: Select all

<script type="text/javascript">
	$(window).load(function() { 
		$("img").each(function(){
			var image = $(this);
			if(image.context.naturalWidth == 0 || image.readyState == 'uninitialized'){
				$(image).unbind("error").attr("src", "images/404.png");
			}
		});
	});
</script>
and it seems to work just fine without any jQuery.noConflict(); stuff. In my experience, the noConlict() API is only useful when you need to use some other JS lib in the same script like jQuery and you need to rescue $ as a function or variable name back from jQuery temporarily (since $ is just an alias for jQuery otherwise.)

If you do anything else with it, it seems you just flush jQuery down the drain and it never comes back. Hmmmm.
Support requests via PM go straight to /dev/null!
User avatar
all4phone
BBCoder IV
BBCoder IV
Posts: 150
Joined: 11 Feb 2011, 13:50
BBCodes: 28
Favourite BBCode: Random text signature
Favourite MOD: BBCode Strikethrough MOD
Location: Poland
Contact:

Problem with Jquery?

Post by all4phone »

Thanks for your reply and for your help doktornotor, probably you're right. I'll try to go the other way ;) .
Locked