SimplePortal

Customization => Custom Coding => Topic started by: cap269 on July 15, 2013, 04:11:58 PM

Title: jQuery question
Post by: cap269 on July 15, 2013, 04:11:58 PM
Pardon these what may be rookie questions, but I have only been working with SMF/SP for three weeks. In the past, I have read and understood that according to best practices jQuery should not be loaded more than once per page. On my SP index page I have jQuery being loaded in the <head> section, but code I place in a custom HTML block using jQuery doesn't run unless I load jQuery again in that specific block. When I look at the page source I see the jQuery in both places. Is this a violation of best practices to have jQuery loaded in both places? Why doesn't the code in the custom HTML block run off of the jQuery being loaded in the page header? Is this because it is in a different scope or context, or is there some housekeeping function I need to call first? If I were to have a second custom HTML block using jQuery functions, would I have to load jQuery again for a third instance? Thank you for your assistance in learning how these pieces fit together.
SimplePortal 2.3.8 © 2008-2024, SimplePortal