You are hereSupport Forums
Search:  
How to change the oder of scripts inserted into the HEAD
Last Post 10 Jun 2010 04:56 PM byRodney Joyce. 4 Replies.
AddThis - Bookmarking and Sharing ButtonPrinter Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
AuthorMessagesNot Resolved
Rodney Joyce
New Member
New Member
Posts:85

--
10 Jun 2010 06:34 AM  
Hi Richard,

I am inserting some .js into the header for my JQuery CodaSlider on the PokerDIY home page. When I view the module logged in as Host, the inserted .js is inserted below the Jquery reference call in the header, and hence it works.

However, when I am logged out, the order seems to change and the insert JS links are above the core Jquery reference, which means it falls over with Jquery not found issues.

How can I tell a particular script to render as close to the end of the HEAD tag as possible? It needs to go in last.

ps - I don't seem to get notified of updates and there is no subscribe button on edit?
Tags: jscript
Richard Edwards
DNNStuff Founder
Advanced Member
Advanced Member
Posts:902
Avatar

--
10 Jun 2010 09:49 AM  
Hi Rodney,

There is an undocumented feature that you can try. If a file called head.txt is found in either the base skin folder, or the template folder then it should render that after the jQuery reference. The reason I've left it undocumented at this stage is because I'm only using it one place right now, the CodaSlider skin, and seeing how it will work out with other skins I'm planning on introducing. That said, this might change in the future but it seems to work fairly well right now.

In the DNNStuff - Aggregator\Skins\CodaSlider\head.txt file, you'll already see a reference to the coda slider javascript file. Just add your reference in there and it should behave as you want.

The only other caveat is that any of the skins that ship with Aggregator will be overwritten on your next update so it's best to create your own version of that skin before making modifications.

Odd that you aren't getting update notifications. Check your email settings in your account to ensure it's coming to the account you expect it at. I'm getting notifications for all of the posts.


Richard Edwards
DNNStuff Founder
Rodney Joyce
New Member
New Member
Posts:85

--
10 Jun 2010 03:05 PM  
The problem is I am not using the Aggregator module - I have a custom Codaslider in an HTML mod - now I am trying to put the .js into the header (using the InjectAnything mod) so PageBlaster merges and compresses it, but it always goes above the Jquery reference unless logged in as Admin.

Is there anything that can in this module to change the order?

Subscriptions: Yes, I don't have the checkbox on these forums (Subscribe to emails) that I have on my ActiveForums.
Richard Edwards
DNNStuff Founder
Advanced Member
Advanced Member
Posts:902
Avatar

--
10 Jun 2010 04:25 PM  
Sorry, I saw CodaSlider and assumed Aggregator .. I didn't even look at the forum name :)

The only thing I can think of would be to place the module as far down in the page as possible such as a bottom pane so it gets injected as late as possible.

For some reason after I upgraded active forums, the subscriptions must have got disabled. I think they should be on again now.


Richard Edwards
DNNStuff Founder
Rodney Joyce
New Member
New Member
Posts:85

--
10 Jun 2010 04:56 PM  
Yip - it's back.

Unfortunately that did not work (it's at the very bottom). When logged in as Host I see it uses the local Jquery link (and puts it high up) - when logged out it uses the Hosted one (this is what I have set under Host Settings) and puts it below...

I did a quick search - would it be possible to add an another value (Inline) into the ddl (I have no idea how your code works - just guessing ;)
http://www.west-wind.com/weblog/posts/154797.aspx
You are not authorized to post a reply.

Active Forums 4.1
Privacy StatementTerms Of UseCopyright (c) 2004-2010 DNNStuff