Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted June 9, 201212 yr https://developers.google.com/speed/pagespeed/insights#url=fearless-assassins.com&mobile=false&rule=DeferParsingJavaScript Can someone tell me how can I do that?
June 10, 201212 yr Good luck! http://community.invisionpower.com/topic/364174-ipb-search-the-following-search-terms-are-not-allowed-and-were-removed-from-your-query-javascript/
June 11, 201212 yr Hello, You can use an anonymous function to load the JavaScript, and place it at the bottom of your page. Something like:(function() { var o = document.createElement('script'); o.type = 'text/javascript'; o.async = true; o.src = '/path/to/your/javascript/file.js'; var a = document.getElementsByTagName('script')[0]; a.parentNode.insertBefore(o, a); })(); Doing that will defer the loading of that JavaScript until after the page has finished parsing. That's not always practical though, so you can also use the defer attribute:http://www.w3schools...cript_defer.aspEdit: There's a ton of information on Google, notably the following guidelines by Google themselves, inc example(s):https://developers.g...actices/payload Hope this helps! :smile:
June 11, 201212 yr How do you edit with defer or async when the line for IPB JavaScript is?:{parse template="includeJS" group="global" params="$jsModules"} That one line in globaltemplate is what spits out the list of <script type="text/javascript" src="... I'm trying now to see if it can be done for the includeJS template.
June 11, 201212 yr Well async gave the same result as moving javascript to footer. Everything worked except for QR and edit boxes. (that I know of) Edit: Gallery JS does not work also. Cuts almost 2 seconds! from "first view" page load speed though.
June 11, 201212 yr Author Well async gave the same result as moving to footers. Everything worked except for GR and edit boxes. (that I know of) How to use async? Laymen term tutorial please? I appreciate your help, Thanks!
June 11, 201212 yr How to use async? Laymen term tutorial please? I appreciate your help, Thanks! Ha! I was thinking the same thing when I read... the above howto. If I get it to work without breaking anything I will post how to here.
June 11, 201212 yr Hello, You can use an anonymous function to load the JavaScript, and place it at the bottom of your page. Something like:(function() { var o = document.createElement('script'); o.type = 'text/javascript'; o.async = true; o.src = '/path/to/your/javascript/file.js'; var a = document.getElementsByTagName('script')[0]; a.parentNode.insertBefore(o, a); })(); Doing that will defer the loading of that JavaScript until after the page has finished parsing. That's not always practical though, so you can also use the defer attribute:http://www.w3schools...cript_defer.aspEdit: There's a ton of information on Google, notably the following guidelines by Google themselves, inc example(s):https://developers.g...actices/payload Hope this helps! :smile: Not as easy as you think. Implementing this (async) breaks java the same way moving to the footer does. I see you're read topic so I guess you also realize what you posted does not apply easily to IPB; thanks anyway
June 11, 201212 yr Not as easy as you think. Implementing this (async) breaks java the same way moving to the footer does. I see you're read topic so I guess you also realize what you posted does not apply easily to IPB; thanks anyway The OP made no mention of IP.Board, you're making an assumption.
June 12, 201212 yr Author The OP made no mention of IP.Board, you're making an assumption. Sorry I thought this forum is about IPB talk and support.. so i didn't thought to mention about it. If you check the link it's fearless-assassins.com and it's running all IPB add-ons.
June 12, 201212 yr The OP made no mention of IP.Board, you're making an assumption. Bahaha! Seriously? Maybe he's taking about Wordpress. :thumbsup:
June 12, 201212 yr Bahaha! Seriously? Maybe he's taking about Wordpress. :thumbsup: Your sarcasm is very much misplaced. If you had taken the time to look carefully you'd have noted that this forum is not necessarily IPS-software specific, just look at the other threads - so yeah he could have been talking about Wordpress. Technically it's in the wrong section anyhow, hehe! Just so you know in future :smile:
June 12, 201212 yr Well, I guess I misunderstood the OP in my reply to his post and you understood him perfectly. Thanks! :smile:
Archived
This topic is now archived and is closed to further replies.