![]() |
![]() ![]() |
![]() |
Dag |
![]()
Post
#1
|
Advanced Member ![]() ![]() ![]() ![]() Group: Members Posts: 107 Joined: 24-October 06 Member No.: 549 ![]() |
For example, here
http://www.laban.rs/f/w4 I have 2 javascripts (easyzoom.js and jquery). One of them, 'jquery-3.1.1.min.js' should be cleared. I want to use only functions that are necessary for tha page above. Is that possible? Dag |
Christian J |
![]()
Post
#2
|
. ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: WDG Moderators Posts: 9,565 Joined: 10-August 06 Member No.: 7 ![]() |
Maybe it's possible, but is it worth all the work? It almost sounds easier to write a new script that doesn't use jQuery from the start.
|
pandy |
![]()
Post
#3
|
🌟Computer says no🌟 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: WDG Moderators Posts: 20,637 Joined: 9-August 06 Member No.: 6 ![]() |
Isn't that what the OP wants to do?
![]() |
Christian J |
![]()
Post
#4
|
. ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: WDG Moderators Posts: 9,565 Joined: 10-August 06 Member No.: 7 ![]() |
|
Dag |
![]()
Post
#5
|
Advanced Member ![]() ![]() ![]() ![]() Group: Members Posts: 107 Joined: 24-October 06 Member No.: 549 ![]() |
Isn't that what the OP wants to do? ![]() Since jQuery is made with javascript I guess doing that is always possible. But I thought Dag wanted to use only those parts of the jQuery library that are needed for the current page. :: needed for the current page. Exactly. Javascript is not my strong part. I can't understand that jquery at all. Looks to me that there are one, and only one function. Some kind of javascript classes. I should probably attach sources. Does it worth it? 85 stupid kb versus (probably) 20-30. I need it for many, many pages (large product gallery). Why that guy who made easyzoom didn't extract all necessary code lines as he did partialy? easyzoom.js http://www.laban.rs/f/easyzoom-copy.js jquery-3.1.1.min.js http://www.laban.rs/f/jquery-3.1.1.min-copy.js |
Christian J |
![]()
Post
#6
|
. ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: WDG Moderators Posts: 9,565 Joined: 10-August 06 Member No.: 7 ![]() |
I can't understand that jquery at all. Looks to me that there are one, and only one function. Some kind of javascript classes. That's all I know as well. I think it's meant to be easy to use for people that don't know much javascript. QUOTE Does it worth it? 85 stupid kb versus (probably) 20-30. I need it for many, many pages (large product gallery). I guess it's easier to learn jQuery than than rewriting the whole zoom script. ![]() If the jQuery library file is cached its extra file size will "average out" if the site visitors view multiple product pages. |
Dag |
![]()
Post
#7
|
Advanced Member ![]() ![]() ![]() ![]() Group: Members Posts: 107 Joined: 24-October 06 Member No.: 549 ![]() |
Also, knowing a little jQuery could be useful for other projects, since many websites use it. Thanks but no way. Never was a fun of that language... If the jQuery library file is cached its extra file size will "average out" if the site visitors view multiple product pages. Yep, I realized that already. But only in case visitor choosed several different products. 50% of time, one product is per one visitor... I'll find some guy to clear it... there are many js ppl arround... Thanks Christian, thanks Pandy. This one is interesting: http://microjs.com/ Or, maybe, just change the script(?) https://www.youtube.com/watch?v=YenYQKHPtHE This post has been edited by Dag: Jul 23 2023, 08:07 AM |
Dag |
![]()
Post
#8
|
Advanced Member ![]() ![]() ![]() ![]() Group: Members Posts: 107 Joined: 24-October 06 Member No.: 549 ![]() |
|
Christian J |
![]()
Post
#9
|
. ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: WDG Moderators Posts: 9,565 Joined: 10-August 06 Member No.: 7 ![]() |
If the jQuery library file is cached its extra file size will "average out" if the site visitors view multiple product pages. Yep, I realized that already. But only in case visitor choosed several different products. 50% of time, one product is per one visitor... Some also recommend loading the jQuery file from a third-party host (for example Google), that way it will be cached from any of the other websites the user has visited before (unless the user clears his cache all the time). Personally I don't like relying on third-party hosts though (for security and privacy reasons). QUOTE I can't edit my own post... Only for one hour. QUOTE That was a little briefer than the jQuery version. ![]() |
Dag |
![]()
Post
#10
|
Advanced Member ![]() ![]() ![]() ![]() Group: Members Posts: 107 Joined: 24-October 06 Member No.: 549 ![]() |
If the jQuery library file is cached its extra file size will "average out" if the site visitors view multiple product pages. Yep, I realized that already. But only in case visitor choosed several different products. 50% of time, one product is per one visitor... Some also recommend loading the jQuery file from a third-party host (for example Google), that way it will be cached from any of the other websites the user has visited before (unless the user clears his cache all the time). Personally I don't like relying on third-party hosts though (for security and privacy reasons). QUOTE I can't edit my own post... Only for one hour. QUOTE That was a little briefer than the jQuery version. ![]() Can you imagine?? 6 lines of code?! Versus 86kb ![]() :: loading the jQuery file from a third-party host Never liked that too. Ppl doing stupid things... especially with fonts ![]() |
Julia54 |
![]()
Post
#11
|
Group: Members Posts: 1 Joined: 17-October 23 Member No.: 29,077 ![]() |
I faced a similar kind of issue last time, I am still searching for some proper solution Same issue still no fix to this.
|
![]() ![]() |
![]() |
Lo-Fi Version | Time is now: 10th December 2023 - 12:20 PM |